From 831cfa4c439c6d073d706a82d2a439f8b1818498 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 18 十一月 2025 16:59:50 +0800
Subject: [PATCH] Merge branch 'new' of http://www.beijingsoft.cn:9090/r/smart-web into new
---
src/views/home/widgets/components/mdcRunning.vue | 134 +++++++++++++++++++++++++-------------------
1 files changed, 76 insertions(+), 58 deletions(-)
diff --git a/src/views/home/widgets/components/mdcRunning.vue b/src/views/home/widgets/components/mdcRunning.vue
index 558578f..bdd6460 100644
--- a/src/views/home/widgets/components/mdcRunning.vue
+++ b/src/views/home/widgets/components/mdcRunning.vue
@@ -1,8 +1,8 @@
<!--
* @Author: lzhe lzhe@example.com
* @Date: 2024-04-16 15:22:46
- * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-21 10:53:10
+ * @LastEditors: 鏉庡枂(寮�鍙戠粍) lzhe@yxqiche.com
+ * @LastEditTime: 2025-03-14 15:07:08
* @FilePath: /CPSnew/smart-web/src/views/home/widgets/components/mdcDeviceStatus.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -29,14 +29,14 @@
default-expand-all
size="small"
@change = "parentIdChange"
- v-model="search.workStationIdList"
- clearable
+ v-model="search.workStationIdList"
+ clearable
node-key="id"
- placeholder="涓婄骇鑿滃崟"
+ placeholder="涓婄骇鑿滃崟"
ref="parentTree"
- :data="parentData"
- :props="{ label: 'title' }"
- style="width:80%;"
+ :data="parentData"
+ :props="{ label: 'title' }"
+ style="width:80%;"
:default-checked-keys="selectedIds"
:render-after-expand="false" />
</div>
@@ -69,7 +69,7 @@
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
let icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
- icons.push(key)
+ icons.push(key)
}
export default {
title: "璁惧杩愯鏃堕暱鎺掑悕",
@@ -94,45 +94,48 @@
workStationIdList: []
},
cardData: {},
- option: {
+ option: {
grid: {
top: '0',
bottom: '0',
containLabel: true
},
- yAxis: {
- type: 'category',
- data: [],
- axisLine: {
- show: false // 闅愯棌y杞磋酱绾�
- },
- axisTick: {
- show: false // 闅愯棌y杞村埢搴︾嚎
+ yAxis: {
+ type: 'category',
+ data: [],
+ axisLine: {
+ show: false // 闅愯棌y杞磋酱绾�
},
- splitLine: {
- show: false // 闅愯棌y杞寸綉鏍肩嚎
+ axisTick: {
+ show: false // 闅愯棌y杞村埢搴︾嚎
+ },
+ splitLine: {
+ show: false // 闅愯棌y杞寸綉鏍肩嚎
}
- },
- xAxis: {
- type: 'value',
- axisLabel: {
- show: false // 闅愯棌x杞存暟鎹爣绛�
- }
- },
- series: [
- {
- data: [3.96, 3.95, 3.93, 3.91, 3.91, 3.9, 3.85],
- type: 'bar',
- label: {
- show: true, // 鏄剧ず鏍囩
- position: 'right', // 鏍囩浣嶇疆璁剧疆涓烘煴瀛愮殑鍙充晶
- formatter: function(params) {
- // 杩斿洖鏁版嵁鍊煎拰鎮ㄦ兂瑕佹坊鍔犵殑瀛楃涓茬殑缁勫悎
- return params.value + 'h'; // 渚嬪锛岃繑鍥� '3.96 鏂囧瓧'
- }
- }
- }
- ]
+ },
+ xAxis: {
+ type: 'value',
+ axisLabel: {
+ show: false // 闅愯棌x杞存暟鎹爣绛�
+ }
+ },
+ series: [
+ {
+ data: [],
+ type: 'bar',
+ label: {
+ show: true, // 鏄剧ず鏍囩
+ position: 'right', // 鏍囩浣嶇疆璁剧疆涓烘煴瀛愮殑鍙充晶
+ formatter: function(params) {
+ // 杩斿洖鏁版嵁鍊煎拰鎮ㄦ兂瑕佹坊鍔犵殑瀛楃涓茬殑缁勫悎
+ return params.value + 'h'; // 渚嬪锛岃繑鍥� '3.96 鏂囧瓧'
+ }
+ },
+ itemStyle: {
+ color: '#5CBF7D'
+ }
+ }
+ ]
},
}
},
@@ -140,7 +143,6 @@
mounted() {
this.getList();
this.getParentData();
- var arr = [];
for(var i=1;i<=30;i++) {
this.timeLevelList.push({value:i,label:i});
this.topList.push({value:i,label:i});
@@ -151,8 +153,6 @@
this.getList();
},
showSearch() {
- this.search.timeLevel = this.timeLevel;
- this.search.top = this.top;
this.isSearch = true;
},
serchSubmit() {
@@ -190,8 +190,22 @@
}
return newData
},
+ extractLastLevelIds(items, result = []) { //閫掑綊鑾峰彇children鏈�鍚庝竴绾х殑id鐨勬暟缁�
+ items.forEach(item => {
+ // 濡傛灉褰撳墠椤规湁id灞炴�т笖娌℃湁children鎴朿hildren涓虹┖鏁扮粍
+ if (item.id && (!item.children || item.children.length === 0)) {
+ result.push(item.id);
+ }
+ // 濡傛灉褰撳墠椤规湁children灞炴�т笖鏄暟缁勶紝鍒欓�掑綊璋冪敤collectIds
+ if (Array.isArray(item.children)) {
+ this.extractLastLevelIds(item.children, result);
+ }
+ });
+ // 杩斿洖鏀堕泦鍒扮殑id鏁扮粍
+ return result;
+ },
getParentData() {
- this.$HTTP.post('/api/blade-cps/group/groupWorkstation/type', {
+ this.$HTTP.post('/api/smis/group/groupWorkstation/type', {
groupCategory: 1,
groupType: "group_workstation"
}).then(({ code, data }) => {
@@ -199,6 +213,12 @@
this.data = this.formatData(data)
this.$nextTick(() => {
this.parentData = this.data;
+ var ids = this.extractLastLevelIds(this.parentData);
+ this.selectedIds = ids;
+ this.search.workStationIdList = ids;
+ this.search.top = 5; //24灏忔椂鍐呭墠5鍚�
+ this.search.timeLevel = 24; //24灏忔椂鍐呭墠5鍚�
+ this.getRunData();
})
}
})
@@ -213,32 +233,30 @@
if(item.cardKey == "mdcRunning") {
if(item.apiResource == "") return;
this.apiResource = JSON.parse(item.apiResource);
- this.selectedIds = this.apiResource.workStationIdList;
- this.search.workStationIdList = this.apiResource.workStationIdList;
- this.timeLevel = this.apiResource.timeLevel;
- this.top = this.apiResource.top;
- if(this.apiResource.workStationIdList.length > 0) {
- this.getRunData();
- }
+ //this.selectedIds = this.apiResource.workStationIdList;
+ //this.search.workStationIdList = this.apiResource.workStationIdList;
+ //this.timeLevel = this.apiResource.timeLevel;
+ //this.top = this.apiResource.top;
+ // if(this.apiResource.workStationIdList.length > 0) {
+ // this.getRunData();
+ // }
}
})
},
getRunData() {
- this.$HTTP.post(`/api/blade-visual/status/running-top`,this.apiResource).then(res=> {
+ this.$HTTP.post(`/api/blade-visual/status/running-top`,this.search).then(res=> {
if(res.code == 200) {
this.isSearch = false;
var recordDom = document.getElementById('running');
if(res.data.categories.length == 0) return;
this.option.yAxis.data = res.data.categories;
- this.option.series.data = res.data.series;
+ this.option.series[0].data = res.data.series[0].data;
var myChart = echarts.init(recordDom);
myChart.setOption(this.option);
}
})
},
- goPage(item) {
-
- }
+ goPage(item) {}
}
}
</script>
@@ -261,7 +279,7 @@
}
.no-list {
display: flex;
- justify-content: center;
+ justify-content: center;
font-weight: 500;
font-size: 14px;
color: #666;
--
Gitblit v1.9.3