feat 行政区划接口

This commit is contained in:
xxm
2022-12-24 23:26:52 +08:00
parent ad58336a82
commit 8c18fdda27
2 changed files with 45 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "bootx-platform-vue3",
"version": "1.1.3",
"version": "1.x",
"author": {
"name": "xxm"
},
@@ -46,7 +46,6 @@
"ant-design-vue": "^3.2.15",
"axios": "^0.26.1",
"bpmn-js": "^10.3.0",
"china-area-data": "^5.0.1",
"codemirror": "^5.65.3",
"cron-parser": "^4.6.0",
"cropperjs": "^1.5.12",

View File

@@ -0,0 +1,44 @@
import { defHttp } from '/@/utils/http/axios'
import { Result } from '/#/axios'
/**
* 获取一级行政区
*/
export function findAllProvince() {
return defHttp.get<Result<Region[]>>({
url: '/china/region/findAllProvince',
})
}
/**
* 获取省市二级联动列表
*/
export function findAllProvinceAndCity() {
return defHttp.get<Result<Region[]>>({
url: '/china/region/findAllProvinceAndCity',
})
}
/**
* 获取省市三级联动列表
*/
export function findAllProvinceAndCityAndArea() {
return defHttp.get<Result<Region[]>>({
url: '/china/region/findAllProvinceAndCityAndArea',
})
}
/**
* 区域表
*/
export interface Region {
// 区划id
id?: number
// 区域名称
name?: string
// 上级区划id
pid?: number
// 区划级别
level?: 1 | 2 | 3 | 4
children?: Region[]
}