Parcourir la source

!1470 新增代码生成复制功能
Merge pull request !1470 from 喵你个汪/dev

zuohuaijun il y a 1 an
Parent
commit
54606db69c
1 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. 12 1
      Web/src/views/system/codeGen/index.vue

+ 12 - 1
Web/src/views/system/codeGen/index.vue

@@ -38,11 +38,12 @@
 						<el-tag type="danger" v-else> 生成到本项目 </el-tag>
 					</template>
 				</el-table-column>
-				<el-table-column label="操作" width="350" fixed="right" align="center" show-overflow-tooltip>
+				<el-table-column label="操作" width="400" fixed="right" align="center" show-overflow-tooltip>
 					<template #default="scope">
 						<el-button icon="ele-Position" size="small" text type="primary" @click="handleGenerate(scope.row)">开始生成</el-button>
 						<el-button icon="ele-View" size="small" text type="primary" @click="handlePreview(scope.row)">预览</el-button>
 						<el-button icon="ele-Setting" size="small" text type="primary" @click="openConfigDialog(scope.row)">配置</el-button>
+						<el-button icon="ele-CopyDocument" size="small" text type="primary" @click="openCopyDialog(scope.row)"> 复制 </el-button>
 						<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditDialog(scope.row)">编辑</el-button>
 						<el-button icon="ele-Delete" size="small" text type="danger" @click="deleConfig(scope.row)">删除</el-button>
 					</template>
@@ -165,6 +166,16 @@ const openEditDialog = (row: any) => {
 	EditCodeGenRef.value?.openDialog(row);
 };
 
+// 打开复制页面
+const openCopyDialog = (row: any) => {
+	state.editUserTitle = '复制';
+	var copyRow = JSON.parse(JSON.stringify(row));
+	copyRow.id = 0;
+	copyRow.busName = '';
+	copyRow.tableName = '';
+	EditCodeGenRef.value?.openDialog(copyRow);
+};
+
 // 删除表
 const deleConfig = (row: any) => {
 	ElMessageBox.confirm(`确定删除吗?`, '提示', {