v3.8.0 新增通用方法简化模态/缓存使用

This commit is contained in:
YunaiV
2022-02-17 13:11:21 +08:00
parent 433056d5ea
commit 38ac5270d6
60 changed files with 366 additions and 452 deletions

View File

@ -194,11 +194,11 @@ export default {
parentMenuId: genTable.parentMenuId
};
updateCodegen(genTable).then(res => {
this.msgSuccess("修改成功!");
this.$modal.msgSuccess("修改成功!");
this.close();
});
} else {
this.msgError("表单校验未通过,请重新检查提交内容");
this.$modal.msgError("表单校验未通过,请重新检查提交内容");
}
});
},

View File

@ -304,7 +304,7 @@ export default {
tplSelectChange(value) {
if (value !== 1) {
// TODO 芋艿:暂时不考虑支持树形结构
this.msgError('暂时不考虑支持【树形】和【主子表】的代码生成。原因是:导致 vm 模板过于复杂,不利于胖友二次开发');
this.$modal.msgError('暂时不考虑支持【树形】和【主子表】的代码生成。原因是:导致 vm 模板过于复杂,不利于胖友二次开发');
return false;
}
if(value !== 'sub') {

View File

@ -96,7 +96,7 @@ export default {
/** 导入按钮操作 */
handleImportTable() {
createCodegenListFromDB(this.tables.join(",")).then(res => {
this.msgSuccess("导入成功");
this.$modal.msgSuccess("导入成功");
this.visible = false;
this.$emit("ok");
});

View File

@ -205,14 +205,10 @@ export default {
}
// 基于 DB 同步
const tableName = row.tableName;
this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function() {
return syncCodegenFromDB(row.id);
}).then(() => {
this.msgSuccess("同步成功");
this.$modal.msgSuccess("同步成功");
}).catch(() => {});
},
/** 打开导入表弹窗 */
@ -326,15 +322,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const tableIds = row.id;
this.$confirm('是否确认删除表名称为"' + row.tableName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$modal.confirm('是否确认删除表名称为"' + row.tableName + '"的数据项?').then(function() {
return deleteCodegen(tableIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
// 取消按钮
@ -360,7 +352,7 @@ export default {
let form = this.importSQL.form;
if (form.tableId != null) {
syncCodegenFromSQL(form.tableId, form.sql).then(response => {
this.msgSuccess("同步成功");
this.$modal.msgSuccess("同步成功");
this.importSQL.open = false;
this.getList();
});
@ -368,7 +360,7 @@ export default {
}
// 添加的提交
createCodegenListFromSQL(form).then(response => {
this.msgSuccess("导入成功");
this.$modal.msgSuccess("导入成功");
this.importSQL.open = false;
this.getList();
});

View File

@ -217,7 +217,7 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateTestDemo(this.form).then(response => {
this.msgSuccess("修改成功");
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
@ -225,7 +225,7 @@ export default {
}
// 添加的提交
createTestDemo(this.form).then(response => {
this.msgSuccess("新增成功");
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
@ -234,15 +234,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$confirm('是否确认删除字典类型编号为"' + id + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$modal.confirm('是否确认删除字典类型编号为"' + id + '"的数据项?').then(function() {
return deleteTestDemo(id);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
@ -253,11 +249,7 @@ export default {
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$confirm('是否确认导出所有字典类型数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$modal.confirm('是否确认导出所有字典类型数据项?').then(() => {
this.exportLoading = true;
return exportTestDemoExcel(params);
}).then(response => {