diff --git a/apps/web-antd/src/views/workflow/category/category-modal.vue b/apps/web-antd/src/views/workflow/category/category-modal.vue index a5ee0498..75fb8d60 100644 --- a/apps/web-antd/src/views/workflow/category/category-modal.vue +++ b/apps/web-antd/src/views/workflow/category/category-modal.vue @@ -41,13 +41,13 @@ const [BasicForm, formApi] = useVbenForm({ async function setupCategorySelect() { const listData = await categoryList(); let treeData = listToTree(listData, { - id: 'id', + id: 'categoryId', pid: 'parentId', }); treeData = [ { categoryName: '根目录', - id: 0, + categoryId: 0, children: treeData, }, ]; @@ -57,7 +57,7 @@ async function setupCategorySelect() { componentProps: { treeData, treeLine: { showLeafIcon: false }, - fieldNames: { label: 'categoryName', value: 'id' }, + fieldNames: { label: 'categoryName', value: 'categoryId' }, treeDefaultExpandAll: true, getPopupContainer, }, diff --git a/apps/web-antd/src/views/workflow/category/index.vue b/apps/web-antd/src/views/workflow/category/index.vue index ab5869ec..5131775d 100644 --- a/apps/web-antd/src/views/workflow/category/index.vue +++ b/apps/web-antd/src/views/workflow/category/index.vue @@ -56,11 +56,11 @@ const gridOptions: VxeGridProps = { gt: 0, }, rowConfig: { - keyField: 'id', + keyField: 'categoryId', }, treeConfig: { parentField: 'parentId', - rowField: 'id', + rowField: 'categoryId', transform: true, }, // 表格全局唯一表示 保存列配置需要用到 @@ -73,17 +73,17 @@ const [CategoryModal, modalApi] = useVbenModal({ }); function handleAdd(row?: Recordable) { - modalApi.setData({ parentId: row?.id }); + modalApi.setData({ parentId: row?.categoryId }); modalApi.open(); } async function handleEdit(row: Recordable) { - modalApi.setData({ id: row.id }); + modalApi.setData({ id: row.categoryId }); modalApi.open(); } async function handleDelete(row: Recordable) { - await categoryRemove(row.id); + await categoryRemove(row.categoryId); await tableApi.query(); } diff --git a/apps/web-antd/src/views/workflow/processDefinition/category-tree.vue b/apps/web-antd/src/views/workflow/processDefinition/category-tree.vue index 6e7c0b5a..b87676dd 100644 --- a/apps/web-antd/src/views/workflow/processDefinition/category-tree.vue +++ b/apps/web-antd/src/views/workflow/processDefinition/category-tree.vue @@ -44,13 +44,13 @@ async function loadTree() { const ret = await categoryList(); let treeData = listToTree(ret, { - id: 'id', + id: 'categoryId', pid: 'parentId', }); treeData = [ { categoryName: '根目录', - id: 0, + categoryId: 0, children: treeData, }, ]; @@ -98,7 +98,7 @@ onMounted(loadTree); v-if="categoryTreeArray.length > 0" v-model:selected-keys="selectCode" :class="$attrs.class" - :field-names="{ title: 'categoryName', key: 'id' }" + :field-names="{ title: 'categoryName', key: 'categoryId' }" :show-line="{ showLeafIcon: false }" :tree-data="categoryTreeArray" :virtual="false" diff --git a/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue b/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue index 62d12cfa..1d0a8d39 100644 --- a/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue +++ b/apps/web-antd/src/views/workflow/processDefinition/process-definition-modal.vue @@ -43,10 +43,13 @@ const [BasicForm, formApi] = useVbenForm({ async function setupCategorySelect() { // menu const resp = await categoryList(); - const tree = listToTree(resp); + const tree = listToTree(resp, { + id: 'categoryId', + pid: 'parentId', + }); const fullMenuTree = [ { - id: 0, + categoryId: 0, categoryName: $t('menu.root'), children: tree, }, @@ -58,7 +61,7 @@ async function setupCategorySelect() { componentProps: { fieldNames: { label: 'categoryName', - value: 'id', + value: 'categoryId', }, getPopupContainer, // 设置弹窗滚动高度 默认256