新增vue的bpm生成模板
This commit is contained in:
@@ -43,6 +43,21 @@
|
||||
<% }else{ %>
|
||||
<BasicForm @register="registerForm" />
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<template #footer>
|
||||
<BpmButton
|
||||
v-model:bpmEntity="record"
|
||||
bpmEntityKey="id"
|
||||
formKey="${table.optionMap['bpmFormKey']}"
|
||||
completeText="提交"
|
||||
:loading="loadingRef"
|
||||
:auth="'oa:oaLeave:edit'"
|
||||
@complete="handleSubmit"
|
||||
@success="handleSuccess"
|
||||
@close="closeDrawer"
|
||||
/>
|
||||
</template>
|
||||
<% } %>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
@@ -84,6 +99,9 @@ for(c in table.columnList){
|
||||
<% if(areaselectExists) { %>
|
||||
import { areaTreeData } from '/@/api/sys/area';
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
import { BpmButton } from '/@/components/Bpm';
|
||||
<% } %>
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
@@ -94,6 +112,10 @@ for(c in table.columnList){
|
||||
icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增${functionNameSimple}') : t('编辑${functionNameSimple}'),
|
||||
}));
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
|
||||
const loadingRef = ref(false);
|
||||
<% } %>
|
||||
|
||||
const inputFormSchemas: FormSchema[] = [
|
||||
<% if(table.isTreeEntity){ %>
|
||||
@@ -558,6 +580,11 @@ for (c in table.columnList){
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
data.bpm = record.value.bpm; // 流程信息
|
||||
data.status = record.value.status; // 提交状态
|
||||
loadingRef.value = true;
|
||||
<% } %>
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
@@ -584,9 +611,18 @@ for (c in table.columnList){
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
loadingRef.value = false;
|
||||
<% } %>
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
|
||||
async function handleSuccess() {
|
||||
emit('success');
|
||||
}
|
||||
<% } %>
|
||||
</script>
|
||||
<% %>
|
||||
]]>
|
||||
|
||||
@@ -72,6 +72,9 @@ if(table.isTreeEntity){
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<BpmRuntimeTrace @register="registerTraceModal" />
|
||||
<% } %>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
@@ -113,6 +116,10 @@ for(c in table.columnList){
|
||||
import { areaTreeData } from '/@/api/sys/area';
|
||||
<% } %>
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { BpmRuntimeTrace } from '/@/components/Bpm';
|
||||
<% } %>
|
||||
import { FormProps } from '/@/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
|
||||
@@ -322,6 +329,9 @@ for(c in table.columnList){
|
||||
confirm: handleDelete.bind(this, { ${idParam} }),
|
||||
},
|
||||
auth: '${permissionPrefix}:edit',
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
ifShow: () => record.status == '9',
|
||||
<% } %>
|
||||
},
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
@@ -335,6 +345,14 @@ for(c in table.columnList){
|
||||
auth: '${permissionPrefix}:edit',
|
||||
},
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
{
|
||||
icon: 'fluent:flowchart-20-regular',
|
||||
title: t('流程追踪'),
|
||||
onClick: handleTrace.bind(this, record),
|
||||
ifShow: () => record.status != '9',
|
||||
},
|
||||
<% } %>
|
||||
],
|
||||
};
|
||||
|
||||
@@ -403,6 +421,14 @@ for(c in table.columnList){
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
|
||||
const [registerTraceModal, { openModal: traceModel }] = useModal();
|
||||
|
||||
function handleTrace(record: Recordable) {
|
||||
traceModel(true, { formKey: '${table.optionMap['bpmFormKey']}', bizKey: record.id });
|
||||
}
|
||||
<% } %>
|
||||
</script>
|
||||
<% %>
|
||||
]]>
|
||||
|
||||
Reference in New Issue
Block a user