|
@@ -91,6 +91,7 @@ export default {
|
|
|
this.flag = !this.flag;
|
|
|
},
|
|
|
setDatas() {
|
|
|
+ console.log(111);
|
|
|
|
|
|
// 耕地保护
|
|
|
this.$refs.gdbh_ref.init_zbph(this.params);
|
|
@@ -178,6 +179,7 @@ export default {
|
|
|
const that = this;
|
|
|
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
|
|
|
handler.setInputAction(async event => {
|
|
|
+
|
|
|
let pickObj = viewer.scene.pick(event.position);
|
|
|
var position = viewer.scene.pickPosition(event.position);
|
|
|
|
|
@@ -195,36 +197,39 @@ export default {
|
|
|
|
|
|
if (!position) {
|
|
|
position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
|
|
|
+ return;
|
|
|
}
|
|
|
- if (Cesium.defined(pickObj) && store.state.xzqh_flag) {
|
|
|
- if (pickObj.primitive instanceof Cesium.Primitive && store.state.xzqh_flag == true) {//点击primitive
|
|
|
- //primitive相关操作
|
|
|
+ if (store.state.xzqh_flag) {
|
|
|
+ if (Cesium.defined(pickObj)) {
|
|
|
+ if (pickObj.primitive instanceof Cesium.Primitive && store.state.xzqh_flag == true) {//点击primitive
|
|
|
+ //primitive相关操作
|
|
|
|
|
|
- let obj = JSON.parse(pickObj.id);
|
|
|
+ let obj = JSON.parse(pickObj.id);
|
|
|
|
|
|
- let pri_name = obj.name;
|
|
|
- let adcode = obj.adcode
|
|
|
- that.params.id = adcode
|
|
|
- that.params.name = pri_name
|
|
|
+ let pri_name = obj.name;
|
|
|
+ let adcode = obj.adcode
|
|
|
+ that.params.id = adcode
|
|
|
+ that.params.name = pri_name
|
|
|
|
|
|
- that.setDatas()
|
|
|
- // 管控指标
|
|
|
- that.gkzb_xzqh(adcode);
|
|
|
- cockpit.pick_xzqh(pri_name);
|
|
|
- }
|
|
|
+ that.setDatas()
|
|
|
+ // 管控指标
|
|
|
+ that.gkzb_xzqh(adcode);
|
|
|
+ cockpit.pick_xzqh(pri_name);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- } else {
|
|
|
- // 暂时点击周围数据显示三亚市
|
|
|
- // 清除所有xzqh状态
|
|
|
+ } else {
|
|
|
+ // 暂时点击周围数据显示三亚市
|
|
|
+ // 清除所有xzqh状态
|
|
|
|
|
|
- cockpit.pick_xzqh();
|
|
|
- // 管控指标
|
|
|
- that.gkzb();
|
|
|
+ cockpit.pick_xzqh();
|
|
|
+ // 管控指标
|
|
|
+ that.gkzb();
|
|
|
|
|
|
- that.params.id = '4602'
|
|
|
- that.setDatas()
|
|
|
+ that.params.id = '4602'
|
|
|
+ that.setDatas()
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|