行政区划级联 懒加载

This commit is contained in:
luozhun 2024-11-01 11:38:42 +08:00
parent 23041368c2
commit a35abcd9cd
2 changed files with 6 additions and 9 deletions

View File

@ -50,7 +50,11 @@ const administrativeDivisionByParentCode = async (code: string = '0'): Promise<T
const resp = await api.get<TreeNodeVo<string>[]>('/common/administrativeDivisionByParentCode', {
parentCode: code
})
return resp.data;
//
return resp.data.map(item => {
delete item.children
return item
});
}
onMounted(async () => {

View File

@ -1,12 +1,5 @@
<template>
<administrative-division-tree/>
123123
<a-image width="100" height="100"
:src="'https://www.hnjinglian.cn:9002'+objUrl"/>
<a-image width="100" height="100"
:src="'https://www.hnjinglian.cn:2563/minio_9000'+objUrl"/>
<a-image width="100" height="100"
:src="'http://118.253.177.137:9000'+objUrl"/>
<administrative-division-tree style="width: 500px" :value='[ "430000"]'/>
</template>
<script setup lang="ts">