feat(@vben/web-antd): 增加工作流关联详情展示并优化列表刷新功能
- 新增 linkDetail API 获取工作流关联详情 - 在表单中展示已关联的部门信息 - 添加操作成功后的通知提示 - 优化工作流列表的刷新功能
This commit is contained in:
parent
6910bd28cc
commit
f32b395e27
@ -57,3 +57,7 @@ export function getWorkflowList(params: WorkflowApi.WorkflowLogParams) {
|
|||||||
export function linkWorkflow(data: WorkflowApi.WorkflowLinkParams) {
|
export function linkWorkflow(data: WorkflowApi.WorkflowLinkParams) {
|
||||||
return requestClient.post(`/v1/server/link`, data);
|
return requestClient.post(`/v1/server/link`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function linkDetail(workflowId: string) {
|
||||||
|
return requestClient.get(`/v1/server/link/${workflowId}`);
|
||||||
|
}
|
||||||
|
@ -44,7 +44,7 @@ function onActionClick({ code, row }: OnActionClickParams<any>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
},
|
},
|
||||||
@ -82,14 +82,14 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
} as VxeTableGridOptions<UserApi.User>,
|
} as VxeTableGridOptions<UserApi.User>,
|
||||||
});
|
});
|
||||||
|
|
||||||
// function onRefresh() {
|
function onRefresh() {
|
||||||
// gridApi.query();
|
gridApi.query();
|
||||||
// }
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<FormDrawer />
|
<FormDrawer />
|
||||||
<FormModal />
|
<FormModal @success="onRefresh" />
|
||||||
<Grid table-title="工作流列表">
|
<Grid table-title="工作流列表">
|
||||||
<!-- <template #toolbar-tools>-->
|
<!-- <template #toolbar-tools>-->
|
||||||
<!-- <Button type="primary" @click="onDelete" danger> 批量删除 </Button>-->
|
<!-- <Button type="primary" @click="onDelete" danger> 批量删除 </Button>-->
|
||||||
|
@ -7,8 +7,10 @@ import { ref } from 'vue';
|
|||||||
|
|
||||||
import { useVbenModal, VbenTree } from '@vben/common-ui';
|
import { useVbenModal, VbenTree } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { notification } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { getAllDeptTree, linkWorkflow } from '#/api';
|
import { getAllDeptTree, linkDetail, linkWorkflow } from '#/api';
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
@ -46,6 +48,9 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
workflowId: workflowId.value,
|
workflowId: workflowId.value,
|
||||||
deptIds,
|
deptIds,
|
||||||
});
|
});
|
||||||
|
notification.success({
|
||||||
|
message: '操作成功',
|
||||||
|
});
|
||||||
emits('success');
|
emits('success');
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
} finally {
|
} finally {
|
||||||
@ -55,7 +60,13 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
async onOpenChange(isOpen) {
|
async onOpenChange(isOpen) {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
workflowId.value = modalApi.getData().id;
|
workflowId.value = modalApi.getData().id;
|
||||||
|
const res = await linkDetail(workflowId.value);
|
||||||
|
const deptIds = res.map((item) => item.deptId);
|
||||||
await getDeptList();
|
await getDeptList();
|
||||||
|
// 设置表单字段的值为过滤出的 deptIds
|
||||||
|
formApi.form.setValues({
|
||||||
|
deptIds,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user