|
@@ -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();
|