国家地区回显
This commit is contained in:
@ -15,7 +15,8 @@ enum Api {
|
|||||||
|
|
||||||
DataLog = '/mdm/countryRegion/datalog',
|
DataLog = '/mdm/countryRegion/datalog',
|
||||||
TreeData = '/mdm/countryRegion/tree',
|
TreeData = '/mdm/countryRegion/tree',
|
||||||
TreeChild = '/mdm/countryRegion/child'
|
TreeChild = '/mdm/countryRegion/child',
|
||||||
|
TreeChildInfo = '/mdm/countryRegion/getParentByCode'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +47,20 @@ export async function getAreaList(params: LngBRegionPageParams, mode: ErrorMessa
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description: 分节点查询LngBRegion树回显
|
||||||
|
*/
|
||||||
|
export async function getAreaInfo(params: LngBRegionPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngBRegionPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.TreeChildInfo,
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngBRegion分页列表
|
* @description: 查询LngBRegion分页列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cascader v-model:value="emitData" :options="options" :load-data="loadData" change-on-select @change="handleChange" :displayRender="handleRenderDisplay">
|
<Cascader v-model:value="emitData" :options="options" :load-data="loadData" @change="handleChange" :displayRender="handleRenderDisplay">
|
||||||
<template #suffixIcon v-if="loading">
|
<template #suffixIcon v-if="loading">
|
||||||
<LoadingOutlined spin />
|
<LoadingOutlined spin />
|
||||||
</template>
|
</template>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
import { get, omit } from 'lodash-es';
|
import { get, omit } from 'lodash-es';
|
||||||
import { LoadingOutlined } from '@ant-design/icons-vue';
|
import { LoadingOutlined } from '@ant-design/icons-vue';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { getAreaList } from '/@/api/mdm/CountryRegion';
|
import { getAreaList, getAreaInfo} from '/@/api/mdm/CountryRegion';
|
||||||
import { requestMagicApi } from '/@/api/magicApi';
|
import { requestMagicApi } from '/@/api/magicApi';
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
@ -60,22 +60,24 @@
|
|||||||
if (isChange.value) return;
|
if (isChange.value) return;
|
||||||
|
|
||||||
if (val) {
|
if (val) {
|
||||||
let arr = val.split(',')
|
const resData = await getAreaInfo({code: val,excludeType:props.excludeType });
|
||||||
console.log(arr, 88888)
|
options.value = resData.areaList
|
||||||
const resData = await requestMagicApi({
|
emitData.value = resData.regionCode
|
||||||
method: "get",
|
// const resData = await requestMagicApi({
|
||||||
url: "mdm/getRegionByCode",
|
// method: "get",
|
||||||
body: undefined,
|
// url: "mdm/countryRegion/getParentByCode",
|
||||||
query: {
|
// body: undefined,
|
||||||
code: arr[arr.length-1]
|
// query: {
|
||||||
}
|
// code: arr[arr.length-1]
|
||||||
});
|
// }
|
||||||
console.log(resData, 'resData')
|
// });
|
||||||
emitData.value = val.split(',');
|
// console.log(resData, 'resData')
|
||||||
|
// emitData.value = val.split(',');
|
||||||
} else {
|
} else {
|
||||||
emitData.value = [];
|
emitData.value = [];
|
||||||
|
await initialFetch();
|
||||||
}
|
}
|
||||||
await initialFetch();
|
// await initialFetch();
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true
|
||||||
@ -186,8 +188,8 @@
|
|||||||
emit('change', keys);
|
emit('change', keys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('change', keys.join(','));
|
emit('change', keys[keys.length -1]);
|
||||||
emit('update:value', keys?.join(','));
|
emit('update:value', keys[keys.length -1]);
|
||||||
emitData.value = props.value === undefined ? keys : emitData.value;
|
emitData.value = props.value === undefined ? keys : emitData.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user