From 4f17438e8199eb44c98d6fcc888dc08ece3bab19 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期五, 08 十一月 2024 18:14:05 +0800
Subject: [PATCH] 1

---
 src/views/mdc/state-feedback.vue |  102 +++++++++++++++++----------------------------------
 src/views/mdc/time-analysis.vue  |    4 +-
 2 files changed, 36 insertions(+), 70 deletions(-)

diff --git a/src/views/mdc/state-feedback.vue b/src/views/mdc/state-feedback.vue
index ee3fb92..13951e3 100644
--- a/src/views/mdc/state-feedback.vue
+++ b/src/views/mdc/state-feedback.vue
@@ -2,7 +2,7 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-03-26 10:28:33
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-11-01 14:56:23
+ * @LastEditTime: 2024-11-08 18:11:39
  * @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
 -->
@@ -12,10 +12,10 @@
             <el-container style="height: 100%;">
                 <el-aside width="300px" style="height: 100%;">
                     <el-container style="flex-direction: column;">
-						<div class="left-title">宸ヤ綅</div>
-                        <el-main style="padding: 12px 20px 20px;">
-							<el-tree :data="tableData" node-key="id" default-expand-all :expand-on-click-node="false" :props="defalutProps" @node-click="handleNodeClick" ref="treeRef" highlight-current />
-                        </el-main>
+						<div class="aposcope-left">
+							<el-row style="margin: 8px;font-size: 14px;">宸ヤ綅</el-row>
+							<MYTree v-model="treeChecked" @loaded="query"></MYTree>
+						</div>
                     </el-container>
                 </el-aside>
                 <el-container>
@@ -65,19 +65,20 @@
             </el-container>
         </el-card>
     </el-main>
-	<save-dialog v-if="dialog.save" ref="saveDialog" :feedBackStatusList="feedBackStatusList" :workstationId="lastLevelId" @success="addfeedbackSuccess" @closed="dialog.save=false"></save-dialog>
+	<save-dialog v-if="dialog.save" ref="saveDialog" :feedBackStatusList="feedBackStatusList" :workstationId="treeChecked.toString()" @success="addfeedbackSuccess" @closed="dialog.save=false"></save-dialog>
 </template>
 <script>
 	import { useTransitionFallthroughEmits } from 'element-plus';
