feat: [bpm][antd] todo 流程监听器、流程表达式修改
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
|||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import ProcessListenerSelectModal from '#/views/bpm/processListener/components/process-listener-select-modal.vue';
|
import { ProcessListenerSelectModal } from '#/views/bpm/processListener/components';
|
||||||
|
|
||||||
import { createListenerObject, updateElementExtensions } from '../../utils';
|
import { createListenerObject, updateElementExtensions } from '../../utils';
|
||||||
import ListenerFieldModal from './ListenerFieldModal.vue';
|
import ListenerFieldModal from './ListenerFieldModal.vue';
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import ProcessListenerSelectModal from '#/views/bpm/processListener/components/process-listener-select-modal.vue';
|
import { ProcessListenerSelectModal } from '#/views/bpm/processListener/components';
|
||||||
|
|
||||||
import { createListenerObject, updateElementExtensions } from '../../utils';
|
import { createListenerObject, updateElementExtensions } from '../../utils';
|
||||||
import ListenerFieldModal from './ListenerFieldModal.vue';
|
import ListenerFieldModal from './ListenerFieldModal.vue';
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import {
|
|||||||
MULTI_LEVEL_DEPT,
|
MULTI_LEVEL_DEPT,
|
||||||
} from '#/views/bpm/components/simple-process-design/consts';
|
} from '#/views/bpm/components/simple-process-design/consts';
|
||||||
import { useFormFieldsPermission } from '#/views/bpm/components/simple-process-design/helpers';
|
import { useFormFieldsPermission } from '#/views/bpm/components/simple-process-design/helpers';
|
||||||
import ProcessExpressionSelectModal from '#/views/bpm/processExpression/components/process-expression-select-modal.vue';
|
import { ProcessExpressionSelectModal } from '#/views/bpm/processExpression/components';
|
||||||
|
|
||||||
defineOptions({ name: 'UserTask' });
|
defineOptions({ name: 'UserTask' });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as ProcessExpressionSelectModal } from './select-modal.vue';
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
|
import type { VbenFormSchema } from '#/adapter/form';
|
||||||
|
import type {
|
||||||
|
VxeGridPropTypes,
|
||||||
|
VxeTableGridOptions,
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
import type { BpmProcessExpressionApi } from '#/api/bpm/processExpression';
|
import type { BpmProcessExpressionApi } from '#/api/bpm/processExpression';
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { CommonStatusEnum } from '@vben/constants';
|
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
|
||||||
|
import { getDictOptions } from '@vben/hooks';
|
||||||
|
|
||||||
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getProcessExpressionPage } from '#/api/bpm/processExpression';
|
import { getProcessExpressionPage } from '#/api/bpm/processExpression';
|
||||||
@@ -16,35 +19,23 @@ const emit = defineEmits<{
|
|||||||
select: [expression: BpmProcessExpressionApi.ProcessExpression];
|
select: [expression: BpmProcessExpressionApi.ProcessExpression];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// TODO @jason:这里是不是要迁移下?
|
|
||||||
// 查询参数
|
|
||||||
const queryParams = ref({
|
|
||||||
status: CommonStatusEnum.ENABLE,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 配置 VxeGrid
|
// 配置 VxeGrid
|
||||||
const [Grid] = useVbenVxeGrid({
|
const [Grid] = useVbenVxeGrid({
|
||||||
|
formOptions: {
|
||||||
|
schema: useGridFormSchema(),
|
||||||
|
},
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: [
|
columns: useGridColumns(),
|
||||||
{ field: 'name', title: '名字', minWidth: 160 },
|
|
||||||
{ field: 'expression', title: '表达式', minWidth: 260 },
|
|
||||||
{
|
|
||||||
field: 'action',
|
|
||||||
title: '操作',
|
|
||||||
width: 120,
|
|
||||||
slots: { default: 'action' },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
showOverflow: true,
|
showOverflow: true,
|
||||||
minHeight: 300,
|
minHeight: 300,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
// 查询表达式列表
|
// 查询表达式列表
|
||||||
query: async ({ page }) => {
|
query: async ({ page }, formValues) => {
|
||||||
return await getProcessExpressionPage({
|
return await getProcessExpressionPage({
|
||||||
pageNo: page.currentPage,
|
pageNo: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
status: queryParams.value.status,
|
...formValues,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -62,6 +53,7 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
// 配置 Modal
|
// 配置 Modal
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
|
contentClass: 'bg-background-deep p-3',
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -70,6 +62,53 @@ function handleSelect(row: BpmProcessExpressionApi.ProcessExpression) {
|
|||||||
emit('select', row);
|
emit('select', row);
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 列表的搜索表单 */
|
||||||
|
function useGridFormSchema(): VbenFormSchema[] {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
fieldName: 'name',
|
||||||
|
label: '名字',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入名字',
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldName: 'status',
|
||||||
|
label: '状态',
|
||||||
|
component: 'Select',
|
||||||
|
defaultValue: CommonStatusEnum.ENABLE,
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||||
|
placeholder: '请选择状态',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
|
return [
|
||||||
|
{ field: 'name', title: '名字', minWidth: 160 },
|
||||||
|
{ field: 'expression', title: '表达式', minWidth: 260 },
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态',
|
||||||
|
minWidth: 100,
|
||||||
|
cellRender: {
|
||||||
|
name: 'CellDict',
|
||||||
|
props: { type: DICT_TYPE.COMMON_STATUS },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
title: '操作',
|
||||||
|
width: 120,
|
||||||
|
slots: { default: 'action' },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -1,21 +1,32 @@
|
|||||||
|
import type { VbenFormSchema } from '#/adapter/form';
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { DICT_TYPE } from '@vben/constants';
|
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
|
||||||
|
import { getDictOptions } from '@vben/hooks';
|
||||||
|
|
||||||
/** 选择监听器弹窗的列表字段 */
|
/** 选择监听器弹窗的列表字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ field: 'name', title: '名字', minWidth: 120 },
|
{ field: 'name', title: '名字', minWidth: 160 },
|
||||||
{
|
{
|
||||||
field: 'type',
|
field: 'type',
|
||||||
title: '类型',
|
title: '类型',
|
||||||
minWidth: 200,
|
minWidth: 120,
|
||||||
cellRender: {
|
cellRender: {
|
||||||
name: 'CellDict',
|
name: 'CellDict',
|
||||||
props: { type: DICT_TYPE.BPM_PROCESS_LISTENER_TYPE },
|
props: { type: DICT_TYPE.BPM_PROCESS_LISTENER_TYPE },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ field: 'event', title: '事件', minWidth: 200 },
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态',
|
||||||
|
minWidth: 120,
|
||||||
|
cellRender: {
|
||||||
|
name: 'CellDict',
|
||||||
|
props: { type: DICT_TYPE.COMMON_STATUS },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ field: 'event', title: '事件', minWidth: 120 },
|
||||||
{
|
{
|
||||||
field: 'valueType',
|
field: 'valueType',
|
||||||
title: '值类型',
|
title: '值类型',
|
||||||
@@ -34,3 +45,29 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 列表的搜索表单 */
|
||||||
|
export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
fieldName: 'name',
|
||||||
|
label: '名字',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入名字',
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldName: 'status',
|
||||||
|
label: '状态',
|
||||||
|
component: 'Select',
|
||||||
|
defaultValue: CommonStatusEnum.ENABLE,
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||||
|
placeholder: '请选择状态',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as ProcessListenerSelectModal } from './select-modal.vue';
|
||||||
@@ -5,12 +5,11 @@ import type { BpmProcessListenerApi } from '#/api/bpm/processListener';
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { CommonStatusEnum } from '@vben/constants';
|
|
||||||
|
|
||||||
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getProcessListenerPage } from '#/api/bpm/processListener';
|
import { getProcessListenerPage } from '#/api/bpm/processListener';
|
||||||
|
|
||||||
import { useGridColumns } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
||||||
defineOptions({ name: 'ProcessListenerSelectModal' });
|
defineOptions({ name: 'ProcessListenerSelectModal' });
|
||||||
|
|
||||||
@@ -18,27 +17,25 @@ const emit = defineEmits<{
|
|||||||
select: [listener: BpmProcessListenerApi.ProcessListener];
|
select: [listener: BpmProcessListenerApi.ProcessListener];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// TODO @jason:这里是不是要迁移下?
|
const listenerType = ref('');
|
||||||
// 查询参数
|
|
||||||
const queryParams = ref({
|
|
||||||
type: '',
|
|
||||||
status: CommonStatusEnum.ENABLE,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 配置 VxeGrid
|
// 配置 VxeGrid
|
||||||
const [Grid] = useVbenVxeGrid({
|
const [Grid] = useVbenVxeGrid({
|
||||||
|
formOptions: {
|
||||||
|
schema: useGridFormSchema(),
|
||||||
|
},
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useGridColumns(),
|
columns: useGridColumns(),
|
||||||
showOverflow: true,
|
showOverflow: true,
|
||||||
minHeight: 300,
|
minHeight: 300,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }) => {
|
query: async ({ page }, formValues) => {
|
||||||
return await getProcessListenerPage({
|
return await getProcessListenerPage({
|
||||||
pageNo: page.currentPage,
|
pageNo: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
type: queryParams.value.type,
|
type: listenerType.value,
|
||||||
status: queryParams.value.status,
|
...formValues,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -56,14 +53,15 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
// 配置 Modal
|
// 配置 Modal
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
|
contentClass: 'bg-background-deep p-3',
|
||||||
onOpenChange: async (isOpen: boolean) => {
|
onOpenChange: async (isOpen: boolean) => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
queryParams.value.type = '';
|
listenerType.value = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const data = modalApi.getData<{ type: string }>();
|
const data = modalApi.getData<{ type: string }>();
|
||||||
if (data?.type) {
|
if (data?.type) {
|
||||||
queryParams.value.type = data.type;
|
listenerType.value = data.type;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
Reference in New Issue
Block a user