|
|
@@ -21,7 +21,7 @@
|
|
|
<div class="em-label">射线设备</div>
|
|
|
</div>
|
|
|
<div class="equip-mid-item">
|
|
|
- <div class="em-value">{{ summary.usageRate }}<span class="em-unit"></span></div>
|
|
|
+ <div class="em-value">{{ summary.craneCount }}<span class="em-unit"></span></div>
|
|
|
<div class="em-label">行车</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -38,6 +38,7 @@
|
|
|
<script>
|
|
|
import * as echarts from 'echarts'
|
|
|
import { getEquipmentStats } from '@/api'
|
|
|
+import { getSpecialDeviceSummary } from '@/api/utilsIndex'
|
|
|
|
|
|
export default {
|
|
|
name: 'EquipmentStats',
|
|
|
@@ -60,13 +61,31 @@ export default {
|
|
|
methods: {
|
|
|
async loadData() {
|
|
|
try {
|
|
|
- const res = await getEquipmentStats()
|
|
|
- this.summary = res.data.summary
|
|
|
- this.status = res.data.status
|
|
|
+ // const res = await getEquipmentStats()
|
|
|
+ const res = await getSpecialDeviceSummary()
|
|
|
+ // this.summary = res.data.summary
|
|
|
+ // this.status = res.data.status
|
|
|
+ this.summary = {
|
|
|
+ totalDevices:res.data.total,
|
|
|
+ totalHours:res.data.pressureVesselCount,
|
|
|
+ usageRate:res.data.radiationCount,
|
|
|
+ craneCount:res.data.craneCount,
|
|
|
+ }
|
|
|
+ this.status = {
|
|
|
+ idle:res.data.inspectedCount,
|
|
|
+ normal:res.data.dueSoonCount,
|
|
|
+ repair:res.data.overdueCount,
|
|
|
+ }
|
|
|
+ let list = [
|
|
|
+ {name:'压力容器', value:res.data.pressureVesselCount?res.data.pressureVesselCount:0},
|
|
|
+ {name:'射线设备', value:res.data.radiationCount?res.data.radiationCount:0},
|
|
|
+ {name:'行车', value:res.data.craneCount?res.data.craneCount:0},
|
|
|
+ ];
|
|
|
if (this.chart) {
|
|
|
- this.chart.setOption({ series: [{ data: res.data.categories.map(c => ({ name: c.name, value: c.value, itemStyle: { color: c.color } })) }] })
|
|
|
+ // this.chart.setOption({ series: [{ data: list.map(c => ({ name: c.name, value: c.value, itemStyle: { color: c.color } })) }] })
|
|
|
+ this.chart.setOption({ series: [{ data: list.map(c => ({ name: c.name, value: c.value, })) }] })
|
|
|
} else {
|
|
|
- this.$nextTick(() => this.initChart(res.data.categories))
|
|
|
+ this.$nextTick(() => this.initChart(list))
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.error('EquipmentStats:', e)
|
|
|
@@ -98,7 +117,7 @@ export default {
|
|
|
data: categories.map(c => ({
|
|
|
name: c.name,
|
|
|
value: c.value,
|
|
|
- itemStyle: { color: c.color }
|
|
|
+ // itemStyle: { color: c.color }
|
|
|
}))
|
|
|
}]
|
|
|
}
|