From 669552cce17139b465eb7f383a63b6a4df7e24a3 Mon Sep 17 00:00:00 2001 From: SunTao <328867980@qq.com> Date: Thu, 28 Nov 2024 11:12:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=8D=95=E6=8D=AE=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E8=81=94=E8=B0=83=EF=BC=8C=E8=AE=A2=E9=98=85=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/xj/document.js | 36 +++ src/api/xj/subscription.js | 44 +++ src/components/map/fssm-map.vue | 14 +- .../big-screen/components/img-dialog.vue | 23 +- src/views/big-screen/index.vue | 150 +++++++-- .../components/edit-dialog.vue | 80 +++-- .../components/view-dialog.vue | 61 +++- .../xj/document/maintenance-notice/index.vue | 301 +++++++++++++++--- .../confirmation-management/index.vue | 6 +- .../inspection/disease-management/index.vue | 72 ++--- src/views/xj/parameter/index.vue | 25 +- .../subscription-center/index.vue | 36 ++- 12 files changed, 643 insertions(+), 205 deletions(-) create mode 100644 src/api/xj/subscription.js diff --git a/src/api/xj/document.js b/src/api/xj/document.js index 6160eb8..d3bdb2a 100644 --- a/src/api/xj/document.js +++ b/src/api/xj/document.js @@ -1,3 +1,12 @@ +/* + * @Author: SunTao 328867980@qq.com + * @Date: 2024-11-27 10:58:33 + * @LastEditors: SunTao 328867980@qq.com + * @LastEditTime: 2024-11-27 10:58:33 + * @FilePath: \znxjxt-ui\src\api\xj\document.js + * @Description: 养护通知单相关接口 + */ + import request from "@/utils/request"; // 路段下拉数据 @@ -24,3 +33,30 @@ export function getDefectStatus() { method: "get", }); } + +// 获取养护通知单列表 +export function getMaintenanceNoticeList(params) { + return request({ + url: "/maintenance-notice/list", + method: "get", + params, + }); +} + +// 生成养护通知单 +export function addMaintenanceNotice(data) { + return request({ + url: "/maintenance-notice/create", + method: "post", + data, + }); +} + +// 根据id查询养护通知单 +export function getMaintenanceNoticeById(params) { + return request({ + url: `/maintenance-notice/getNoticeByDefectId`, + method: "get", + params, + }); +} diff --git a/src/api/xj/subscription.js b/src/api/xj/subscription.js new file mode 100644 index 0000000..0634819 --- /dev/null +++ b/src/api/xj/subscription.js @@ -0,0 +1,44 @@ +/* + * @Author: SunTao 328867980@qq.com + * @Date: 2024-11-20 11:58:33 + * @LastEditors: SunTao 328867980@qq.com + * @LastEditTime: 2024-11-20 15:49:28 + * @FilePath: \znxjxt-ui\src\api\xj\subscription.js + * @Description: 订阅中心相关接口 + */ + +import request from "@/utils/request"; + +/** + * @description: 获取订阅列表 + * @return {Promise} + */ +export const getSubscriptionList = (data) => { + return request({ + url: "/subscriptions/list", + method: "get", + params: data, + }); +}; + +/** + * @description: 订阅 + */ +export const subscribe = (data) => { + return request({ + url: "/subscriptions/add", + method: "post", + data, + }); +}; + +/** + * @description: 取消订阅 + */ +export const unsubscribe = (data) => { + return request({ + url: "/subscriptions/remove", + method: "post", + data, + }); +}; diff --git a/src/components/map/fssm-map.vue b/src/components/map/fssm-map.vue index 04ad10a..f5b2453 100644 --- a/src/components/map/fssm-map.vue +++ b/src/components/map/fssm-map.vue @@ -52,13 +52,7 @@ import { Tile as TileLayer } from "ol/layer"; import { defaults as defaultControls } from "ol/control"; import VectorLayer from "ol/layer/Vector"; import { Vector as VectorSource } from "ol/source"; -import { - Draw, - Modify, - Select, - Snap, - defaults as defaultInteractions, -} from "ol/interaction"; +import { Draw, Modify, Select, Snap } from "ol/interaction"; import * as styleExports from "ol/style"; import { Polygon, LineString } from "ol/geom"; @@ -117,7 +111,7 @@ export default { default: () => [], }, // 接收传过来的绘制线段数组 - editCoordinatesLine:{ + editCoordinatesLine: { type: Array, default: () => [], }, @@ -460,7 +454,7 @@ export default { }); modify.on("modifyend", (e) => { console.log(11111111); - + e.features.forEach((feature) => { this.drawMarkers = feature.getGeometry().getCoordinates().flat(); this.$emit("endEoordinate", this.drawMarkers); @@ -635,7 +629,7 @@ export default { * @description: 删除绘制线段功能 * @return {*} */ - deleteLinedraw(){ + deleteLinedraw() { const map = this.instance.get("map"); map.removeInteraction(this.drawLine); this.drawLineLayer.getSource().clear(); diff --git a/src/views/big-screen/components/img-dialog.vue b/src/views/big-screen/components/img-dialog.vue index 97f1cbd..cd28914 100644 --- a/src/views/big-screen/components/img-dialog.vue +++ b/src/views/big-screen/components/img-dialog.vue @@ -153,25 +153,12 @@ {{ item.stakeStart || "暂无数据" }} 终止桩号: {{ item.stakeEnd || "暂无数据" }} 病害类型: - {{ item.type || "暂无数据" }} 病害面积:{{ item.area }}平方米 - 病害长度{{ item.length }}米 + {{ item.type || "暂无数据" }} + + 病害面积:{{ item.area }}平方米 病害长度{{ item.length }}米 + + -
@@ -511,7 +511,10 @@ export default { // this.initWebSocket(); }, methods: { - /* 获取当前时间 */ + /** + * @description: 获取当前时间 + * @return {*} + */ setTime() { this.timeFlag = setInterval(() => { const weekMap = [ @@ -544,7 +547,10 @@ export default { }, 1000); }, - /* 获取消息中心数据 */ + /** + * @description: 获取消息中心数据 + * @return {void} + */ getMessageList() { // getMessageList().then(({ code, data }) => { // if (code === 200) { @@ -592,7 +598,10 @@ export default { this.$router.push("/inspection_warn/warning-center"); }, - /* 获取数据栏右上角选项数据 */ + /** + * @description: 获取数据栏右上角选项数据 + * @return {void} + */ getSelect() { selectTypeList().then(({ code, data }) => { if (code === 200) { @@ -600,8 +609,11 @@ export default { } }); }, - - /* 获取路段下拉数据 */ + + /** + * @description: 获取路段下拉数据 + * @return {void} + */ getRoadList() { getRoadListTypes().then(({ code, data }) => { if (code === 200) { @@ -610,7 +622,10 @@ export default { }); }, - /* 获取图片背景左上角病害类型下拉 */ + /** + * @description: 获取图片背景左上角病害类型下拉 + * @return {void} + */ getDieaseTypeList() { getDefectTypes().then(({ code, data }) => { if (code === 200) { @@ -619,7 +634,10 @@ export default { }); }, - /* 获取图片背景下坐标数据 */ + /** + * @description: 获取图片背景下坐标数据 + * @return {void} + */ getMapCare(value) { const data = { classType: value ? value[0] : "", @@ -632,7 +650,10 @@ export default { }); }, - /* 点击病害日志详情打开弹窗进行地图打点 */ + /** + * @description: 点击病害日志详情打开弹窗进行地图打点 + * @return {void} + */ getimagePoint(item) { this.imgTitle = "查看"; this.imageItem = item; @@ -650,20 +671,29 @@ export default { this.getCenterPiont(); }, - /* 关闭图片查看弹窗 */ + /** + * @description: 关闭图片查看弹窗 + * @return {void} + */ imgCancel() { this.imgTitle = ""; this.imageItem = {}; this.imgVisible = false; }, - /* 关闭查看点位大图弹窗 */ + /** + * @description: 关闭查看点位大图弹窗 + * @return {void} + */ screenImgCancel() { this.$refs.roadMap.removeSelectClick(); this.showImageDialog = false; }, - /* 切换icon类型多选框事件 */ + /** + * @description: 切换icon类型多选框事件 + * @return {void} + */ handleChecked(value) { this.centerPiont = this.drawPointList.filter( (item) => value.indexOf(item.iconType) > -1 @@ -676,7 +706,10 @@ export default { }); }, - /* 获取地图点位信息 */ + /** + * @description: 获取地图点位信息 + * @return {void} + */ getCenterPiont() { // 如果当前已经有打点坐标 if (this.clusters) { @@ -719,7 +752,10 @@ export default { }); }, - /* 绘制地图点位 */ + /** + * @description: 绘制地图点位 + * @return {void} + */ drawPoint() { const features = []; this.centerPiont.forEach((element) => { @@ -815,7 +851,10 @@ export default { }); }, - /* 获取地图线段点位信息 */ + /** + * @description: 获取地图线段点位信息 + * @return {void} + */ getLinePoint() { if (!this.markLayerLines) { mapPciList().then(({ code, data }) => { @@ -827,7 +866,10 @@ export default { } }, - /* 绘制地图线段 */ + /** + * @description: 绘制地图线段 + * @return {void} + */ drawLine() { const features = []; this.lineString.forEach((element) => { @@ -856,6 +898,16 @@ export default { color: "#ffffff", }), }), + // text: new Text({ + // text: "121454", + // color: "#ffffff", + // textAlign: "center", //位置 + // textBaseline: "middle", + // offsetY: 0, + // fill: new Fill({ + // color: "#ffffff", + // }), + // }), }), ]); features.push(line); @@ -875,7 +927,11 @@ export default { }); }, - /* 地图线段颜色区分 */ + /** + * @description: 地图线段颜色区分 + * @param {number} value + * @return {string} + */ getLineColor(value) { if (value > 92) { return "#0ABE67"; @@ -889,8 +945,12 @@ export default { return "#E64548"; } }, - - /* 地图下方4图标类别切换点击事件 */ + + /** + * @description: 地图下方4图标类别切换点击事件 + * @param {string} value + * @return {void} + */ changeIconType(value) { if (this.bottomTipClick !== value) { this.bottomTipClick = value; @@ -908,7 +968,10 @@ export default { } }, - /* 获取icon多选数据 */ + /** + * @description: 获取icon多选数据 + * @return {void} + */ getIconType() { this.mapLogeList = {}; getItemTypes({ @@ -927,7 +990,11 @@ export default { }); }, - /* 传回来的地图图层 */ + /** + * @description: 传回来的地图图层 + * @param {number} zoom + * @return {void} + */ getZoom(zoom) { this.mapZoom = zoom; if (this.clusters && zoom * 1 > 15) { @@ -937,7 +1004,11 @@ export default { } }, - /* 地图选中feature事件 */ + /** + * @description: 地图选中feature事件 + * @param {object} e + * @return {void} + */ featureSelect(e) { const map = this.$refs.roadMap.instance.get("map"); const selectedFeatures = e.selected; @@ -970,7 +1041,11 @@ export default { } }, - /* 数据栏切换事件 */ + /** + * @description: 数据栏切换事件 + * @param {object} item + * @return {void} + */ changeElement(item) { if (this.elementDiv !== item) { this.elementDiv = item.component; @@ -1137,12 +1212,18 @@ export default { } }, - /* 跳转系统首页 */ + /** + * @description: 跳转系统首页 + * @return {void} + */ goIndex() { this.$router.push("/index"); }, - /* 图片位置信息获取 */ + /** + * @description: 图片位置信息获取 + * @return {void} + */ updateScreenRects() { 1; this.screenRects = []; @@ -1158,7 +1239,14 @@ export default { ]; }, - /* 图片红框位置 */ + /** + * @description: 图片红框位置 + * @param {object} left + * @param {object} top + * @param {object} width + * @param {object} height + * @return {object} + */ getScreenRectStyle({ left, top, width, height }) { const image = this.$refs.mainImage; const container = this.$refs.imageContainer; @@ -1185,7 +1273,10 @@ export default { }; }, - /* 初始化websocket */ + /** + * @description: 初始化websocket + * @return {void} + */ initWebSocket() { const url = `ws://192.168.1.188:8080/websocket?token=${getToken()}`; const data = { type: "carLocation", status: true }; @@ -1202,7 +1293,10 @@ export default { ); }, - /* 发送消息 */ + /** + * @description: 发送消息 + * @return {void} + */ sendMsg() { sendMsg(5555); //value是发送的值 // this.value = ""; diff --git a/src/views/xj/document/maintenance-notice/components/edit-dialog.vue b/src/views/xj/document/maintenance-notice/components/edit-dialog.vue index 3477f00..2b01615 100644 --- a/src/views/xj/document/maintenance-notice/components/edit-dialog.vue +++ b/src/views/xj/document/maintenance-notice/components/edit-dialog.vue @@ -19,7 +19,6 @@ @@ -47,7 +45,6 @@ @@ -56,21 +53,21 @@ - + - +
@@ -78,7 +75,7 @@ type="textarea" resize="none" placeholder="请输入养护内容" - v-model="editForm.content[index]" + v-model="editForm.taskDescription[index]" /> @@ -107,13 +104,26 @@ diff --git a/src/views/xj/document/maintenance-notice/index.vue b/src/views/xj/document/maintenance-notice/index.vue index f3c9421..cb04a36 100644 --- a/src/views/xj/document/maintenance-notice/index.vue +++ b/src/views/xj/document/maintenance-notice/index.vue @@ -10,6 +10,7 @@
+ {{ item.title }} - + + - - - + + + + + + + + + + + + @@ -271,7 +332,12 @@ @@ -521,6 +716,7 @@ export default { width: 100%; height: calc(100vh - 5.4rem); padding: 1rem; + overflow-y: auto; } /* 分页样式 */ @@ -530,4 +726,27 @@ export default { padding-top: 1rem; justify-content: flex-end; } + +/* 查看大图弹窗 */ +.image-container { + position: relative; + width: 100%; + height: 80%; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +} + +.image-container img { + max-width: 100%; + max-height: 100%; + object-fit: contain; +} + +.rect-overlay { + position: absolute; + pointer-events: none; + border: 2px solid red; +} diff --git a/src/views/xj/inspection/confirmation-management/index.vue b/src/views/xj/inspection/confirmation-management/index.vue index 97ff7fb..44a70b9 100644 --- a/src/views/xj/inspection/confirmation-management/index.vue +++ b/src/views/xj/inspection/confirmation-management/index.vue @@ -251,7 +251,11 @@ /> - + + +