diff --git a/src/api/xj/map.js b/src/api/xj/map.js new file mode 100644 index 0000000..7ad6b0d --- /dev/null +++ b/src/api/xj/map.js @@ -0,0 +1,153 @@ +// 02转84坐标 +export function gcj02ToWgs84([lng, lat]) { + const a = 6378245.0; + const ee = 0.00669342162296594323; + const pi = Math.PI; + + if (outOfChina02(lng, lat)) { + return [lng, lat]; + } else { + let dlat = transformLat02(lng - 105.0, lat - 35.0); + let dlng = transformLng02(lng - 105.0, lat - 35.0); + const radLat = (lat / 180.0) * pi; + let magic = Math.sin(radLat); + magic = 1 - ee * magic * magic; + const sqrtMagic = Math.sqrt(magic); + dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * pi); + dlng = (dlng * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * pi); + const mgLat = lat + dlat; + const mgLng = lng + dlng; + return [lng * 2 - mgLng, lat * 2 - mgLat]; + } +} + +function outOfChina02(lng, lat) { + return lng < 72.004 || lng > 137.8347 || lat < 0.8293 || lat > 55.8271; +} + +// 经纬度转换 +function transformLat02(lng, lat) { + let ret = + -100.0 + + 2.0 * lng + + 3.0 * lat + + 0.2 * lat * lat + + 0.1 * lng * lat + + 0.2 * Math.sqrt(Math.abs(lng)); + ret += + ((20.0 * Math.sin(6.0 * lng * Math.PI) + + 20.0 * Math.sin(2.0 * lng * Math.PI)) * + 2.0) / + 3.0; + ret += + ((20.0 * Math.sin(lat * Math.PI) + 40.0 * Math.sin((lat / 3.0) * Math.PI)) * + 2.0) / + 3.0; + ret += + ((160.0 * Math.sin((lat / 12.0) * Math.PI) + + 320 * Math.sin((lat * Math.PI) / 30.0)) * + 2.0) / + 3.0; + return ret; +} + +function transformLng02(lng, lat) { + let ret = + 300.0 + + lng + + 2.0 * lat + + 0.1 * lng * lng + + 0.1 * lng * lat + + 0.1 * Math.sqrt(Math.abs(lng)); + ret += + ((20.0 * Math.sin(6.0 * lng * Math.PI) + + 20.0 * Math.sin(2.0 * lng * Math.PI)) * + 2.0) / + 3.0; + ret += + ((20.0 * Math.sin(lng * Math.PI) + 40.0 * Math.sin((lng / 3.0) * Math.PI)) * + 2.0) / + 3.0; + ret += + ((150.0 * Math.sin((lng / 12.0) * Math.PI) + + 300.0 * Math.sin((lng / 30.0) * Math.PI)) * + 2.0) / + 3.0; + return ret; +} + +// 84转02坐标 +export function wgs84ToGcj02([lng, lat]) { + if (outOfChina84(lng, lat)) { + return { lng, lat }; + } + let dlat = transformLat84(lng - 105.0, lat - 35.0); + let dlng = transformLng84(lng - 105.0, lat - 35.0); + const radLat = (lat / 180.0) * Math.PI; + let magic = Math.sin(radLat); + magic = 1 - 0.00669342162296594323 * magic * magic; + const sqrtMagic = Math.sqrt(magic); + dlat = + (dlat * 180.0) / + (((6378245.0 * (1 - 0.00669342162296594323)) / (magic * sqrtMagic)) * + Math.PI); + dlng = + (dlng * 180.0) / ((6378245.0 / sqrtMagic) * Math.cos(radLat) * Math.PI); + const gcjLng = lng + dlng; + const gcjLat = lat + dlat; + return [gcjLng, gcjLat]; +} + +// 判断是否在中国境内 +function outOfChina84(lng, lat) { + return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55); +} + +// 转换公式所需的常量 +function transformLat84(x, y) { + let ret = + -100.0 + + 2.0 * x + + 3.0 * y + + 0.2 * y * y + + 0.1 * x * y + + 0.2 * Math.sqrt(Math.abs(x)); + ret += + ((20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * + 2.0) / + 3.0; + ret += + ((20.0 * Math.sin(y * Math.PI) + 40.0 * Math.sin((y / 3.0) * Math.PI)) * + 2.0) / + 3.0; + ret += + ((160.0 * Math.sin((y / 12.0) * Math.PI) + + 320 * Math.sin((y * Math.PI) / 30.0)) * + 2.0) / + 3.0; + return ret; +} + +function transformLng84(x, y) { + let ret = + 300.0 + + x + + 2.0 * y + + 0.1 * x * x + + 0.1 * x * y + + 0.1 * Math.sqrt(Math.abs(x)); + ret += + ((20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * + 2.0) / + 3.0; + ret += + ((20.0 * Math.sin(x * Math.PI) + 40.0 * Math.sin((x / 3.0) * Math.PI)) * + 2.0) / + 3.0; + ret += + ((150.0 * Math.sin((x / 12.0) * Math.PI) + + 300.0 * Math.sin((x / 30.0) * Math.PI)) * + 2.0) / + 3.0; + return ret; +} diff --git a/src/api/xj/screen/disease-screen.js b/src/api/xj/screen/disease-screen.js new file mode 100644 index 0000000..95f9306 --- /dev/null +++ b/src/api/xj/screen/disease-screen.js @@ -0,0 +1,59 @@ +import request from "@/utils/request"; + +// 路面状况排名接口 +export function roadRankList(query) { + return request({ + url: "/bigscreen/getDefectCountRanking", + method: "get", + params: query, + }); +} + +// 病害趋势柱状图接口 +export function roadTrends(query) { + return request({ + url: "/bigscreen/getHistoryDefect", + method: "get", + params: query, + }); + } + +// 今日巡查数据 + export function roadToday(query) { + return request({ + url: "/bigscreen/getInspectionInfo", + method: "get", + params: query, + }); + } + + + // pci排名数据 + export function roadPic(query) { + return request({ + url: "/bigscreen/pciRanking", + method: "get", + params: query, + }); + } + + +// 病害趋势3维饼图 +export function roadCurrent(query) { + return request({ + url: "/bigscreen/roadStatus", + method: "get", + params: query, + }); + } + +// 数据栏内右上角下拉框 +export function getDropList(query) { + return request({ + url: "/bigscreen/getDropdownList", + method: "get", + params: query, + }); + } + + diff --git a/src/api/xj/screen/index.js b/src/api/xj/screen/index.js new file mode 100644 index 0000000..b3d75fc --- /dev/null +++ b/src/api/xj/screen/index.js @@ -0,0 +1,12 @@ +import request from "@/utils/request"; + +// 获取数据栏右上角选择数据接口 +export function selectTypeList(query) { + return request({ + url: "/bigscreen/getSwitch", + method: "get", + params: query, + }); + } + + diff --git a/src/api/xj/screen/road-screen.js b/src/api/xj/screen/road-screen.js new file mode 100644 index 0000000..8c397c6 --- /dev/null +++ b/src/api/xj/screen/road-screen.js @@ -0,0 +1,56 @@ +/* + * @Author: SunTao 328867980@qq.com + * @Date: 2024-10-25 14:44:22 + * @LastEditors: SunTao 328867980@qq.com + * @LastEditTime: 2024-10-25 16:25:39 + * @FilePath: \znxjxt-ui\src\api\xj\screen\road-screen.js + * @Description: 道路资产大屏接口 + */ +import request from "@/utils/request"; + +// 路面状况排名接口 +export function roadRankStatistics(query) { + return request({ + url: "/bigscreen/getRoadStatistics", + method: "get", + params: query, + }); + } + + +// 附属设施分布接口 +export function ancillaryList(query) { + return request({ + url: "/bigscreen/getEquipmentScale", + method: "get", + params: query, + }); + } + +// 附属设施分布累计路产数 +export function ancillaryCount(query) { + return request({ + url: "/bigscreen/getEquipmentCount", + method: "get", + params: query, + }); + } + + +// 附属设施异常统计接口 +export function anomalyList(query) { + return request({ + url: "/bigscreen/getEquipmentAnomalyLog", + method: "get", + params: query, + }); + } + +// 路产统计信息接口 +export function roadStatisticList(query) { + return request({ + url: "/bigscreen/getEquipmentStatistics", + method: "get", + params: query, + }); + } diff --git a/src/api/xj/section.js b/src/api/xj/section.js index 9aea352..d04a1ce 100644 --- a/src/api/xj/section.js +++ b/src/api/xj/section.js @@ -9,6 +9,14 @@ export function getSectionList(query) { }); } +// 查询路线下拉列表 +export function getSegmentList() { + return request({ + url: "/xj/route/listDropDown", + method: "get", + }); +} + // 新增路段 export function addSection(query) { return request({ diff --git a/src/api/xj/task.js b/src/api/xj/task.js index f0fa670..d858481 100644 --- a/src/api/xj/task.js +++ b/src/api/xj/task.js @@ -2,9 +2,9 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-14 10:04:12 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-14 10:27:49 + * @LastEditTime: 2024-10-25 13:55:51 * @FilePath: \znxjxt-ui\src\api\xj\task.js - * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + * @Description: 巡检任务管理接口 */ import request from "@/utils/request"; @@ -17,6 +17,15 @@ export function getTaskTable(params) { }); } +// 任务id模糊查询接口 +export function getTaskIdList(params) { + return request({ + url: "/xj/xjtask/taskDropDown", + method: "get", + params, + }); +} + // 巡检路段下拉数据 export function getSegment() { return request({ diff --git a/src/components/map/fssm-map.vue b/src/components/map/fssm-map.vue index 1df05e2..63b3d16 100644 --- a/src/components/map/fssm-map.vue +++ b/src/components/map/fssm-map.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-14 10:46:23 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-23 15:33:10 + * @LastEditTime: 2024-10-24 17:17:45 * @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\components\fssm-map.vue * @Description: 公共地图 --> @@ -164,6 +164,7 @@ export default { /* 初始化openlayer地图 */ initMap() { const tianditu_vec_c = new TileLayer({ + className: "baseLayerClass", title: "矢量底图", id: "vec_c", source: new XYZ({ @@ -173,6 +174,7 @@ export default { visible: true, }); const tianditu_cva_c = new TileLayer({ + className: "baseLayerClass", title: "矢量地图", id: "cva_c", source: new XYZ({ diff --git a/src/views/big-screen/disease-components/disease-current.vue b/src/views/big-screen/disease-components/disease-current.vue index 4777175..5ade892 100644 --- a/src/views/big-screen/disease-components/disease-current.vue +++ b/src/views/big-screen/disease-components/disease-current.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 10:19:56 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-23 14:32:47 + * @LastEditTime: 2024-10-24 16:37:52 * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\disease-current.vue * @Description: 病害巡检-病害三维饼图 --> @@ -31,8 +31,8 @@ :key="`chart-${index}`" >
-
{{ item.name }}
-
{{ item.value }}
+
{{ item.typeName }}
+
{{ item.rate }}%
{{ item.value }}
@@ -42,35 +42,21 @@ diff --git a/src/views/big-screen/disease-components/road-rank.vue b/src/views/big-screen/disease-components/road-rank.vue index 9c8aa86..37658be 100644 --- a/src/views/big-screen/disease-components/road-rank.vue +++ b/src/views/big-screen/disease-components/road-rank.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 10:33:24 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-18 15:05:44 + * @LastEditTime: 2024-10-25 16:19:23 * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\road-rank.vue * @Description: 病害巡检-路面状况排名 --> @@ -13,6 +13,7 @@ class="vue-scroll" :class-option="defaultOption" :data="roadList" + v-if="roadList.length > 4" >
TOP
{{ item.name }}
病害数:{{ item.value }}
-
- 环比:{{ item.rate }} +
+ 环比:{{ item.huanbi }} +
+
+ 同比:{{ item.tongbi }}
+ @@ -70,9 +137,8 @@ export default { overflow: hidden; .road-div { - height: 2rem; + min-height: 2rem; width: 100%; - padding: 0 1.5rem; display: flex; > div { diff --git a/src/views/big-screen/disease-components/today-inspection.vue b/src/views/big-screen/disease-components/today-inspection.vue index 18c14a0..dbb76d4 100644 --- a/src/views/big-screen/disease-components/today-inspection.vue +++ b/src/views/big-screen/disease-components/today-inspection.vue @@ -2,26 +2,57 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 09:42:49 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-22 09:30:05 + * @LastEditTime: 2024-10-24 14:10:06 * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\today-inspection.vue * @Description: 病害巡检-今日巡查 --> @@ -117,7 +148,7 @@ export default { background: linear-gradient( to bottom, #ffffff, - #E9BC5C + #e9bc5c ); /*设置渐变的方向从左到右 颜色从ff0000到ffff00*/ background-clip: text; /*将设置的背景颜色限制在文字中*/ -webkit-text-fill-color: transparent; /*给文字设置成透明*/ diff --git a/src/views/big-screen/index.vue b/src/views/big-screen/index.vue index b39e69a..d7c0a78 100644 --- a/src/views/big-screen/index.vue +++ b/src/views/big-screen/index.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-17 11:34:00 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-23 16:12:45 + * @LastEditTime: 2024-10-25 16:40:29 * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @Description: 大屏首页 --> @@ -16,7 +16,6 @@ height="45" frameborder="0" allowtransparency="true" - @load="loadFrame" src="https://i.tianqi.com?c=code&id=12&icon=1&color=%2389C5E8&py=shenyang&num=1&site=12" > @@ -46,8 +45,12 @@ > @@ -61,11 +64,17 @@ :title="item.title" :class="item.class" > - + @@ -98,6 +107,10 @@
+
+
+
+
{ @@ -348,6 +362,14 @@ export default { this.dataTime = `${hours}:${minutes}:${seconds}`; }, 1000); }, + /* 获取数据栏右上角选项数据 */ + getSelect() { + selectTypeList().then(({ code, data }) => { + if (code === 200) { + this.selectTypeArr = data; + } + }); + }, /* 点击病害筛查 */ clickImg() { this.imgVisible = true; @@ -632,7 +654,7 @@ export default { title: "病害趋势", component: DiseaseCurrent, selectIsShow: true, - select: "1", + select: "", class: "twe", }, ]; @@ -659,7 +681,7 @@ export default { title: "路面状况排名", component: RoadRank, selectIsShow: true, - select: "1", + select: "", class: "twe", }, ]; @@ -689,7 +711,7 @@ export default { title: "附属设施异常统计", component: AnomalyFacilities, selectIsShow: true, - select: "1", + select: "", class: "one", }, { @@ -698,7 +720,7 @@ export default { title: "路产统计", component: RoadStatistic, selectIsShow: true, - select: "1", + select: "", class: "twe", }, ]; @@ -717,7 +739,7 @@ export default { height: "14rem", title: "交安事件趋势", component: TrafficTrend, - selectIsShow: false, + selectIsShow: true, class: "twe", }, { @@ -726,7 +748,7 @@ export default { title: "交安事件统计", component: TrafficStatistic, selectIsShow: true, - select: "1", + select: "", class: "twe", }, ]; @@ -737,7 +759,7 @@ export default { title: "交安事件排名", component: TrafficRank, selectIsShow: true, - select: "1", + select: "", class: "one", }, { @@ -853,8 +875,8 @@ export default { flex-direction: column; align-items: center; position: absolute; - left: 29rem; - top: 6rem; + left: 27%; + top: 10%; .road-div { width: 100%; @@ -924,9 +946,6 @@ export default { display: flex; justify-content: center; align-items: center; - // position: absolute; - // left: 30rem; - // top: 12rem; font-size: 0.8rem; color: #ffffff; background-color: #395569; @@ -945,8 +964,8 @@ export default { width: 8rem; height: 10rem; position: absolute; - right: 28rem; - top: 6rem; + right: 26%; + top: 10%; padding: 0.4rem; border-radius: 0.4rem; border: 1px solid #193dae; @@ -971,6 +990,7 @@ export default { background-size: 100% 100%; position: relative; + // 标题 .disease-title { width: 20rem; height: 2.8rem; @@ -982,9 +1002,29 @@ export default { background-repeat: no-repeat; background-size: 100%; } + + // 图例 + .map-legend { + height: 9rem; + width: 2rem; + position: absolute; + top: 13%; + left: 26%; + background-color: #1cb6ff; + z-index: 1; + } + + // 打点部分 + .map-care { + width: 48%; + height: 73%; + position: absolute; + left: 26%; + top: 13%; + } } - ::v-deep .ol-layer:nth-child(1) { + ::v-deep .baseLayerClass { filter: grayscale(200%) invert(200%) sepia(50%) hue-rotate(175deg) brightness(80%) saturate(550%); } @@ -1071,7 +1111,7 @@ export default { .change-map-div { cursor: pointer; - margin: 0 1.2rem; + margin: 0 2rem; } .change-map-click { diff --git a/src/views/big-screen/road-components/ancillary-facilities.vue b/src/views/big-screen/road-components/ancillary-facilities.vue index de92312..39291f5 100644 --- a/src/views/big-screen/road-components/ancillary-facilities.vue +++ b/src/views/big-screen/road-components/ancillary-facilities.vue @@ -2,24 +2,24 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 15:18:03 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-22 09:05:30 + * @LastEditTime: 2024-10-25 16:27:10 * @FilePath: \znxjxt-ui\src\views\big-screen\road-components\ancillary-facilities.vue * @Description: 道路资产大屏-附属设施分布 --> diff --git a/src/views/big-screen/road-components/anomaly-facilities.vue b/src/views/big-screen/road-components/anomaly-facilities.vue index 9e3e029..3a1b9ab 100644 --- a/src/views/big-screen/road-components/anomaly-facilities.vue +++ b/src/views/big-screen/road-components/anomaly-facilities.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 15:21:24 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-21 16:03:14 + * @LastEditTime: 2024-10-25 15:37:00 * @FilePath: \znxjxt-ui\src\views\big-screen\road-components\anomaly-facilities.vue * @Description: 附属设施异常统计 --> @@ -29,49 +29,137 @@ diff --git a/src/views/big-screen/road-components/road-statistic.vue b/src/views/big-screen/road-components/road-statistic.vue index e9654d1..d5585cf 100644 --- a/src/views/big-screen/road-components/road-statistic.vue +++ b/src/views/big-screen/road-components/road-statistic.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-18 15:22:31 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-22 09:13:22 + * @LastEditTime: 2024-10-25 16:11:56 * @FilePath: \znxjxt-ui\src\views\big-screen\road-components\road-statistic.vue * @Description: 道路资产大屏-路产统计 --> @@ -17,7 +17,7 @@
{{ index + 1 < 10 ? "0" + (index + 1) : index + 1 }}{{ item.name }} + >{{ item.label }}
{{ item.value }}
-
-
+ >
@@ -146,13 +163,6 @@ export default { width: 100%; height: 100%; display: flex; - - .road-info { - height: 100%; - width: 40px; - border-left: 2px black solid; - margin: 0 0.1rem; - } } .bottom-0 { diff --git a/src/views/big-screen/road-screen.vue b/src/views/big-screen/road-screen.vue deleted file mode 100644 index fb7dc67..0000000 --- a/src/views/big-screen/road-screen.vue +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/big-screen/traffic-components/traffic-trend.vue b/src/views/big-screen/traffic-components/traffic-trend.vue index b49a387..0928bdf 100644 --- a/src/views/big-screen/traffic-components/traffic-trend.vue +++ b/src/views/big-screen/traffic-components/traffic-trend.vue @@ -97,10 +97,8 @@ export default { { data: ["fdfs", "frffs", "wdwe", "10-1", "asdasd", "asd", "fdfs"], axisLabel: { - textStyle: { - color: "#808C9F", - fontSize: 12, - }, + color: "#808C9F", + fontSize: 12, interval: 0, }, axisLine: { @@ -138,10 +136,8 @@ export default { }, axisLabel: { show: true, - textStyle: { - color: "#808C9F", - fontSize: 12, - }, + color: "#808C9F", + fontSize: 12, }, }, ], diff --git a/src/views/xj/inspection/disease-management/index.vue b/src/views/xj/inspection/disease-management/index.vue index 7749a28..0317afe 100644 --- a/src/views/xj/inspection/disease-management/index.vue +++ b/src/views/xj/inspection/disease-management/index.vue @@ -2,7 +2,7 @@ * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git * @Date: 2024-10-08 10:58:25 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-12 15:22:08 + * @LastEditTime: 2024-10-25 11:29:20 * @FilePath: \znxjxt-ui\src\views\xj\inspection\disease-management .vue * @Description: 巡检信息管理-病害管理 --> @@ -40,7 +40,6 @@ format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable - @change="handleQuery" /> @@ -178,7 +177,7 @@ icon="el-icon-delete" size="mini" :disabled="multiple" - @click="handleDelete" + @click="handleDelete('')" v-hasPermi="['system:defect:remove']" >删除 @@ -194,18 +193,18 @@ >导出 --> - + @@ -248,7 +247,11 @@ @@ -354,7 +357,7 @@ - + - + { this.initMap("addMap"); const e = { lnglat: { - lat: row.geometry.coordinates[1], - lng: row.geometry.coordinates[0], + lng: gcj02ToWgs84([ + row.geometry.coordinates[0], + row.geometry.coordinates[1], + ])[0], + lat: gcj02ToWgs84([ + row.geometry.coordinates[0], + row.geometry.coordinates[1], + ])[1], }, }; this.onMapClick(e); }); - this.form = row; + this.form = { ...row, dataStatus: row.dataStatus.toString() }; this.upload.fileList = row.media.map((item) => { return { ...item, @@ -940,9 +950,9 @@ export default { }, /* 文件上传成功处理 */ handleFileSuccess(response, file, fileList) { - this.fileList = fileList.map((item) => { + this.upload.fileList = fileList.map((item) => { if (item.response) { - return { img: item.response.url }; + return { ...item, img: item.response.url }; } return item; }); @@ -958,16 +968,22 @@ export default { return false; } // 验证文件上传列表 - if (this.fileList.length < 1) { + if (this.upload.fileList.length < 1) { this.$modal.msgWarning("请上传图片"); return false; } const data = { ...this.form, - media: this.fileList, + media: this.upload.fileList.map((item) => { + return { ...item, img: item.img }; + }), geometry: { type: "Point", - coordinates: [this.markers[0].lng, this.markers[0].lat], + coordinates: wgs84ToGcj02([ + this.markers[0].lng, + this.markers[0].lat, + ]), + id: this.form?.geometry?.id, }, }; if (this.form.id) { @@ -1053,11 +1069,27 @@ export default { this.openViewDialog = true; this.viewForm = defect; this.$nextTick(() => { + this.centerPoint = [ + gcj02ToWgs84([ + defect.geometry.coordinates[0], + defect.geometry.coordinates[1], + ])[0], + gcj02ToWgs84([ + defect.geometry.coordinates[0], + defect.geometry.coordinates[1], + ])[1], + ]; this.initMap("viewMap"); const e = { lnglat: { - lat: defect.geometry.coordinates[1], - lng: defect.geometry.coordinates[0], + lng: gcj02ToWgs84([ + defect.geometry.coordinates[0], + defect.geometry.coordinates[1], + ])[0], + lat: gcj02ToWgs84([ + defect.geometry.coordinates[0], + defect.geometry.coordinates[1], + ])[1], }, }; this.onMapClick(e); @@ -1095,6 +1127,7 @@ export default { }, /* 关闭查看对话框 */ closeDialog() { + this.centerPoint = [123.30297096718999, 41.87942945541742]; this.openViewDialog = false; }, }, diff --git a/src/views/xj/inspection/road-management/components/road-add.vue b/src/views/xj/inspection/road-management/components/road-add.vue index ab3e981..4b8f2f4 100644 --- a/src/views/xj/inspection/road-management/components/road-add.vue +++ b/src/views/xj/inspection/road-management/components/road-add.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-11 16:52:24 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-10-12 14:13:23 + * @LastEditTime: 2024-10-25 11:17:56 * @FilePath: \znxjxt-ui\src\views\xj\inspection\road-management\components\road-add.vue * @Description: 路产管理-新增/编辑弹窗 --> @@ -156,15 +156,10 @@