Merge branch 'main' into hotfix

This commit is contained in:
weibl
2026-03-14 11:31:07 +08:00
2 changed files with 76 additions and 28 deletions

View File

@@ -90,7 +90,7 @@
<span v-permission="'flow_flowLib_delete'">
<el-dropdown-item
v-if="flow.approveType !== FLOW_APPROVE_STATUS_ENUM.APPROVING"
@click="deleteFlowMessageBox(flow.uuid)"
@click="deleteFlowMessageBox(flow.uuid, flow.templateCode)"
>
<span class="flow-delete-btn">删除</span>
</el-dropdown-item>
@@ -200,7 +200,7 @@
</template>
<script setup lang="ts">
import { computed, reactive, ref } from 'vue';
import { computed, h, reactive, ref } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { useDict } from '@/utils/useDict';
import addDialog from './components/addDialog.vue';
@@ -210,7 +210,7 @@ import {
queryFlowTemplateApi,
// updateFlowTemplateUseStatusApi,
} from '@/api/capability/flow';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
import {
FLOW_APPROVE_STATUS_ENUM,
FLOW_OPERATION_TYPE,
@@ -331,10 +331,9 @@ const actionList = ref<any>([
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '确认删除吗?',
click: (row: any) => {
deleteFlowFun(row.uuid);
deleteFlowMessageBox(row.uuid, row.templateCode);
// deleteFlowFun(row.uuid);
},
hide: (row: any) => {
return (
@@ -400,25 +399,50 @@ const addOrEditFun = ({ type, uuid, tVersion, simulationPoolInfoList }: any) =>
}
};
const deleteFlowFun = async (uuid: string) => {
const res: any = await deleteFlowTemplateDraftApi({ uuid });
const deleteFlowFun = async (uuid: string, templateCode: string) => {
const params: any = {};
if (deleteAllVersion.value) {
params.templateCode = templateCode;
} else {
params.uuid = uuid;
}
const res: any = await deleteFlowTemplateDraftApi(params);
if (res.code === 200) {
tableRef.value.resetFun();
deleteAllVersion.value = false;
} else {
ElMessage.error(res.message);
}
};
const deleteFlowMessageBox = (uuid: string) => {
ElMessageBox.confirm('确认删除流程?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
const deleteAllVersion = ref(false);
const deleteFlowMessageBox = (uuid: string, templateCode: string) => {
ElMessageBox({
title: '确认删除流程?',
message: () =>
h(ElSwitch, {
modelValue: deleteAllVersion.value,
activeText: '所有版本',
inactiveText: '当前版本',
'onUpdate:modelValue': (val: any) => {
deleteAllVersion.value = val;
},
}),
})
.then(() => {
deleteFlowFun(uuid);
deleteFlowFun(uuid, templateCode);
})
.catch(() => {});
// ElMessageBox.confirm('确认删除流程?', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning',
// })
// .then(() => {
// deleteFlowFun(uuid, templateCode);
// })
// .catch(() => {});
};
// const changeFlowStatus = async (uuid: string, type: number) => {

View File

@@ -84,7 +84,7 @@
> -->
<el-dropdown-item
v-if="report.approveType !== FLOW_APPROVE_STATUS_ENUM.APPROVING"
@click="deleteFlowMessageBox(report.templateCode)"
@click="deleteFlowMessageBox(report.uuid, report.templateCode)"
>
<span class="flow-delete-btn">删除</span>
</el-dropdown-item>
@@ -193,11 +193,11 @@
</template>
<script setup lang="ts">
import { computed, reactive, ref } from 'vue';
import { computed, h, reactive, ref } from 'vue';
import BaseTable from '@/components/common/table/baseTable.vue';
import { useDict } from '@/utils/useDict';
import addDialog from './components/addDialog.vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
import { FLOW_APPROVE_STATUS_ENUM, FLOW_USE_STATUS } from '@/utils/enum/flow';
import ReportViewDialog from '@/components/common/report/reportViewDialog.vue';
import ApprovalProcess from '@/components/common/approvalProcess/index.vue';
@@ -311,10 +311,9 @@ const actionList = ref<any>([
{
title: '删除',
type: 'danger',
needConfirm: true,
confirmTip: '确认删除吗?',
click: (row: any) => {
deleteReportFun(row.templateCode);
// deleteReportFun(row.templateCode);
deleteFlowMessageBox(row.uuid, row.templateCode);
},
hide: (row: any) => {
return row.approveType === FLOW_APPROVE_STATUS_ENUM.APPROVING;
@@ -382,25 +381,50 @@ const addOrEditFun = ({ type, uuid, comment, file, fileId, simulationPoolInfoLis
}
};
const deleteReportFun = async (templateCode: string) => {
const res: any = await deleteReportTemplateApi({ templateCode });
const deleteReportFun = async (uuid: string, templateCode: string) => {
const params: any = {};
if (deleteAllVersion.value) {
params.templateCode = templateCode;
} else {
params.uuid = uuid;
}
const res: any = await deleteReportTemplateApi(params);
if (res.code === 200) {
tableRef.value.resetFun();
deleteAllVersion.value = false;
} else {
ElMessage.error(res.message);
}
};
const deleteFlowMessageBox = (templateCode: string) => {
ElMessageBox.confirm('确认删除流程?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
const deleteAllVersion = ref(false);
const deleteFlowMessageBox = (uuid: string, templateCode: string) => {
ElMessageBox({
title: '确认删除报告模板?',
message: () =>
h(ElSwitch, {
modelValue: deleteAllVersion.value,
activeText: '所有版本',
inactiveText: '当前版本',
'onUpdate:modelValue': (val: any) => {
deleteAllVersion.value = val;
},
}),
})
.then(() => {
deleteReportFun(templateCode);
deleteReportFun(uuid, templateCode);
})
.catch(() => {});
// ElMessageBox.confirm('确认删除流程?', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning',
// })
// .then(() => {
// deleteReportFun(templateCode);
// })
// .catch(() => {});
};
// const changeFlowStatus = async (uuid: string, type: number) => {