From acacdfa1b6b5dc0ac0c444c53fcbd05f8552ff3c Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 23 四月 2024 08:44:39 +0800
Subject: [PATCH] #演示

---
 src/main/webapp/views/commandManage/commandManage.html |   94 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/views/commandManage/commandManage.html b/src/main/webapp/views/commandManage/commandManage.html
index 81e2487..8e3e6e2 100644
--- a/src/main/webapp/views/commandManage/commandManage.html
+++ b/src/main/webapp/views/commandManage/commandManage.html
@@ -40,7 +40,7 @@
 							<el-button type="primary" @click="resetParam">閲嶇疆</el-button>
 						</el-form-item>
 					</el-form>
-					<el-table ref="singleTable" :data="tableData" style="width: 100%;" :row-class-name="tableRowClassName">
+					<el-table border ref="singleTable" :data="tableData" style="width: 100%;" :row-class-name="tableRowClassName">
 						<el-table-column label="鎿嶄綔" width="100">
 							<template slot-scope="scope">
 								<el-dropdown @command="(command)=>{handleCommand(command, scope.row)}">
@@ -63,7 +63,7 @@
 						</el-table-column>
 						<el-table-column show-overflow-tooltip property="durationTime" label="鎸佺画鏃堕暱">
 						</el-table-column>
-						<el-table-column property="commandType" label="鎸囦护绫诲瀷">
+						<el-table-column property="commandType$" label="鎸囦护绫诲瀷">
 						</el-table-column>
 						<el-table-column property="device" label="璁惧">
 						</el-table-column>
@@ -184,6 +184,96 @@
 						}
 						return '';
 					},
+					handleCommand(command, row) {
+						switch (command) {
+							case "showTask":
+								//鏌ョ湅浠诲姟
+								this.showTask(row)
+								break;
+							case "executeCommand":
+								//鎵ц鎸囦护
+								this.executeCommand(row)
+								break;
+							case "completeCommand":
+								//瀹屾垚鎸囦护
+								this.completeCommand(row)
+								break;
+						}
+					},
+					showTask(row) {
+						let wrkNo = row.wrkNo == null ? "" : row.wrkNo
+						console.log(wrkNo)
+						//鏌ョ湅鎸囦护
+						$layui.layer.open({
+							type: 2,
+							title: '浠诲姟绠$悊',
+							maxmin: true,
+							area: [top.detailWidth, top.detailHeight],
+							shadeClose: true,
+							content: '../taskWrk/taskWrk.html?taskNo=' + row.taskNo + "&wrkNo=" + wrkNo,
+							success: function(layero, index) {}
+						});
+					},
+					executeCommand(row) {
+						//鎵ц鎸囦护
+						let that = this
+						$.ajax({
+							url: baseUrl + "/commandInfo/executeCommand",
+							headers: {
+								'token': localStorage.getItem('token')
+							},
+							data: {
+								id: row.id
+							},
+							method: 'POST',
+							success: function(res) {
+								if (res.code == 200) {
+									that.$message({
+										message: "鎵ц鎴愬姛",
+										type: 'success'
+									});
+									that.getTableData()
+								} else if (res.code === 403) {
+									top.location.href = baseUrl + "/";
+								} else {
+									that.$message({
+										message: res.msg,
+										type: 'error'
+									});
+								}
+							}
+						});
+					},
+					completeCommand(row) {
+						//瀹屾垚鎸囦护
+						let that = this
+						$.ajax({
+							url: baseUrl + "/commandInfo/completeCommand",
+							headers: {
+								'token': localStorage.getItem('token')
+							},
+							data: {
+								id: row.id
+							},
+							method: 'POST',
+							success: function(res) {
+								if (res.code == 200) {
+									that.$message({
+										message: "瀹屾垚鎴愬姛",
+										type: 'success'
+									});
+									that.getTableData()
+								} else if (res.code === 403) {
+									top.location.href = baseUrl + "/";
+								} else {
+									that.$message({
+										message: res.msg,
+										type: 'error'
+									});
+								}
+							}
+						});
+					},
 				}
 			})
 		</script>

--
Gitblit v1.9.1