|
@@ -317,91 +317,59 @@ export default {
|
|
|
that.dataSourceLayer.entities.removeAll();
|
|
|
//拾取模型
|
|
|
let pickedFeature = scene.pick(movement.position);
|
|
|
- console.log("ighui",pickedFeature);
|
|
|
- let eneityName = pickedFeature.primitive.name
|
|
|
- let Pid =''
|
|
|
- // "ResultNetWork@管线#1"///"ResultNetWork_Node@管线#1"
|
|
|
- if (eneityName.indexOf('管线') > 0) {
|
|
|
- let buildingLayer = scene.layers.find(eneityName);
|
|
|
- buildingLayer.indexedDBSetting.isAttributesSave = true; //保存属性
|
|
|
- if (buildingLayer.getSelection().length > 0) {
|
|
|
- const selectedId = Number(buildingLayer.getSelection()[0]);
|
|
|
- console.log(selectedId,'selectedId');
|
|
|
- buildingLayer.getAttributesById([selectedId]).then(function (atts) {
|
|
|
- if (atts) {
|
|
|
- console.log(atts);
|
|
|
- // var Pid = atts['管线段']
|
|
|
- console.log(atts["管线段"]);
|
|
|
- console.log(atts["物探点"]);
|
|
|
- Pid = atts["管线段"] || atts["物探点"]
|
|
|
- // viewer.entities.removeAll();
|
|
|
-
|
|
|
- // var length = Object.keys(atts).length;
|
|
|
- // var des;
|
|
|
- // for (var i = 0; i < length; i++) {
|
|
|
- // var key = Object.keys(atts)[i];
|
|
|
- // var value = atts[key];
|
|
|
- // console.log(key);
|
|
|
- // console.log(value);
|
|
|
|
|
|
- // var index = i.toString();
|
|
|
- // if (i == 0) {
|
|
|
- // des = '<table class="cesium-infoBox-defaultTable"><tbody>' + '<tr><th>' + key + '</th><td>' + value + '</td></tr>';
|
|
|
- // } else if (i == length - 1) {
|
|
|
- // des += '<tr><th>' + key + '</th><td>' + value + '</td></tr>' + "</tbody></table>";
|
|
|
- // } else {
|
|
|
- // des += '<tr><th>' + key + '</th><td>' + value + '</td></tr>';
|
|
|
- // }
|
|
|
- // }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if (
|
|
|
scene.pickPositionSupported &&
|
|
|
Cesium.defined(pickedFeature) &&
|
|
|
pickedFeature != null &&
|
|
|
pickedFeature.primitive
|
|
|
) {
|
|
|
-
|
|
|
-
|
|
|
- //解构赋值点击对象的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) {
|
|
|
- gwtype = 1;
|
|
|
- } else {
|
|
|
- // Pid = Pid.replace("_", "-");
|
|
|
- gwtype = 2;
|
|
|
- }
|
|
|
- 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,
|
|
|
+ let eneityName = pickedFeature.primitive.name;
|
|
|
+ let Pid = "";
|
|
|
+ var tempArr = [];
|
|
|
+ // "ResultNetWork@管线#1"///"ResultNetWork_Node@管线#1"
|
|
|
+ if (eneityName.indexOf("管线") > 0) {
|
|
|
+ let buildingLayer = scene.layers.find(eneityName);
|
|
|
+ buildingLayer.indexedDBSetting.isAttributesSave = true; //保存属性
|
|
|
+ if (buildingLayer.getSelection().length > 0) {
|
|
|
+ const selectedId = Number(buildingLayer.getSelection()[0]);
|
|
|
+ buildingLayer.getAttributesById([selectedId]).then(function (atts) {
|
|
|
+ if (atts) {
|
|
|
+ // console.log(atts);
|
|
|
+ Pid = atts["管线段"] || atts["物探点"];
|
|
|
+ var length = Object.keys(atts).length;
|
|
|
+ var des;
|
|
|
+ for (var i = 0; i < length; i++) {
|
|
|
+ var key = Object.keys(atts)[i];
|
|
|
+ var value = atts[key];
|
|
|
+ // console.log(key);
|
|
|
+ // console.log(value);
|
|
|
+ if (
|
|
|
+ key.toLowerCase().indexOf("shape") < 0 &&
|
|
|
+ key.toLowerCase().indexOf("sm") &&
|
|
|
+ value != ""
|
|
|
+ ) {
|
|
|
+ tempArr.push({
|
|
|
+ name: key,
|
|
|
+ value: value,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取图层id的参数
|
|
|
+ let substring = pickedFeature.primitive._baseUri.query;
|
|
|
+ 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] = [tempArr];
|
|
|
+ that.queryResultsGeom[substring] = [];
|
|
|
+ that.activeLayerId = substring;
|
|
|
});
|
|
|
}
|
|
|
- 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) {
|