
`],
- ['电子套结机', '123456', '123456', '123456', '123456'],
- ['电子套结机', '123456', '123456', '123456', '123456'],
- ['电子套结机', '123456', '123456', '123456', '123456'],
- ['电子套结机', '123456', '123456', '123456', '123456'],
- ['电子套结机', '123456', '123456', '123456', '123456'],
+let devStatus = reactive({
+ "wait": 0,
+ "total": 0,
+ "stop": 0,
+ "rate": 0,
+ "work": 0,
+ "devTypes": [ ]
+})
+
+let devList = ref([])
+let scrollBoardConfig_data = computed(()=>{
+ let data = []
+ data = devList.value.map(item => {
+ return [
+ item.code,
+ item.name,
+ item.runTime + 'min',
+ item.rate,
+ status2Img(item.state)
+ ]
+ })
+ return data
+})
+
+function status2Img(status) {
+ let html = `
`
+ switch (status) {
+ case 0:
+ html += `

`
+ break
+ case 1:
+ html += `

`
+ break
+ case 2:
+ html += `

`
+ break
+ case 4:
+ html += `

`
+ break
+ default:
+ html += `

`
+ break
+ }
+ html += '
'
+ return html
+}
+
+//获取设备列表
+function getListDevice() {
+ listDevice().then(res => {
+ devList.value = res.data
+
+ })
+}
+
+let sortBarChartData = ref([])
+//获取设备能耗排行
+function getlistElect() {
+ listElect(radio_bar.value).then(res => {
+ sortBarChartData.value = res.data.map(item => {
+ return {
+ name: item.name,
+ value: item.electricity
+ }
+ })
+ })
+}
+
+//切换能耗排行
+function handleChangeBar() {
+ getlistElect()
+}
+
+
+let powerMonitoring = ref([
+ { label: '当天耗电量', value: 8 },
+ { label: '本周耗电量', value: 60 },
+ { label: '本月耗电量', value: 288 }
])
+//获取用电监测
+function getelectMonitoring() {
+ electMonitoring().then(res => {
+ powerMonitoring.value = [
+ { label: '当天耗电量', value: res.data.day },
+ { label: '本周耗电量', value: res.data.week },
+ { label: '本月耗电量', value: res.data.month }
+ ]
+ })
+}
+
let remindData = ref([
['abc', '模板缝纫机', '上油', '张三', '2025-02-19'],
['acg', '铺布机', '检查', '李四', '2025-02-20'],
@@ -175,38 +258,35 @@ let remindData = ref([
])
-let devTypeList = ref([
- { label: '板房设备', on: 2, all: 6 },
- { label: '裁剪设备', on: 3, all: 8 },
- { label: '模板缝纫设备', on: 4, all: 10 },
- { label: '簇绒设备', on: 5, all: 12 },
- { label: '绣花设备', on: 3, all: 8 },
- { label: '缝纫设备', on: 3, all: 8 },
- { label: '后整设备', on: 3, all: 8 },
-])
-let productionChart = ref()
-let powerMonitoring = ref([
- { label: '当天耗电量', value: 8 },
- { label: '本周耗电量', value: 60 },
- { label: '本月耗电量', value: 288 }
-])
-let sortBarChartData = ref([])
+//获取设备状态
+function getdeviceStatus() {
+ deviceStatus().then(res=>{
+ devStatus.wait = res.data.wait
+ devStatus.total = res.data.total
+ devStatus.stop = res.data.stop
+ devStatus.rate = res.data.rate
+ devStatus.work = res.data.work
+ devStatus.devTypes = res.data.devTypes
+ })
+}
+let rateData = ref()
+//设备利用率
+function getdeviceRate() {
+ deviceRate().then(res => {
+ rateData.value = {
+ xAxis: res.data.dates,
+ series: res.data.rate
+ }
+ })
+}
onMounted(() => {
- sortBarChartData.value = [
-
- { name: '缝纫设备1', value: 120 },
- { name: '缝纫设备2', value: 200 },
- { name: '缝纫设备3', value: 150 },
- { name: '缝纫设备4', value: 80 },
- { name: '缝纫设备5', value: 70 },
- { name: '板房设备1', value: 135 },
- { name: '板房设备2', value: 122 },
- { name: '板房设备3', value: 85 },
- { name: '板房设备4', value: 47 },
- { name: '板房设备5', value: 31 },
- ]
+ getListDevice()
+ getlistElect()
+ getelectMonitoring()
+ getdeviceStatus()
+ getdeviceRate()
})
@@ -331,18 +411,19 @@ onUnmounted(() => {
flex-direction: row;
justify-content: center;
align-items: center;
-
- &::after {
- content: "";
- width: 1px;
- height: 54px;
- border: #f9f8f4 solid 1px;
- position: absolute;
- transform: rotate(30deg);
- top: 0px;
- left: 61px;
- }
+ &::after {
+ content: "";
+ width: 1px;
+ height: 54px;
+ border: #f9f8f4 solid 1px;
+ position: absolute;
+ transform: rotate(30deg);
+ top: 0px;
+ left: 61px;
+
+ }
+
.on-text {
width: 24px;
height: 24px;
@@ -353,6 +434,7 @@ onUnmounted(() => {
text-align: center;
line-height: 24px;
}
+
.all-text {
width: 24px;
height: 24px;
@@ -364,6 +446,7 @@ onUnmounted(() => {
line-height: 24px;
}
}
+
.label {
width: 100%;
height: 24px;
@@ -383,6 +466,7 @@ onUnmounted(() => {
display: flex;
flex-direction: row;
align-items: center;
+
.yuan {
width: 24px;
height: 24px;
@@ -396,6 +480,7 @@ onUnmounted(() => {
.blue {
background-color: #21dadb;
}
+
.flag-text {
color: #f9f8f4;
font-size: 18px;