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

@ -435,14 +435,14 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateForm(form).then(response => {
this.msgSuccess("修改成功");
this.$modal.msgSuccess("修改成功");
this.close()
});
return;
}
// 添加的提交
createForm(form).then(response => {
this.msgSuccess("新增成功");
this.$modal.msgSuccess("新增成功");
this.close()
});
});

View File

@ -150,15 +150,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 deleteForm(id);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}

View File

@ -213,7 +213,7 @@ export default {
// 修改的提交
if (this.form.id != null) {
updateUserGroup(this.form).then(response => {
this.msgSuccess("修改成功");
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
@ -221,7 +221,7 @@ export default {
}
// 添加的提交
createUserGroup(this.form).then(response => {
this.msgSuccess("新增成功");
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
@ -230,15 +230,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 deleteUserGroup(id);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
getUserNickname(userId) {

View File

@ -399,7 +399,7 @@ export default {
formCustomCreatePath: this.form.formType === 20 ? this.form.formCustomCreatePath : undefined,
formCustomViewPath: this.form.formType === 20 ? this.form.formCustomViewPath : undefined,
}).then(response => {
this.msgSuccess("修改模型成功");
this.$modal.msgSuccess("修改模型成功");
this.open = false;
this.getList();
});
@ -425,11 +425,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const that = this;
this.$confirm('是否删除该流程!!', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$modal.confirm('是否删除该流程!!').then(function() {
deleteModel(row.id).then(response => {
that.getList();
that.msgSuccess("删除成功");
@ -439,11 +435,7 @@ export default {
/** 部署按钮操作 */
handleDeploy(row) {
const that = this;
this.$confirm('是否部署该流程!!', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "success"
}).then(function() {
this.$modal.confirm('是否部署该流程!!').then(function() {
deployModel(row.id).then(response => {
that.getList();
that.msgSuccess("部署成功");
@ -491,15 +483,11 @@ export default {
const id = row.id;
let state = row.processDefinition.suspensionState;
let statusState = state === 1 ? '激活' : '挂起';
this.$confirm('是否确认' + statusState + '流程名字为"' + row.name + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$modal.confirm('是否确认' + statusState + '流程名字为"' + row.name + '"的数据项?').then(function() {
return updateModelState(id, state);
}).then(() => {
this.getList();
this.msgSuccess(statusState + "成功");
this.$modal.msgSuccess(statusState + "成功");
}).catch(() => {});
},
/** 导入按钮操作 */
@ -513,13 +501,13 @@ export default {
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
if (response.code !== 0) {
this.msgError(response.msg)
this.$modal.msgError(response.msg)
return;
}
// 重置表单
this.uploadClose();
// 提示,并刷新
this.msgSuccess("导入流程成功!请点击【设计流程】按钮,进行编辑保存后,才可以进行【发布流程】");
this.$modal.msgSuccess("导入流程成功!请点击【设计流程】按钮,进行编辑保存后,才可以进行【发布流程】");
this.getList();
},
uploadClose() {

View File

@ -96,7 +96,7 @@ export default {
// 修改的提交
if (data.id) {
updateModel(data).then(response => {
this.msgSuccess("修改成功")
this.$modal.msgSuccess("修改成功")
// 跳转回去
this.close()
})
@ -104,7 +104,7 @@ export default {
}
// 添加的提交
createModel(data).then(response => {
this.msgSuccess("保存成功")
this.$modal.msgSuccess("保存成功")
// 跳转回去
this.close()
})

View File

@ -65,7 +65,7 @@ export default {
// 添加的提交
createLeave(this.form).then(response => {
this.msgSuccess("发起成功");
this.$modal.msgSuccess("发起成功");
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/bpm/oa/leave"});
});

View File

@ -169,7 +169,7 @@ export default {
return cancelProcessInstance(id, value);
}).then(() => {
this.getList();
this.msgSuccess("取消成功");
this.$modal.msgSuccess("取消成功");
})
}
}

View File

@ -144,7 +144,7 @@ export default {
processDefinitionId: this.selectProcessInstance.id,
variables: variables
}).then(response => {
this.msgSuccess("发起流程成功");
this.$modal.msgSuccess("发起流程成功");
// 关闭当前窗口
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.go(-1);

View File

@ -300,7 +300,7 @@ export default {
processDefinitionId: this.selectProcessInstance.id,
variables: variables
}).then(response => {
this.msgSuccess("发起流程成功");
this.$modal.msgSuccess("发起流程成功");
// 关闭当前窗口
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.go(-1);
@ -355,12 +355,12 @@ export default {
}
if (pass) {
approveTask(data).then(response => {
this.msgSuccess("审批通过成功!");
this.$modal.msgSuccess("审批通过成功!");
this.getDetail(); // 获得最新详情
});
} else {
rejectTask(data).then(response => {
this.msgSuccess("审批不通过成功!");
this.$modal.msgSuccess("审批不通过成功!");
this.getDetail(); // 获得最新详情
});
}
@ -381,7 +381,7 @@ export default {
return;
}
updateTaskAssignee(this.updateAssignee.form).then(response => {
this.msgSuccess("转派任务成功!");
this.$modal.msgSuccess("转派任务成功!");
this.updateAssignee.open = false;
this.getDetail(); // 获得最新详情
});
@ -402,11 +402,11 @@ export default {
},
/** 处理审批退回的操作 */
handleDelegate(task) {
this.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
this.$modal.msgError("暂不支持【委派】功能,可以使用【转派】替代!");
},
/** 处理审批退回的操作 */
handleBack(task) {
this.msgError("暂不支持【退回】功能!");
this.$modal.msgError("暂不支持【退回】功能!");
}
}
};

View File

@ -174,7 +174,7 @@ export default {
return cancelProcessInstance(id, value);
}).then(() => {
this.getList();
this.msgSuccess("取消成功");
this.$modal.msgSuccess("取消成功");
})
},
/** 处理详情按钮 */

View File

@ -257,7 +257,7 @@ export default {
if (!form.id) {
form.modelId = this.modelId; // 模型编号
createTaskAssignRule(form).then(response => {
this.msgSuccess("修改成功");
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
@ -265,7 +265,7 @@ export default {
} else {
form.taskDefinitionKey = undefined; // 无法修改
updateTaskAssignRule(form).then(response => {
this.msgSuccess("修改成功");
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});