shuishen
2021-06-18 d12e030d8a7690d79c5786bc2a786b6c21a24433
widgets/searchL/Widget.js
@@ -29,6 +29,7 @@
         layers: {},
         states: 'one',
         searchDatas: '',
         addOneEntitys: null,
         startup: function () {
            var that = this;
@@ -54,6 +55,8 @@
            $(".searchImg").click(function () {
               that.getInputData();
               topic.publish('getLegendsData', that.searchDatas);
               that.addOneEntitys.removeAll();
               if (typeof that.searchDatas == 'string') {
                  var han = /^[\u4e00-\u9fa5]+$/;
                  if (han.test(that.searchDatas) || that.searchDatas == '  ') {
@@ -94,13 +97,16 @@
            })
            $(".searchColce").click(function () {
               $('.searchLMain').hide();
               that.map.entities.removeAll();
               that.addOneEntitys.removeAll();
               topic.publish('getLegendsData', '');
            })
            $("#local_data").keyup(function (e) {
               // console.log(e);
               that.getInputData();
               if (e.keyCode == 13 && typeof that.searchDatas == 'string') {
                  topic.publish('getLegendsData', that.searchDatas);
                  that.addOneEntitys.removeAll();
                  var han = /^[\u4e00-\u9fa5]+$/;
                  if (han.test(that.searchDatas) || that.searchDatas == '  ') {
                     that.getData(0, that.searchDatas);
@@ -132,6 +138,7 @@
         },
         getData: function (index, val) {
            val = val == '  ' ? '' : val;
            var d = $('.searchLMain').find('.layui-tab-item').hide;
            var that = this,
               url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${index}`
@@ -160,7 +167,7 @@
            })
         },
         createDatas: function (d, n) {
            this.map.entities.removeAll();//清除图标点
            this.addOneEntitys.removeAll();//清除图标点
            if (d == []) {
               if (n == 0) {
                  this.beginLayUi(d);
@@ -187,6 +194,9 @@
            }
         },
         onOpen: function () {
            var dataSourceOne = new Cesium.CustomDataSource();
            this.addOneEntitys = dataSourceOne.entities;
            this.map.dataSources.add(dataSourceOne);
            //面板打开的时候触发
            var that = this;
            that.getData(0)
@@ -223,7 +233,7 @@
         clickHand: function clickHand(data) {
            var pickedObjects = this.map.scene.drillPick(data.position) || 0;
            // console.log(pickedObjects);
            if (pickedObjects.length != 0) {
            if (pickedObjects.length != 0 && pickedObjects.id != undefined) {
               var data = pickedObjects[0].primitive.id.onceData[1];
               if (pickedObjects[0].primitive.id.onceData[0] == 1) {//全景
@@ -249,7 +259,7 @@
                     dom = $('#poput-m-t-video');
                     str = `
                     <video id="poput-m-t-video-video" ></video>
               `;
                     `;
                     dom.empty();
                     dom.append(str);
                     if (flvjs.isSupported()) {
@@ -306,27 +316,28 @@
         },
         //定位实体位置
         shiti: function (data, i) {
            // console.log(data)
            var imgs = i == 1 ? 'images/addL/全景.png' : i == 2 ? 'images/addL/监控.png' : i == 3 ? 'images/addL/监测.png' : '';
            this.map.entities.add({
            this.addOneEntitys.add({
               id: data.id, // 实体ID
               name: data.name, // 实体名称
               position: Cesium.Cartesian3.fromDegrees(Number(data.lon), Number(data.lat)), // x,y 实体经纬度
               // label: {
               //    show: true,
               //    text: item.siteName, // text 与实体相关的文字
               //    font: "700 14px '黑体'",
               //    fillColor: Cesium.Color.DEEPSKYBLUE,
               //    // backgroundColor: Cesium.Color.DEEPSKYBLUE,
               //    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
               //    outlineWidth: 2,
               //    outlineColor: Cesium.Color.fromBytes(255, 255, 255), // 文字轮廓的颜色
               //    verticalOrigin: Cesium.VerticalOrigin.CENTER,//垂直位置
               //    horizontalOrigin: Cesium.HorizontalOrigin.LEFT,//水平位置
               //    pixelOffset: new Cesium.Cartesian2(10, -10), // 文字位置
               //    heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
               //    distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1, entityConfig.showheight),
               //    disableDepthTestDistance: Number.POSITIVE_INFINITY
               // },
               label: {
                  show: true,
                  text: data.name, // text 与实体相关的文字
                  font: "700 20px '黑体'",
                  fillColor: Cesium.Color.fromCssColorString("rgba(57,165,253)"),
                  // backgroundColor: Cesium.Color.DEEPSKYBLUE,
                  style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                  outlineWidth: 2,
                  outlineColor: Cesium.Color.fromBytes(255, 255, 255), // 文字轮廓的颜色
                  verticalOrigin: Cesium.VerticalOrigin.CENTER,//垂直位置
                  horizontalOrigin: Cesium.HorizontalOrigin.CENTER,//水平位置
                  pixelOffset: new Cesium.Cartesian2(0, -40), // 文字位置
                  heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                  // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1, entityConfig.showheight),
                  disableDepthTestDistance: Number.POSITIVE_INFINITY
               },
               billboard: {
                  show: true,
                  // image: 'images/addL/监测.png',
@@ -376,7 +387,14 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function (res, curr, count) {
                        that.addTitle();
                     }
                  });
                  table.on('row(test)', function (obj) {
                     that.goOnPosition([obj.data.lon, obj.data.lat], 1, obj.data);
                  });
                  table.on('tool(test)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
@@ -416,6 +434,9 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function (res, curr, count) {
                        that.addTitle();
                     }
                  });
                  table.on('tool(test1)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
@@ -461,6 +482,10 @@
                        that.goOnPosition([obj.data.lon, obj.data.lat], 2, obj.data);
                     }
                  });
                  table.on('row(test1)', function (obj) {
                     that.goOnPosition([obj.data.lon, obj.data.lat], 2, obj.data);
                  });
               }
               if (data2 != 1) {
@@ -488,6 +513,9 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function (res, curr, count) {
                        that.addTitle();
                     }
                  });
@@ -510,8 +538,11 @@
                        that.goOnPosition([obj.data.lon, obj.data.lat], 3, obj.data);
                     }
                  });
                  table.on('row(test2)', function (obj) {
                     that.goOnPosition([obj.data.lon, obj.data.lat], 3, obj.data);
                  });
               }
               that.addTitle();
               // that.addTitle();
               //…
            });
         },
@@ -561,12 +592,23 @@
                  </tr>
                  <tr>
                     <th>图片:</th>
                     <td class="left" colspan="3">
                     <img src="${obj.data.attList[0].uaOriginPath}" alt="">
                     <td class="left" colspan="3" id="popupsimg">
                     <img layer-src="${obj.data.attList[0].uaOriginPath}" src="${obj.data.attList[0].uaOriginPath}" alt="">
                     </td>
                  </tr>`;
            str += '</table>';
            XQDom.append(str);
            // 相册层
            layui.use(['form', 'layer'], function () {
               //----------模块----------
               var form = layui.form;
               var layer = layui.layer;
               layer.photos({
                  photos: '#popupsimg'
                  , anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
               });
            });
         },
         getshuiwen: function (stcd) {
            var that = this;