+	import MYTree from './MYTree.vue'
 	import saveDialog from './add-feedback'
 	export default {
 		name: "state-feedback",
 		data(){
 			return {
+				treeChecked: [],
 				dialog: {
 					save: false
 				},
-				lastLevelId: "",
 				feedBackStatusList: [],
 				current: "1",
 				size: "15",
@@ -104,12 +105,16 @@
 			
 		},
 		mounted(){
-			this.getTreeList();
 			this.getfeedBackStatusList();  //鑾峰彇鐘舵�乴ist
 		},
 		components: {
-			saveDialog
+			saveDialog,MYTree
 	    },
+		watch: {
+			treeChecked() {
+				this.query()
+			}
+		},
 		methods: {
 			table_del(row) {
 				this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
@@ -173,47 +178,25 @@
 				var d = diffDays == 0?"":diffDays + "澶�";
 				return d + diffHours + "灏忔椂 " + diffMinutes + "鍒嗛挓 " + diffSeconds + "绉�"
 			},
-			handleNodeClick(data) {
-				if(data.code) {
-					this.lastLevelId = data.id;
-					var obj = {
-						workstationId: this.lastLevelId,
-					}
-					if(this.searchData.feedBackStatus.length != 0) {
-						obj.feedBackStatus = this.searchData.feedBackStatus;
-					}
-					if(this.searchData.endDate) {
-						obj.endDate = this.searchData.endDate;
-					}
-					if(this.searchData.startDate) {
-						obj.startDate = this.searchData.startDate;
-					}
-					this.$HTTP.post("/api/mdc/workstation-wcs-feedback/page?current=1&size=15",obj).then(res=> {
-						if(res.code == 200) {
-							this.searchDataList = res.data.records;
-						}
-					})
+			query() {
+				if (!this.treeChecked.toString()) return;
+				var obj = {
+					workstationId: this.treeChecked.toString(),
 				}
-			},
-			getLastLevelIds(tree) {  
-				if (tree.length === 0) return ""; // 濡傛灉娌℃湁鏍硅妭鐐癸紝杩斿洖绌� 
-				const lastLevelIds = []; 
-				const lastLevelCodes = [];
-				function traverseTree(node) {  
-					if(!node.code) {
-						lastLevelCodes.push(node.id);
+				if(this.searchData.feedBackStatus.length != 0) {
+					obj.feedBackStatus = this.searchData.feedBackStatus;
+				}
+				if(this.searchData.endDate) {
+					obj.endDate = this.searchData.endDate;
+				}
+				if(this.searchData.startDate) {
+					obj.startDate = this.searchData.startDate;
+				}
+				this.$HTTP.post("/api/mdc/workstation-wcs-feedback/page?current=1&size=15",obj).then(res=> {
+					if(res.code == 200) {
+						this.searchDataList = res.data.records;
 					}
-					if (node.children.length > 0) {  
-						node.children.forEach(traverseTree); // 閫掑綊閬嶅巻瀛愯妭鐐�  
-					} else {  
-						if(node.code) {
-							lastLevelIds.push(node.id); // 鏈塩ode鎵嶈 
-						}
-					}
-				}  	
-				// 鍙亶鍘嗙涓�涓牴鑺傜偣  
-				traverseTree(tree[0]);  
-				return {lastLevelCodes,lastLevelId:lastLevelIds[0]}; // 杩斿洖lastLevelCodes锛氭病鏈塩ode鐨勬暟缁勩�俵astLevelId锛氭湁code鐨勭涓�涓猧d
+				})
 			},
 			buildTree(items) {  
 			  const idMap = {};  
@@ -250,26 +233,9 @@
 				})
 				return tree;
 			},
-			getTreeList(flag) {
-				var obj = {
-					groupCategory: 1,
-					groupType: "group_workstation"
-				}
-				this.$HTTP.post("/api/smis/group/groupWorkstation/type",obj).then(res=> {
-					if(res.code == 200) {
-						var treeDisabled = this.addTreeDisable(res.data);
-						this.tableData = this.buildTree(treeDisabled);  //浠庢墎骞冲寲鍙樹负鏍戠姸缁撴瀯
-						this.$nextTick(()=> {
-							this.lastLevelId = this.getLastLevelIds(this.tableData).lastLevelId;
-							this.$refs.treeRef.setCurrentKey(this.lastLevelId);  //绗竴涓妭鐐圭殑绗竴涓瓙鑺傜偣鏈�鍚庝竴绾ч粯璁ら�変腑
-							this.getlist();  //娓叉煋鍙嶉鍒楄〃
-						})
-					}
-				})
-			},
 			getlist() {
 				var obj = {
-					workstationId: this.lastLevelId,
+					workstationId: this.treeChecked.toString(),
 				}
 				if(this.searchData.feedBackStatus != 0) {
 					obj.feedBackStatus = this.searchData.feedBackStatus;
@@ -322,10 +288,10 @@
 	margin: 8px;
 }
 .aposcope-left {
-	width: 240px;
 	margin-right: 8px;
-	padding: 4px;
+	padding: 20px;
 	background-color: #fff;
+	padding-top: 20px;
 }
 .aposcope-right {
 	flex: 1;
diff --git a/src/views/mdc/time-analysis.vue b/src/views/mdc/time-analysis.vue
index 169941b..6cc39f7 100644
--- a/src/views/mdc/time-analysis.vue
+++ b/src/views/mdc/time-analysis.vue
@@ -2,7 +2,7 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-04-26 09:36:18
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-11-04 12:11:01
+ * @LastEditTime: 2024-11-08 18:13:17
  * @FilePath: /smart-web/src/views/mdc/status-record.vue
  * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -12,7 +12,7 @@
             <el-container style="height: 100%;">
                 <el-aside width="300px" style="height: 100%;">
                     <el-container>
-                        <div class="left-title">鏌ヨ鏉′欢</div>
+                        <!-- <div class="left-title">鏌ヨ鏉′欢</div> -->
                         <el-main style="padding: 20px;">
                             <el-row>
                                 <el-col style="margin-bottom: 12px;">鏃ユ湡</el-col>

--
Gitblit v1.9.3