hookehuyr

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

- 将启用流程按钮的确认逻辑从`el-popconfirm`改为`ElMessageBox.confirm`,以提供更清晰的提示信息
- 修复`.gitignore`文件中的拼写错误,将`.histroy`改为`.history`
1 node_modules 1 node_modules
2 -.histroy 2 +.history
3 docs 3 docs
4 .vscode 4 .vscode
......
...@@ -486,17 +486,7 @@ ...@@ -486,17 +486,7 @@
486 </el-form> 486 </el-form>
487 <template #footer> 487 <template #footer>
488 <span class="dialog-footer"> 488 <span class="dialog-footer">
489 - <el-popconfirm 489 + <el-button @click="setFLowVersionEnable" type="success">启用流程</el-button>
490 - v-if="state.current_enable_version !== state.versionForm.code"
491 - title="是否确认启用该版本流程?"
492 - width="220px"
493 - confirm-button-text="确认"
494 - cancel-button-text="取消"
495 - @confirm="setFLowVersionEnable">
496 - <template #reference>
497 - <el-button type="success">启用流程</el-button>
498 - </template>
499 - </el-popconfirm>
500 <el-popconfirm 490 <el-popconfirm
501 title="是否确认复制该版本流程?" 491 title="是否确认复制该版本流程?"
502 width="220px" 492 width="220px"
...@@ -1281,27 +1271,36 @@ export default { ...@@ -1281,27 +1271,36 @@ export default {
1281 * 启用版本 1271 * 启用版本
1282 */ 1272 */
1283 const setFLowVersionEnable = async () => { 1273 const setFLowVersionEnable = async () => {
1284 - // 启动前,自动保存操作 1274 + ElMessageBox.confirm('流程启用之后新增的数据,才会按新版本流程执行;已经存在的数据,仍将按原流程执行后续步骤, 是否确认启用该版本流程?', '温馨提示', {
1285 - let is_pass = await saveData('auto'); 1275 + confirmButtonText: '确定',
1286 - if (is_pass !== false) { // 不通过后会返回false,不返回false就是通过了 1276 + cancelButtonText: '取消',
1287 - state.versionForm.type = 2; 1277 + showClose: false,
1288 - const { code, data } = await enableFlowVersionAPI(state.versionForm); 1278 + callback: async action => {
1289 - if (code) { 1279 + if (action === 'confirm') {
1290 - ElMessage({ 1280 + // 启动前,自动保存操作
1291 - type: 'success', 1281 + let is_pass = await saveData('auto');
1292 - message: '启用成功', 1282 + if (is_pass !== false) { // 不通过后会返回false,不返回false就是通过了
1293 - }); 1283 + state.versionForm.type = 2;
1294 - state.current_enable_version = state.versionForm.code; // 当前选中的版本号 1284 + const { code, data } = await enableFlowVersionAPI(state.versionForm);
1295 - state.dialogVersionFormVisible = false; // 关闭弹框 1285 + if (code) {
1296 - state.reloadLoading = true; // 打开loading 1286 + ElMessage({
1297 - 1287 + type: 'success',
1298 - getVersionList(); // 刷新版本列表 1288 + message: '启用成功',
1299 - updateFlowId(data); // 更新缓存flow_id 1289 + });
1300 - getFlowData(data); // 更新流程图数据 1290 + state.current_enable_version = state.versionForm.code; // 当前选中的版本号
1301 - } else { 1291 + state.dialogVersionFormVisible = false; // 关闭弹框
1302 - state.reloadLoading = false; 1292 + state.reloadLoading = true; // 打开loading
1293 +
1294 + getVersionList(); // 刷新版本列表
1295 + updateFlowId(data); // 更新缓存flow_id
1296 + getFlowData(data); // 更新流程图数据
1297 + } else {
1298 + state.reloadLoading = false;
1299 + }
1300 + }
1301 + }
1303 } 1302 }
1304 - } 1303 + });
1305 } 1304 }
1306 1305
1307 const copyFLowVersion = async () => { // 复制版本流程 1306 const copyFLowVersion = async () => { // 复制版本流程
......