|
@@ -4,13 +4,28 @@
|
|
|
<span>{{ Resource.PoinyQuery }}</span>
|
|
|
<span class="closeBtn" @click="toggleVisibility">×</span>
|
|
|
</div>
|
|
|
- <div class="sm-function-module-content-btn">
|
|
|
- <el-button type="primary" size="small" @click.stop="mapLayerQuery"
|
|
|
+ <!-- <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>
|
|
|
+ <!-- <el-button type="primary" size="small" @click.stop="mapLayerQuery"
|
|
|
>点击</el-button
|
|
|
>
|
|
|
<el-button type="primary" size="small" @click.stop="removeMapLayerQuery"
|
|
|
>清除</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</div>
|
|
|
<div class="sm-function-module-content-tabs">
|
|
|
<el-tabs @tab-click="handleTabClick" v-model="activeLayerId">
|
|
@@ -65,6 +80,9 @@
|
|
|
|
|
|
<script>
|
|
|
import axios from "axios";
|
|
|
+import { GetGDlnfo, GetXzqhTree } from "../../../api/map";
|
|
|
+import { keys } from "lodash";
|
|
|
+let gwtype;
|
|
|
export default {
|
|
|
name: "clickQuery",
|
|
|
data() {
|
|
@@ -91,6 +109,26 @@ export default {
|
|
|
queryResultsGeom: {},
|
|
|
viewer: window.viewer,
|
|
|
dataSourceLayer: null,
|
|
|
+ actionOptions: [
|
|
|
+ {
|
|
|
+ index: 1,
|
|
|
+ lable: "图层",
|
|
|
+ iconName: "el-icon-tickets",
|
|
|
+ isSelect: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: 2,
|
|
|
+ lable: "模型",
|
|
|
+ iconName: "el-icon-office-building",
|
|
|
+ isSelect: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: 3,
|
|
|
+ lable: "清除",
|
|
|
+ iconName: "el-icon-delete",
|
|
|
+ isSelect: false,
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -231,14 +269,40 @@ export default {
|
|
|
) {
|
|
|
//解构赋值点击对象的id
|
|
|
let Pid = pickedFeature.getProperty("id");
|
|
|
+ let commaIndex = pickedFeature.primitive.url.indexOf("=");
|
|
|
+ let substring = "";
|
|
|
+ if (commaIndex !== -1) {
|
|
|
+ //primitive级别id
|
|
|
+ substring = pickedFeature.primitive.url.substring(commaIndex + 1); // 从逗号后一位开始,到字符串末尾
|
|
|
+ }
|
|
|
+ //定义数组用于存储转换完成的管井数据
|
|
|
+ let newArr = [];
|
|
|
//判断对象类型
|
|
|
+
|
|
|
if (Pid.indexOf("_") < 0) {
|
|
|
- console.log("我是管井");
|
|
|
+ gwtype = 1;
|
|
|
} else {
|
|
|
- console.log("我是管线");
|
|
|
+ Pid = Pid.replace("_", "-");
|
|
|
+ gwtype = 2;
|
|
|
}
|
|
|
-
|
|
|
- // console.log(pickedFeature.getPropertyNames()); //获取对象含有的属性
|
|
|
+ GetGDlnfo({ type: gwtype, key: Pid }).then((res) => {
|
|
|
+ let aaa = Object.entries(res.data);
|
|
|
+ for (const [name, value] of aaa) {
|
|
|
+ newArr.push({
|
|
|
+ name: name,
|
|
|
+ value: value,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ for (let p = 0; p < store.state.vectorlayerlist.length; i++) {
|
|
|
+ if (store.state.vectorlayerlist[p].id == substring) {
|
|
|
+ that.layerList.push(store.state.vectorlayerlist[p]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.queryResults[substring] = [newArr];
|
|
|
+ that.queryResultsGeom[substring] = [];
|
|
|
+ that.activeLayerId = substring;
|
|
|
+ });
|
|
|
|
|
|
that.loading = true;
|
|
|
that.queryByPickFeature(pickedFeature, function (result, Fields) {
|
|
@@ -318,12 +382,19 @@ export default {
|
|
|
geoms.push(points);
|
|
|
queryData.push(cur);
|
|
|
}
|
|
|
+ console.log(
|
|
|
+ that.queryResults,
|
|
|
+ "that.queryResults,",
|
|
|
+ obj.id,
|
|
|
+ that.queryResults[obj.id]
|
|
|
+ );
|
|
|
that.queryResults[obj.id] = queryData;
|
|
|
that.queryResultsGeom[obj.id] = geoms;
|
|
|
}
|
|
|
}
|
|
|
if (that.layerList.length > 0) {
|
|
|
that.activeLayerId = that.layerList[0].id;
|
|
|
+ console.log(that.activeLayerId, "that.activeLayerId");
|
|
|
} else {
|
|
|
that.$message({
|
|
|
message: "查询结果为空!",
|
|
@@ -439,6 +510,25 @@ export default {
|
|
|
uriArr[8] = "featureResults.rjson?returnContent=true";
|
|
|
return uriArr.join("/");
|
|
|
},
|
|
|
+ //地图数据查询事件
|
|
|
+ changleQueryItem(item){
|
|
|
+ switch (item.index) {
|
|
|
+ case 1: {
|
|
|
+ this.mapLayerQuery(); //图层点击事件
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2: {
|
|
|
+ console.log('我是模型点击');
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3: {
|
|
|
+ this.removeMapLayerQuery(); //清除
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.removeMapLayerQuery();
|
|
@@ -502,3 +592,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "clickQuery";
|
|
|
+</style>
|