|
|
@@ -33,7 +33,7 @@
|
|
|
<div class="map-center-crosshair" v-if="btn_Aim_show"></div>
|
|
|
|
|
|
<div class="tips">
|
|
|
- <div id="tipsText" @click="copyDivText('#tipsText')">位置信息:{{mouseCenter}}</div>
|
|
|
+ <span id="tipsText" @click="copyDivText('#tipsText')">位置信息:{{mouseCenter}}</span>
|
|
|
</div>
|
|
|
|
|
|
<div class="select-item" v-if="btn_data_show">
|
|
|
@@ -83,6 +83,7 @@ import { ElMessage } from "element-plus";
|
|
|
import LeftMenu from "@/components/LeftMenu.vue";
|
|
|
import VueJsonEditor from '@/components/JsonEditor.vue';
|
|
|
import Table from '@/components/Table.vue';
|
|
|
+import * as wellknown from 'wellknown';
|
|
|
import UTIL from '@/utils/util'
|
|
|
import commonAPI from '@/api/common'
|
|
|
import api from '@/api/content'
|
|
|
@@ -124,7 +125,8 @@ export default {
|
|
|
},
|
|
|
contentItem: {},
|
|
|
|
|
|
- arrParam: ["补查查询串","补查相似度","补查原因","补查匹配地址","补查点坐标","补查匹配名称","补查buffer_m","补查状态"], //过滤字段
|
|
|
+ // arrParam: ["补查查询串","补查相似度","补查原因","补查匹配地址","补查点坐标","补查匹配名称","补查buffer_m","补查状态"], //过滤字段
|
|
|
+ arrParam: webConfig.FILTER_PARAM,
|
|
|
selectText: [],
|
|
|
options: [],
|
|
|
fontText:["concat"],// "concat", ["get", "GUID"], "\n", ["get", "match_status"],"\n", ["get", "range_shape"]
|
|
|
@@ -140,26 +142,35 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
saveFeature(data){
|
|
|
- if(!data.properties.dms_id){
|
|
|
+ if(!data.properties.id){
|
|
|
ElMessage.error("请选择正确数据进行保存");
|
|
|
return;
|
|
|
}
|
|
|
let content = {};
|
|
|
- content["id"] = data.properties.dms_id;
|
|
|
+ // content["id"] = data.properties.dms_id;
|
|
|
+ // content["c_polygon"] = UTIL.geojsonToWkt(data.geometry);
|
|
|
+ // content["c_properties"] = data.properties;
|
|
|
+ // let params = {
|
|
|
+ // content: JSON.stringify(content),
|
|
|
+ // columnId: 1719,
|
|
|
+ // modelId: 1753,
|
|
|
+ // };
|
|
|
+
|
|
|
+ content = data.properties;
|
|
|
content["c_polygon"] = UTIL.geojsonToWkt(data.geometry);
|
|
|
- content["c_properties"] = data.properties;
|
|
|
let params = {
|
|
|
content: JSON.stringify(content),
|
|
|
- columnId: 1719,
|
|
|
- modelId: 1753,
|
|
|
+ columnId: 1743, // 保存到申勤项目数据的栏目ID
|
|
|
+ modelId: 1794, // 保存到申勤项目数据的模型ID
|
|
|
};
|
|
|
- console.log(params);
|
|
|
commonAPI.updateContent(params).then(res => {
|
|
|
if(res.code == 200){
|
|
|
ElMessage.success("保存成功");
|
|
|
- this.getVectorData();
|
|
|
+ // this.getVectorData();
|
|
|
+ this.getDmsData();
|
|
|
// 清空绘制工具
|
|
|
- this.mapEditDraw.clearAll();
|
|
|
+ // this.mapEditDraw.clearAll();
|
|
|
+ this.closeJsonEditor();
|
|
|
}else{
|
|
|
ElMessage.error(res.msg);
|
|
|
}
|
|
|
@@ -244,8 +255,6 @@ export default {
|
|
|
modelId: webConfig.columnArr[0].mid, // 申勤员工ID
|
|
|
};
|
|
|
api.getColumnModel(requestParams).then((res) => {
|
|
|
- // console.log(res);
|
|
|
-
|
|
|
if (res.code === 200) {
|
|
|
that.columnModel = res.content;
|
|
|
that.columnModel.modelId = webConfig.columnArr[0].mid;
|
|
|
@@ -261,7 +270,6 @@ export default {
|
|
|
columnId: item.column_id,
|
|
|
contentId: item.id,
|
|
|
};
|
|
|
- // console.log(item);
|
|
|
api.getContentById(requestParams).then((data) => {
|
|
|
if (data.code === 200) {
|
|
|
that.contentItem = data.content;
|
|
|
@@ -274,13 +282,11 @@ export default {
|
|
|
//关闭编辑弹窗
|
|
|
handleEditClose(flag) {
|
|
|
const that = this;
|
|
|
- // console.log("关闭编辑弹窗",flag);
|
|
|
that.contentItem = {};
|
|
|
that.isContentShow = false;
|
|
|
that.isContentView = false;
|
|
|
if(flag){
|
|
|
let guid = sessionStorage.getItem('guid');
|
|
|
- // console.log("关闭编辑弹窗",guid);
|
|
|
that.handleMoreClick(guid,this.tableSearchText,this.page);
|
|
|
that.$parent.getDmsDataList();
|
|
|
}
|
|
|
@@ -343,19 +349,23 @@ export default {
|
|
|
that.mapEditDraw = new MapDraw.init(window.mapboxMap, {
|
|
|
// 编辑完成 → 自动接收最新图形
|
|
|
onEditComplete: (data) => {
|
|
|
- // console.log("===mapEditDraw返回数据===:", data);
|
|
|
- if(data.properties.dms_id){// 对dms_id进行判断
|
|
|
+ // if(data.properties.dms_id){// 对dms_id进行判断
|
|
|
+ if(data.properties.id){
|
|
|
that.editDataList = data;
|
|
|
+ delete that.editDataList.properties.center
|
|
|
+ delete that.editDataList.properties.checkItem
|
|
|
+ delete that.editDataList.properties.value
|
|
|
+ delete that.editDataList.properties.address
|
|
|
}
|
|
|
// 你可以在这里提交后端接口,将数据保存到数据库
|
|
|
}
|
|
|
});
|
|
|
window.mapEditDraw = that.mapEditDraw;
|
|
|
- // console.log("mapEditDraw:", that.mapEditDraw);
|
|
|
|
|
|
})
|
|
|
that.drawAreaFeature();
|
|
|
- this.getVectorData();
|
|
|
+ // this.getVectorData();
|
|
|
+ this.getDmsData();
|
|
|
},
|
|
|
|
|
|
initBaseMap(type){
|
|
|
@@ -448,17 +458,14 @@ export default {
|
|
|
});
|
|
|
// window.mapboxMap.on('click', function(e) {
|
|
|
// // that.editDataList = fet;
|
|
|
- // console.log("仅获取 click 的要素:", e);
|
|
|
// if (that.editFlag) return;
|
|
|
// // 关键:只查询 data-fill-layer,过滤掉所有其他图层
|
|
|
// const features = window.mapboxMap.queryRenderedFeatures(e.point, {
|
|
|
// layers: ['data-fill-layer'] // 只取这个图层
|
|
|
// });
|
|
|
- // // console.log("仅获取e的要素:", e);
|
|
|
// if (!features.length) return;
|
|
|
// // 现在最多只有 1 个要素 → 绝对不会乱
|
|
|
// const feature = features[0];
|
|
|
- // console.log("仅获取 feature 的要素:", feature);
|
|
|
// // 深拷贝 Geometry:绝对避免引用错乱
|
|
|
// const fet = {
|
|
|
// type: "Feature",
|
|
|
@@ -466,7 +473,6 @@ export default {
|
|
|
// properties: { ...feature.properties }
|
|
|
// };
|
|
|
|
|
|
- // // console.log("仅获取 data-fill-layer 的要素:", fet);
|
|
|
// // 以下弹窗(注意要使用 fet.properties)
|
|
|
// let str = "";
|
|
|
// for (let item in fet.properties) {
|
|
|
@@ -497,7 +503,6 @@ export default {
|
|
|
mapClickValue(e){
|
|
|
let that = this;
|
|
|
// that.editDataList = fet;
|
|
|
- // console.log("仅获取 click 的要素:", e);
|
|
|
// 关键:只查询 data-fill-layer,过滤掉所有其他图层
|
|
|
const features = window.mapboxMap.queryRenderedFeatures(e.point, {
|
|
|
layers: ['data-fill-layer'] // 只取这个图层
|
|
|
@@ -511,11 +516,9 @@ export default {
|
|
|
}
|
|
|
return;
|
|
|
};
|
|
|
- // console.log("仅获取e的要素:", e);
|
|
|
if (!features.length) return;
|
|
|
// 现在最多只有 1 个要素 → 绝对不会乱
|
|
|
const feature = features[0];
|
|
|
- // console.log("仅获取 feature 的要素:", feature);
|
|
|
// 深拷贝 Geometry:绝对避免引用错乱
|
|
|
const fet = {
|
|
|
type: "Feature",
|
|
|
@@ -523,20 +526,21 @@ export default {
|
|
|
properties: { ...feature.properties }
|
|
|
};
|
|
|
|
|
|
- // console.log("仅获取 data-fill-layer 的要素:", fet);
|
|
|
// 以下弹窗(注意要使用 fet.properties)
|
|
|
|
|
|
let str = "";
|
|
|
for (let item in fet.properties) {
|
|
|
- // console.log(item);
|
|
|
- if (UTIL.isChinese(item) && !that.arrParam.includes(item)) {
|
|
|
- str += `<p style="margin:2px 0;">${item}:${fet.properties[item]}</p>`;
|
|
|
+ // if (UTIL.isChinese(item) && !that.arrParam.includes(item)) {
|
|
|
+ // str += `<p style="margin:2px 0;">${item}:${fet.properties[item]}</p>`;
|
|
|
+ // }
|
|
|
+ if (that.arrParam.map(ev => ev.value).includes(item)) {
|
|
|
+ str += `<p style="margin:2px 0;">${that.arrParam.find(et => et.value == item).name}:${fet.properties[item]}</p>`;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const popupContent = `
|
|
|
<div style="font-size:14px;line-height:1.6;padding:10px;">
|
|
|
- <h4 style="margin:0 0 6px 0;color:#222;"><span>内容信息</span><span class="more" id="popup-more-btn">员工信息>></span></h4>
|
|
|
+ <h4 style="margin:0 0 6px 0;color:#222;"><span>内容信息</span><span style="display: ${fet.properties.c_xmygrs>0 ? 'block' : 'none'};" class="more" id="popup-more-btn">员工信息>></span></h4>
|
|
|
${str}
|
|
|
</div>
|
|
|
`;
|
|
|
@@ -557,8 +561,8 @@ export default {
|
|
|
moreBtn.addEventListener('click', () => {
|
|
|
// that.tableShow = false;
|
|
|
this.tableSearchText = "";
|
|
|
- sessionStorage.setItem('guid', fet.properties.GUID);
|
|
|
- that.handleMoreClick(fet.properties.GUID,"",0);
|
|
|
+ sessionStorage.setItem('guid', fet.properties.c_guid);
|
|
|
+ that.handleMoreClick(fet.properties.c_guid,"",0);
|
|
|
});
|
|
|
}
|
|
|
}, 0);
|
|
|
@@ -584,8 +588,6 @@ export default {
|
|
|
pageSize: that.pageSize,
|
|
|
page: that.page,
|
|
|
};
|
|
|
- // console.log("guid:", guid);
|
|
|
- // console.log("text:", text);
|
|
|
let arr = [...(requestParams.search ? JSON.parse(requestParams.search) : [])];
|
|
|
if(guid){
|
|
|
arr.push({
|
|
|
@@ -621,7 +623,6 @@ export default {
|
|
|
}
|
|
|
return newItem;
|
|
|
})
|
|
|
- // console.log("data:", data);
|
|
|
that.tableData = data;
|
|
|
that.tableData.sort((a, b) => a.c_xm.localeCompare(b.c_xm, 'zh-CN'))
|
|
|
|
|
|
@@ -649,7 +650,6 @@ export default {
|
|
|
that.tableSearchText = text;
|
|
|
that.handlePageChange(0,that.pageSize,that.tableSearchText);
|
|
|
});
|
|
|
- // console.log("that.tableSearchText:", that.tableSearchText);
|
|
|
},
|
|
|
// 复制指定元素内的文本
|
|
|
copyDivText(selector) {
|
|
|
@@ -661,7 +661,8 @@ export default {
|
|
|
});;
|
|
|
|
|
|
// 创建临时文本域
|
|
|
- const text = el.innerText.trim();
|
|
|
+ let text = el.innerText.trim();
|
|
|
+ text = text.replace('位置信息:', '');
|
|
|
this.$copyText(text);
|
|
|
// navigator.clipboard.writeText(text).then(() => {
|
|
|
// ElMessage({
|
|
|
@@ -680,7 +681,6 @@ export default {
|
|
|
toggleEditMode(isEdit){
|
|
|
let that = this;
|
|
|
that.editFlag = isEdit;
|
|
|
- // console.log("isEdit:", isEdit);
|
|
|
// if(isEdit){
|
|
|
// this.editWinFlag = true;
|
|
|
// window.mapboxMap.off('click', that.mapClickValue)
|
|
|
@@ -868,23 +868,62 @@ export default {
|
|
|
that.$message.success('token过期,请重新登录');
|
|
|
that.$router.push({ path: '/' });
|
|
|
}else{
|
|
|
- that.createVectorLayer(response.data);
|
|
|
+ // that.createVectorLayer(response.data);
|
|
|
}
|
|
|
})
|
|
|
.catch(function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
-
|
|
|
+ },
|
|
|
+ getDmsData() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ "columnId": 1743,
|
|
|
+ "orderBy": JSON.stringify([{"field":"update_time","orderByType":2}]),
|
|
|
+ "states": '0,1,2,3',
|
|
|
+ "pageSize": 99999,
|
|
|
+ "page": 0
|
|
|
+ }
|
|
|
+ let feat = {
|
|
|
+ type: "FeatureCollection",
|
|
|
+ features: [],
|
|
|
+ }
|
|
|
+ commonAPI.getDmsDataList(param).then((res) => {
|
|
|
+ if(res.message == '无效token'){
|
|
|
+ that.$message.success('token过期,请重新登录');
|
|
|
+ that.$router.push({ path: '/' });
|
|
|
+ }else{
|
|
|
+ if (res.code == 200){
|
|
|
+ const ret = res.content.data || [];
|
|
|
+ ret.forEach(item => {
|
|
|
+ const prop = Object.fromEntries(
|
|
|
+ Object.entries(item).filter(([key]) => that.arrParam.find(et => et.value == key))
|
|
|
+ )
|
|
|
+ let feature = {
|
|
|
+ type: "Feature",
|
|
|
+ geometry: wellknown.parse(item.c_polygon.value) || {},
|
|
|
+ properties: prop || {},
|
|
|
+ }
|
|
|
+ feat.features.push(feature);
|
|
|
+ });
|
|
|
+ that.createVectorLayer(feat);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch((error)=>{
|
|
|
+ })
|
|
|
},
|
|
|
createVectorLayer(vectorData) {
|
|
|
let that = this;
|
|
|
- // console.log(vectorData);
|
|
|
that.options = [];
|
|
|
for (let o in vectorData.features[0].properties) {
|
|
|
+ if (that.arrParam.map(ev => ev.value).includes(o)) {
|
|
|
that.options.push({
|
|
|
- value: o,
|
|
|
- label: o,
|
|
|
- })
|
|
|
+ value: o,
|
|
|
+ label: o,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
that.dataList = vectorData;
|
|
|
if(window.mapboxMap.getSource('vector-data')){
|