|
@@ -1,14 +1,28 @@
|
|
|
<template>
|
|
|
- <div class="sm-panel sm-function-module-query" v-show="PoinyQueryShow && vectorShow" v-drag>
|
|
|
+ <div
|
|
|
+ class="sm-panel sm-function-module-query"
|
|
|
+ v-show="PoinyQueryShow && vectorShow"
|
|
|
+ v-drag
|
|
|
+ >
|
|
|
<div class="sm-panel-header">
|
|
|
<span>{{ Resource.PoinyQuery }}</span>
|
|
|
<span class="closeBtn" @click="toggleVisibility">×</span>
|
|
|
</div>
|
|
|
<!-- <div class="sm-function-module-content-btn"> -->
|
|
|
<div class="btnList">
|
|
|
- <span v-for="(item, index) in actionOptions" :key="index" class="icon-span" :title="item.lable"
|
|
|
- :class="item.isSelect ? 'selected-icon' : ''" @click="changleQueryItem(item)">
|
|
|
- <i class="iconfont iconSize" :class="item.iconName" style="margin-top: 0px"></i>
|
|
|
+ <span
|
|
|
+ v-for="(item, index) in actionOptions"
|
|
|
+ :key="index"
|
|
|
+ class="icon-span"
|
|
|
+ :title="item.lable"
|
|
|
+ :class="item.isSelect ? 'selected-icon' : ''"
|
|
|
+ @click="changleQueryItem(item)"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="iconfont iconSize"
|
|
|
+ :class="item.iconName"
|
|
|
+ style="margin-top: 0px"
|
|
|
+ ></i>
|
|
|
</span>
|
|
|
<!-- <el-button type="primary" size="small" @click.stop="mapLayerQuery"
|
|
|
>点击</el-button
|
|
@@ -19,27 +33,51 @@
|
|
|
</div>
|
|
|
<div class="sm-function-module-content-tabs">
|
|
|
<el-tabs @tab-click="handleTabClick" v-model="activeLayerId">
|
|
|
- <el-tab-pane :label="item.label" :name="item.id" v-for="(item, index) in layerList" :key="index"></el-tab-pane>
|
|
|
+ <el-tab-pane
|
|
|
+ :label="item.label"
|
|
|
+ :name="item.id"
|
|
|
+ v-for="(item, index) in layerList"
|
|
|
+ :key="index"
|
|
|
+ ></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
|
<div class="sm-function-module-content-table">
|
|
|
- <el-collapse :value="activeNames" @change="handleCollapseChange" v-if="activeLayerId &&
|
|
|
- queryResults[activeLayerId] &&
|
|
|
- queryResults[activeLayerId].length > 0
|
|
|
- ">
|
|
|
- <el-collapse-item :title="'查询结果' + (index + 1)" :name="'查询结果' + (index + 1)"
|
|
|
- v-for="(item, index) in queryResults[activeLayerId]" :key="index">
|
|
|
+ <el-collapse
|
|
|
+ :value="activeNames"
|
|
|
+ @change="handleCollapseChange"
|
|
|
+ v-if="
|
|
|
+ activeLayerId &&
|
|
|
+ queryResults[activeLayerId] &&
|
|
|
+ queryResults[activeLayerId].length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-collapse-item
|
|
|
+ :title="'查询结果' + (index + 1)"
|
|
|
+ :name="'查询结果' + (index + 1)"
|
|
|
+ v-for="(item, index) in queryResults[activeLayerId]"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
<template slot="title">
|
|
|
查询结果{{ index + 1
|
|
|
- }}<i title="定位" class="header-icon el-icon-s-promotion flyBtn2" @click.stop="flyTo(index)"></i>
|
|
|
+ }}<i
|
|
|
+ title="定位"
|
|
|
+ class="header-icon el-icon-s-promotion flyBtn2"
|
|
|
+ @click.stop="flyTo(index)"
|
|
|
+ ></i>
|
|
|
</template>
|
|
|
- <el-table :data="item" :show-header="false" border style="width: 100%" :header-cell-style="{
|
|
|
- background: 'rgba(10, 25, 38, 0.6)',
|
|
|
- color: '#66b1ff',
|
|
|
- fontSize: '14px',
|
|
|
- fontFamily: 'Microsoft YaHei',
|
|
|
- fontWeight: '400',
|
|
|
- }">
|
|
|
+ <el-table
|
|
|
+ :data="item"
|
|
|
+ :show-header="false"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{
|
|
|
+ background: 'rgba(10, 25, 38, 0.6)',
|
|
|
+ color: '#66b1ff',
|
|
|
+ fontSize: '14px',
|
|
|
+ fontFamily: 'Microsoft YaHei',
|
|
|
+ fontWeight: '400',
|
|
|
+ }"
|
|
|
+ >
|
|
|
<el-table-column prop="name" label="字段" width="100">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="value" label="值" width="208">
|
|
@@ -117,7 +155,8 @@ export default {
|
|
|
lable: "矢量",
|
|
|
iconName: "el-icon-picture",
|
|
|
isSelect: false,
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ {
|
|
|
index: 5,
|
|
|
lable: "联级查询",
|
|
|
iconName: "el-icon-c-scale-to-original",
|
|
@@ -137,10 +176,13 @@ export default {
|
|
|
return store.state.toolBar[9];
|
|
|
},
|
|
|
vectorShow: function () {
|
|
|
- return store.state.cockpit_vector.title || store.state.cockpit_vector.goitem ? !store.state.viewer_flag : true
|
|
|
+ return store.state.cockpit_vector.title ||
|
|
|
+ store.state.cockpit_vector.goitem
|
|
|
+ ? !store.state.viewer_flag
|
|
|
+ : true;
|
|
|
},
|
|
|
},
|
|
|
- created() { },
|
|
|
+ created() {},
|
|
|
watch: {
|
|
|
activeLayerId(val) {
|
|
|
if (val && val != "0") {
|
|
@@ -169,14 +211,12 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
this.$nextTick((res) => {
|
|
|
query_click = new Cesium.CustomDataSource("query_click");
|
|
|
viewer.dataSources.add(query_click);
|
|
|
|
|
|
manager_layer_png = new Cesium.CustomDataSource("manager_layer_png");
|
|
|
viewer.dataSources.add(manager_layer_png);
|
|
|
-
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
@@ -199,7 +239,7 @@ export default {
|
|
|
toggleVisibility() {
|
|
|
this.removeMapLayerQuery();
|
|
|
store.setToolBarAction(9);
|
|
|
- tdsy.remove(false)
|
|
|
+ tdsy.remove(false);
|
|
|
store.state.vectorData = [];
|
|
|
},
|
|
|
addGeometrys(fill) {
|
|
@@ -298,7 +338,6 @@ export default {
|
|
|
},
|
|
|
handleTabClick(item, a) {
|
|
|
this.activeLayerId = item.name;
|
|
|
- console.log('this.: ', this.activeLayerId);
|
|
|
},
|
|
|
// 设置数据
|
|
|
setData() {
|
|
@@ -332,7 +371,10 @@ export default {
|
|
|
let Pid = "";
|
|
|
var tempArr = [];
|
|
|
// "ResultNetWork@管线#1"///"ResultNetWork_Node@管线#1"
|
|
|
- if (eneityName.indexOf("雨水") > -1 || eneityName.indexOf("管线") > -1) {
|
|
|
+ if (
|
|
|
+ eneityName.indexOf("雨水") > -1 ||
|
|
|
+ eneityName.indexOf("管线") > -1
|
|
|
+ ) {
|
|
|
let buildingLayer = scene.layers.find(eneityName);
|
|
|
buildingLayer.indexedDBSetting.isAttributesSave = true; //保存属性
|
|
|
if (buildingLayer.getSelection().length > 0) {
|
|
@@ -450,7 +492,6 @@ export default {
|
|
|
|
|
|
// positions = oneDArray;
|
|
|
|
|
|
-
|
|
|
// if (this.isArray2D(oneDArray)) {
|
|
|
// const oneDArray2 = oneDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
// positions = oneDArray2;
|
|
@@ -486,7 +527,6 @@ export default {
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
-
|
|
|
if (e && e.totalCount > 0) {
|
|
|
that.layerList.push(store.state.vectorlayerlist[i]);
|
|
|
let queryData = [];
|
|
@@ -545,18 +585,21 @@ export default {
|
|
|
// var linSAr = JSON.parse(JSON.stringify(e.features[u]));
|
|
|
// }
|
|
|
var linSAr = JSON.parse(JSON.stringify(e.features[u]));
|
|
|
- let parseJson = legendJson.legend != "" ? JSON.parse(legendJson.legend) : [];
|
|
|
+ let parseJson =
|
|
|
+ legendJson.legend != "" ? JSON.parse(legendJson.legend) : [];
|
|
|
function condition(ci) {
|
|
|
return ci.status != undefined && ci.status;
|
|
|
}
|
|
|
if (e.features[u].fieldNames) {
|
|
|
linSAr.fieldNames.forEach((fieldName, i) => {
|
|
|
- let perjson = parseJson.filter(p => p.fieldname.toUpperCase() == fieldName);
|
|
|
+ let perjson = parseJson.filter(
|
|
|
+ (p) => p.fieldname.toUpperCase() == fieldName
|
|
|
+ );
|
|
|
if (perjson.length > 0) {
|
|
|
var show = condition(perjson[0]);
|
|
|
var order = perjson[0].order || linSAr.fieldNames.length;
|
|
|
if (fieldName != perjson[0].fieldaliasname)
|
|
|
- fieldName = perjson[0].fieldaliasname
|
|
|
+ fieldName = perjson[0].fieldaliasname;
|
|
|
}
|
|
|
if (show) {
|
|
|
let v = linSAr.fieldValues[i];
|
|
@@ -590,7 +633,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //排序
|
|
|
+ //排序
|
|
|
cur.sort((a, b) => a.order - b.order);
|
|
|
// cur.sort((a, b) => {
|
|
|
// if (a === b) {
|
|
@@ -604,13 +647,20 @@ export default {
|
|
|
// return a.value < b.value ? 1 : -1;
|
|
|
// }
|
|
|
// });
|
|
|
-
|
|
|
+ let urlNew = obj.url + ".json";
|
|
|
+ let resNew = await axios.get(urlNew);
|
|
|
+ let serCode = resNew.data.prjCoordSys.epsgCode;
|
|
|
let points = [];
|
|
|
for (let y = 0; y < e.features[u].geometry.points.length; y++) {
|
|
|
- let c = that.cartesianToCartographic84(
|
|
|
- e.features[u].geometry.points[y].x,
|
|
|
- e.features[u].geometry.points[y].y
|
|
|
- );
|
|
|
+ let c = {}
|
|
|
+ if (serCode == 3857) {
|
|
|
+ c = that.cartesianToCartographic84(
|
|
|
+ e.features[u].geometry.points[y].x,
|
|
|
+ e.features[u].geometry.points[y].y
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ c = e.features[u].geometry.points[y];
|
|
|
+ }
|
|
|
points.push([c.x, c.y]);
|
|
|
}
|
|
|
parts.push(e.features[u].geometry.parts);
|
|
@@ -645,10 +695,9 @@ export default {
|
|
|
width: 36,
|
|
|
scale: 1.0,
|
|
|
zIndex: 2,
|
|
|
- show: true
|
|
|
+ show: true,
|
|
|
},
|
|
|
-
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
addLayerList(label) {
|
|
|
if (this.layerList.findIndex((a) => a.label == label) >= 0) return;
|
|
@@ -747,7 +796,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
convertCoordinates(coordArray) {
|
|
|
- return coordArray.map(coord => [coord.x, coord.y]);
|
|
|
+ return coordArray.map((coord) => [coord.x, coord.y]);
|
|
|
},
|
|
|
// 取消左键点击查询
|
|
|
removeMapLayerQuery() {
|
|
@@ -809,13 +858,10 @@ export default {
|
|
|
remove_query_click() {
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
query_click.entities.values.forEach((res) => {
|
|
|
-
|
|
|
query_click.entities.remove(res);
|
|
|
-
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 图标
|
|
|
var entities = manager_layer_png.entities.values;
|
|
|
for (var i = entities.length - 1; i >= 0; i--) {
|
|
@@ -838,17 +884,20 @@ export default {
|
|
|
case 3: {
|
|
|
this.removeMapLayerQuery(); //清除
|
|
|
clearTranslate();
|
|
|
- pick_cockpit_vector.clear_data();//矢量拾取清除
|
|
|
- this.$refs.MultiLevelQuery.clear_data();//多级查询
|
|
|
+ pick_cockpit_vector.clear_data(); //矢量拾取清除
|
|
|
+ this.$refs.MultiLevelQuery.clear_data(); //多级查询
|
|
|
|
|
|
this.remove_query_click();
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
- case 4: {//驾驶舱矢量数据点选查询
|
|
|
+ case 4: {
|
|
|
+ //驾驶舱矢量数据点选查询
|
|
|
pick_cockpit_vector.init_handler();
|
|
|
break;
|
|
|
- } case 5: {//联级查询
|
|
|
+ }
|
|
|
+ case 5: {
|
|
|
+ //联级查询
|
|
|
this.$refs.MultiLevelQuery.init_handler();
|
|
|
break;
|
|
|
}
|
|
@@ -932,7 +981,6 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
@import "clickQuery";
|
|
|
|
|
|
-
|
|
|
/deep/ .el-table tr {
|
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
|
}
|
|
@@ -941,10 +989,9 @@ export default {
|
|
|
.el-table th.el-table__cell.is-leaf {
|
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
|
|
|
|
- border-bottom: 1px solid #EBEEF5;
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
.el-table {
|
|
|
color: #fff;
|
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
@@ -952,14 +999,11 @@ export default {
|
|
|
|
|
|
/deep/ .el-table__fixed-right::before,
|
|
|
.el-table__fixed::before {
|
|
|
-
|
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/deep/ .el-table__fixed-right-patch {
|
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/deep/ .el-table--border::after,
|
|
@@ -974,12 +1018,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
/deep/ .el-collapse {
|
|
|
- border: none
|
|
|
- /* border-top: 1px solid #EBEEF5; */
|
|
|
- /* border-bottom: 1px solid #EBEEF5; */
|
|
|
+ border: none;
|
|
|
+ /* border-top: 1px solid #EBEEF5; */
|
|
|
+ /* border-bottom: 1px solid #EBEEF5; */
|
|
|
}
|
|
|
|
|
|
/deep/ .el-collapse-item__content {
|
|
|
- padding-bottom: 0px
|
|
|
+ padding-bottom: 0px;
|
|
|
}
|
|
|
</style>
|