hookehuyr

fix: 修复启用流程按钮的确认逻辑和拼写错误

- 将启用流程按钮的确认逻辑从`el-popconfirm`改为`ElMessageBox.confirm`,以提供更清晰的提示信息
- 修复`.gitignore`文件中的拼写错误,将`.histroy`改为`.history`
node_modules
.histroy
.history
docs
.vscode
......
......@@ -486,17 +486,7 @@
</el-form>
<template #footer>
<span class="dialog-footer">
<el-popconfirm
v-if="state.current_enable_version !== state.versionForm.code"
title="是否确认启用该版本流程?"
width="220px"
confirm-button-text="确认"
cancel-button-text="取消"
@confirm="setFLowVersionEnable">
<template #reference>
<el-button type="success">启用流程</el-button>
</template>
</el-popconfirm>
<el-button @click="setFLowVersionEnable" type="success">启用流程</el-button>
<el-popconfirm
title="是否确认复制该版本流程?"
width="220px"
......@@ -1281,27 +1271,36 @@ export default {
* 启用版本
*/
const setFLowVersionEnable = async () => {
// 启动前,自动保存操作
let is_pass = await saveData('auto');
if (is_pass !== false) { // 不通过后会返回false,不返回false就是通过了
state.versionForm.type = 2;
const { code, data } = await enableFlowVersionAPI(state.versionForm);
if (code) {
ElMessage({
type: 'success',
message: '启用成功',
});
state.current_enable_version = state.versionForm.code; // 当前选中的版本号
state.dialogVersionFormVisible = false; // 关闭弹框
state.reloadLoading = true; // 打开loading
getVersionList(); // 刷新版本列表
updateFlowId(data); // 更新缓存flow_id
getFlowData(data); // 更新流程图数据
} else {
state.reloadLoading = false;
ElMessageBox.confirm('流程启用之后新增的数据,才会按新版本流程执行;已经存在的数据,仍将按原流程执行后续步骤, 是否确认启用该版本流程?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
showClose: false,
callback: async action => {
if (action === 'confirm') {
// 启动前,自动保存操作
let is_pass = await saveData('auto');
if (is_pass !== false) { // 不通过后会返回false,不返回false就是通过了
state.versionForm.type = 2;
const { code, data } = await enableFlowVersionAPI(state.versionForm);
if (code) {
ElMessage({
type: 'success',
message: '启用成功',
});
state.current_enable_version = state.versionForm.code; // 当前选中的版本号
state.dialogVersionFormVisible = false; // 关闭弹框
state.reloadLoading = true; // 打开loading
getVersionList(); // 刷新版本列表
updateFlowId(data); // 更新缓存flow_id
getFlowData(data); // 更新流程图数据
} else {
state.reloadLoading = false;
}
}
}
}
}
});
}
const copyFLowVersion = async () => { // 复制版本流程
......