样式调整
信息体组件自动带部门 tab标题显示业务功能名称 修改流程默认节点名称、修改流程线名称可为空 表单流程验证跳过
This commit is contained in:
@ -647,6 +647,21 @@
|
||||
generatorConfig.listConfig.buttonConfigs.length === 0
|
||||
) {
|
||||
generatorConfig.listConfig.buttonConfigs = [
|
||||
{
|
||||
isUse: true,
|
||||
name: t('新增'),
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('编辑'),
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('刷新'),
|
||||
@ -661,20 +676,6 @@
|
||||
icon: 'ant-design:eye-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('新增'),
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('编辑'),
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('删除'),
|
||||
|
||||
@ -41,13 +41,15 @@ import {inject, ref, watchEffect} from 'vue';
|
||||
if (props && props.value) {
|
||||
//当前用户
|
||||
if (props.infoType === 0) {
|
||||
let deptId=formModel![props.deptField];
|
||||
let deptName=deptId?await getDepartment(deptId):"";
|
||||
const deptId=formModel?.[props.deptField];
|
||||
const dept=deptId?await getDepartment(deptId):null;
|
||||
const deptName=dept?.name||"";
|
||||
//判断传入的值 是不是当前登录人 或需要二次加载 就不需要发请求获取用户信息了
|
||||
if (props.value === userStore.getUserInfo.id || props.loadAgain) {
|
||||
name.value = userStore.getUserInfo.name+(props.userNameWithDepartment&&(deptName||userStore.getUserInfo.departmentName)?("/"+(deptName||userStore.getUserInfo.departmentName)):"");
|
||||
emit('update:value', userStore.getUserInfo.id);
|
||||
} else {
|
||||
name.value = props.value;
|
||||
//如果不是当前登陆人 需要用户id 查询当前用户信息
|
||||
const userInfo = await getUser(props.value);
|
||||
name.value = userInfo.name;
|
||||
@ -61,6 +63,7 @@ import {inject, ref, watchEffect} from 'vue';
|
||||
name.value = userStore.getUserInfo.departmentName;
|
||||
emit('update:value', userStore.getUserInfo.departmentId);
|
||||
} else {
|
||||
name.value = props.value;
|
||||
//如果不是当前登陆人 需要用户id 查询当前用户信息
|
||||
const dept = await getDepartment(props.value);
|
||||
name.value = dept.name;
|
||||
@ -78,8 +81,9 @@ import {inject, ref, watchEffect} from 'vue';
|
||||
} else {
|
||||
//当前用户
|
||||
if (props.infoType === 0) {
|
||||
let deptId=formModel![props.deptField];
|
||||
let deptName=deptId?await getDepartment(deptId):"";
|
||||
const deptId=formModel?.[props.deptField];
|
||||
const dept=deptId?await getDepartment(deptId):null;
|
||||
const deptName=dept?.name||"";
|
||||
//判断传入的值 是不是当前登录人 就不需要发请求获取用户信息了
|
||||
name.value = userStore.getUserInfo.name+(props.userNameWithDepartment&&(deptName||userStore.getUserInfo.departmentName)?("/"+(deptName||userStore.getUserInfo.departmentName)):"");
|
||||
emit('update:value', userStore.getUserInfo.id);
|
||||
|
||||
@ -67,7 +67,7 @@ function handleIndexColumn(
|
||||
flag: INDEX_COLUMN_FLAG,
|
||||
width: 50,
|
||||
title: t('序号'),
|
||||
align: 'center',
|
||||
align: 'right',
|
||||
customRender: ({ index }) => {
|
||||
const getPagination = unref(getPaginationRef);
|
||||
if (isBoolean(getPagination)) {
|
||||
|
||||
@ -67,7 +67,7 @@ function handleIndexColumn(
|
||||
flag: INDEX_COLUMN_FLAG,
|
||||
width: 50,
|
||||
title: t('序号'),
|
||||
align: 'center',
|
||||
align: 'right',
|
||||
customRender: ({ index }) => {
|
||||
const getPagination = unref(getPaginationRef);
|
||||
if (isBoolean(getPagination)) {
|
||||
|
||||
@ -27,7 +27,8 @@ export function useTitle() {
|
||||
return;
|
||||
}
|
||||
|
||||
const tTitle = t(route?.meta?.title as string);
|
||||
const metaTitle=typeof route?.meta?.title=='function'?route.meta.title(route):route?.meta?.title;
|
||||
const tTitle = t(metaTitle);
|
||||
pageTitle.value = tTitle
|
||||
? ` ${tTitle} - ${title} `
|
||||
: `${title}`;
|
||||
|
||||
@ -45,7 +45,8 @@
|
||||
const getTitle = computed(() => {
|
||||
const tabItem = props.tabItem as any;
|
||||
const meta = tabItem.meta || {};
|
||||
return tabItem.tabTitle || (meta && t(meta.title as string));
|
||||
const metaTitle=typeof meta?.title=='function'?meta.title(tabItem):meta?.title;
|
||||
return tabItem.tabTitle || (meta && t(metaTitle as string));
|
||||
});
|
||||
|
||||
const getIsTabs = computed(() => !props.isExtra);
|
||||
|
||||
@ -126,6 +126,8 @@ export interface ButtonConfig {
|
||||
icon: string;
|
||||
//是否新增
|
||||
isDefault: boolean;
|
||||
//按钮类型
|
||||
type: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -138,7 +138,7 @@ export const FLOW_ROUTE: AppRouteRecordRaw[] = [{
|
||||
name: 'CreateFlow',
|
||||
component: () => import('/@/views/secondDev/createFlow.vue'),
|
||||
meta: {
|
||||
title: '新建流程'
|
||||
title: (route) => '新建'+(route.query.formName||'流程')
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -146,7 +146,7 @@ export const FLOW_ROUTE: AppRouteRecordRaw[] = [{
|
||||
name: 'ApproveFlow',
|
||||
component: () => import('/@/views/secondDev/approveFlowPage.vue'),
|
||||
meta: {
|
||||
title: '审批流程'
|
||||
title: (route) => '审批'+(route.query.formName||'流程')
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -197,7 +197,7 @@ export const FLOW_ROUTE: AppRouteRecordRaw[] = [{
|
||||
name: 'createForm',
|
||||
component: () => import('/@/views/secondDev/formCreatePage.vue'),
|
||||
meta: {
|
||||
title: '新建表单'
|
||||
title: (route) => '新建'+(route.query.formName||'表单')
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -205,7 +205,7 @@ export const FLOW_ROUTE: AppRouteRecordRaw[] = [{
|
||||
name: 'updateForm',
|
||||
component: () => import('/@/views/secondDev/formCreatePage.vue'),
|
||||
meta: {
|
||||
title: '更新表单'
|
||||
title: (route) => '更新'+(route.query.formName||'表单')
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -213,7 +213,7 @@ export const FLOW_ROUTE: AppRouteRecordRaw[] = [{
|
||||
name: 'viewForm',
|
||||
component: () => import('/@/views/secondDev/formCreatePage.vue'),
|
||||
meta: {
|
||||
title: '查看表单'
|
||||
title: (route) => '查看'+(route.query.formName||'表单')
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -534,11 +534,11 @@ export function buildListCode(model: GeneratorConfig): string {
|
||||
}
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(button.code)">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else type="primary">
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
@ -908,10 +908,11 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
`
|
||||
: ''
|
||||
}
|
||||
const formName='${model.outputConfig?.comment || pascalClassName}';
|
||||
const [registerTable, { reload, ${hasFilterButton ? 'setColumns,' : ''} ${
|
||||
hasPrintButton ? 'getRawDataSource,' : ''
|
||||
} }] = useTable({
|
||||
title: '${model.listConfig?.listTitle || pascalClassName + '列表'}',
|
||||
title: '${model.listConfig?.listTitle||''}' || (formName + '列表'),
|
||||
api: get${pascalMainTableName}Page,
|
||||
rowKey: '${camelCaseString(mainTable.pkField)}',
|
||||
columns: filterColumns,
|
||||
@ -1003,7 +1004,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0]
|
||||
taskId: taskIds[0],
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
} else if (record.workflowData?.schemaId && !record.workflowData.taskIds) {
|
||||
@ -1012,14 +1014,16 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: ''
|
||||
taskId: '',
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1047,7 +1051,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/0/createForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1064,7 +1069,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
formName: formName
|
||||
}
|
||||
});`
|
||||
: `
|
||||
@ -1348,7 +1354,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
formName: formName
|
||||
}
|
||||
});`
|
||||
: `
|
||||
@ -1491,7 +1498,7 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
}
|
||||
${hasFlowRecordButton ? `if (button.code === 'flowRecord') hasFlowRecord = true;` : ''}
|
||||
});
|
||||
if (record.workflowData.enabled) {
|
||||
if (record.workflowData?.enabled) {
|
||||
//与工作流有关联的表单
|
||||
if (record.workflowData.status) {
|
||||
//如果是本人需要审批的数据 就会有taskIds 所以需要修改绑定事件
|
||||
@ -1529,7 +1536,7 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
actionsList = actionsList.concat(editAndDelBtn);
|
||||
}
|
||||
} else {
|
||||
if (!record.workflowData.processId) {
|
||||
if (!record.workflowData?.processId) {
|
||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
||||
actionsList = actionsList.concat(editAndDelBtn);
|
||||
}
|
||||
@ -1570,7 +1577,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: ''
|
||||
taskId: '',
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1614,7 +1622,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0]
|
||||
taskId: taskIds[0],
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -539,6 +539,21 @@
|
||||
generatorConfig.listConfig.buttonConfigs.length === 0
|
||||
) {
|
||||
generatorConfig.listConfig.buttonConfigs = [
|
||||
{
|
||||
isUse: true,
|
||||
name: t('新增'),
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('编辑'),
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('刷新'),
|
||||
@ -553,20 +568,6 @@
|
||||
icon: 'ant-design:eye-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('新增'),
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('编辑'),
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: t('删除'),
|
||||
|
||||
@ -323,6 +323,12 @@
|
||||
selectIds: []
|
||||
};
|
||||
});
|
||||
const strictDesign=false;
|
||||
if (strictDesign&&taskList.length > 0) {
|
||||
notificationError('提交失败', '流程设计错误,开始后的第一个节点必须是审批人为发起人的起草节点。');
|
||||
data.submitLoading = false;
|
||||
loading.value = false;
|
||||
} else {
|
||||
createFlowSuccess(taskList);
|
||||
} else {
|
||||
createFlowSuccess();
|
||||
|
||||
@ -172,6 +172,21 @@
|
||||
},
|
||||
columnConfigs: [],
|
||||
buttonConfigs: [
|
||||
{
|
||||
isUse: true,
|
||||
name: '新增',
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: '编辑',
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: '刷新',
|
||||
@ -186,20 +201,6 @@
|
||||
icon: 'ant-design:eye-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: '新增',
|
||||
code: 'add',
|
||||
icon: 'ant-design:plus-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: '编辑',
|
||||
code: 'edit',
|
||||
icon: 'ant-design:form-outlined',
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
isUse: true,
|
||||
name: '删除',
|
||||
|
||||
@ -11,10 +11,14 @@
|
||||
value: 'key',
|
||||
}"
|
||||
@select="changeTarget"
|
||||
:placeholder="props.placeholder||t('请选择表单字段')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {useI18n} from "/@/hooks/web/useI18n";
|
||||
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['update:target']);
|
||||
const props = defineProps({
|
||||
target: {
|
||||
@ -25,6 +29,10 @@
|
||||
type: Array, //类型
|
||||
default: null, //默认值
|
||||
},
|
||||
placeholder:{
|
||||
type: String,
|
||||
required: false
|
||||
}
|
||||
});
|
||||
|
||||
function changeTarget(value, node) {
|
||||
|
||||
@ -31,8 +31,9 @@ export const getLabelName = (type: InfoType) => {
|
||||
// 初始化开始节点信息
|
||||
export const initStartProperties = () => {
|
||||
const bpmnStore = useBpmnStore();
|
||||
initProperties(getStartNodeId, BpmnNodeKey.START, t('开始节点'), bpmnStore.processInfo.processId);
|
||||
initProperties('Activity_draft', BpmnNodeKey.USER, '发起审批', bpmnStore.processInfo.processId);
|
||||
initProperties(getStartNodeId, BpmnNodeKey.START, t('开始'), bpmnStore.processInfo.processId);
|
||||
initProperties('Activity_draft', BpmnNodeKey.USER, '提交申请', bpmnStore.processInfo.processId);
|
||||
initProperties('Flow_line_draft', BpmnNodeKey.SEQUENCEFLOW, '', bpmnStore.processInfo.processId);
|
||||
};
|
||||
// 修改流程属性
|
||||
export const changeProcessProperties = async (processConfig: ProcessConfig) => {
|
||||
@ -163,13 +164,13 @@ export const getInitializeXml = (resourceId: string) => {
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1u51epq" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.2.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
|
||||
<bpmn:process id="${resourceId}" name="${resourceId}" isExecutable="true">
|
||||
<bpmn:startEvent id="${getStartNodeId}" name="开始节点">
|
||||
<bpmn:startEvent id="${getStartNodeId}" name="开始">
|
||||
<bpmn:outgoing>Flow_line_draft</bpmn:outgoing>
|
||||
</bpmn:startEvent>
|
||||
<bpmn:userTask id="Activity_draft" name="发起审批">
|
||||
<bpmn:userTask id="Activity_draft" name="提交申请">
|
||||
<bpmn:incoming>Flow_line_draft</bpmn:incoming>
|
||||
</bpmn:userTask>
|
||||
<bpmn:sequenceFlow id="Flow_line_draft" name="流程线" sourceRef="${getStartNodeId}" targetRef="Activity_draft" />
|
||||
<bpmn:sequenceFlow id="Flow_line_draft" name="" sourceRef="${getStartNodeId}" targetRef="Activity_draft" />
|
||||
</bpmn:process>
|
||||
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1m1pmsz">
|
||||
|
||||
@ -310,8 +310,8 @@ export const propertiesByType: Map<InfoType, any> = new Map([
|
||||
]);
|
||||
// 根据节点类型获取节点名称
|
||||
export const nodeNameByType: Map<InfoType, any> = new Map([
|
||||
[BpmnNodeKey.START, t('开始节点')],
|
||||
[BpmnNodeKey.END, t('结束节点')],
|
||||
[BpmnNodeKey.START, t('开始')],
|
||||
[BpmnNodeKey.END, t('结束')],
|
||||
[BpmnNodeKey.USER, t('用户节点')],
|
||||
[BpmnNodeKey.SCRIPT, t('脚本节点')],
|
||||
[BpmnNodeKey.EXCLUSIVE, t('互斥网关')],
|
||||
@ -319,6 +319,6 @@ export const nodeNameByType: Map<InfoType, any> = new Map([
|
||||
[BpmnNodeKey.PARALLEL, t('并行网关')],
|
||||
[BpmnNodeKey.SUB_PROCESS, t('子流程')],
|
||||
[BpmnNodeKey.CALLACTIVITY, t('外部流程')],
|
||||
[BpmnNodeKey.SEQUENCEFLOW, t('流程线')],
|
||||
[BpmnNodeKey.SEQUENCEFLOW, t('')],
|
||||
[BpmnNodeKey.PROCESS, t('流程模板')],
|
||||
]);
|
||||
|
||||
@ -203,7 +203,7 @@
|
||||
} else {
|
||||
if (CanInitializeProperties(NewElement.id) && NewElement.type !== 'label') {
|
||||
let name = getLabelName(NewElement.type);
|
||||
if (name) {
|
||||
if (name||NewElement.type==BpmnNodeKey.SEQUENCEFLOW) {
|
||||
initProperties(NewElement.id, NewElement.type, name, NewElement.parent.id);
|
||||
const modeling = bpmnModeler.get('modeling');
|
||||
modeling.updateProperties(NewElement, { name });
|
||||
@ -228,7 +228,7 @@
|
||||
e.element.type !== 'label'
|
||||
) {
|
||||
let name = getLabelName(e.element.type);
|
||||
if (name) {
|
||||
if (name||e.element.type==BpmnNodeKey.SEQUENCEFLOW) {
|
||||
initProperties(e.element.id, e.element.type, name, e.element.parent.id);
|
||||
const modeling = bpmnModeler.get('modeling');
|
||||
modeling.updateProperties(e.element, { name });
|
||||
|
||||
Reference in New Issue
Block a user