Merge branch 'dev' of https://fcd.gdyditc.com/itc-framework/ma/2024/front into dev
This commit is contained in:
@ -825,12 +825,14 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
const btnEvent = ${btnEvent}
|
const btnEvent = ${btnEvent}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
|
const router = useRouter();
|
||||||
${
|
${
|
||||||
hasTemplatePrint
|
hasTemplatePrint
|
||||||
? `const printMenuId = computed(() => currentRoute.value.meta.menuId as string);`
|
? `const printMenuId = computed(() => currentRoute.value.meta.menuId as string);`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
|
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
|
||||||
|
const schemaIdComputedRef = computed(() => currentRoute.value.meta.schemaId as string);
|
||||||
|
|
||||||
${
|
${
|
||||||
hasStartWorkButton
|
hasStartWorkButton
|
||||||
@ -1000,16 +1002,17 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
hasAddButton
|
hasAddButton
|
||||||
? `
|
? `
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
${
|
if (schemaIdComputedRef.value) {
|
||||||
formType === 'modal'
|
router.push({
|
||||||
? `
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||||
openModal(true, {
|
});
|
||||||
isUpdate: false,
|
} else {
|
||||||
});`
|
router.push({
|
||||||
: `
|
path: '/form/${lowerClassName}/0/createForm',
|
||||||
openDrawer(true, {
|
query: {
|
||||||
isUpdate: false,
|
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||||
});`
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
: ''
|
: ''
|
||||||
@ -1021,9 +1024,11 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
${
|
${
|
||||||
formType === 'modal'
|
formType === 'modal'
|
||||||
? `
|
? `
|
||||||
openModal(true, {
|
router.push({
|
||||||
id: record.${camelCaseString(mainTable.pkField)},
|
path: '/form/${lowerClassName}/' + record.id + '/updateForm',
|
||||||
isUpdate: true,
|
query: {
|
||||||
|
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||||
|
}
|
||||||
});`
|
});`
|
||||||
: `
|
: `
|
||||||
openDrawer(true, {
|
openDrawer(true, {
|
||||||
@ -1303,10 +1308,12 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
${
|
${
|
||||||
formType === 'modal'
|
formType === 'modal'
|
||||||
? `
|
? `
|
||||||
openModal(true, {
|
router.push({
|
||||||
isView: true,
|
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||||
id: record.${camelCaseString(mainTable.pkField)},
|
query: {
|
||||||
});`
|
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||||
|
}
|
||||||
|
});`
|
||||||
: `
|
: `
|
||||||
openDrawer(true, {
|
openDrawer(true, {
|
||||||
isView: true,
|
isView: true,
|
||||||
@ -1547,10 +1554,13 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleApproveProcess(record: Recordable) {
|
function handleApproveProcess(record: Recordable) {
|
||||||
visibleApproveProcessRef.value = true;
|
const { processId, taskIds, schemaId } = record.workflowData;
|
||||||
schemaIdRef.value = record.workflowData.schemaId;
|
router.push({
|
||||||
processIdRef.value = record.workflowData.processId;
|
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||||
taskIdRef.value = record.workflowData.taskIds[0];
|
query: {
|
||||||
|
taskId: taskIds[0]
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function handleCloseLaunch() {
|
function handleCloseLaunch() {
|
||||||
visibleLaunchProcessRef.value = false;
|
visibleLaunchProcessRef.value = false;
|
||||||
|
|||||||
@ -36,16 +36,9 @@
|
|||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<FormInformation
|
<FormInformation :key="renderKey" ref="formInformation" :disabled="readonly"
|
||||||
:key="renderKey"
|
:formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions"
|
||||||
ref="formInformation"
|
:opinionsComponents="data.opinionsComponents" @get-form-configs="(config) => (formConfigs = config)" />
|
||||||
:disabled="readonly"
|
|
||||||
:formAssignmentData="data.formAssignmentData"
|
|
||||||
:formInfos="data.formInfos"
|
|
||||||
:opinions="data.opinions"
|
|
||||||
:opinionsComponents="data.opinionsComponents"
|
|
||||||
@get-form-configs="(config) => (formConfigs = config)"
|
|
||||||
/>
|
|
||||||
<Title :font-size="18" default-value="流转信息"></Title>
|
<Title :font-size="18" default-value="流转信息"></Title>
|
||||||
<flow-history :items="getTaskRecords()"></flow-history>
|
<flow-history :items="getTaskRecords()"></flow-history>
|
||||||
<opinion-dialog ref="opinionDlg" />
|
<opinion-dialog ref="opinionDlg" />
|
||||||
@ -54,231 +47,231 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { onMounted, reactive, ref, unref } from 'vue';
|
import { onMounted, reactive, ref, unref } from 'vue';
|
||||||
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
||||||
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
||||||
import { getApprovalProcess, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
|
import { getApprovalProcess, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
|
||||||
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
||||||
import { CheckCircleOutlined, StopOutlined, CloseOutlined, DownOutlined } from '@ant-design/icons-vue';
|
import { CheckCircleOutlined, StopOutlined, CloseOutlined, DownOutlined } from '@ant-design/icons-vue';
|
||||||
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
|
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
|
||||||
import { separator } from '/@bpmn/config/info';
|
import { separator } from '/@bpmn/config/info';
|
||||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
import Title from '/@/components/Title/src/Title.vue';
|
import Title from '/@/components/Title/src/Title.vue';
|
||||||
import FlowHistory from '/@/components/SecondDev/FlowHistory.vue';
|
import FlowHistory from '/@/components/SecondDev/FlowHistory.vue';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
|
|
||||||
const { data, approveUserData, initProcessData, notificationError, notificationSuccess } = userTaskItem();
|
const { data, approveUserData, initProcessData, notificationError, notificationSuccess } = userTaskItem();
|
||||||
const { bus, FLOW_PROCESSED } = useEventBus();
|
const { bus, FLOW_PROCESSED } = useEventBus();
|
||||||
|
|
||||||
const tabStore = useMultipleTabStore();
|
const tabStore = useMultipleTabStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const currentRoute = router.currentRoute.value;
|
const currentRoute = router.currentRoute.value;
|
||||||
const rQuery = currentRoute.query;
|
const rQuery = currentRoute.query;
|
||||||
const rParams = currentRoute.params;
|
const rParams = currentRoute.params;
|
||||||
const schemaId = ref(rParams.arg1);
|
const schemaId = ref(rParams.arg1);
|
||||||
const taskId = ref(rQuery.taskId);
|
const taskId = ref(rQuery.taskId);
|
||||||
const processId = ref(rParams.arg2);
|
const processId = ref(rParams.arg2);
|
||||||
const readonly = ref(!!rQuery.readonly); // 查看流程会触发只读模式
|
const readonly = ref(!!rQuery.readonly); // 查看流程会触发只读模式
|
||||||
const renderKey = ref('');
|
const renderKey = ref('');
|
||||||
const formConfigs = ref();
|
const formConfigs = ref();
|
||||||
const opinionDlg = ref();
|
const opinionDlg = ref();
|
||||||
const validateSuccess = ref(false);
|
const validateSuccess = ref(false);
|
||||||
const formInformation = ref();
|
const formInformation = ref();
|
||||||
|
|
||||||
let approvalData = reactive({
|
let approvalData = reactive({
|
||||||
isCountersign: false,
|
isCountersign: false,
|
||||||
isAddOrSubSign: false,
|
isAddOrSubSign: false,
|
||||||
stampInfo: {
|
stampInfo: {
|
||||||
stampId: '',
|
stampId: '',
|
||||||
password: ''
|
password: ''
|
||||||
},
|
},
|
||||||
buttonConfigs: [],
|
buttonConfigs: [],
|
||||||
approvedType: ApproveType.AGREE,
|
approvedType: ApproveType.AGREE,
|
||||||
approvedResult: ApproveCode.AGREE,
|
approvedResult: ApproveCode.AGREE,
|
||||||
approvedContent: '',
|
approvedContent: '',
|
||||||
rejectNodeActivityId: '',
|
rejectNodeActivityId: '',
|
||||||
rejectNodeActivityIds: [],
|
rejectNodeActivityIds: [],
|
||||||
circulateConfigs: [],
|
circulateConfigs: [],
|
||||||
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
||||||
});
|
});
|
||||||
let approvedType = ref(ApproveType.AGREE);
|
let approvedType = ref(ApproveType.AGREE);
|
||||||
|
|
||||||
function onMoreClick() {}
|
function onMoreClick() { }
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute, router);
|
tabStore.closeTab(currentRoute, router);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onApproveClick() {
|
async function onApproveClick() {
|
||||||
await submit();
|
await submit();
|
||||||
const params = await getApproveParams();
|
const params = await getApproveParams();
|
||||||
const nextNodes = await postGetNextTaskMaybeArrival(params);
|
const nextNodes = await postGetNextTaskMaybeArrival(params);
|
||||||
approvalData.approvedType = ApproveType.AGREE;
|
approvalData.approvedType = ApproveType.AGREE;
|
||||||
approvalData.approvedResult = ApproveCode.AGREE;
|
approvalData.approvedResult = ApproveCode.AGREE;
|
||||||
opinionDlg.value.toggleDialog({
|
opinionDlg.value.toggleDialog({
|
||||||
action: 'agree',
|
action: 'agree',
|
||||||
nextNodes,
|
nextNodes,
|
||||||
callback: (args) => {
|
callback: (args) => {
|
||||||
approvalData.approvedContent = args.opinion;
|
approvalData.approvedContent = args.opinion;
|
||||||
approvalData.nextTaskUser = args.nextTaskUser;
|
approvalData.nextTaskUser = args.nextTaskUser;
|
||||||
onFinish({});
|
onFinish({});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onDenyClick() {
|
|
||||||
approvalData.approvedType = ApproveType.REJECT;
|
|
||||||
approvalData.approvedResult = ApproveCode.REJECT;
|
|
||||||
opinionDlg.value.toggleDialog({
|
|
||||||
action: 'reject',
|
|
||||||
processId: processId.value,
|
|
||||||
taskId: taskId.value,
|
|
||||||
callback: (args) => {
|
|
||||||
approvalData.approvedContent = args.opinion;
|
|
||||||
approvalData.rejectNodeActivityId = args.rejectNodeId;
|
|
||||||
approvalData.nextTaskUser = args.nextTaskUser;
|
|
||||||
onFinish({});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function flowSuccess() {
|
|
||||||
opinionDlg.value.toggleDialog({
|
|
||||||
isClose: true
|
|
||||||
});
|
|
||||||
message.success('操作成功');
|
|
||||||
setTimeout(() => {
|
|
||||||
bus.emit(FLOW_PROCESSED);
|
|
||||||
close();
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
function flowFail() {
|
|
||||||
opinionDlg.value.stopLoading();
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
approvalData.isAddOrSubSign = false;
|
|
||||||
approvalData.stampInfo = {
|
|
||||||
stampId: '',
|
|
||||||
password: ''
|
|
||||||
};
|
|
||||||
approvalData.buttonConfigs = [];
|
|
||||||
approvalData.approvedType = ApproveType.AGREE;
|
|
||||||
approvalData.approvedContent = '';
|
|
||||||
approvalData.rejectNodeActivityId = '';
|
|
||||||
approvalData.rejectNodeActivityIds = [];
|
|
||||||
approvalData.circulateConfigs = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTaskRecords() {
|
|
||||||
if (data?.taskApproveOpinions?.length) {
|
|
||||||
return data.taskApproveOpinions || [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
if (unref(taskId)) {
|
|
||||||
try {
|
|
||||||
let res = await getApprovalProcess(unref(taskId), unref(processId));
|
|
||||||
initProcessData(res);
|
|
||||||
if (!readonly.value) {
|
|
||||||
if (res.buttonConfigs) {
|
|
||||||
approvalData.buttonConfigs = res.buttonConfigs;
|
|
||||||
}
|
|
||||||
if (res.relationTasks) {
|
|
||||||
data.predecessorTasks = res.relationTasks;
|
|
||||||
}
|
|
||||||
if (res.isAddOrSubSign) {
|
|
||||||
approvalData.isAddOrSubSign = res.isAddOrSubSign;
|
|
||||||
}
|
|
||||||
|
|
||||||
approvalData.approvedType = ApproveType.AGREE;
|
|
||||||
approvedType.value = ApproveType.AGREE;
|
|
||||||
approvalData.approvedContent = '';
|
|
||||||
approvalData.rejectNodeActivityId = '';
|
|
||||||
approvalData.rejectNodeActivityIds = [];
|
|
||||||
approvalData.circulateConfigs = [];
|
|
||||||
}
|
|
||||||
renderKey.value = Math.random() + '';
|
|
||||||
} catch (error) {}
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function submit() {
|
async function onDenyClick() {
|
||||||
data.submitLoading = true;
|
approvalData.approvedType = ApproveType.REJECT;
|
||||||
validateSuccess.value = false;
|
approvalData.approvedResult = ApproveCode.REJECT;
|
||||||
try {
|
opinionDlg.value.toggleDialog({
|
||||||
let validateForms = await formInformation.value.validateForm();
|
action: 'reject',
|
||||||
if (validateForms.length > 0) {
|
processId: processId.value,
|
||||||
let successValidate = validateForms.filter((ele) => {
|
taskId: taskId.value,
|
||||||
return ele.validate;
|
callback: (args) => {
|
||||||
});
|
approvalData.approvedContent = args.opinion;
|
||||||
if (successValidate.length == validateForms.length) {
|
approvalData.rejectNodeActivityId = args.rejectNodeId;
|
||||||
validateSuccess.value = true;
|
approvalData.nextTaskUser = args.nextTaskUser;
|
||||||
data.submitLoading = false;
|
onFinish({});
|
||||||
} else {
|
|
||||||
data.submitLoading = false;
|
|
||||||
notificationError(t('审批流程'), t('表单校验未通过'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
data.submitLoading = false;
|
|
||||||
notificationError(t('审批流程'), t('审批流程失败'));
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getUploadFileFolderIds(formModels) {
|
function flowSuccess() {
|
||||||
let fileFolderIds = [];
|
opinionDlg.value.toggleDialog({
|
||||||
let uploadComponentIds = formInformation.value.getUploadComponentIds();
|
isClose: true
|
||||||
uploadComponentIds.forEach((ids) => {
|
});
|
||||||
if (ids.includes(separator)) {
|
message.success('操作成功');
|
||||||
let arr = ids.split(separator);
|
setTimeout(() => {
|
||||||
if (arr.length == 2 && formModels[arr[0]][arr[1]]) {
|
bus.emit(FLOW_PROCESSED);
|
||||||
fileFolderIds.push(formModels[arr[0]][arr[1]]);
|
close();
|
||||||
} else if (arr.length == 3 && formModels[arr[0]][arr[1]] && Array.isArray(formModels[arr[0]][arr[1]])) {
|
}, 500);
|
||||||
formModels[arr[0]][arr[1]].forEach((o) => {
|
}
|
||||||
fileFolderIds.push(o[arr[2]]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return fileFolderIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getApproveParams() {
|
function flowFail() {
|
||||||
let formModels = await formInformation.value.getFormModels();
|
opinionDlg.value.stopLoading();
|
||||||
let system = formInformation.value.getSystemType();
|
}
|
||||||
let fileFolderIds = getUploadFileFolderIds(formModels);
|
|
||||||
return {
|
|
||||||
approvedType: approvalData.approvedType,
|
|
||||||
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
|
|
||||||
approvedContent: approvalData.approvedContent,
|
|
||||||
formData: formModels,
|
|
||||||
rejectNodeActivityId: approvalData.rejectNodeActivityId,
|
|
||||||
taskId: taskId.value,
|
|
||||||
fileFolderIds,
|
|
||||||
circulateConfigs: approvalData.circulateConfigs,
|
|
||||||
/*stampId: values.stampId,
|
|
||||||
stampPassword: values.password,*/
|
|
||||||
isOldSystem: system,
|
|
||||||
nextTaskUser: approvalData.nextTaskUser
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onFinish(values) {
|
function reset() {
|
||||||
|
approvalData.isAddOrSubSign = false;
|
||||||
|
approvalData.stampInfo = {
|
||||||
|
stampId: '',
|
||||||
|
password: ''
|
||||||
|
};
|
||||||
|
approvalData.buttonConfigs = [];
|
||||||
|
approvalData.approvedType = ApproveType.AGREE;
|
||||||
|
approvalData.approvedContent = '';
|
||||||
|
approvalData.rejectNodeActivityId = '';
|
||||||
|
approvalData.rejectNodeActivityIds = [];
|
||||||
|
approvalData.circulateConfigs = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTaskRecords() {
|
||||||
|
if (data?.taskApproveOpinions?.length) {
|
||||||
|
return data.taskApproveOpinions || [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (unref(taskId)) {
|
||||||
try {
|
try {
|
||||||
if (/*validateSuccess.value*/ true) {
|
let res = await getApprovalProcess(unref(taskId), unref(processId));
|
||||||
let params = await getApproveParams();
|
initProcessData(res);
|
||||||
await postApproval(params);
|
if (!readonly.value) {
|
||||||
flowSuccess();
|
if (res.buttonConfigs) {
|
||||||
|
approvalData.buttonConfigs = res.buttonConfigs;
|
||||||
|
}
|
||||||
|
if (res.relationTasks) {
|
||||||
|
data.predecessorTasks = res.relationTasks;
|
||||||
|
}
|
||||||
|
if (res.isAddOrSubSign) {
|
||||||
|
approvalData.isAddOrSubSign = res.isAddOrSubSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
approvalData.approvedType = ApproveType.AGREE;
|
||||||
|
approvedType.value = ApproveType.AGREE;
|
||||||
|
approvalData.approvedContent = '';
|
||||||
|
approvalData.rejectNodeActivityId = '';
|
||||||
|
approvalData.rejectNodeActivityIds = [];
|
||||||
|
approvalData.circulateConfigs = [];
|
||||||
|
}
|
||||||
|
renderKey.value = Math.random() + '';
|
||||||
|
} catch (error) { }
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
async function submit() {
|
||||||
|
data.submitLoading = true;
|
||||||
|
validateSuccess.value = false;
|
||||||
|
try {
|
||||||
|
let validateForms = await formInformation.value.validateForm();
|
||||||
|
if (validateForms.length > 0) {
|
||||||
|
let successValidate = validateForms.filter((ele) => {
|
||||||
|
return ele.validate;
|
||||||
|
});
|
||||||
|
if (successValidate.length == validateForms.length) {
|
||||||
|
validateSuccess.value = true;
|
||||||
data.submitLoading = false;
|
data.submitLoading = false;
|
||||||
|
} else {
|
||||||
|
data.submitLoading = false;
|
||||||
|
notificationError(t('审批流程'), t('表单校验未通过'));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
flowFail();
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
data.submitLoading = false;
|
||||||
|
notificationError(t('审批流程'), t('审批流程失败'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUploadFileFolderIds(formModels) {
|
||||||
|
let fileFolderIds = [];
|
||||||
|
let uploadComponentIds = formInformation.value.getUploadComponentIds();
|
||||||
|
uploadComponentIds.forEach((ids) => {
|
||||||
|
if (ids.includes(separator)) {
|
||||||
|
let arr = ids.split(separator);
|
||||||
|
if (arr.length == 2 && formModels[arr[0]][arr[1]]) {
|
||||||
|
fileFolderIds.push(formModels[arr[0]][arr[1]]);
|
||||||
|
} else if (arr.length == 3 && formModels[arr[0]][arr[1]] && Array.isArray(formModels[arr[0]][arr[1]])) {
|
||||||
|
formModels[arr[0]][arr[1]].forEach((o) => {
|
||||||
|
fileFolderIds.push(o[arr[2]]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return fileFolderIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getApproveParams() {
|
||||||
|
let formModels = await formInformation.value.getFormModels();
|
||||||
|
let system = formInformation.value.getSystemType();
|
||||||
|
let fileFolderIds = getUploadFileFolderIds(formModels);
|
||||||
|
return {
|
||||||
|
approvedType: approvalData.approvedType,
|
||||||
|
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
|
||||||
|
approvedContent: approvalData.approvedContent,
|
||||||
|
formData: formModels,
|
||||||
|
rejectNodeActivityId: approvalData.rejectNodeActivityId,
|
||||||
|
taskId: taskId.value,
|
||||||
|
fileFolderIds,
|
||||||
|
circulateConfigs: approvalData.circulateConfigs,
|
||||||
|
/*stampId: values.stampId,
|
||||||
|
stampPassword: values.password,*/
|
||||||
|
isOldSystem: system,
|
||||||
|
nextTaskUser: approvalData.nextTaskUser
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onFinish(values) {
|
||||||
|
try {
|
||||||
|
if (/*validateSuccess.value*/ true) {
|
||||||
|
let params = await getApproveParams();
|
||||||
|
await postApproval(params);
|
||||||
|
flowSuccess();
|
||||||
|
data.submitLoading = false;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
flowFail();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -36,7 +36,9 @@
|
|||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
<div class="flow-content">
|
<div class="flow-content">
|
||||||
<FormInformation :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
<FormInformation :key="randKey" ref="formInformation" :disabled="false"
|
||||||
|
:formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions"
|
||||||
|
:opinionsComponents="data.opinionsComponents" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px">
|
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px">
|
||||||
@ -45,252 +47,293 @@
|
|||||||
<a-button type="primary" @click="closeFlowChart">关闭</a-button>
|
<a-button type="primary" @click="closeFlowChart">关闭</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
<opinion-dialog ref="opinionDlg" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
||||||
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
||||||
import ProcessInformation from '/@/views/workflow/task/components/flow/ProcessInformation.vue';
|
import ProcessInformation from '/@/views/workflow/task/components/flow/ProcessInformation.vue';
|
||||||
import { getStartProcessInfo, getReStartProcessInfo, reLaunch, postLaunch } from '/@/api/workflow/task';
|
import { getStartProcessInfo, getReStartProcessInfo, reLaunch, postLaunch, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
|
||||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue';
|
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue';
|
||||||
import { nextTick, onMounted, ref, toRaw } from 'vue';
|
import { nextTick, onMounted, ref, toRaw, reactive } from 'vue';
|
||||||
import { postDraft, putDraft } from '/@/api/workflow/process';
|
import { postDraft, putDraft } from '/@/api/workflow/process';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { separator } from '/@bpmn/config/info';
|
import { separator } from '/@bpmn/config/info';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
|
||||||
|
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const tabStore = useMultipleTabStore();
|
const tabStore = useMultipleTabStore();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { data, approveUserData, initProcessData, notificationSuccess, notificationError } = userTaskItem();
|
const { data, approveUserData, initProcessData, notificationSuccess, notificationError } = userTaskItem();
|
||||||
const currentRoute = router.currentRoute.value;
|
const currentRoute = router.currentRoute.value;
|
||||||
const rParams = currentRoute.params;
|
const rParams = currentRoute.params;
|
||||||
const fullPath = currentRoute.fullPath;
|
const fullPath = currentRoute.fullPath;
|
||||||
const rSchemaId = rParams.arg1;
|
const rSchemaId = rParams.arg1;
|
||||||
const rDraftsId = rParams.arg2;
|
const rDraftsId = rParams.arg2;
|
||||||
const draftsJsonStr = localStorage.getItem('draftsJsonStr');
|
const taskId = ref();
|
||||||
let formInformation = ref();
|
const draftsJsonStr = localStorage.getItem('draftsJsonStr');
|
||||||
let pageMode = 'new';
|
let formInformation = ref();
|
||||||
const showFlowChart = ref(false);
|
const opinionDlg = ref();
|
||||||
const disableSubmit = ref(false);
|
let pageMode = 'new';
|
||||||
let randKey = ref('randkey'); // 强制表单重新渲染
|
const showFlowChart = ref(false);
|
||||||
|
const disableSubmit = ref(false);
|
||||||
|
const mainFormModels = ref();
|
||||||
|
let randKey = ref('randkey'); // 强制表单重新渲染
|
||||||
|
let approvalData = reactive({
|
||||||
|
isCountersign: false,
|
||||||
|
isAddOrSubSign: false,
|
||||||
|
stampInfo: {
|
||||||
|
stampId: '',
|
||||||
|
password: ''
|
||||||
|
},
|
||||||
|
buttonConfigs: [],
|
||||||
|
approvedType: ApproveType.AGREE,
|
||||||
|
approvedResult: ApproveCode.AGREE,
|
||||||
|
approvedContent: '',
|
||||||
|
rejectNodeActivityId: '',
|
||||||
|
rejectNodeActivityIds: [],
|
||||||
|
circulateConfigs: [],
|
||||||
|
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (draftsJsonStr) {
|
||||||
|
localStorage.removeItem('draftsJsonStr');
|
||||||
|
pageMode = 'draft';
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeFlowChart() {
|
||||||
|
showFlowChart.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openFlowChart() {
|
||||||
|
showFlowChart.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
tabStore.closeTab(currentRoute, router);
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
rowKeyData: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
// 发起流程
|
||||||
|
let res = await getStartProcessInfo(rSchemaId);
|
||||||
|
const title = res?.schemaInfo?.name;
|
||||||
|
if (title) {
|
||||||
|
const tabPrefix = pageMode === 'new' ? '新建' : '草稿';
|
||||||
|
tabStore.changeTitle(fullPath, `${tabPrefix}:${title}`);
|
||||||
|
}
|
||||||
|
initProcessData(res);
|
||||||
|
} catch (error) { }
|
||||||
|
randKey.value = Math.random() + '';
|
||||||
|
// 这里的顺序不能变 表单不渲染的时候 设置表单初值没用
|
||||||
|
await nextTick();
|
||||||
|
await initDraftsFormData();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function initDraftsFormData() {
|
||||||
|
//isPublish.value = Object.keys(data.formInfos).length > 0 ? false : true;
|
||||||
if (draftsJsonStr) {
|
if (draftsJsonStr) {
|
||||||
localStorage.removeItem('draftsJsonStr');
|
let formDataJson = JSON.parse(draftsJsonStr);
|
||||||
pageMode = 'draft';
|
let formData = [];
|
||||||
}
|
|
||||||
|
|
||||||
function closeFlowChart() {
|
data.formInfos.forEach((item) => {
|
||||||
showFlowChart.value = false;
|
if (formDataJson && item.formConfig && item.formConfig.key && formDataJson[item.formConfig.key]) {
|
||||||
}
|
formData.push(item.formConfig.key ? formDataJson[item.formConfig.key] : {});
|
||||||
|
|
||||||
function openFlowChart() {
|
|
||||||
showFlowChart.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
tabStore.closeTab(currentRoute, router);
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
schemaId: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
draftsId: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
taskId: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
processId: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
formData: {
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
formId: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
rowKeyData: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
try {
|
|
||||||
if (props.processId) {
|
|
||||||
// 重新发起
|
|
||||||
let res = await getReStartProcessInfo(props.taskId, props.processId);
|
|
||||||
res.taskApproveOpinions = [];
|
|
||||||
initProcessData(res);
|
|
||||||
} else if (props.schemaId && props.formId) {
|
|
||||||
let res = await getStartProcessInfo(props.schemaId);
|
|
||||||
|
|
||||||
if (props.formData && props.formId) {
|
|
||||||
res.formInfos.map((m) => {
|
|
||||||
if (m.formConfig.formId === props.formId) {
|
|
||||||
m.formData = toRaw(props.formData);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
initProcessData(res);
|
|
||||||
} else {
|
|
||||||
// 发起流程
|
|
||||||
let res = await getStartProcessInfo(rSchemaId);
|
|
||||||
const title = res?.schemaInfo?.name;
|
|
||||||
if (title) {
|
|
||||||
const tabPrefix = pageMode === 'new' ? '新建' : '草稿';
|
|
||||||
tabStore.changeTitle(fullPath, `${tabPrefix}:${title}`);
|
|
||||||
}
|
|
||||||
initProcessData(res);
|
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
});
|
||||||
randKey.value = Math.random() + '';
|
await formInformation.value.setFormData(formData);
|
||||||
// 这里的顺序不能变 表单不渲染的时候 设置表单初值没用
|
|
||||||
await nextTick();
|
|
||||||
await initDraftsFormData();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function initDraftsFormData() {
|
|
||||||
//isPublish.value = Object.keys(data.formInfos).length > 0 ? false : true;
|
|
||||||
if (draftsJsonStr) {
|
|
||||||
let formDataJson = JSON.parse(draftsJsonStr);
|
|
||||||
let formData = [];
|
|
||||||
|
|
||||||
data.formInfos.forEach((item) => {
|
|
||||||
if (formDataJson && item.formConfig && item.formConfig.key && formDataJson[item.formConfig.key]) {
|
|
||||||
formData.push(item.formConfig.key ? formDataJson[item.formConfig.key] : {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
await formInformation.value.setFormData(formData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function saveDraft() {
|
async function saveDraft() {
|
||||||
try {
|
try {
|
||||||
disableSubmit.value = true;
|
disableSubmit.value = true;
|
||||||
let formModels = await formInformation.value.saveDraftData();
|
let formModels = await formInformation.value.saveDraftData();
|
||||||
if (rDraftsId !== '0') {
|
if (rDraftsId !== '0') {
|
||||||
let res = await putDraft(rSchemaId, formModels, rDraftsId, props.rowKeyData);
|
let res = await putDraft(rSchemaId, formModels, rDraftsId, props.rowKeyData);
|
||||||
showResult(res, '保存草稿');
|
showResult(res, '保存草稿');
|
||||||
} else {
|
|
||||||
let res = await postDraft(rSchemaId, formModels, props.rowKeyData);
|
|
||||||
showResult(res, '保存草稿');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
notificationError('保存草稿');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showResult(res, title) {
|
|
||||||
if (res) {
|
|
||||||
notificationSuccess(title);
|
|
||||||
} else {
|
} else {
|
||||||
notificationError(title);
|
let res = await postDraft(rSchemaId, formModels, props.rowKeyData);
|
||||||
|
showResult(res, '保存草稿');
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
notificationError('保存草稿');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showResult(res, title) {
|
||||||
|
if (res) {
|
||||||
|
notificationSuccess(title);
|
||||||
|
} else {
|
||||||
|
notificationError(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function flowSuccess() {
|
function createFlowSuccess(taskList) {
|
||||||
/*opinionDlg.value.toggleDialog({
|
/*opinionDlg.value.toggleDialog({
|
||||||
isClose: true
|
isClose: true
|
||||||
});*/
|
});*/
|
||||||
|
if (taskList) {
|
||||||
|
approvalCreate();
|
||||||
|
} else {
|
||||||
message.success('流程发起成功');
|
message.success('流程发起成功');
|
||||||
|
|
||||||
|
data.submitLoading = false;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
close();
|
close();
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveLaunch() {
|
}
|
||||||
data.submitLoading = true;
|
async function approvalCreate() {
|
||||||
try {
|
const params = await getApproveParams();
|
||||||
let validateForms = await formInformation.value.validateForm();
|
let fileFolderIds = getUploadFileFolderIds(mainFormModels.value);
|
||||||
let system = formInformation.value.getSystemType();
|
let system = formInformation.value.getSystemType();
|
||||||
|
const nextNodes = await postGetNextTaskMaybeArrival(params);
|
||||||
if (validateForms.length > 0) {
|
opinionDlg.value.toggleDialog({
|
||||||
let successValidate = validateForms.filter((ele) => {
|
action: 'agree',
|
||||||
return ele.validate;
|
nextNodes,
|
||||||
});
|
callback: (args) => {
|
||||||
if (successValidate.length == validateForms.length) {
|
approvalData.approvedContent = args.opinion;
|
||||||
let formModels = await formInformation.value.getFormModels();
|
approvalData.nextTaskUser = args.nextTaskUser;
|
||||||
let relationTasks = [];
|
onFinish({});
|
||||||
if (data.predecessorTasks && data.predecessorTasks.length > 0) {
|
|
||||||
relationTasks = data.predecessorTasks.map((ele) => {
|
|
||||||
return { taskId: ele.taskId, schemaId: ele.schemaId };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let fileFolderIds = getUploadFileFolderIds(formModels);
|
|
||||||
//如果传入了processId 代表是重新发起流程
|
|
||||||
let res;
|
|
||||||
if (props.processId) {
|
|
||||||
res = await reLaunch(props.processId, props.schemaId, formModels, relationTasks, fileFolderIds, system);
|
|
||||||
} else {
|
|
||||||
res = await postLaunch(rSchemaId, formModels, relationTasks, fileFolderIds, system);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 下一节点审批人
|
|
||||||
let taskList = [];
|
|
||||||
if (res && res.length > 0) {
|
|
||||||
taskList = res
|
|
||||||
.filter((ele) => {
|
|
||||||
return ele.isMultiInstance == false && ele.isAppoint == true;
|
|
||||||
})
|
|
||||||
.map((ele) => {
|
|
||||||
return {
|
|
||||||
taskId: ele.taskId,
|
|
||||||
taskName: ele.taskName,
|
|
||||||
provisionalApprover: ele.provisionalApprover,
|
|
||||||
selectIds: []
|
|
||||||
};
|
|
||||||
});
|
|
||||||
if (taskList.length > 0) {
|
|
||||||
notificationError('提交失败', '流程设计错误,开始后的第一个节点必须是审批人为发起人的起草节点。');
|
|
||||||
data.submitLoading = false;
|
|
||||||
} else {
|
|
||||||
data.submitLoading = false;
|
|
||||||
flowSuccess();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data.submitLoading = false;
|
|
||||||
flowSuccess();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
data.submitLoading = false;
|
|
||||||
notificationError(t('发起流程'), t('表单校验未通过'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
data.submitLoading = false;
|
|
||||||
notificationError(t('发起流程'), t('发起流程失败'));
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function flowSuccess() {
|
||||||
|
opinionDlg.value.toggleDialog({
|
||||||
|
isClose: true
|
||||||
|
});
|
||||||
|
message.success('操作成功');
|
||||||
|
setTimeout(() => {
|
||||||
|
close();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
function flowFail() {
|
||||||
|
opinionDlg.value.stopLoading();
|
||||||
|
}
|
||||||
|
async function onFinish(values) {
|
||||||
|
try {
|
||||||
|
if (/*validateSuccess.value*/ true) {
|
||||||
|
let params = await getApproveParams();
|
||||||
|
await postApproval(params);
|
||||||
|
flowSuccess();
|
||||||
|
data.submitLoading = false;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
flowFail();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
async function getApproveParams() {
|
||||||
|
let formModels = mainFormModels.value;
|
||||||
|
let system = formInformation.value.getSystemType();
|
||||||
|
let fileFolderIds = getUploadFileFolderIds(formModels);
|
||||||
|
return {
|
||||||
|
approvedType: approvalData.approvedType,
|
||||||
|
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
|
||||||
|
approvedContent: approvalData.approvedContent,
|
||||||
|
formData: formModels,
|
||||||
|
rejectNodeActivityId: approvalData.rejectNodeActivityId,
|
||||||
|
taskId: taskId.value,
|
||||||
|
fileFolderIds,
|
||||||
|
circulateConfigs: approvalData.circulateConfigs,
|
||||||
|
/*stampId: values.stampId,
|
||||||
|
stampPassword: values.password,*/
|
||||||
|
isOldSystem: system,
|
||||||
|
nextTaskUser: approvalData.nextTaskUser
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function getUploadFileFolderIds(formModels) {
|
async function saveLaunch() {
|
||||||
let fileFolderIds = [];
|
data.submitLoading = true;
|
||||||
let uploadComponentIds = formInformation.value.getUploadComponentIds();
|
try {
|
||||||
uploadComponentIds.forEach((ids) => {
|
let validateForms = await formInformation.value.validateForm();
|
||||||
if (ids.includes(separator)) {
|
let system = formInformation.value.getSystemType();
|
||||||
let arr = ids.split(separator);
|
|
||||||
if (arr.length == 2 && formModels[arr[0]][arr[1]]) {
|
if (validateForms.length > 0) {
|
||||||
fileFolderIds.push(formModels[arr[0]][arr[1]]);
|
let successValidate = validateForms.filter((ele) => {
|
||||||
} else if (arr.length == 3 && formModels[arr[0]][arr[1]] && Array.isArray(formModels[arr[0]][arr[1]])) {
|
return ele.validate;
|
||||||
formModels[arr[0]][arr[1]].forEach((o) => {
|
});
|
||||||
fileFolderIds.push(o[arr[2]]);
|
if (successValidate.length == validateForms.length) {
|
||||||
|
mainFormModels.value = await formInformation.value.getFormModels();
|
||||||
|
let relationTasks = [];
|
||||||
|
if (data.predecessorTasks && data.predecessorTasks.length > 0) {
|
||||||
|
relationTasks = data.predecessorTasks.map((ele) => {
|
||||||
|
return { taskId: ele.taskId, schemaId: ele.schemaId };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
let fileFolderIds = getUploadFileFolderIds(mainFormModels.value);
|
||||||
|
//如果传入了processId 代表是重新发起流程
|
||||||
|
let res;
|
||||||
|
res = await postLaunch(rSchemaId, mainFormModels.value, relationTasks, fileFolderIds, system);
|
||||||
|
|
||||||
|
// 下一节点审批人
|
||||||
|
let taskList = [];
|
||||||
|
if (res && res.length > 0) {
|
||||||
|
taskId.value = res[0].taskId
|
||||||
|
taskList = res
|
||||||
|
.filter((ele) => {
|
||||||
|
return ele.isMultiInstance == false && ele.isAppoint == true;
|
||||||
|
})
|
||||||
|
.map((ele) => {
|
||||||
|
return {
|
||||||
|
taskId: ele.taskId,
|
||||||
|
taskName: ele.taskName,
|
||||||
|
provisionalApprover: ele.provisionalApprover,
|
||||||
|
selectIds: []
|
||||||
|
};
|
||||||
|
});
|
||||||
|
if (taskList.length > 0) {
|
||||||
|
notificationError('提交失败', '流程设计错误,开始后的第一个节点必须是审批人为发起人的起草节点。');
|
||||||
|
data.submitLoading = false;
|
||||||
|
} else {
|
||||||
|
createFlowSuccess(taskList);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
createFlowSuccess();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data.submitLoading = false;
|
||||||
|
notificationError(t('发起流程'), t('表单校验未通过'));
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return fileFolderIds;
|
} catch (error) {
|
||||||
|
data.submitLoading = false;
|
||||||
|
notificationError(t('发起流程'), t('发起流程失败'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUploadFileFolderIds(formModels) {
|
||||||
|
let fileFolderIds = [];
|
||||||
|
let uploadComponentIds = formInformation.value.getUploadComponentIds();
|
||||||
|
uploadComponentIds.forEach((ids) => {
|
||||||
|
if (ids.includes(separator)) {
|
||||||
|
let arr = ids.split(separator);
|
||||||
|
if (arr.length == 2 && formModels[arr[0]][arr[1]]) {
|
||||||
|
fileFolderIds.push(formModels[arr[0]][arr[1]]);
|
||||||
|
} else if (arr.length == 3 && formModels[arr[0]][arr[1]] && Array.isArray(formModels[arr[0]][arr[1]])) {
|
||||||
|
formModels[arr[0]][arr[1]].forEach((o) => {
|
||||||
|
fileFolderIds.push(o[arr[2]]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return fileFolderIds;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less"></style>
|
<style lang="less"></style>
|
||||||
|
|||||||
@ -1,169 +1,170 @@
|
|||||||
<template>
|
<template>
|
||||||
<PageLayout :layoutClass="currentRoute.path == '/workflow/launch' ? '!p-2' : currentRoute.path == '/task/processtasks' ? '!p-0 !pr-7px' : ''" :searchConfig="searchConfig" :title="t('流程模板列表')" @search="search" @scroll-height="scrollHeight">
|
<PageLayout
|
||||||
|
:layoutClass="currentRoute.path == '/workflow/launch' ? '!p-2' : currentRoute.path == '/task/processtasks' ? '!p-0 !pr-7px' : ''"
|
||||||
|
:searchConfig="searchConfig" :title="t('流程模板列表')" @search="search" @scroll-height="scrollHeight">
|
||||||
<template #left>
|
<template #left>
|
||||||
<BasicTree :clickRowToExpand="true" :fieldNames="{ key: 'id', title: 'name' }" :title="t('流程模板分类')" :treeData="data.treeData" search @select="handleSelect" />
|
<BasicTree :clickRowToExpand="true" :fieldNames="{ key: 'id', title: 'name' }" :title="t('流程模板分类')"
|
||||||
|
:treeData="data.treeData" search @select="handleSelect" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #search></template>
|
<template #search></template>
|
||||||
|
|
||||||
<template #right>
|
<template #right>
|
||||||
<div v-if="data.list.length > 0" :style="{ overflowY: 'auto', height: tableOptions.scrollHeight + 30 + 'px' }">
|
<div v-if="data.list.length > 0"
|
||||||
|
:style="{ overflowY: 'auto', height: tableOptions.scrollHeight + 30 + 'px' }">
|
||||||
<div class="list-page-box">
|
<div class="list-page-box">
|
||||||
<TemplateCard v-for="(item, index) in data.list" :key="index" :item="item" @click="launchProcessInTab(item.id)" />
|
<TemplateCard v-for="(item, index) in data.list" :key="index" :item="item"
|
||||||
|
@click="launchProcessInTab(item.id)" />
|
||||||
</div>
|
</div>
|
||||||
<div class="page-box">
|
<div class="page-box">
|
||||||
<a-pagination
|
<a-pagination v-model:current="data.pagination.current" v-model:pageSize="data.pagination.pageSize"
|
||||||
v-model:current="data.pagination.current"
|
|
||||||
v-model:pageSize="data.pagination.pageSize"
|
|
||||||
:pageSizeOptions="['18', '36', '54', '72']"
|
:pageSizeOptions="['18', '36', '54', '72']"
|
||||||
:show-total="(total) => t(`共 {total} 条数据`, { total })"
|
:show-total="(total) => t(`共 {total} 条数据`, { total })" :showSizeChanger="true"
|
||||||
:showSizeChanger="true"
|
:total="data.pagination.total" @change="getList" />
|
||||||
:total="data.pagination.total"
|
|
||||||
@change="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<EmptyBox />
|
<EmptyBox />
|
||||||
</div>
|
</div>
|
||||||
<LaunchProcess v-if="visibleLaunchProcess" :schemaId="data.schemaId" @close="visibleLaunchProcess = false" />
|
<LaunchProcess v-if="visibleLaunchProcess" :schemaId="data.schemaId"
|
||||||
|
@close="visibleLaunchProcess = false" />
|
||||||
</template>
|
</template>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref, unref, watch } from 'vue';
|
import { onMounted, reactive, ref, unref, watch } from 'vue';
|
||||||
import TemplateCard from '/@bpmn/components/card/TemplateCard.vue';
|
import TemplateCard from '/@bpmn/components/card/TemplateCard.vue';
|
||||||
import { EmptyBox } from '/@/components/ModalPanel/index';
|
import { EmptyBox } from '/@/components/ModalPanel/index';
|
||||||
import { getDesignPage } from '/@/api/workflow/design';
|
import { getDesignPage } from '/@/api/workflow/design';
|
||||||
import { WorkflowPageModel } from '/@/api/workflow/model';
|
import { WorkflowPageModel } from '/@/api/workflow/model';
|
||||||
import { getDicDetailList } from '/@/api/system/dic';
|
import { getDicDetailList } from '/@/api/system/dic';
|
||||||
import { BasicTree, TreeItem } from '/@/components/Tree';
|
import { BasicTree, TreeItem } from '/@/components/Tree';
|
||||||
import { PageLayout } from '/@/components/ModalPanel';
|
import { PageLayout } from '/@/components/ModalPanel';
|
||||||
import LaunchProcess from './components/LaunchProcess.vue';
|
import LaunchProcess from './components/LaunchProcess.vue';
|
||||||
import { FlowCategory } from '/@/enums/workflowEnum';
|
import { FlowCategory } from '/@/enums/workflowEnum';
|
||||||
import userTableScrollHeight from '/@/hooks/setting/userTableScrollHeight';
|
import userTableScrollHeight from '/@/hooks/setting/userTableScrollHeight';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { currentRoute } = router;
|
const { currentRoute } = router;
|
||||||
const searchConfig = [
|
const searchConfig = [
|
||||||
{
|
{
|
||||||
field: 'code',
|
field: 'code',
|
||||||
label: t('模板编码'),
|
label: t('模板编码'),
|
||||||
type: 'input'
|
type: 'input'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
label: t('模板名称'),
|
label: t('模板名称'),
|
||||||
type: 'input'
|
type: 'input'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const { tableOptions, scrollHeight } = userTableScrollHeight();
|
const { tableOptions, scrollHeight } = userTableScrollHeight();
|
||||||
let visibleLaunchProcess = ref(false);
|
let visibleLaunchProcess = ref(false);
|
||||||
let data: {
|
let data: {
|
||||||
list: Array<WorkflowPageModel>;
|
list: Array<WorkflowPageModel>;
|
||||||
treeData: Array<TreeItem>;
|
treeData: Array<TreeItem>;
|
||||||
schemaId: string;
|
schemaId: string;
|
||||||
selectDeptId: string;
|
selectDeptId: string;
|
||||||
pagination: { current: number; total: number; pageSize: number };
|
pagination: { current: number; total: number; pageSize: number };
|
||||||
} = reactive({
|
} = reactive({
|
||||||
list: [],
|
list: [],
|
||||||
treeData: [],
|
treeData: [],
|
||||||
schemaId: '',
|
schemaId: '',
|
||||||
selectDeptId: '',
|
selectDeptId: '',
|
||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 18
|
pageSize: 18
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => unref(currentRoute),
|
||||||
|
(val) => {
|
||||||
|
if (val.path == '/workflow/launch') init();
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
getCategoryTree();
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
data.pagination.current = 1;
|
||||||
|
data.pagination.total = 0;
|
||||||
|
data.selectDeptId = '';
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCategoryTree() {
|
||||||
|
let res = (await getDicDetailList({
|
||||||
|
itemId: FlowCategory.ID
|
||||||
|
})) as unknown as TreeItem[];
|
||||||
|
data.treeData = res.map((ele) => {
|
||||||
|
ele.icon = 'ant-design:tags-outlined';
|
||||||
|
return ele;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
async function getList(params?: any) {
|
||||||
() => unref(currentRoute),
|
const searchParams = {
|
||||||
(val) => {
|
...{
|
||||||
if (val.path == '/workflow/launch') init();
|
limit: data.pagination.current,
|
||||||
|
size: data.pagination.pageSize
|
||||||
},
|
},
|
||||||
{ deep: true }
|
...{ category: data.selectDeptId },
|
||||||
);
|
...params,
|
||||||
onMounted(() => {
|
...{ enabledMark: 1 } // 流程发起list 需要隐藏 禁用的模板[enabledMark=1]
|
||||||
getCategoryTree();
|
};
|
||||||
init();
|
|
||||||
|
try {
|
||||||
|
let res = await getDesignPage(searchParams);
|
||||||
|
data.pagination.total = res.total;
|
||||||
|
data.list = res.list;
|
||||||
|
} catch (error) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSelect(deptIds) {
|
||||||
|
data.selectDeptId = deptIds[0];
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function launchProcess(id: string) {
|
||||||
|
// 旧版弹窗界面 便于调试
|
||||||
|
data.schemaId = id;
|
||||||
|
visibleLaunchProcess.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function launchProcessInTab(id: string) {
|
||||||
|
router.push({
|
||||||
|
path: `/flow/${id}/0/createFlow`
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function init() {
|
function search(params: any) {
|
||||||
data.pagination.current = 1;
|
data.pagination.current = 1;
|
||||||
data.pagination.total = 0;
|
getList(params);
|
||||||
data.selectDeptId = '';
|
}
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getCategoryTree() {
|
|
||||||
let res = (await getDicDetailList({
|
|
||||||
itemId: FlowCategory.ID
|
|
||||||
})) as unknown as TreeItem[];
|
|
||||||
data.treeData = res.map((ele) => {
|
|
||||||
ele.icon = 'ant-design:tags-outlined';
|
|
||||||
return ele;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getList(params?: any) {
|
|
||||||
const searchParams = {
|
|
||||||
...{
|
|
||||||
limit: data.pagination.current,
|
|
||||||
size: data.pagination.pageSize
|
|
||||||
},
|
|
||||||
...{ category: data.selectDeptId },
|
|
||||||
...params,
|
|
||||||
...{ enabledMark: 1 } // 流程发起list 需要隐藏 禁用的模板[enabledMark=1]
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
let res = await getDesignPage(searchParams);
|
|
||||||
data.pagination.total = res.total;
|
|
||||||
data.list = res.list;
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSelect(deptIds) {
|
|
||||||
data.selectDeptId = deptIds[0];
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function launchProcess(id: string) {
|
|
||||||
// 旧版弹窗界面 便于调试
|
|
||||||
data.schemaId = id;
|
|
||||||
visibleLaunchProcess.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function launchProcessInTab(id: string) {
|
|
||||||
router.push({
|
|
||||||
path: `/flow/${id}/0/createFlow`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function search(params: any) {
|
|
||||||
data.pagination.current = 1;
|
|
||||||
getList(params);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.list-page-box {
|
.list-page-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.list-item) {
|
:deep(.list-item) {
|
||||||
max-width: 320px;
|
max-width: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-box {
|
.page-box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -4,122 +4,124 @@
|
|||||||
<TableAction :actions="tableActions(record)" />
|
<TableAction :actions="tableActions(record)" />
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<LaunchProcess v-if="processData.visible" :draftsId="processData.draftsId" :draftsJsonStr="processData.draftsJsonStr" :schemaId="processData.schemaId" @close="processData.visible = false" />
|
<LaunchProcess v-if="processData.visible" :draftsId="processData.draftsId"
|
||||||
|
:draftsJsonStr="processData.draftsJsonStr" :schemaId="processData.schemaId"
|
||||||
|
@close="processData.visible = false" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import userTaskTable from './../../hooks/userTaskTable';
|
import userTaskTable from './../../hooks/userTaskTable';
|
||||||
|
|
||||||
import LaunchProcess from './../LaunchProcess.vue';
|
import LaunchProcess from './../LaunchProcess.vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { deleteDraft, getDraftInfo, getSchemaTask } from '/@/api/workflow/process';
|
import { deleteDraft, getDraftInfo, getSchemaTask } from '/@/api/workflow/process';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { notification } from 'ant-design-vue';
|
import { notification } from 'ant-design-vue';
|
||||||
import { TaskTypeUrl } from '/@/enums/workflowEnum';
|
import { TaskTypeUrl } from '/@/enums/workflowEnum';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const configColumns = [
|
const configColumns = [
|
||||||
|
{
|
||||||
|
title: t('流程名称'),
|
||||||
|
dataIndex: 'schemaName',
|
||||||
|
align: 'left'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('发起者'),
|
||||||
|
dataIndex: 'originator',
|
||||||
|
sorter: true,
|
||||||
|
align: 'left'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('发起时间'),
|
||||||
|
dataIndex: 'createDate',
|
||||||
|
align: 'left'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const processData = reactive({
|
||||||
|
visible: false,
|
||||||
|
schemaId: '',
|
||||||
|
draftsJsonStr: '',
|
||||||
|
draftsId: ''
|
||||||
|
});
|
||||||
|
const { formConfig } = userTaskTable();
|
||||||
|
const [registerTable, { reload }] = useTable({
|
||||||
|
title: t('草稿箱列表'),
|
||||||
|
api: getSchemaTask,
|
||||||
|
rowKey: 'id',
|
||||||
|
columns: configColumns,
|
||||||
|
formConfig: formConfig('Drafts'),
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { data: params, taskUrl: TaskTypeUrl.DRAFT };
|
||||||
|
},
|
||||||
|
useSearchForm: true,
|
||||||
|
showTableSetting: true,
|
||||||
|
striped: false,
|
||||||
|
pagination: {
|
||||||
|
pageSize: 18
|
||||||
|
},
|
||||||
|
actionColumn: {
|
||||||
|
width: 80,
|
||||||
|
title: t('操作'),
|
||||||
|
dataIndex: 'action',
|
||||||
|
slots: { customRender: 'action' },
|
||||||
|
fixed: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function tableActions(record) {
|
||||||
|
return [
|
||||||
{
|
{
|
||||||
title: t('流程名称'),
|
icon: 'clarity:note-edit-line',
|
||||||
dataIndex: 'schemaName',
|
onClick: handleEdit.bind(null, record)
|
||||||
align: 'left'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('发起者'),
|
icon: 'ant-design:delete-outlined',
|
||||||
dataIndex: 'originator',
|
color: 'error',
|
||||||
sorter: true,
|
popConfirm: {
|
||||||
align: 'left'
|
title: t('是否确认删除'),
|
||||||
},
|
confirm: handleDelete.bind(null, record)
|
||||||
{
|
}
|
||||||
title: t('发起时间'),
|
|
||||||
dataIndex: 'createDate',
|
|
||||||
align: 'left'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const processData = reactive({
|
}
|
||||||
visible: false,
|
|
||||||
schemaId: '',
|
|
||||||
draftsJsonStr: '',
|
|
||||||
draftsId: ''
|
|
||||||
});
|
|
||||||
const { formConfig } = userTaskTable();
|
|
||||||
const [registerTable, { reload }] = useTable({
|
|
||||||
title: t('草稿箱列表'),
|
|
||||||
api: getSchemaTask,
|
|
||||||
rowKey: 'id',
|
|
||||||
columns: configColumns,
|
|
||||||
formConfig: formConfig('Drafts'),
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
return { data: params, taskUrl: TaskTypeUrl.DRAFT };
|
|
||||||
},
|
|
||||||
useSearchForm: true,
|
|
||||||
showTableSetting: true,
|
|
||||||
striped: false,
|
|
||||||
pagination: {
|
|
||||||
pageSize: 18
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 80,
|
|
||||||
title: t('操作'),
|
|
||||||
dataIndex: 'action',
|
|
||||||
slots: { customRender: 'action' },
|
|
||||||
fixed: undefined
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function tableActions(record) {
|
async function handleEdit(record) {
|
||||||
return [
|
try {
|
||||||
{
|
let res = await getDraftInfo(record.id);
|
||||||
icon: 'clarity:note-edit-line',
|
/*processData.draftsId = record.id;
|
||||||
onClick: handleEdit.bind(null, record)
|
processData.schemaId = res.schemaId;
|
||||||
},
|
processData.draftsJsonStr = res.formData;
|
||||||
{
|
processData.visible = true;*/
|
||||||
icon: 'ant-design:delete-outlined',
|
localStorage.setItem('draftsJsonStr', res.formData);
|
||||||
color: 'error',
|
router.push({
|
||||||
popConfirm: {
|
path: `/flow/${res.schemaId}/${record.id}/createFlow`
|
||||||
title: t('是否确认删除'),
|
});
|
||||||
confirm: handleDelete.bind(null, record)
|
} catch (error) { }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleEdit(record) {
|
async function handleDelete(record) {
|
||||||
try {
|
try {
|
||||||
let res = await getDraftInfo(record.id);
|
let res = await deleteDraft([record.id]);
|
||||||
/*processData.draftsId = record.id;
|
if (res) {
|
||||||
processData.schemaId = res.schemaId;
|
notification.open({
|
||||||
processData.draftsJsonStr = res.formData;
|
type: 'success',
|
||||||
processData.visible = true;*/
|
message: t('删除'),
|
||||||
localStorage.setItem('draftsJsonStr', res.formData);
|
description: t('删除成功')
|
||||||
router.push({
|
|
||||||
path: `/flow/${res.schemaId}/${record.id}/createFlow`
|
|
||||||
});
|
});
|
||||||
} catch (error) {}
|
reload();
|
||||||
}
|
} else {
|
||||||
|
notification.open({
|
||||||
async function handleDelete(record) {
|
type: 'error',
|
||||||
try {
|
message: t('删除'),
|
||||||
let res = await deleteDraft([record.id]);
|
description: t('删除失败')
|
||||||
if (res) {
|
});
|
||||||
notification.open({
|
}
|
||||||
type: 'success',
|
} catch (error) { }
|
||||||
message: t('删除'),
|
}
|
||||||
description: t('删除成功')
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
} else {
|
|
||||||
notification.open({
|
|
||||||
type: 'error',
|
|
||||||
message: t('删除'),
|
|
||||||
description: t('删除失败')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
@ -114,6 +114,15 @@
|
|||||||
});
|
});
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { currentRoute } = router;
|
const { currentRoute } = router;
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
bus.on(FLOW_PROCESSED, onFlowProcessed);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
bus.off(FLOW_PROCESSED, onFlowProcessed);
|
||||||
|
});
|
||||||
watch(
|
watch(
|
||||||
() => unref(currentRoute),
|
() => unref(currentRoute),
|
||||||
(val) => {
|
(val) => {
|
||||||
@ -134,14 +143,6 @@
|
|||||||
function onFlowProcessed() {
|
function onFlowProcessed() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
bus.on(FLOW_PROCESSED, onFlowProcessed);
|
|
||||||
});
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
bus.off(FLOW_PROCESSED, onFlowProcessed);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user