From 7b7d8fa56c904cebda07b7cb437e6273975fca05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E4=BC=9F=E6=B4=8B?= Date: Thu, 13 Mar 2025 10:48:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=8C=E6=94=BF=E5=8C=BA=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/api/sy-map-admin/water/regionTree.json | 372 ++++++++++++++++++ src/api/project/index.ts | 58 +-- src/components.d.ts | 1 + src/theme/select.scss | 31 +- src/views/RegionSelect/index.vue | 33 +- 5 files changed, 453 insertions(+), 42 deletions(-) create mode 100644 public/api/sy-map-admin/water/regionTree.json diff --git a/public/api/sy-map-admin/water/regionTree.json b/public/api/sy-map-admin/water/regionTree.json new file mode 100644 index 0000000..dfff05e --- /dev/null +++ b/public/api/sy-map-admin/water/regionTree.json @@ -0,0 +1,372 @@ +{ + "code": 200, + "msg": "操作成功", + "data": [ + { + "code": "440000", + "parentCode": "0", + "name": "广东省", + "orderNum": 1, + "id": "d3ad5e5dbec83e9aabbd8b2ce704672a", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_sheng", + "field": "adcode", + "children": [ + { + "code": "441900", + "parentCode": "440000", + "name": "东莞市", + "orderNum": 1, + "id": "c45f712c4e19998c9cf2de86a4e613cc", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441800", + "parentCode": "440000", + "name": "清远市", + "orderNum": 1, + "id": "adb67f26d0a71067887ae7eceed5dc29", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441700", + "parentCode": "440000", + "name": "阳江市", + "orderNum": 1, + "id": "e7031b69c7968313dfcda737b55f8145", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441600", + "parentCode": "440000", + "name": "河源市", + "orderNum": 1, + "id": "73e70da62880174426ad0fa9aef41a8a", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441500", + "parentCode": "440000", + "name": "汕尾市", + "orderNum": 1, + "id": "213b3eed7077e90ef956a66b0160e67b", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441400", + "parentCode": "440000", + "name": "梅州市", + "orderNum": 1, + "id": "8754d3d581487a5cbfff23b257f6b485", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441300", + "parentCode": "440000", + "name": "惠州市", + "orderNum": 1, + "id": "b785b55f1365872f3a569bd393df8f49", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "442000", + "parentCode": "440000", + "name": "中山市", + "orderNum": 1, + "id": "25d2e55dac65de1dde00e30ea0d4d8d9", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "441200", + "parentCode": "440000", + "name": "肇庆市", + "orderNum": 1, + "id": "ccb3b0f6b36da5e396c94c7646285f15", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440900", + "parentCode": "440000", + "name": "茂名市", + "orderNum": 1, + "id": "3c8de8ff830a11d8fb3f595a8ffbe042", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440800", + "parentCode": "440000", + "name": "湛江市", + "orderNum": 1, + "id": "19a316be41e20d38dc4c08112298f3ea", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440700", + "parentCode": "440000", + "name": "江门市", + "orderNum": 1, + "id": "1c89b772da65045df5b31485628dad14", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440600", + "parentCode": "440000", + "name": "佛山市", + "orderNum": 1, + "id": "ad2555b457fd807d72e82a2991d107c3", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440500", + "parentCode": "440000", + "name": "汕头市", + "orderNum": 1, + "id": "b05a7b1d1ad376f10d10e2a0435a67c3", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440400", + "parentCode": "440000", + "name": "珠海市", + "orderNum": 1, + "id": "4eef3fbbb0cd7638fa40b7fcc57b4b92", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "445200", + "parentCode": "440000", + "name": "揭阳市", + "orderNum": 1, + "id": "3dff46756700d3e3db2349891cb54493", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440300", + "parentCode": "440000", + "name": "深圳市", + "orderNum": 1, + "id": "fb56831063f1051787a1e9e22e2e4234", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "445100", + "parentCode": "440000", + "name": "潮州市", + "orderNum": 1, + "id": "3e7e5a5fad638f89c0830435397dbadc", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440200", + "parentCode": "440000", + "name": "韶关市", + "orderNum": 1, + "id": "c5a42e1868770edddd9ebf9f740b4300", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + }, + { + "code": "440100", + "parentCode": "440000", + "name": "广州市", + "orderNum": 1, + "id": "29946f1b893b208c6124699a935c4612", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [ + { + "code": "440118", + "parentCode": "440100", + "name": "增城区", + "orderNum": 1, + "id": "ded8f077dabe4dc63c774ad58a5c2a10", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440117", + "parentCode": "440100", + "name": "从化区", + "orderNum": 1, + "id": "86c2e947c41b0638de835edde04c2c5d", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440115", + "parentCode": "440100", + "name": "南沙区", + "orderNum": 1, + "id": "36138ff7f7ebbc7f89cf0027606ec243", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440114", + "parentCode": "440100", + "name": "花都区", + "orderNum": 1, + "id": "1a857a710ae8629e200e9d120b450d3d", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440113", + "parentCode": "440100", + "name": "番禺区", + "orderNum": 1, + "id": "b7802e0cf9884629c539ae1ca82e001a", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440112", + "parentCode": "440100", + "name": "黄埔区", + "orderNum": 1, + "id": "0c26e7524f46b2e03af7e8de9e8454c0", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440111", + "parentCode": "440100", + "name": "白云区", + "orderNum": 1, + "id": "4eb36dfdc0c8f02b8e5069d0f546ecbd", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440106", + "parentCode": "440100", + "name": "天河区", + "orderNum": 1, + "id": "4068f7d91a3e4b8b0c54ae596a9657ff", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440105", + "parentCode": "440100", + "name": "海珠区", + "orderNum": 1, + "id": "39224ef8724828db2a397a387bdf61fc", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440104", + "parentCode": "440100", + "name": "越秀区", + "orderNum": 1, + "id": "159dccc4b1ae55111bd571a86634c16b", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + }, + { + "code": "440103", + "parentCode": "440100", + "name": "荔湾区", + "orderNum": 1, + "id": "118759109037d200b15874736e708d71", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gz_qu", + "field": "adcode", + "children": [] + } + ] + }, + { + "code": "445300", + "parentCode": "440000", + "name": "云浮市", + "orderNum": 1, + "id": "9c2d0666c2dd18437fd4bba9d04c6ba5", + "url": "/geoserver/ows", + "serviceIndex": "shuyuan:xzqconfig_gd_shi", + "field": "adcode", + "children": [] + } + ] + } + ], + "success": true +} diff --git a/src/api/project/index.ts b/src/api/project/index.ts index 1e1b8cd..0313230 100644 --- a/src/api/project/index.ts +++ b/src/api/project/index.ts @@ -1,33 +1,40 @@ -import axios from 'axios'; -import { request } from '../axios'; -const url = '/sy-map-admin'; +import axios from "axios"; +import { request } from "../axios"; +const url = "/sy-map-admin"; export const getProjectList = async (params: any) => { const res = await request({ - url: url + '/water/project.json', - method: 'get', - params + url: url + "/water/project.json", + method: "get", + params, }); return res; }; export const getLayerTree = async (params: any) => { return await request({ - url: url + '/water/layerTree.json', - method: 'get', - params + url: url + "/water/layerTree.json", + method: "get", + params, }); }; // 默认视点 export const getDefaultViewPoint = async () => { return await request({ - url: url + '/water/defaultViewPoint.json', - method: 'get' + url: url + "/water/defaultViewPoint.json", + method: "get", + }); +}; +// 行政区划树 +export const getRegionTree = async () => { + return await request({ + url: url + "/water/regionTree.json", + method: "get", }); }; export const getLayerStyle = async (id: string) => { return await request({ - url: url + '/layer/style/' + id, - method: 'get' + url: url + "/layer/style/" + id, + method: "get", }); }; @@ -35,26 +42,26 @@ export const getLayerStyle = async (id: string) => { export const getFirstScene = async () => { return request({ url: `/map/scene/sceneList`, - method: 'post', + method: "post", data: { pageNum: 1, pageSize: 1, data: { - id: '', - name: '' + id: "", + name: "", }, params: { - order: 'asc', - orderBy: 'pub_date' - } - } + order: "asc", + orderBy: "pub_date", + }, + }, }); }; export const getLayerData = async (sceneId: string) => { return request({ url: `/map/scene/getLayerTree/${sceneId}`, - method: 'get' + method: "get", }); }; @@ -68,10 +75,13 @@ export const getLayerLegend = async (url: string) => { * @param code 图层的查询编码 * @returns */ -export const identifyLayerInfo = async (type: string | number, code: string | number) => { +export const identifyLayerInfo = async ( + type: string | number, + code: string | number +) => { return request({ url: `/run/api/object/info/${type}/${code}`, - method: 'get' + method: "get", }); }; @@ -79,6 +89,6 @@ export const identifyLayerInfo = async (type: string | number, code: string | nu export function getSceneConfig(sceneId: string | number) { return request({ url: `/map/scene/config/findConfigBySceneId/${sceneId}`, - method: 'get' + method: "get", }); } diff --git a/src/components.d.ts b/src/components.d.ts index 2c5962a..39e5112 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -15,6 +15,7 @@ declare module 'vue' { ElSelect: typeof import('element-plus/es')['ElSelect'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] Form: typeof import('./components/Form/index.vue')['default'] InputNumber: typeof import('./components/Input/input-number.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/theme/select.scss b/src/theme/select.scss index f93c712..0e28cc9 100644 --- a/src/theme/select.scss +++ b/src/theme/select.scss @@ -1,24 +1,25 @@ .sy-select__popper.sy-popper { - border: 1px solid rgba(10, 204, 204, 0.32) !important; - box-shadow: none; - background: rgba(0, 37, 88, 0.6) !important; + border: 1px solid rgba(255, 255, 255, 0.8) !important; + box-shadow: none; + background: rgba(255, 255, 255, 0.8) !important; } .sy-select-dropdown__list { - background: rgba(0, 37, 88, 0.6); - box-shadow: none; - margin: 6px !important; + background: rgba(255, 255, 255, 0.8); + box-shadow: none; + margin: 6px !important; + backdrop-filter: blur(10px); } .sy-select-dropdown__item { - background: transparent !important; - color: rgba(255, 255, 255, 0.7) !important; - &:hover { - color: var(--sy-main-font-color); - } + background: transparent !important; + color: rgba(0, 0, 0, 0.9) !important; + &:hover { + color: var(--sy-main-font-color); + } } .sy-select { - height: 42px; - line-height: 42px; + height: 42px; + line-height: 42px; } .sy-select .sy-input__wrapper { - line-height: 42px; -} \ No newline at end of file + line-height: 42px; +} diff --git a/src/views/RegionSelect/index.vue b/src/views/RegionSelect/index.vue index 5ae329a..e70322e 100644 --- a/src/views/RegionSelect/index.vue +++ b/src/views/RegionSelect/index.vue @@ -1,16 +1,43 @@