feat: 修改地址查询层级

This commit is contained in:
fyy
2025-07-30 14:57:42 +08:00
parent 64a01a3d6f
commit e0d55b6ab4
7 changed files with 440 additions and 346 deletions

View File

@@ -2,9 +2,13 @@
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep,handleNode,getPopupContainer } from '@vben/utils';
import { cloneDeep, handleNode, getPopupContainer } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { orderMaintainAdd, orderMaintainInfo, orderMaintainUpdate } from '#/api/property/conservationManagement';
import {
orderMaintainAdd,
orderMaintainInfo,
orderMaintainUpdate,
} from '#/api/property/conservationManagement';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
import { communityTree } from '#/api/property/community';
@@ -21,7 +25,7 @@ const [BasicForm, formApi] = useVbenForm({
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
},
schema: modalSchema(),
showDefaultActions: false,
@@ -45,7 +49,7 @@ const [BasicModal, modalApi] = useVbenModal({
if (!isOpen) {
return null;
}
setupCommunitySelect()
setupCommunitySelect();
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
@@ -91,12 +95,12 @@ async function handleClosed() {
// 获取服务地址
async function setupCommunitySelect() {
const areaList = await communityTree(5);
const areaList = await communityTree(4);
// 选中后显示在输入框的值 即父节点 / 子节点
// addFullName(areaList, 'areaName', ' / ');
const splitStr = '/';
handleNode(areaList, 'label', splitStr, function (node: any) {
if (node.level != 5) {
if (node.level != 4) {
node.disabled = true;
}
});
@@ -132,4 +136,3 @@ async function setupCommunitySelect() {
<BasicForm />
</BasicModal>
</template>