fix:养护通知单功能
This commit is contained in:
parent
8f64f82359
commit
d973853a49
@ -2,7 +2,7 @@
|
|||||||
* @Author: SunTao 328867980@qq.com
|
* @Author: SunTao 328867980@qq.com
|
||||||
* @Date: 2024-11-20 11:58:33
|
* @Date: 2024-11-20 11:58:33
|
||||||
* @LastEditors: SunTao 328867980@qq.com
|
* @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
|
* @FilePath: \znxjxt-ui\src\views\xj\document\maintenance-notice\components\edit-dialog.vue
|
||||||
* @Description: 养护通知单编辑弹窗
|
* @Description: 养护通知单编辑弹窗
|
||||||
-->
|
-->
|
||||||
@ -184,7 +184,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -392,8 +392,6 @@ export default {
|
|||||||
mapTip: true,
|
mapTip: true,
|
||||||
// 已选病害列表
|
// 已选病害列表
|
||||||
checkedDiseaseList: [],
|
checkedDiseaseList: [],
|
||||||
// 病害点位
|
|
||||||
centerPiont: [],
|
|
||||||
// 点位图层
|
// 点位图层
|
||||||
clusters: null,
|
clusters: null,
|
||||||
// 地图图层层级
|
// 地图图层层级
|
||||||
@ -488,9 +486,6 @@ export default {
|
|||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
this.centerPiont = this.checkedDiseaseList.map((item) => {
|
|
||||||
return { coordinates: item.coordinates, defectTypeName: item.defectTypeName };
|
|
||||||
});
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.fitMapToPoints(pointArray);
|
this.fitMapToPoints(pointArray);
|
||||||
this.drawPoint();
|
this.drawPoint();
|
||||||
@ -547,7 +542,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
drawPoint() {
|
drawPoint() {
|
||||||
const features = [];
|
const features = [];
|
||||||
this.centerPiont.forEach((element) => {
|
this.checkedDiseaseList.forEach((element) => {
|
||||||
// 修改坐标样式
|
// 修改坐标样式
|
||||||
const point = new Point(element.coordinates);
|
const point = new Point(element.coordinates);
|
||||||
const feature = new Feature({
|
const feature = new Feature({
|
||||||
@ -589,7 +584,7 @@ export default {
|
|||||||
font: "normal 14px 微软雅黑",
|
font: "normal 14px 微软雅黑",
|
||||||
offsetY: -40,
|
offsetY: -40,
|
||||||
fill: new Fill({
|
fill: new Fill({
|
||||||
color: "#ffffff",
|
color: "black",
|
||||||
}),
|
}),
|
||||||
text: count.toString(),
|
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: 选择病害弹窗
|
* @description: 选择病害弹窗
|
||||||
* @param {*}
|
* @param {*}
|
||||||
@ -724,6 +752,9 @@ export default {
|
|||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
imgCancel() {
|
imgCancel() {
|
||||||
|
if (this.$refs.diseaseMap) {
|
||||||
|
this.$refs.diseaseMap.removeSelectClick();
|
||||||
|
}
|
||||||
this.showImageDialog = false;
|
this.showImageDialog = false;
|
||||||
this.currentImageItem = {};
|
this.currentImageItem = {};
|
||||||
this.rects = [];
|
this.rects = [];
|
||||||
|
|||||||
@ -169,6 +169,7 @@
|
|||||||
>
|
>
|
||||||
<el-option label="确认" value="2" />
|
<el-option label="确认" value="2" />
|
||||||
<el-option label="未确认" value="1" />
|
<el-option label="未确认" value="1" />
|
||||||
|
<el-option label="不是病害" value="3" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user