From 33ceb7a85a37fb874a0152983ea9a883696a7a38 Mon Sep 17 00:00:00 2001 From: Esacpe <1113279529@qq.com> Date: Tue, 22 Jul 2025 13:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 +- src/components/GdMap/index.vue | 57 +++----- .../GdMap/{indexww.vue => indexNr.vue} | 57 +++++--- src/utils/tools.js | 10 ++ .../JudgmentHome/tsypHome/index.vue | 1 + .../qbypfx/hot_hm/index.vue | 40 +++-- .../qbypfx/hot_ry/index.vue | 40 +++-- .../qbypfx/hot_xs/index.vue | 40 +++-- .../qbypfx/hot_zz/index.vue | 50 +++++-- .../IntelligenceManagement/qbypfx/index.vue | 138 ++++++++++++------ .../qbypfx/zdxsfl/index.vue | 37 ++++- .../qbypfx/zlcs/index.vue | 31 +++- .../qbypfx/zqfl/index.vue | 50 ++++--- 13 files changed, 382 insertions(+), 172 deletions(-) rename src/components/GdMap/{indexww.vue => indexNr.vue} (92%) diff --git a/src/App.vue b/src/App.vue index b60c4f2..6fb1dc8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,7 @@ import * as ocr from "@paddlejs-models/ocr"; import { ref, nextTick, provide, onMounted,getCurrentInstance } from "vue"; import { useStore } from "vuex"; -import { getItem } from "@/utils/storage"; +import { getItem, setItem} from "@/utils/storage"; import { generateNewStyle, writeNewStyle } from "@/utils/theme"; const { proxy } = getCurrentInstance(); const store = useStore(); @@ -41,7 +41,6 @@ const initPage = async () => { } catch (err) { proxy.$message({ type: "error", message: "加载失败,请刷新页面" }); imgIsLoad = false; - // initPage() } } diff --git a/src/components/GdMap/index.vue b/src/components/GdMap/index.vue index 32ff62e..229bc71 100644 --- a/src/components/GdMap/index.vue +++ b/src/components/GdMap/index.vue @@ -1,8 +1,7 @@ @@ -74,7 +74,7 @@ const props = defineProps({ }); try { const userInfo = getItem("deptId")[0].deptCode; -} catch (error) { } +} catch (error) {} let map; let mapLayer; let mapLayer1; @@ -85,36 +85,30 @@ onMounted(() => { box[0].style.right = !res ? "4px" : "398px"; box[0].style.transition = "0.5s"; }); - + map = new EliMap({ id: props.mapid, - crs: "EPSG:4490", + crs: "EPSG:3857", style: { glyphs: "./fonts/{fontstack}/{range}.pbf", - center: [94.36057012, 29.64276831], - zoom: 15 + center: [94.36,29.65], + zoom: 10 }, - minZoom: 7, - maxZoom: 18, + transformRequest: (url) => { + if (url.indexOf("TileMatrix=") != -1) { + const arr = url.split("TileMatrix="); + const arr1 = arr[1].split("&"); + const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`; + + } + } }); + window.map = map; map.mapboxGLMap.on("load", () => { - map.addWMTSLayer( - "/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap" - , - { - Service: "getImage", - Type: "RGB", - ZoomOffset: "0", - V: "0.3", - Zoom: "{z}", - Row: "{y}", - Col: "{x}" - }, - { - tileSize: 300 - } - ); + map.addGaudLayer({ + url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', + }) zoomTarget.value = map.mapboxGLMap.getZoom(); }); mapUtil.value = new MapUtil(map); @@ -259,6 +253,7 @@ const mapSetLayer = (id, source) => { //获取地图绘制的数据 const resFun = (coord, type, flag, data) => { + emitter.emit("coordString", { coord: coord, type: type, @@ -323,35 +318,29 @@ onUnmounted(() => { right: 398px; bottom: 4px; z-index: 9; - .mapImageItem { border: 1px solid #08aae8; background: rgb(9, 26, 70); - - &>img { + & > img { width: 100%; height: 50px; } - - &>div { + & > div { text-align: center; position: relative; top: -3px; } } - .zoomTargetBox { margin-top: 10px; margin-left: 23px; } - ::v-deep .el-input-number__decrease, ::v-deep .el-input-number__increase { background: #133362; color: #fff; border: none; } - ::v-deep .el-input__inner { background: #0c1641; } diff --git a/src/components/GdMap/indexww.vue b/src/components/GdMap/indexNr.vue similarity index 92% rename from src/components/GdMap/indexww.vue rename to src/components/GdMap/indexNr.vue index 229bc71..32ff62e 100644 --- a/src/components/GdMap/indexww.vue +++ b/src/components/GdMap/indexNr.vue @@ -1,7 +1,8 @@ @@ -74,7 +74,7 @@ const props = defineProps({ }); try { const userInfo = getItem("deptId")[0].deptCode; -} catch (error) {} +} catch (error) { } let map; let mapLayer; let mapLayer1; @@ -85,30 +85,36 @@ onMounted(() => { box[0].style.right = !res ? "4px" : "398px"; box[0].style.transition = "0.5s"; }); - + map = new EliMap({ id: props.mapid, - crs: "EPSG:3857", + crs: "EPSG:4490", style: { glyphs: "./fonts/{fontstack}/{range}.pbf", - center: [94.36,29.65], - zoom: 10 + center: [94.36057012, 29.64276831], + zoom: 15 }, - transformRequest: (url) => { - if (url.indexOf("TileMatrix=") != -1) { - const arr = url.split("TileMatrix="); - const arr1 = arr[1].split("&"); - const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`; - - } - } + minZoom: 7, + maxZoom: 18, }); - window.map = map; map.mapboxGLMap.on("load", () => { - map.addGaudLayer({ - url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', - }) + map.addWMTSLayer( + "/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap" + , + { + Service: "getImage", + Type: "RGB", + ZoomOffset: "0", + V: "0.3", + Zoom: "{z}", + Row: "{y}", + Col: "{x}" + }, + { + tileSize: 300 + } + ); zoomTarget.value = map.mapboxGLMap.getZoom(); }); mapUtil.value = new MapUtil(map); @@ -253,7 +259,6 @@ const mapSetLayer = (id, source) => { //获取地图绘制的数据 const resFun = (coord, type, flag, data) => { - emitter.emit("coordString", { coord: coord, type: type, @@ -318,29 +323,35 @@ onUnmounted(() => { right: 398px; bottom: 4px; z-index: 9; + .mapImageItem { border: 1px solid #08aae8; background: rgb(9, 26, 70); - & > img { + + &>img { width: 100%; height: 50px; } - & > div { + + &>div { text-align: center; position: relative; top: -3px; } } + .zoomTargetBox { margin-top: 10px; margin-left: 23px; } + ::v-deep .el-input-number__decrease, ::v-deep .el-input-number__increase { background: #133362; color: #fff; border: none; } + ::v-deep .el-input__inner { background: #0c1641; } diff --git a/src/utils/tools.js b/src/utils/tools.js index 7d6c336..8ce4e4e 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -13,6 +13,16 @@ export function choseRbgb(color,opcity) { return `rgba(${r},${g},${b},${a})` } } + +// 随机十六进制颜色 +export function randomHexColor() { // 随机生成十六进制颜色 + var hex = Math.floor(Math.random() * 16777216).toString(16); + while (hex.length < 6) { + hex = '0' + hex; + } + return '#' + hex; +} + // 今天周几 export function weekValidate() { let week = new Date().getDay() diff --git a/src/views/backOfficeSystem/JudgmentHome/tsypHome/index.vue b/src/views/backOfficeSystem/JudgmentHome/tsypHome/index.vue index d9205d8..fd3c7a8 100644 --- a/src/views/backOfficeSystem/JudgmentHome/tsypHome/index.vue +++ b/src/views/backOfficeSystem/JudgmentHome/tsypHome/index.vue @@ -72,6 +72,7 @@