fix: 优化新建流程的操作体验
This commit is contained in:
@ -3,19 +3,19 @@
|
||||
<div class="geg-flow-page">
|
||||
<div class="top-toolbar">
|
||||
<a-space :size="10" wrap>
|
||||
<a-button style="margin-right: 10px">
|
||||
<a-button style="margin-right: 10px" @click="close">
|
||||
<slot name="icon">
|
||||
<close-outlined />
|
||||
</slot>
|
||||
关闭
|
||||
</a-button>
|
||||
<a-button type="primary" @click="saveLaunch">
|
||||
<a-button type="primary" :disabled="data.submitLoading" @click="saveLaunch">
|
||||
<slot name="icon">
|
||||
<send-outlined />
|
||||
</slot>
|
||||
提交
|
||||
</a-button>
|
||||
<a-button :disabled="disableSubmit" @click="saveDraft">
|
||||
<a-button :disabled="data.submitLoading" @click="saveDraft">
|
||||
<slot name="icon">
|
||||
<clock-circle-outlined />
|
||||
</slot>
|
||||
@ -38,8 +38,6 @@
|
||||
<div class="flow-content">
|
||||
<FormInformation :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
||||
</div>
|
||||
<PredecessorTask v-if="data.relationTasks && data.relationTasks.length > 0" @change="changePredecessorTasks" :schemaId="rSchemaId" :relationTasks="data.predecessorTasks" />
|
||||
<ApproveUser v-if="approveUserData.visible" :taskList="approveUserData.list" :schemaId="approveUserData.schemaId" @change="changeApproveUserData" />
|
||||
</div>
|
||||
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px">
|
||||
<process-information :process-id="processId" :xml="data.xml" />
|
||||
@ -55,19 +53,17 @@
|
||||
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
|
||||
import FormInformation from '/@/views/secondDev/FormInformation.vue';
|
||||
import ProcessInformation from '/@/views/workflow/task/components/flow/ProcessInformation.vue';
|
||||
import ApproveUser from '/@/views/workflow/task/components/flow/ApproveUser.vue';
|
||||
import PredecessorTask from '/@/views/workflow/task/components/PredecessorTask.vue';
|
||||
import { getStartProcessInfo, getReStartProcessInfo, reLaunch, postLaunch } from '/@/api/workflow/task';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const router = useRouter();
|
||||
const tabStore = useMultipleTabStore();
|
||||
|
||||
import { nextTick, onMounted, ref, toRaw } from 'vue';
|
||||
import { postDraft, putDraft } from '/@/api/workflow/process';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { separator } from '/@bpmn/config/info';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const router = useRouter();
|
||||
const tabStore = useMultipleTabStore();
|
||||
|
||||
const { t } = useI18n();
|
||||
const { data, approveUserData, initProcessData, notificationSuccess, notificationError } = userTaskItem();
|
||||
@ -96,6 +92,10 @@
|
||||
showFlowChart.value = true;
|
||||
}
|
||||
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute, router);
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
schemaId: {
|
||||
type: String,
|
||||
@ -181,13 +181,13 @@
|
||||
let formModels = await formInformation.value.saveDraftData();
|
||||
if (rDraftsId !== '0') {
|
||||
let res = await putDraft(rSchemaId, formModels, rDraftsId, props.rowKeyData);
|
||||
showResult(res, t('保存草稿'));
|
||||
showResult(res, '保存草稿');
|
||||
} else {
|
||||
let res = await postDraft(rSchemaId, formModels, props.rowKeyData);
|
||||
showResult(res, t('保存草稿'));
|
||||
showResult(res, '保存草稿');
|
||||
}
|
||||
} catch (error) {
|
||||
notificationError(t('保存草稿'));
|
||||
notificationError('保存草稿');
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,12 +199,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function changePredecessorTasks(list) {
|
||||
data.predecessorTasks = list;
|
||||
}
|
||||
|
||||
function changeApproveUserData() {
|
||||
/*approveUserData.visible = false;*/
|
||||
function flowSuccess() {
|
||||
/*opinionDlg.value.toggleDialog({
|
||||
isClose: true
|
||||
});*/
|
||||
message.success('流程发起成功');
|
||||
setTimeout(() => {
|
||||
close();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
async function saveLaunch() {
|
||||
@ -250,17 +253,15 @@
|
||||
};
|
||||
});
|
||||
if (taskList.length > 0) {
|
||||
approveUserData.list = taskList;
|
||||
approveUserData.schemaId = rSchemaId;
|
||||
approveUserData.visible = true;
|
||||
notificationError('提交失败', '流程设计错误,开始后的第一个节点必须是审批人为发起人的起草节点。');
|
||||
data.submitLoading = false;
|
||||
} else {
|
||||
data.submitLoading = false;
|
||||
//save(true, t('发起流程'));
|
||||
flowSuccess();
|
||||
}
|
||||
} else {
|
||||
data.submitLoading = false;
|
||||
//save(true, t('发起流程'));
|
||||
flowSuccess();
|
||||
}
|
||||
} else {
|
||||
data.submitLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user