|
@@ -6,7 +6,7 @@ import Card01 from '@/components/card/Card01.vue'
|
|
import StripeTable from '@/components/StripeTable.vue'
|
|
import StripeTable from '@/components/StripeTable.vue'
|
|
import { getDeviceByName } from '@/utils/device'
|
|
import { getDeviceByName } from '@/utils/device'
|
|
import Chart from '@/components/Chart.vue'
|
|
import Chart from '@/components/Chart.vue'
|
|
-import StationRightButtonGroup from "@/components/StationRightButtonGroup.vue";
|
|
|
|
|
|
+import StationRightButtonGroup from '@/components/StationRightButtonGroup.vue'
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const right3Ref = ref(null)
|
|
const right3Ref = ref(null)
|
|
@@ -14,27 +14,29 @@ const device = ref(getDeviceByName('COD分析仪'))
|
|
|
|
|
|
|
|
|
|
const deviceStatusColumns = [
|
|
const deviceStatusColumns = [
|
|
- {label: '维护信息', prop: 'name'},
|
|
|
|
- {label: '维护人员', prop: 'volume', width: '110'},
|
|
|
|
- {label: '维护日期', prop: 'updateTm', width: '110'}
|
|
|
|
|
|
+ { label: '维护信息', prop: 'deviceName', width: '100' },
|
|
|
|
+ { label: '维护人员', prop: 'woker', width: '90' },
|
|
|
|
+ { label: '维护日期', prop: 'updateTm' },
|
|
|
|
+ { label: '状态', prop: 'status',width: '70' }
|
|
]
|
|
]
|
|
|
|
|
|
const deviceStatusData = [
|
|
const deviceStatusData = [
|
|
- { name: '总磷分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '总氮分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '水位计', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '氢氮分析仪', volume: 2, updateTm: '11-20 15:00:00' }
|
|
|
|
|
|
+ { deviceName: '总磷分析仪', woker: '陈标', updateTm: '11-20 15:00:00', status: '正常' },
|
|
|
|
+ { deviceName: '总氮分析仪', woker: '于奇', updateTm: '11-20 15:00:00', status: '正常' },
|
|
|
|
+ { deviceName: '水位计', woker: '张孝荣', updateTm: '11-20 15:00:00', status: '正常' },
|
|
|
|
+ { deviceName: '氨氮分析仪', woker: '张孝荣', updateTm: '11-20 15:00:00', status: '正常' }
|
|
]
|
|
]
|
|
const accessoriesColumns = [
|
|
const accessoriesColumns = [
|
|
- { label: '试剂名称', prop: 'name' },
|
|
|
|
- { label: '添加体积', prop: 'volume', width: '110' },
|
|
|
|
- { label: '更换时间', prop: 'updateTm', width: '110' }
|
|
|
|
|
|
+ { label: '耗材名称', prop: 'name', width: '110' },
|
|
|
|
+ { label: '剩余有效期', prop: 'days', width: '110' },
|
|
|
|
+ { label: '到期时间', prop: 'updateTm' }
|
|
]
|
|
]
|
|
const accessoriesData = [
|
|
const accessoriesData = [
|
|
- { name: '总磷分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '总氮分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '水位计', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '氢氮分析仪', volume: 2, updateTm: '11-20 15:00:00' }
|
|
|
|
|
|
+ { name: '1-16泵管', days: 120, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '试管', days: 20, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '滴定管', days: 90, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '3-16泵管', days: 65, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '瓶子', days: 102, updateTm: '11-20 15:00:00' }
|
|
]
|
|
]
|
|
|
|
|
|
const reagentColumns = [
|
|
const reagentColumns = [
|
|
@@ -43,127 +45,204 @@ const reagentColumns = [
|
|
{ label: '更换时间', prop: 'updateTm', width: '110' }
|
|
{ label: '更换时间', prop: 'updateTm', width: '110' }
|
|
]
|
|
]
|
|
const reagentData = [
|
|
const reagentData = [
|
|
- { name: '总磷分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '总氮分析仪', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '水位计', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
- { name: '氢氮分析仪', volume: 2, updateTm: '11-20 15:00:00' }
|
|
|
|
|
|
+ { name: '硫酸溶液', volume: 2, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '高锰酸钾溶液', volume: 1, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '草酸钠溶液', volume: 3, updateTm: '11-20 15:00:00' },
|
|
|
|
+ { name: '去离子水', volume: 2, updateTm: '11-20 15:00:00' }
|
|
]
|
|
]
|
|
|
|
|
|
-function reloadRight3(list) {
|
|
|
|
- if (!list || list.length === 0) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const typeSet = new Set()
|
|
|
|
- const times = []
|
|
|
|
- list.forEach((item, index) => {
|
|
|
|
- Object.keys(item).forEach(key => typeSet.add(key))
|
|
|
|
- times.push(item['maintainDate'] || index + 1)
|
|
|
|
- })
|
|
|
|
- typeSet.delete('maintainDate')
|
|
|
|
- const types = Array.from(typeSet)
|
|
|
|
- const rawData = []
|
|
|
|
- types.forEach(t => {
|
|
|
|
- let array = []
|
|
|
|
- list.forEach(d => array.push(d[t] || 0))
|
|
|
|
- rawData.push(array)
|
|
|
|
- })
|
|
|
|
- const totalData = []
|
|
|
|
- for (let i = 0; i < rawData[0].length; ++i) {
|
|
|
|
- let sum = 0
|
|
|
|
- for (let j = 0; j < rawData.length; ++j) {
|
|
|
|
- sum += Number(rawData[j][i])
|
|
|
|
- }
|
|
|
|
- totalData.push(sum)
|
|
|
|
- }
|
|
|
|
- const grid = {
|
|
|
|
- left: 10,
|
|
|
|
- right: 10,
|
|
|
|
- top: 50,
|
|
|
|
- bottom: 10,
|
|
|
|
- containLabel: true
|
|
|
|
- }
|
|
|
|
- const series = types.map((name, sid) => {
|
|
|
|
- return {
|
|
|
|
- name,
|
|
|
|
- type: 'bar',
|
|
|
|
- stack: 'total',
|
|
|
|
- barWidth: '60%',
|
|
|
|
- label: { show: false },
|
|
|
|
- data: rawData[sid]
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- series.push({
|
|
|
|
- name: '总计',
|
|
|
|
- type: 'bar',
|
|
|
|
- stack: 'total',
|
|
|
|
- label: {
|
|
|
|
- show: true,
|
|
|
|
- position: 'top',
|
|
|
|
- color: '#fff',
|
|
|
|
- formatter: params => totalData[params.dataIndex] + '个'
|
|
|
|
- },
|
|
|
|
- data: totalData.map(t => 0)
|
|
|
|
- })
|
|
|
|
- let maxValue = totalData.reduce((a, b) => Math.max(a, b))
|
|
|
|
|
|
+// function reloadRight3(list) {
|
|
|
|
+// if (!list || list.length === 0) {
|
|
|
|
+// return
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// const typeSet = new Set()
|
|
|
|
+// const times = []
|
|
|
|
+// list.forEach((item, index) => {
|
|
|
|
+// Object.keys(item).forEach(key => typeSet.add(key))
|
|
|
|
+// times.push(item['maintainDate'] || index + 1)
|
|
|
|
+// })
|
|
|
|
+// typeSet.delete('maintainDate')
|
|
|
|
+// const types = Array.from(typeSet)
|
|
|
|
+// const rawData = []
|
|
|
|
+// types.forEach(t => {
|
|
|
|
+// let array = []
|
|
|
|
+// list.forEach(d => array.push(d[t] || 0))
|
|
|
|
+// rawData.push(array)
|
|
|
|
+// })
|
|
|
|
+// const totalData = []
|
|
|
|
+// for (let i = 0; i < rawData[0].length; ++i) {
|
|
|
|
+// let sum = 0
|
|
|
|
+// for (let j = 0; j < rawData.length; ++j) {
|
|
|
|
+// sum += Number(rawData[j][i])
|
|
|
|
+// }
|
|
|
|
+// totalData.push(sum)
|
|
|
|
+// }
|
|
|
|
+// const grid = {
|
|
|
|
+// left: 10,
|
|
|
|
+// right: 10,
|
|
|
|
+// top: 50,
|
|
|
|
+// bottom: 10,
|
|
|
|
+// containLabel: true
|
|
|
|
+// }
|
|
|
|
+// const series = types.map((name, sid) => {
|
|
|
|
+// return {
|
|
|
|
+// name,
|
|
|
|
+// type: 'bar',
|
|
|
|
+// stack: 'total',
|
|
|
|
+// barWidth: '60%',
|
|
|
|
+// label: { show: false },
|
|
|
|
+// data: rawData[sid]
|
|
|
|
+// }
|
|
|
|
+// })
|
|
|
|
+// series.push({
|
|
|
|
+// name: '总计',
|
|
|
|
+// type: 'bar',
|
|
|
|
+// stack: 'total',
|
|
|
|
+// label: {
|
|
|
|
+// show: true,
|
|
|
|
+// position: 'top',
|
|
|
|
+// color: '#fff',
|
|
|
|
+// formatter: params => totalData[params.dataIndex] + '个'
|
|
|
|
+// },
|
|
|
|
+// data: totalData.map(t => 0)
|
|
|
|
+// })
|
|
|
|
+// let maxValue = totalData.reduce((a, b) => Math.max(a, b))
|
|
|
|
+// const option = {
|
|
|
|
+// tooltip: {
|
|
|
|
+// trigger: 'axis',
|
|
|
|
+// axisPointer: {
|
|
|
|
+// type: 'shadow'
|
|
|
|
+// },
|
|
|
|
+// formatter(params) {
|
|
|
|
+// let circle = `<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:`
|
|
|
|
+// let info = params[0].axisValueLabel
|
|
|
|
+// for (let i = 0; i < params.length; i++) {
|
|
|
|
+// let param = params[i]
|
|
|
|
+// if (i === params.length - 1) {
|
|
|
|
+// info += `<br/>${circle}${param.color}"></span> ${param.seriesName}: ${totalData[param.dataIndex]}个`
|
|
|
|
+// } else {
|
|
|
|
+// if (param.value > 0) {
|
|
|
|
+// info += `<br/>${circle}${param.color}"></span> ${param.seriesName}: ${param.value}个`
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// return info
|
|
|
|
+// }
|
|
|
|
+// },
|
|
|
|
+// legend: {
|
|
|
|
+// type: 'scroll',
|
|
|
|
+// icon: 'circle',
|
|
|
|
+// data: types,
|
|
|
|
+// selectedMode: false,
|
|
|
|
+// textStyle: {
|
|
|
|
+// color: '#fff'
|
|
|
|
+// }
|
|
|
|
+// },
|
|
|
|
+// grid,
|
|
|
|
+// yAxis: {
|
|
|
|
+// type: 'value',
|
|
|
|
+// name: '个',
|
|
|
|
+// nameTextStyle: {
|
|
|
|
+// color: '#fff'
|
|
|
|
+// },
|
|
|
|
+// minInterval: 1,
|
|
|
|
+// interval: Math.ceil(maxValue / 5),
|
|
|
|
+// axisLabel: {
|
|
|
|
+// color: '#fff'
|
|
|
|
+// }
|
|
|
|
+// },
|
|
|
|
+// xAxis: {
|
|
|
|
+// type: 'category',
|
|
|
|
+// axisLabel: {
|
|
|
|
+// color: '#fff'
|
|
|
|
+// },
|
|
|
|
+// data: times
|
|
|
|
+// },
|
|
|
|
+// series
|
|
|
|
+// }
|
|
|
|
+// right3Ref.value.loadChart(option)
|
|
|
|
+// }
|
|
|
|
+function reloadRight3() {
|
|
const option = {
|
|
const option = {
|
|
|
|
+ // backgroundColor: "#0B2D55",
|
|
tooltip: {
|
|
tooltip: {
|
|
- trigger: 'axis',
|
|
|
|
axisPointer: {
|
|
axisPointer: {
|
|
- type: 'shadow'
|
|
|
|
- },
|
|
|
|
- formatter(params) {
|
|
|
|
- let circle = `<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;left:5px;background-color:`
|
|
|
|
- let info = params[0].axisValueLabel
|
|
|
|
- for (let i = 0; i < params.length; i++) {
|
|
|
|
- let param = params[i]
|
|
|
|
- if (i === params.length - 1) {
|
|
|
|
- info += `<br/>${circle}${param.color}"></span> ${param.seriesName}: ${totalData[param.dataIndex]}个`
|
|
|
|
- } else {
|
|
|
|
- if (param.value > 0) {
|
|
|
|
- info += `<br/>${circle}${param.color}"></span> ${param.seriesName}: ${param.value}个`
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return info
|
|
|
|
|
|
+ type: 'cross'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- legend: {
|
|
|
|
- type: 'scroll',
|
|
|
|
- icon: 'circle',
|
|
|
|
- data: types,
|
|
|
|
- selectedMode: false,
|
|
|
|
- textStyle: {
|
|
|
|
- color: '#fff'
|
|
|
|
- }
|
|
|
|
|
|
+ grid: {
|
|
|
|
+ top: '14%',
|
|
|
|
+ left: '2%',
|
|
|
|
+ right: '4%',
|
|
|
|
+ bottom: '5%',
|
|
|
|
+ containLabel: true
|
|
},
|
|
},
|
|
- grid,
|
|
|
|
- yAxis: {
|
|
|
|
- type: 'value',
|
|
|
|
|
|
+ xAxis: [{
|
|
|
|
+ type: 'category',
|
|
|
|
+ axisLine: { // 坐标轴轴线相关设置。数学上的x轴
|
|
|
|
+ show: true,
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#233e64'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLabel: { // 坐标轴刻度标签的相关设置
|
|
|
|
+ color: '#02cacf'
|
|
|
|
+ },
|
|
|
|
+ axisTick: { show: false },
|
|
|
|
+ data: ['1-16氯管', 'p3-16氯管', '3-16氯管']
|
|
|
|
+ }],
|
|
|
|
+ yAxis: [{
|
|
name: '个',
|
|
name: '个',
|
|
nameTextStyle: {
|
|
nameTextStyle: {
|
|
- color: '#fff'
|
|
|
|
|
|
+ color: '#02cacf'
|
|
},
|
|
},
|
|
- minInterval: 1,
|
|
|
|
- interval: Math.ceil(maxValue / 5),
|
|
|
|
|
|
+ min: value => (value.min - 1).toFixed(0),
|
|
|
|
+ max: value => (value.max + 1).toFixed(0),
|
|
axisLabel: {
|
|
axisLabel: {
|
|
- color: '#fff'
|
|
|
|
|
|
+ margin: 20,
|
|
|
|
+ color: '#02cacf'
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true,
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#233e64'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ show: true
|
|
}
|
|
}
|
|
- },
|
|
|
|
- xAxis: {
|
|
|
|
- type: 'category',
|
|
|
|
- axisLabel: {
|
|
|
|
- color: '#fff'
|
|
|
|
|
|
+ }],
|
|
|
|
+ series: [{
|
|
|
|
+ name: '数量',
|
|
|
|
+ type: 'bar',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: function(params) {
|
|
|
|
+ // 根据params的
|
|
|
|
+ const colorsMap = [
|
|
|
|
+ '#4768ec',
|
|
|
|
+ '#92da76',
|
|
|
|
+ '#dc8a5e'
|
|
|
|
+ ]
|
|
|
|
+ //返回对应的颜色
|
|
|
|
+ return colorsMap[params.dataIndex]
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- data: times
|
|
|
|
- },
|
|
|
|
- series
|
|
|
|
|
|
+ barWidth: 50,
|
|
|
|
+ label: {
|
|
|
|
+ show: true,
|
|
|
|
+ position: 'top'
|
|
|
|
+ },
|
|
|
|
+ data: [3, 5, 6]
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
right3Ref.value.loadChart(option)
|
|
right3Ref.value.loadChart(option)
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- reloadRight3([])
|
|
|
|
|
|
+ // reloadRight3([])
|
|
|
|
+ reloadRight3()
|
|
|
|
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
@@ -171,7 +250,7 @@ onMounted(() => {
|
|
<template>
|
|
<template>
|
|
<right-frame>
|
|
<right-frame>
|
|
<template #leftModule>
|
|
<template #leftModule>
|
|
- <card01 :title="device.name" style="height: 65%">
|
|
|
|
|
|
+ <card01 :title="device.deviceName" style="height: 65%">
|
|
<h4 style="color: #00ccff">设备简介</h4>
|
|
<h4 style="color: #00ccff">设备简介</h4>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="16">
|
|
<el-col :span="16">
|
|
@@ -188,7 +267,7 @@ onMounted(() => {
|
|
<p>·检查电源线路,确保干燥和稳定。</p>
|
|
<p>·检查电源线路,确保干燥和稳定。</p>
|
|
<p>·校准仪器,确保测量准确性。</p>
|
|
<p>·校准仪器,确保测量准确性。</p>
|
|
</card01>
|
|
</card01>
|
|
- <card01 style="height: 40%" title="设备状态">
|
|
|
|
|
|
+ <card01 style="height: 40%" title="设备维护情况">
|
|
<stripe-table :columns="deviceStatusColumns" :data="deviceStatusData"></stripe-table>
|
|
<stripe-table :columns="deviceStatusColumns" :data="deviceStatusData"></stripe-table>
|
|
</card01>
|
|
</card01>
|
|
</template>
|
|
</template>
|