From b583be5465970411153abad0ae85661059818f14 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Thu, 16 Mar 2023 13:51:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E5=8C=BA=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/area/index.ts | 15 ++++ src/views/system/area/area.data.ts | 23 ++++++ src/views/system/area/index.vue | 126 +++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 src/api/system/area/index.ts create mode 100644 src/views/system/area/area.data.ts create mode 100644 src/views/system/area/index.vue diff --git a/src/api/system/area/index.ts b/src/api/system/area/index.ts new file mode 100644 index 00000000..7d8a9d7c --- /dev/null +++ b/src/api/system/area/index.ts @@ -0,0 +1,15 @@ +import request from '@/config/axios/request' + +// 获得地区树 +export const getAreaTree = async (content?: any) => { + return await request.get({ + url: '/system/area/tree', + params: content + }) +} +// 获得 IP 对应的地区名 +export const getAreaByIp = async (ip) => { + return await request.get({ + url: '/system/area/get-by-ip?ip=' + ip + }) +} diff --git a/src/views/system/area/area.data.ts b/src/views/system/area/area.data.ts new file mode 100644 index 00000000..008e8a41 --- /dev/null +++ b/src/views/system/area/area.data.ts @@ -0,0 +1,23 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: false, + columns: [ + { + title: '编号', + field: 'id', + table: { + treeNode: true, + align: 'left' + } + }, + { + title: '名字', + field: 'name' + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue new file mode 100644 index 00000000..e5a6a682 --- /dev/null +++ b/src/views/system/area/index.vue @@ -0,0 +1,126 @@ + + +