From c45cd9877daf5b4f51359e6dad7b71ff9a5069b6 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 24 六月 2024 22:26:03 +0800
Subject: [PATCH] 1

---
 src/views/home/widgets/components/mdcRunning.vue |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/views/home/widgets/components/mdcRunning.vue b/src/views/home/widgets/components/mdcRunning.vue
index ddfdf27..558578f 100644
--- a/src/views/home/widgets/components/mdcRunning.vue
+++ b/src/views/home/widgets/components/mdcRunning.vue
@@ -2,15 +2,15 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-04-16 15:22:46
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-21 01:45:18
+ * @LastEditTime: 2024-06-21 10:53:10
  * @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
 -->
 <template>
 	<el-card shadow="hover" header="璁惧杩愯鏃堕暱鎺掑悕" style="height: 100%;" class="running">
 		<div class="running-icon">
-			<el-icon><RefreshLeft /></el-icon>
-			<el-icon @click="isSearch = true"><Filter /></el-icon>
+			<el-icon @click="refreshBtn"><RefreshLeft /></el-icon>
+			<el-icon @click="showSearch"><Filter /></el-icon>
 		</div>
 		<div class="no-list">璁惧杩愯鏃堕暱{{timeLevel}}灏忔椂鍐呭墠{{top}}鍚�</div>
 		<div :id="'running'" style="height:160px;"></div>
@@ -37,6 +37,7 @@
 						    :data="parentData"
 						    :props="{ label: 'title' }"
 						    style="width:80%;"
+							:default-checked-keys="selectedIds"
 							:render-after-expand="false" />
 					</div>
 					<div>
@@ -76,6 +77,7 @@
 		description: "蹇�熸煡鐪嬭澶囪繍琛屾椂闀挎帓鍚�",
 		data() {
 			return {
+				selectedIds: [],
 				parentData: {},
 				list: [],
 				timeLevelList: [],
@@ -86,8 +88,8 @@
 					top: ""
 				},
 				isSearch: false,
-				timeLevel: "",
-				top: "",
+				timeLevel: "24",
+				top: "5",
 				apiResource: {
 					workStationIdList: []
 				},
@@ -145,8 +147,17 @@
 			}
 		},
 		methods: {
+			refreshBtn() {
+				this.getList();
+			},
+			showSearch() {
+				this.search.timeLevel = this.timeLevel;
+				this.search.top = this.top;
+				this.isSearch = true;
+			},
 			serchSubmit() {
-
+				this.apiResource = this.search;
+				this.getRunData();
 			},
 			setCurrentKey(v) {
 				if (this.firstWorkKey) return
@@ -200,7 +211,10 @@
 				this.cardData = this.$CONFIG.DEFAULT_GRID.data;
 				this.cardData.forEach(item=> {
 					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) {
@@ -212,6 +226,7 @@
 			getRunData() {
 				this.$HTTP.post(`/api/blade-visual/status/running-top`,this.apiResource).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;

--
Gitblit v1.9.3