From 117d37c8cee4b83eda0625f758faf467ab12f674 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期三, 17 四月 2024 23:20:20 +0800
Subject: [PATCH] 1

---
 src/views/mdc/state-feedback.vue |  214 +++++++++++++++++++++++++++++++++++++++++++++++++----
 src/api/model/workstation.js     |    7 +
 2 files changed, 205 insertions(+), 16 deletions(-)

diff --git a/src/api/model/workstation.js b/src/api/model/workstation.js
index d70c9d2..f57954d 100644
--- a/src/api/model/workstation.js
+++ b/src/api/model/workstation.js
@@ -25,6 +25,13 @@
 			return await http.get(this.url, params);
 		}
 	},
+	groupWorkstationType: {
+		url: `${config.API_URL}/blade-cps/group/groupWorkstation/type`,
+		name: "鑾峰彇鐘舵�佸弽棣堟爲",
+		post: async function(params){
+			return await http.post(this.url, params);
+		}
+	},
     calendarList: {
 		url: `${config.API_URL}/blade-cps/calendar/list`,
 		name: "鑾峰彇鐢熶骇鏃ュ巻",
diff --git a/src/views/mdc/state-feedback.vue b/src/views/mdc/state-feedback.vue
index 0617cc7..db9312e 100644
--- a/src/views/mdc/state-feedback.vue
+++ b/src/views/mdc/state-feedback.vue
@@ -1,24 +1,206 @@
 <!--
- * @Date: 2024-04-09 22:11:21
- * @LastEditors: Sneed
- * @LastEditTime: 2024-04-13 22:15:38
- * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/state-feedback.vue
- 鐘舵�佸弽棣�
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-03-26 10:28:33
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-04-17 17:52:50
+ * @FilePath: /smart-web/src/views/master/person/main/index.vue
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <template>
-    <el-main>
-        <el-card shadow="never">
-            鏁堢巼鍒嗘瀽
-        </el-card>
-    </el-main>
+	<div class="aposcope-main">
+		<div class="aposcope-left">
+			<div class="left-title">宸ヤ綅</div>
+			<el-tree :data="tableData" row-key="id" default-expand-all :expand-on-click-node="false" :props="defalutProps" @node-click="handleNodeClick" ref="treeRef"/>
+		</div>
+		<div class="aposcope-right">
+			<div>
+				<!-- <el-button type="primary" @click="addData">+ 娣诲姞</el-button> -->
+				<!-- <el-button type="danger" plain @click="delData">鍒犻櫎</el-button> -->
+			</div>
+			<el-table ref="searchDataListRef" :data="searchDataList" border style="width: 100%;margin-top: 20px;" class="multipleTableRef" @selection-change="searchHandleSelectionChange">
+				<el-table-column type="selection" width="55" />
+				<el-table-column prop="moduleCode" label="宸ヤ綅鍚嶇О"></el-table-column>
+				<el-table-column prop="controllerCode" label="鐘舵��"></el-table-column>
+				<el-table-column prop="scopeName" label="鎻忚堪"></el-table-column>
+				<el-table-column prop="httpMethod" label="鎸佺画鏃堕暱"></el-table-column>
+				<el-table-column prop="scopePath" label="鐘舵�佹椂闂�"></el-table-column>
+				<el-table-column prop="scopePath" label="鍙嶉鏃堕棿"></el-table-column>
+				<el-table-column fixed="right" label="鎿嶄綔">
+					<template #default="scope">
+						<el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">鍒犻櫎</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+		</div>
+	</div>
 </template>
-
 <script>
-    export default {
-        
-    }
+	export default {
+		name: "state-feedback",
+		data(){
+			return {
+				searchData: {
+					menuId: "",
+					size: "15",
+					current: "1"
+				},
+				searchDataList: [],  //鍙充晶鏁版嵁list
+				aList: [],
+				defalutProps: {
+					label: 'title',
+  					children: 'children',
+					isLeaf: 'hasChildren'
+				},
+				parentId: "0",
+				tableData: [],
+				searchSelection: []
+			}
+		},
+		created(){
+			
+		},
+		mounted(){
+			this.getTreeList();
+		},
+		components: {
+
+	    },
+		methods: {
+			searchHandleSelectionChange(selection) {
+				this.searchSelection = selection;
+			},
+			handleClose(done) {
+		        done();
+		    },
+			handleNodeClick(data) {
+				// var obj = {
+				// 	groupCategory: 1,
+				// 	groupType: "group_workstation"
+				// }
+				// this.$HTTP.post("/api/blade-cps/group/groupWorkstation/type",obj).then(res=> {
+				// 	if(res.code == 200) {
+				// 		this.searchDataList = res.data.records;
+				// 	}
+				// })
+			},
+			buildTree(items) {  
+			  const idMap = {};  
+			  const tree = [];  
+			  
+			  // 绗竴姝ワ細鍒涘缓id鍒板璞$殑鏄犲皠  
+			  items.forEach(item => {  
+			    idMap[item.id] = { ...item, children: [] };  
+			  });  
+			  
+			  // 绗簩姝ワ細鏋勫缓鏍戝舰缁撴瀯  
+			  items.forEach(item => {  
+			    const currentNode = idMap[item.id];  
+			      
+			    // 濡傛灉parentId涓�0锛岃鏄庢槸鏍硅妭鐐�  
+			    if (item.parentId === 0) {  
+			      tree.push(currentNode);  
+			    } else {  
+			      // 鍚﹀垯锛屾煡鎵剧埗鑺傜偣锛屽苟灏嗗綋鍓嶈妭鐐规坊鍔犲埌鐖惰妭鐐圭殑children鏁扮粍涓�  
+			      const parentId = item.parentId;  
+			      if (idMap[parentId]) {  
+			        idMap[parentId].children.push(currentNode);  
+			      }  
+			    }  
+			  });  
+			  
+			  return tree;  
+			},
+			getTreeList(flag) {
+				var obj = {
+					groupCategory: 1,
+					groupType: "group_workstation"
+				}
+				this.$HTTP.post("/api/blade-cps/group/groupWorkstation/type",obj).then(res=> {
+					if(res.code == 200) {
+						if (res.code == 200) {
+							this.tableData = this.buildTree(res.data);
+							console.log(this.buildTree(res.data))
+						}
+					}
+				})
+			},
+			loadNode(node, resolve, reject) {
+				if(node.data.id) {
+					this.parentId = node.data.id;
+				}else {
+					this.parentId = '0';
+				}
+				this.$HTTP.get("/api/blade-system/menu/lazy-list",{parentId: this.parentId}).then(res=> {
+					if(res.code == 200) {
+						res.data.forEach(node => {
+							node.hasChildren = !node.hasChildren;
+						});
+						resolve(res.data);
+					}
+				})
+			},
+			addData() {
+				
+			},
+			delData() {
+				if(this.searchSelection.length == 0) {
+					this.$message({
+			          message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
+			          type: 'warning'
+			        });
+			        return;
+				}
+				var selStr = "";
+				this.searchSelection.map(item=> {
+					selStr += item.id + ","
+				})
+				selStr = selStr.replace(/,$/, '');
+				var that = this;
+			}
+		}
+	}
 </script>
 
-<style lang="scss" scoped>
-
+<style scoped>
+.aposcope-main {
+	display: flex;
+	min-height: 100%;
+	margin: 8px;
+}
+.aposcope-left {
+	width: 240px;
+	margin-right: 8px;
+	padding: 4px;
+	background-color: #fff;
+}
+.aposcope-right {
+	flex: 1;
+	padding: 8px;
+	background-color: #fff;
+}
+.left-title {
+	font-size: 16px;
+    text-align: center;
+    height: 38px;
+    line-height: 38px;
+    border-bottom: 1px solid #e2e2e2;
+    background-color: #409eff;
+    color: #fff;
+    border-radius: 2px 2px 0 0;
+}
+.right-content {
+	text-align: center;
+}
+.right-content img {
+	width: 350px;
+	height: 350px;
+}
+.right-content > div {
+	font-size: 14px;;
+}
+.right-content > div span:nth-child(2) {
+	margin-left: 8px;
+	color: #409eff;
+	cursor: pointer;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3