Browse Source

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pblUserManage

lzw 1 month ago
parent
commit
1926685f4c

File diff suppressed because it is too large
+ 0 - 0
dist/css/app.1e390582.css


+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.3a922260.js"></script><script defer="defer" src="/js/app.d2906166.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.5c25bc03.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.3a922260.js"></script><script defer="defer" src="/js/app.3dc7bee8.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.1e390582.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because it is too large
+ 0 - 0
dist/js/app.3dc7bee8.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.3dc7bee8.js.map


+ 74 - 1
src/components/desktopToolList.vue

@@ -165,7 +165,7 @@
 					}}</template>
 				</el-table-column>
 
-				<el-table-column label="操作" width="200px" show-overflow-tooltip>
+				<el-table-column label="操作" width="240px" show-overflow-tooltip>
 					<template slot-scope="scope">
 						<button
 							@click="editTool(scope.row)"
@@ -207,6 +207,32 @@
 						>
 							启用
 						</button>
+
+						<button
+							@click="copyTool(scope.row)"
+							style="
+								color: #308fff;
+								background: none;
+								border: none;
+								cursor: pointer;
+								margin-left: 25px;
+							"
+						>
+							复制
+						</button>
+
+						<button
+							@click="delTool(scope.row)"
+							style="
+								color: #ff2570;
+								background: none;
+								border: none;
+								cursor: pointer;
+								margin-left: 25px;
+							"
+						>
+							删除
+						</button>
 					</template>
 				</el-table-column>
 			</el-table>
@@ -447,6 +473,53 @@ export default {
 					this.$message.error("停用失败");
 				});
 		},
+		copyTool(data) {
+			let _copyData = JSON.parse(JSON.stringify(data));
+			console.log("👉", _copyData);
+			_copyData.toolId = _copyData.toolId + "_copy";
+			_copyData.description = _copyData.description + "_copy";
+			delete _copyData.id;
+			this.$refs.addDesktopToolDialogRef.open(_copyData);
+		},
+		delTool(data) {
+			this.$confirm("此操作将永久删除该工具,是否继续?", "删除工具", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+				.then(() => {
+					let params = [
+						{
+							functionName: "delete_desktopToolById",
+							id: data.id,
+						},
+					];
+					this.$ajax
+						.post(API_CONFIG.baseUrl, params)
+						.then(async (res) => {
+							console.log(res);
+							if (res.data == 1) {
+								this.$message.success("删除工具成功");
+								await addOp({
+									uid: this.userid,
+									cid: "",
+									type: "user_op",
+									content: `删除了了工具:${data.toolId}-${data.id}`,
+								});
+							}else{
+								this.$message.error("删除工具失败");
+							}
+
+							this.getData();
+						})
+						.catch((err) => {
+							console.log(err);
+							this.$message.error("删除工具失败");
+							this.getData();
+						});
+				})
+				.catch(() => {});
+		},
 	},
 	mounted() {
 		this.getData();

Some files were not shown because too many files changed in this diff