chore: categoryId
This commit is contained in:
@@ -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"
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user