fix:去除大屏病害状态,修改大屏线段中心点
This commit is contained in:
		
							parent
							
								
									b96dcf1cbe
								
							
						
					
					
						commit
						cdfbc4cb9b
					
				| @ -2,7 +2,7 @@ | |||||||
|  * @Author: SunTao 328867980@qq.com |  * @Author: SunTao 328867980@qq.com | ||||||
|  * @Date: 2024-10-14 10:46:23 |  * @Date: 2024-10-14 10:46:23 | ||||||
|  * @LastEditors: SunTao 328867980@qq.com |  * @LastEditors: SunTao 328867980@qq.com | ||||||
|  * @LastEditTime: 2024-12-23 11:07:04 |  * @LastEditTime: 2024-12-23 17:37:59 | ||||||
|  * @FilePath: \znxjxt-ui\src\components\map\fssm-map.vue |  * @FilePath: \znxjxt-ui\src\components\map\fssm-map.vue | ||||||
|  * @Description: 公共地图 |  * @Description: 公共地图 | ||||||
| --> | --> | ||||||
| @ -389,7 +389,10 @@ export default { | |||||||
|           // 获取弹窗数据 |           // 获取弹窗数据 | ||||||
|           const popupData = feature.get("data"); |           const popupData = feature.get("data"); | ||||||
|           // 获取弹窗内元素并赋值 |           // 获取弹窗内元素并赋值 | ||||||
|           this.$refs.popupContent.innerHTML = `<span>路段名称:</span><span>${popupData.name}</span><br/><span>病害数:</span><span>${popupData.count}个</span><br/><span>起始桩号:</span><span>${popupData.stakeStart}</span><br/><span>终止桩号:</span><span>${popupData.stakeEnd}</span>`; |           this.$refs.popupContent.innerHTML = `<span>路段名称:</span><span>${popupData.name}</span><br/> | ||||||
|  |           <span>病害数:</span><span>${popupData.count}个</span><br/> | ||||||
|  |           <span>起始桩号:</span><span>${popupData.stakeStart}</span><br/> | ||||||
|  |           <span>终止桩号:</span><span>${popupData.stakeEnd}</span>`; | ||||||
|           dislogLay.setPosition(coordinate); |           dislogLay.setPosition(coordinate); | ||||||
|         } else { |         } else { | ||||||
|           dislogLay.setPosition(undefined); |           dislogLay.setPosition(undefined); | ||||||
| @ -413,7 +416,7 @@ export default { | |||||||
|         this.$emit("map-moveend", zoom); |         this.$emit("map-moveend", zoom); | ||||||
|       }); |       }); | ||||||
|       // 图层选择事件 |       // 图层选择事件 | ||||||
|       this.selectSingClick = new Select({ style: null }); |       this.selectSingClick = new Select(); | ||||||
|       map.addInteraction(this.selectSingClick); |       map.addInteraction(this.selectSingClick); | ||||||
|       this.selectSingClick.on("select", (e) => { |       this.selectSingClick.on("select", (e) => { | ||||||
|         this.$emit("feature-select", e); |         this.$emit("feature-select", e); | ||||||
| @ -825,14 +828,20 @@ export default { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 地图弹窗样式 |   // 地图弹窗样式 | ||||||
|   .ol-popup > div { |   .ol-popup{ | ||||||
|     padding: 0.5rem; |     width:10rem; | ||||||
|     box-sizing: border-box; |     position: absolute; | ||||||
|     background: rgba(79, 79, 79, 0.7); |     margin: 0.5rem; | ||||||
|     border-radius: 0.2rem; | 
 | ||||||
|     border: 1px solid #3976f1; |     > div { | ||||||
|     font-size: 0.7rem; |       padding: 0.5rem; | ||||||
|     color: #ffffff; |       box-sizing: border-box; | ||||||
|  |       background: rgba(79, 79, 79, 0.7); | ||||||
|  |       border-radius: 0.2rem; | ||||||
|  |       border: 1px solid #3976f1; | ||||||
|  |       font-size: 0.7rem; | ||||||
|  |       color: #ffffff; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 放大缩小控件 |   // 放大缩小控件 | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|  * @Author: SunTao 328867980@qq.com |  * @Author: SunTao 328867980@qq.com | ||||||
|  * @Date: 2024-11-08 11:56:02 |  * @Date: 2024-11-08 11:56:02 | ||||||
|  * @LastEditors: SunTao 328867980@qq.com |  * @LastEditors: SunTao 328867980@qq.com | ||||||
|  * @LastEditTime: 2024-12-23 13:23:20 |  * @LastEditTime: 2024-12-24 09:07:12 | ||||||
|  * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\traffic-log.vue |  * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\traffic-log.vue | ||||||
|  * @Description: 病害巡检-病害日志 |  * @Description: 病害巡检-病害日志 | ||||||
| --> | --> | ||||||
| @ -112,21 +112,6 @@ | |||||||
|               /> |               /> | ||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|           <el-form-item class="form-item" label="病害状态" prop="state"> |  | ||||||
|             <el-select |  | ||||||
|               v-model="trafficForm.state" |  | ||||||
|               popper-class="screen-select" |  | ||||||
|               placeholder="请选择病害状态" |  | ||||||
|               clearable |  | ||||||
|             > |  | ||||||
|               <el-option |  | ||||||
|                 v-for="item in defectStatus" |  | ||||||
|                 :key="item.value" |  | ||||||
|                 :label="item.label" |  | ||||||
|                 :value="item.value" |  | ||||||
|               /> |  | ||||||
|             </el-select> |  | ||||||
|           </el-form-item> |  | ||||||
|         </el-form> |         </el-form> | ||||||
|       </fssm-scroll> |       </fssm-scroll> | ||||||
|     </div> |     </div> | ||||||
| @ -146,7 +131,8 @@ | |||||||
|         style="width: 100%; background: none" |         style="width: 100%; background: none" | ||||||
|         height="85%" |         height="85%" | ||||||
|       > |       > | ||||||
|         <el-table-column prop="defectType" label="病害类型"> </el-table-column> |         <el-table-column prop="defectType" width="100" label="病害类型"> | ||||||
|  |         </el-table-column> | ||||||
|         <el-table-column |         <el-table-column | ||||||
|           prop="segmentName" |           prop="segmentName" | ||||||
|           show-overflow-tooltip |           show-overflow-tooltip | ||||||
| @ -155,12 +141,7 @@ | |||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column show-overflow-tooltip prop="companyName" label="所属"> |         <el-table-column show-overflow-tooltip prop="companyName" label="所属"> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
|         <el-table-column prop="state" label="病害状态"> |         <el-table-column width="70" prop="pci" label="操作"> | ||||||
|           <template slot-scope="scope"> |  | ||||||
|             {{ scope.row.state === "2" ? "已修复" : "未修复" }} |  | ||||||
|           </template> |  | ||||||
|         </el-table-column> |  | ||||||
|         <el-table-column width="50" prop="pci" label="操作"> |  | ||||||
|           <template slot-scope="scope"> |           <template slot-scope="scope"> | ||||||
|             <el-button |             <el-button | ||||||
|               slot="reference" |               slot="reference" | ||||||
| @ -204,10 +185,10 @@ export default { | |||||||
|       default: "", |       default: "", | ||||||
|     }, |     }, | ||||||
|     // 各个种类下详细的病害类型 |     // 各个种类下详细的病害类型 | ||||||
|     eventType:{ |     eventType: { | ||||||
|       type: Array, |       type: Array, | ||||||
|       default: ()=>[], |       default: () => [], | ||||||
|     } |     }, | ||||||
|   }, |   }, | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
| @ -224,8 +205,6 @@ export default { | |||||||
|         stakeEnd: "", |         stakeEnd: "", | ||||||
|         // 病害类型 |         // 病害类型 | ||||||
|         defectType: "", |         defectType: "", | ||||||
|         // 病害状态 |  | ||||||
|         state: "", |  | ||||||
|       }, |       }, | ||||||
|       // 时间选择筛选 |       // 时间选择筛选 | ||||||
|       dateTime: [], |       dateTime: [], | ||||||
| @ -235,13 +214,6 @@ export default { | |||||||
|       lineList: [], |       lineList: [], | ||||||
|       // 路段名称下拉数据 |       // 路段名称下拉数据 | ||||||
|       segmentList: [], |       segmentList: [], | ||||||
|       // 病害类型下拉数据 |  | ||||||
|       // eventType: [], |  | ||||||
|       // 病害状态下拉数据 |  | ||||||
|       defectStatus: [ |  | ||||||
|         { label: "已修复", value: "2" }, |  | ||||||
|         { label: "未修复", value: "1" }, |  | ||||||
|       ], |  | ||||||
|       // 事件列表 |       // 事件列表 | ||||||
|       emergencyList: [], |       emergencyList: [], | ||||||
|       // 分页数据绑定 |       // 分页数据绑定 | ||||||
| @ -257,7 +229,6 @@ export default { | |||||||
|     bottomTipClick: { |     bottomTipClick: { | ||||||
|       handler() { |       handler() { | ||||||
|         this.trafficForm.defectType = ""; |         this.trafficForm.defectType = ""; | ||||||
|         // this.getAllDefectType(); |  | ||||||
|         this.getData(); |         this.getData(); | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
| @ -265,7 +236,6 @@ export default { | |||||||
|   mounted() { |   mounted() { | ||||||
|     this.getData(); |     this.getData(); | ||||||
|     this.getLineList(); |     this.getLineList(); | ||||||
|     // this.getAllDefectType(); |  | ||||||
|     this.getSegmentList(); |     this.getSegmentList(); | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
| @ -305,19 +275,6 @@ export default { | |||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     // /** |  | ||||||
|     //  * @description: 获取病害类型下拉数据 |  | ||||||
|     //  * @param {*} |  | ||||||
|     //  * @return {*} |  | ||||||
|     //  */ |  | ||||||
|     // getAllDefectType() { |  | ||||||
|     //   DefectType({ classType: this.bottomTipClick }).then(({ code, data }) => { |  | ||||||
|     //     if (code === 200) { |  | ||||||
|     //       this.eventType = data; |  | ||||||
|     //     } |  | ||||||
|     //   }); |  | ||||||
|     // }, |  | ||||||
| 
 |  | ||||||
|     /** |     /** | ||||||
|      * @description: 点击搜索事件 |      * @description: 点击搜索事件 | ||||||
|      * @param {*} |      * @param {*} | ||||||
| @ -382,8 +339,6 @@ export default { | |||||||
|         stakeEnd: "", |         stakeEnd: "", | ||||||
|         // 病害类型 |         // 病害类型 | ||||||
|         defectType: "", |         defectType: "", | ||||||
|         // 病害状态 |  | ||||||
|         state: "", |  | ||||||
|       }; |       }; | ||||||
|       this.dateTime = []; |       this.dateTime = []; | ||||||
|       this.segmentList = []; |       this.segmentList = []; | ||||||
| @ -443,7 +398,7 @@ export default { | |||||||
| 
 | 
 | ||||||
|   .traffic-form { |   .traffic-form { | ||||||
|     width: calc(100% - 0.5rem); |     width: calc(100% - 0.5rem); | ||||||
|     height: 22rem; |     height: 19rem; | ||||||
|     padding: 0.5rem; |     padding: 0.5rem; | ||||||
| 
 | 
 | ||||||
|     .form-item { |     .form-item { | ||||||
| @ -530,7 +485,7 @@ export default { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   .form-btn { |   .form-btn { | ||||||
|     height: 4%; |     height: 5%; | ||||||
|     width: 100%; |     width: 100%; | ||||||
|     display: flex; |     display: flex; | ||||||
|     justify-content: flex-end; |     justify-content: flex-end; | ||||||
| @ -569,7 +524,7 @@ export default { | |||||||
| 
 | 
 | ||||||
|   ::v-deep .traffic-table { |   ::v-deep .traffic-table { | ||||||
|     width: 100%; |     width: 100%; | ||||||
|     height: 42%; |     height: 50%; | ||||||
|     padding: 0.5rem 0; |     padding: 0.5rem 0; | ||||||
|     overflow: hidden; |     overflow: hidden; | ||||||
| 
 | 
 | ||||||
| @ -646,6 +601,7 @@ export default { | |||||||
| 
 | 
 | ||||||
| // 按钮样式 | // 按钮样式 | ||||||
| .btn-submit { | .btn-submit { | ||||||
|  |   height: 2rem; | ||||||
|   background-color: transparent; |   background-color: transparent; | ||||||
|   background-image: url("~@/assets/screen/index/btn-submit.png"); |   background-image: url("~@/assets/screen/index/btn-submit.png"); | ||||||
|   background-repeat: no-repeat; |   background-repeat: no-repeat; | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|  * @Author: SunTao 328867980@qq.com |  * @Author: SunTao 328867980@qq.com | ||||||
|  * @Date: 2024-10-17 11:34:00 |  * @Date: 2024-10-17 11:34:00 | ||||||
|  * @LastEditors: SunTao 328867980@qq.com |  * @LastEditors: SunTao 328867980@qq.com | ||||||
|  * @LastEditTime: 2024-12-23 14:29:26 |  * @LastEditTime: 2024-12-24 11:20:36 | ||||||
|  * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue |  * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue | ||||||
|  * @Description: 大屏首页 |  * @Description: 大屏首页 | ||||||
| --> | --> | ||||||
| @ -432,6 +432,8 @@ import VectorLayer from "ol/layer/Vector"; | |||||||
| import * as geomExports from "ol/geom"; | import * as geomExports from "ol/geom"; | ||||||
| import Cluster from "ol/source/Cluster"; | import Cluster from "ol/source/Cluster"; | ||||||
| import logo from "@/assets/xc.png"; | import logo from "@/assets/xc.png"; | ||||||
|  | import { getCenter } from "ol/extent"; | ||||||
|  | import MultiLineString from "ol/geom/MultiLineString"; | ||||||
| // 组件 | // 组件 | ||||||
| import ModuleBlock from "./module-block.vue"; | import ModuleBlock from "./module-block.vue"; | ||||||
| import TodayInspection from "./overview-components/today-inspection.vue"; | import TodayInspection from "./overview-components/today-inspection.vue"; | ||||||
| @ -622,6 +624,8 @@ export default { | |||||||
|       clusters: null, |       clusters: null, | ||||||
|       // 线段图层 |       // 线段图层 | ||||||
|       markLayerLines: null, |       markLayerLines: null, | ||||||
|  |       // 是否需要修改地图中心点 | ||||||
|  |       isCenterCalculated: false, | ||||||
| 
 | 
 | ||||||
|       // 图片弹窗标题 |       // 图片弹窗标题 | ||||||
|       imgTitle: "查看", |       imgTitle: "查看", | ||||||
| @ -847,6 +851,7 @@ export default { | |||||||
|       this.showMap = false; |       this.showMap = false; | ||||||
|       this.markLayerLines = null; |       this.markLayerLines = null; | ||||||
|       this.companyId = null; |       this.companyId = null; | ||||||
|  |       this.isCenterCalculated = false; | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -1011,7 +1016,7 @@ export default { | |||||||
|                 src: require(`@/assets/screen/index/${ |                 src: require(`@/assets/screen/index/${ | ||||||
|                   this.mapLogeList[ |                   this.mapLogeList[ | ||||||
|                     feature.getProperties().features[0].get("data").iconType |                     feature.getProperties().features[0].get("data").iconType | ||||||
|                   ] |                   ] || "龟裂" | ||||||
|                 }.png`), |                 }.png`), | ||||||
|                 // 图标缩放比例 |                 // 图标缩放比例 | ||||||
|                 scale: 0.6, |                 scale: 0.6, | ||||||
| @ -1077,6 +1082,39 @@ export default { | |||||||
|           this.mapLegendList = data.basLinetypeSetting; |           this.mapLegendList = data.basLinetypeSetting; | ||||||
|           this.lineString = data.lines; |           this.lineString = data.lines; | ||||||
|           this.drawLine(); |           this.drawLine(); | ||||||
|  |           // 修改地图中心点 | ||||||
|  |           if (!this.isCenterCalculated) { | ||||||
|  |             const lineArray = data.lines.map((item) => { | ||||||
|  |               return JSON.parse(item.line).map((it) => { | ||||||
|  |                 return [it.lon, it.lat]; | ||||||
|  |               }); | ||||||
|  |             }); | ||||||
|  |             // 创建 MultiLineString 对象 | ||||||
|  |             const multiLine = new MultiLineString(lineArray); | ||||||
|  |             // 获取 MultiLineString 的边界框(extent) | ||||||
|  |             const extent = multiLine.getExtent(); | ||||||
|  |             // 计算边界框的中心点 | ||||||
|  |             const center = getCenter(extent); | ||||||
|  |             if (this.showMap) { | ||||||
|  |               this.$nextTick(() => { | ||||||
|  |                 const map = this.$refs.overViewMap.instance.get("map"); | ||||||
|  |                 map.getView().animate({ | ||||||
|  |                   center, | ||||||
|  |                   duration: 500, | ||||||
|  |                 }); | ||||||
|  |               }); | ||||||
|  |             } else { | ||||||
|  |               this.$nextTick(() => { | ||||||
|  |                 const map = this.$refs.roadMap.instance.get("map"); | ||||||
|  |                 // map.getView().setCenter(center); | ||||||
|  |                 map.getView().animate({ | ||||||
|  |                   center, | ||||||
|  |                   duration: 500, | ||||||
|  |                 }); | ||||||
|  |               }); | ||||||
|  |             } | ||||||
|  |             this.isCenterCalculated = true; | ||||||
|  |           } | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
| @ -1275,6 +1313,8 @@ export default { | |||||||
|         // 清除已经点击的公司 |         // 清除已经点击的公司 | ||||||
|         this.companyId = null; |         this.companyId = null; | ||||||
|         if (item.component === "OverviewScreen") { |         if (item.component === "OverviewScreen") { | ||||||
|  |           // 将线段中心点修改标识置为false | ||||||
|  |           this.isCenterCalculated = false; | ||||||
|           /* 清空线段图层 */ |           /* 清空线段图层 */ | ||||||
|           this.markLayerLines = null; |           this.markLayerLines = null; | ||||||
|           this.leftModuleList = [ |           this.leftModuleList = [ | ||||||
| @ -1373,6 +1413,8 @@ export default { | |||||||
|               class: "twe", |               class: "twe", | ||||||
|             }, |             }, | ||||||
|           ]; |           ]; | ||||||
|  |           // 将线段中心点修改标识置为false | ||||||
|  |           this.isCenterCalculated = false; | ||||||
|           // 隐藏总览地图 |           // 隐藏总览地图 | ||||||
|           this.showMap = false; |           this.showMap = false; | ||||||
|           // 发送小车位置消息 |           // 发送小车位置消息 | ||||||
| @ -1455,7 +1497,6 @@ export default { | |||||||
|             map.removeLayer(this.clusters); |             map.removeLayer(this.clusters); | ||||||
|             this.clusters = null; |             this.clusters = null; | ||||||
|             map.getView().setZoom(10); |             map.getView().setZoom(10); | ||||||
|             map.getView().setCenter([123.30297096718999, 41.87942945541742]); |  | ||||||
|           }); |           }); | ||||||
|           this.getLinePoint(); |           this.getLinePoint(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|  * @Author: SunTao 328867980@qq.com |  * @Author: SunTao 328867980@qq.com | ||||||
|  * @Date: 2024-12-17 09:18:08 |  * @Date: 2024-12-17 09:18:08 | ||||||
|  * @LastEditors: SunTao 328867980@qq.com |  * @LastEditors: SunTao 328867980@qq.com | ||||||
|  * @LastEditTime: 2024-12-23 11:44:13 |  * @LastEditTime: 2024-12-24 10:52:05 | ||||||
|  * @FilePath: \znxjxt-ui\src\views\xj\inspection-warn\warning-line\index.vue |  * @FilePath: \znxjxt-ui\src\views\xj\inspection-warn\warning-line\index.vue | ||||||
|  * @Description: 预警中心-大屏图例设置 |  * @Description: 预警中心-大屏图例设置 | ||||||
| --> | --> | ||||||
| @ -28,9 +28,9 @@ | |||||||
|       <el-table-column label="范围四" align="center" prop="s4"> |       <el-table-column label="范围四" align="center" prop="s4"> | ||||||
|         <template slot-scope="scope"> ≤{{ scope.row.s4 }} </template> |         <template slot-scope="scope"> ≤{{ scope.row.s4 }} </template> | ||||||
|       </el-table-column> |       </el-table-column> | ||||||
|       <!-- <el-table-column label="范围五" align="center" prop="s5"> |       <el-table-column label="范围五" align="center" prop="s5"> | ||||||
|         <template slot-scope="scope"> ≤{{ scope.row.s5 }} </template> |         <template slot-scope="scope"> >{{ scope.row.s4 }} </template> | ||||||
|       </el-table-column> --> |       </el-table-column> | ||||||
|       <el-table-column |       <el-table-column | ||||||
|         label="操作" |         label="操作" | ||||||
|         align="center" |         align="center" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user