update web/src/views/system/menu/components/MenuFormCom/index.vue.
优化在新增修改菜单的时候,父级菜单tree只显示目录 Signed-off-by: 木子-李 <1537080775@qq.com>
This commit is contained in:
@@ -111,6 +111,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import XEUtils from 'xe-utils';
|
||||||
import { ref, onMounted, reactive } from 'vue';
|
import { ref, onMounted, reactive } from 'vue';
|
||||||
import { ElForm, FormRules } from 'element-plus';
|
import { ElForm, FormRules } from 'element-plus';
|
||||||
import IconSelector from '/@/components/iconSelector/index.vue';
|
import IconSelector from '/@/components/iconSelector/index.vue';
|
||||||
@@ -246,7 +247,7 @@ const createFilter = (queryString: string) => {
|
|||||||
const handleTreeLoad = (node: Node, resolve: Function) => {
|
const handleTreeLoad = (node: Node, resolve: Function) => {
|
||||||
if (node.level !== 0) {
|
if (node.level !== 0) {
|
||||||
lazyLoadMenu({ parent: node.data.id }).then((res: APIResponseData) => {
|
lazyLoadMenu({ parent: node.data.id }).then((res: APIResponseData) => {
|
||||||
resolve(res.data);
|
resolve(XEUtils.filter(res.data, (i: MenuTreeItemType) => i.is_catalog));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -280,7 +281,9 @@ const handleCancel = (type: string = '') => {
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
props.treeData.map((item) => {
|
props.treeData.map((item) => {
|
||||||
deptDefaultList.value.push(item);
|
if (item.is_catalog) {
|
||||||
|
deptDefaultList.value.push(item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
setMenuFormData();
|
setMenuFormData();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user