fix:养护通知单功能

This commit is contained in:
SunTao 2025-02-12 13:23:22 +08:00
parent 8f64f82359
commit d973853a49
2 changed files with 41 additions and 9 deletions

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com
* @Date: 2024-11-20 11:58:33
* @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2025-02-11 16:44:38
* @LastEditTime: 2025-02-12 13:16:22
* @FilePath: \znxjxt-ui\src\views\xj\document\maintenance-notice\components\edit-dialog.vue
* @Description: 养护通知单编辑弹窗
-->
@ -184,7 +184,7 @@
</el-table-column>
</el-table>
<!-- 地图 -->
<fssm-map v-if="!mapTip" @map-zoom="getZoom" ref="diseaseMap"></fssm-map>
<fssm-map ref="diseaseMap" v-if="!mapTip" @map-zoom="getZoom" @feature-select="featureSelect"></fssm-map>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
@ -392,8 +392,6 @@ export default {
mapTip: true,
//
checkedDiseaseList: [],
//
centerPiont: [],
//
clusters: null,
//
@ -488,9 +486,6 @@ export default {
}
return [];
});
this.centerPiont = this.checkedDiseaseList.map((item) => {
return { coordinates: item.coordinates, defectTypeName: item.defectTypeName };
});
this.$nextTick(() => {
this.fitMapToPoints(pointArray);
this.drawPoint();
@ -547,7 +542,7 @@ export default {
*/
drawPoint() {
const features = [];
this.centerPiont.forEach((element) => {
this.checkedDiseaseList.forEach((element) => {
//
const point = new Point(element.coordinates);
const feature = new Feature({
@ -589,7 +584,7 @@ export default {
font: "normal 14px 微软雅黑",
offsetY: -40,
fill: new Fill({
color: "#ffffff",
color: "black",
}),
text: count.toString(),
}),
@ -627,6 +622,39 @@ export default {
});
},
/**
* @description: 点击地图图标事件
* @param {*}
* @return {*}
*/
featureSelect(e) {
const map = this.$refs.diseaseMap.instance.get("map");
const selectedFeatures = e.selected;
if (selectedFeatures.length > 0) {
let feature = selectedFeatures[0];
let features = feature.get("features");
if (features.length === 1) {
//
//
//
const selectFeature = feature.getProperties().features[0];
console.log(selectFeature, "点位");
//
this.currentImageItem = selectFeature.get("data");
this.showImageDialog = true;
// console.log(selectFeature.get("data"));
} else {
//
//
map.getView().animate({
center: feature.getGeometry().getCoordinates(),
zoom: map.getView().getZoom() + 1,
});
}
}
},
/**
* @description: 选择病害弹窗
* @param {*}
@ -724,6 +752,9 @@ export default {
* @return {*}
*/
imgCancel() {
if (this.$refs.diseaseMap) {
this.$refs.diseaseMap.removeSelectClick();
}
this.showImageDialog = false;
this.currentImageItem = {};
this.rects = [];

View File

@ -169,6 +169,7 @@
>
<el-option label="确认" value="2" />
<el-option label="未确认" value="1" />
<el-option label="不是病害" value="3" />
</el-select>
</el-form-item>
<el-form-item>