|
|
@ -106,6 +106,16 @@ |
|
|
|
<span>{{ getCkTitle(scope.row.ckId) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="维修状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.maintenance == '1'" style="color:blue">{{ getMainTitle(scope.row.maintenance) |
|
|
|
}}</span> |
|
|
|
<span v-if="scope.row.maintenance == '2'" style="color:orange">{{ getMainTitle(scope.row.maintenance) |
|
|
|
}}</span> |
|
|
|
<span v-if="scope.row.maintenance == '3'" style="color:red">{{ getMainTitle(scope.row.maintenance) |
|
|
|
}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="状态" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.status == 1" style="color:red">{{ getStatus(scope.row.status) }}</span> |
|
|
@ -133,23 +143,19 @@ |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
// import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons' |
|
|
|
import shebeitaizhangAdd from './shebeitaizhangAdd' |
|
|
|
import shebeitaizhangInfo from './shebeitaizhangInfo' |
|
|
|
import { getDevicePage, getInfoById, removeDevice } from '@/api/device/device' |
|
|
|
// import req from '@/api/shebeitaizhang/shebeitaizhang' |
|
|
|
import { getDevicePage, getInfoById, removeDevice, getStatusList } from '@/api/device/device' |
|
|
|
import * as echarts from "echarts"; |
|
|
|
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuanb' |
|
|
|
// 1.1完好率饼图 |
|
|
|
const wanhao_Chart = { |
|
|
|
// seriesName: '完好率', |
|
|
|
unit: '次', |
|
|
|
color: ['#30e9ff', '#d9d9d9', '#fdc004'], |
|
|
|
Data: { |
|
|
|
seriesData: [ |
|
|
|
{ value: 75, name: '完好' }, |
|
|
|
{ value: 25, name: '不完好' }, |
|
|
|
// { value: 12, name: '报警' } |
|
|
|
] |
|
|
|
}, |
|
|
|
label: { |
|
|
@ -158,19 +164,15 @@ const wanhao_Chart = { |
|
|
|
show: false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// radius: ['50%', '55%'] |
|
|
|
} |
|
|
|
// 1.2维修率饼图 |
|
|
|
const weixiu_Chart = { |
|
|
|
// seriesName: '维修率', |
|
|
|
unit: '次', |
|
|
|
color: ['#fe7f02', '#fdc004'], |
|
|
|
Data: { |
|
|
|
seriesData: [ |
|
|
|
{ value: 15, name: '维修' }, |
|
|
|
{ value: 85, name: '无维修' }, |
|
|
|
// { value: 12, name: '报警' } |
|
|
|
] |
|
|
|
}, |
|
|
|
label: { |
|
|
@ -179,12 +181,9 @@ const weixiu_Chart = { |
|
|
|
show: false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// radius: ['50%', '55%'] |
|
|
|
} |
|
|
|
// 1.3损害率饼图 |
|
|
|
const sunhai_Chart = { |
|
|
|
// seriesName: '损害率', |
|
|
|
unit: '次', |
|
|
|
color: ['#d2cece', '#ff0202', '#fdc004'], |
|
|
|
Data: { |
|
|
@ -199,8 +198,6 @@ const sunhai_Chart = { |
|
|
|
show: false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// radius: ['50%', '55%'] |
|
|
|
} |
|
|
|
|
|
|
|
export default { |
|
|
@ -268,6 +265,11 @@ export default { |
|
|
|
{ name: '机器人', id: '4' }, |
|
|
|
{ name: '网络录像机', id: '5' } |
|
|
|
], |
|
|
|
maintenanceList: [ |
|
|
|
{ name: '完好', id: '1' }, |
|
|
|
{ name: '维修', id: '2' }, |
|
|
|
{ name: '损坏', id: '3' }, |
|
|
|
], |
|
|
|
floor_list: [ |
|
|
|
{ title: '一层', id: '1' }, |
|
|
|
{ title: '二层', id: '2' }, |
|
|
@ -318,6 +320,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getMainTitle(item) { |
|
|
|
for (var i = 0; i < this.maintenanceList.length; i++) { |
|
|
|
if (this.maintenanceList[i].id == item) { |
|
|
|
return this.maintenanceList[i].name |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
btnHandle(btnKey) { |
|
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|
|
|
switch (btnKey) { |
|
|
@ -354,17 +363,44 @@ export default { |
|
|
|
}, |
|
|
|
init() { |
|
|
|
this.getList() |
|
|
|
getStatusList().then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
debugger |
|
|
|
this.wanhao_Chart.Data.seriesData = [] |
|
|
|
this.weixiu_Chart.Data.seriesData = [] |
|
|
|
this.sunhai_Chart.Data.seriesData = [] |
|
|
|
for (var i = 0; i < res.data.length; i++) { |
|
|
|
var item = res.data[i]; |
|
|
|
// 1完好 2维修 3损坏 |
|
|
|
if (item.maintenance == '1') { |
|
|
|
var bad = 100 - item.maintenanceCount; |
|
|
|
var obj = { name: '完好', value: item.maintenanceCount } |
|
|
|
var obj1 = { name: '不完好', value: bad } |
|
|
|
this.wanhao_Chart.Data.seriesData.push(obj) |
|
|
|
this.wanhao_Chart.Data.seriesData.push(obj1) |
|
|
|
} |
|
|
|
|
|
|
|
// 1完好 2维修 3损坏 |
|
|
|
if (item.maintenance == '2') { |
|
|
|
var bad = 100 - item.maintenanceCount; |
|
|
|
var obj = { name: '维修', value: item.maintenanceCount } |
|
|
|
var obj1 = { name: '不维修', value: bad } |
|
|
|
this.weixiu_Chart.Data.seriesData.push(obj) |
|
|
|
this.weixiu_Chart.Data.seriesData.push(obj1) |
|
|
|
} |
|
|
|
|
|
|
|
// 1完好 2维修 3损坏 |
|
|
|
if (item.maintenance == '3') { |
|
|
|
var bad = 100 - item.maintenanceCount; |
|
|
|
var obj = { name: '损害', value: item.maintenanceCount } |
|
|
|
var obj1 = { name: '不损害', value: bad } |
|
|
|
this.sunhai_Chart.Data.seriesData.push(obj) |
|
|
|
this.sunhai_Chart.Data.seriesData.push(obj1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// getType() { |
|
|
|
// typeValues({ |
|
|
|
// type: 'supplierType' |
|
|
|
// }).then((res) => { |
|
|
|
// if (res.code === '200') { |
|
|
|
// this.supplierType_list = res.data |
|
|
|
// console.log('选择楼层', this.supplierType_list) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|
|
|