|
|
@@ -11,8 +11,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { dashboardsFacilitiesUsageStats } from '@/api/yiLi'
|
|
|
-
|
|
|
+ import { dashboardsResearchUsage } from '@/api/yiLi'
|
|
|
+ import { getFloorMap } from '@/utils/mapList'
|
|
|
export default {
|
|
|
name: 'usageRateComponent',
|
|
|
data() {
|
|
|
@@ -37,32 +37,47 @@
|
|
|
},
|
|
|
usageSwitchTime:600000,
|
|
|
usageTimer:null,
|
|
|
+ roomNames:[],
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.dashboardsFacilitiesUsageStats()
|
|
|
- this.overviewTimerFunction();
|
|
|
+ this.initialize();
|
|
|
},
|
|
|
methods: {
|
|
|
- dashboardsFacilitiesUsageStats() {
|
|
|
- let self = this
|
|
|
+ initialize(){
|
|
|
let text = window.location.href
|
|
|
let urlList = text.split('?')[1].split('&')
|
|
|
let codeData = {}
|
|
|
urlList.forEach((item) => {
|
|
|
codeData[item.split('=')[0]] = item.split('=')[1]
|
|
|
})
|
|
|
+ let list = getFloorMap(codeData.floorId)
|
|
|
+ let roomName = ''
|
|
|
+ for(let i=0;i<list.list.length;i++){
|
|
|
+ if(i==0){
|
|
|
+ roomName = roomName + 'roomNames=' +list.list[i].roomNumName
|
|
|
+ }else{
|
|
|
+ roomName = roomName + '&roomNames=' +list.list[i].roomNumName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'roomNames',roomName);
|
|
|
+ this.dashboardsResearchUsage()
|
|
|
+ this.overviewTimerFunction();
|
|
|
+ },
|
|
|
+ dashboardsResearchUsage() {
|
|
|
+ let self = this
|
|
|
this.$set(this.config,'data',[]);
|
|
|
- dashboardsFacilitiesUsageStats({floorid:codeData.floorId}).then(res => {
|
|
|
+ dashboardsResearchUsage(this.roomNames).then(res => {
|
|
|
let list = []
|
|
|
for (let i = 0; i < res.data.monthlyUsage.length; i++) {
|
|
|
let obj = {
|
|
|
- name: res.data.monthlyUsage[i].equTypeName,
|
|
|
- num: res.data.monthlyUsage[i].rentedCount,
|
|
|
- value: this.accMul(res.data.monthlyUsage[i].rentingMonthFromYearRate,100).toFixed(0)
|
|
|
+ name: res.data[i].roomNumValue,
|
|
|
+ num: res.data[i].usageCount,
|
|
|
+ // value: this.accMul(res.data[i].rentingMonthFromYearRate,100).toFixed(0)
|
|
|
+ value: res.data[i].usageRate
|
|
|
}
|
|
|
list.push(obj)
|
|
|
}
|
|
|
@@ -111,7 +126,7 @@
|
|
|
usageUpdates();
|
|
|
}, this.usageSwitchTime);
|
|
|
async function usageUpdates() {
|
|
|
- self.dashboardsFacilitiesUsageStats();
|
|
|
+ self.dashboardsResearchUsage();
|
|
|
}
|
|
|
},
|
|
|
},
|