From 506263001909d6e1c1727f092042a0370f2586e4 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期日, 23 六月 2024 23:13:25 +0800
Subject: [PATCH] 1

---
 src/views/home/widgets/components/mdcEquipmentRun.vue |    3 +--
 src/views/home/widgets/index.vue                      |   33 ++++++++++++++++++++++++---------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/views/home/widgets/components/mdcEquipmentRun.vue b/src/views/home/widgets/components/mdcEquipmentRun.vue
index 040c9cf..2ba15fb 100644
--- a/src/views/home/widgets/components/mdcEquipmentRun.vue
+++ b/src/views/home/widgets/components/mdcEquipmentRun.vue
@@ -2,7 +2,7 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-04-16 15:22:46
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-21 10:49:01
+ * @LastEditTime: 2024-06-23 21:52: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
 -->
@@ -218,7 +218,6 @@
 			},
 			getRunData(type) {
 				this.isSearch = false;
-				return;
 				if(type != "search") {
 					var ids = this.extractLastLevelIds(this.parentData); 
 					this.selectedIds = ids;
diff --git a/src/views/home/widgets/index.vue b/src/views/home/widgets/index.vue
index bd5febd..93d9d19 100644
--- a/src/views/home/widgets/index.vue
+++ b/src/views/home/widgets/index.vue
@@ -39,6 +39,7 @@
 					<div class="widgets-aside-title"><el-icon><el-icon-circle-plus-filled/></el-icon>娣诲姞閮ㄤ欢</div>
 					<div class="widgets-aside-close" @click="close()"><el-icon><el-icon-close /></el-icon></div>
 				</el-header>
+				{{grid.layout.join(',')}},xxxx
 				<el-header style="height:auto">
 					<div class="selectLayout">
 						<div class="selectLayout-item item01" :class="{active:grid.layout.join(',')=='12,6,6'}" @click="setLayout([12,6,6])">
@@ -66,9 +67,9 @@
 				</el-header>
 				<el-main class="nopadding">
 					<div class="widgets-list">
-						<div v-if="myCompsList.length<=0" class="widgets-list-nodata">
+						<!-- <div v-if="myCompsList.length<=0" class="widgets-list-nodata">
 							<el-empty description="娌℃湁閮ㄤ欢鍟�" :image-size="60"></el-empty>
-						</div>
+						</div> -->
 						<div v-for="item in myCompsList" :key="item.title" class="widgets-list-item">
 							<div class="item-logo"><el-icon><component :is="item.icon" /></el-icon></div>
 							<div class="item-info">
@@ -92,6 +93,7 @@
 <script>
 	import draggable from 'vuedraggable'
 	import allComps from './components'
+import { arrow } from '@popperjs/core';
 
 	export default {
 		components: {
@@ -134,7 +136,6 @@
 				return allCompsList
 			},
 			myCompsList(){
-				alert(1)
 				var copmsList = [];
 				if(this.defaultGrid.copmsList == undefined) return [];
 				this.defaultGrid.copmsList.forEach(item=> {
@@ -142,7 +143,8 @@
 				})
 				var myGrid = copmsList;
 				this.$TOOL.data.set("DASHBOARDGRID", copmsList);
-				return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key))
+				//return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key))
+				return this.allCompsList;
 			},
 			nowCompsList(){
 				var copmsList = [];
@@ -182,7 +184,7 @@
 							}  
 							// 濡傛灉 xcoordinate 涔熺浉鍚岋紝鍒欎笉浜ゆ崲浣嶇疆  
 							return 0;  
-						});   
+						});
 						cards.forEach((item,index)=> {
 							this.$CONFIG.DEFAULT_GRID.copmsList[index] = [item.cardKey];
 							this.$CONFIG.DEFAULT_GRID.layout[index] = item.cardWide * 2;
@@ -219,19 +221,31 @@
 			},
 			//闅愯棌缁勪欢
 			remove(item){
-				console.log(item,222)
 				var newCopmsList = this.grid.copmsList
 				newCopmsList.forEach((obj, index) => {
 					var newObj = obj.filter(o=>o!=item)
 					newCopmsList[index] = newObj;
 				})
-				//console.log(newCopmsList,123)
 			},
 			//淇濆瓨
 			save(){
 				this.customizing = false
 				this.$refs.widgets.style.removeProperty('transform')
 				this.$TOOL.data.set("grid", this.grid)
+				//淇濆瓨鎺ュ彛
+				var copmsList = this.grid.copmsList;
+				var flattened = copmsList.reduce((acc, val) => acc.concat(val), []); //鎵佸钩鍖� 
+				var data = this.grid.data.filter(item=>flattened.includes(item.cardKey));
+				var obj = {
+					workbenchCardAddVOList: data,
+					workbenchId: this.workid
+				}
+				this.$HTTP.post(`/api/blade-system/workbench-card/create-workbench-card`,obj).then(res=> {
+					if(res.code == 200) {
+						this.$message.success("鎿嶄綔鎴愬姛");
+					}
+				})
+				console.log(this.grid,111)
 			},
 			//鎭㈠榛樿
 			backDefaul(){
@@ -242,8 +256,9 @@
 			},
 			//鍏抽棴
 			close(){
-				this.customizing = false
-				this.$refs.widgets.style.removeProperty('transform')
+				//this.customizing = false
+				//this.$refs.widgets.style.removeProperty('transform')
+				this.backDefaul();
 			}
 		}
 	}

--
Gitblit v1.9.3