新增vue的bpm生成模板
This commit is contained in:
@@ -43,6 +43,21 @@
|
|||||||
<% }else{ %>
|
<% }else{ %>
|
||||||
<BasicForm @register="registerForm" />
|
<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>
|
</BasicDrawer>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -84,6 +99,9 @@ for(c in table.columnList){
|
|||||||
<% if(areaselectExists) { %>
|
<% if(areaselectExists) { %>
|
||||||
import { areaTreeData } from '/@/api/sys/area';
|
import { areaTreeData } from '/@/api/sys/area';
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
import { BpmButton } from '/@/components/Bpm';
|
||||||
|
<% } %>
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
@@ -94,6 +112,10 @@ for(c in table.columnList){
|
|||||||
icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
|
icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
|
||||||
value: record.value.isNewRecord ? t('新增${functionNameSimple}') : t('编辑${functionNameSimple}'),
|
value: record.value.isNewRecord ? t('新增${functionNameSimple}') : t('编辑${functionNameSimple}'),
|
||||||
}));
|
}));
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
|
||||||
|
const loadingRef = ref(false);
|
||||||
|
<% } %>
|
||||||
|
|
||||||
const inputFormSchemas: FormSchema[] = [
|
const inputFormSchemas: FormSchema[] = [
|
||||||
<% if(table.isTreeEntity){ %>
|
<% if(table.isTreeEntity){ %>
|
||||||
@@ -558,6 +580,11 @@ for (c in table.columnList){
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const data = await validate();
|
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 });
|
setDrawerProps({ confirmLoading: true });
|
||||||
const params: any = {
|
const params: any = {
|
||||||
isNewRecord: record.value.isNewRecord,
|
isNewRecord: record.value.isNewRecord,
|
||||||
@@ -584,9 +611,18 @@ for (c in table.columnList){
|
|||||||
}
|
}
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
} finally {
|
} finally {
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
loadingRef.value = false;
|
||||||
|
<% } %>
|
||||||
setDrawerProps({ confirmLoading: false });
|
setDrawerProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
|
||||||
|
async function handleSuccess() {
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
</script>
|
</script>
|
||||||
<% %>
|
<% %>
|
||||||
]]>
|
]]>
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ if(table.isTreeEntity){
|
|||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
<BpmRuntimeTrace @register="registerTraceModal" />
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -113,6 +116,10 @@ for(c in table.columnList){
|
|||||||
import { areaTreeData } from '/@/api/sys/area';
|
import { areaTreeData } from '/@/api/sys/area';
|
||||||
<% } %>
|
<% } %>
|
||||||
import { useDrawer } from '/@/components/Drawer';
|
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 { FormProps } from '/@/components/Form';
|
||||||
import InputForm from './form.vue';
|
import InputForm from './form.vue';
|
||||||
|
|
||||||
@@ -322,6 +329,9 @@ for(c in table.columnList){
|
|||||||
confirm: handleDelete.bind(this, { ${idParam} }),
|
confirm: handleDelete.bind(this, { ${idParam} }),
|
||||||
},
|
},
|
||||||
auth: '${permissionPrefix}:edit',
|
auth: '${permissionPrefix}:edit',
|
||||||
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
ifShow: () => record.status == '9',
|
||||||
|
<% } %>
|
||||||
},
|
},
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if(table.isTreeEntity){ %>
|
<% if(table.isTreeEntity){ %>
|
||||||
@@ -335,6 +345,14 @@ for(c in table.columnList){
|
|||||||
auth: '${permissionPrefix}:edit',
|
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() {
|
function handleSuccess() {
|
||||||
reload();
|
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>
|
</script>
|
||||||
<% %>
|
<% %>
|
||||||
]]>
|
]]>
|
||||||
|
|||||||
Reference in New Issue
Block a user