shuishen
2021-06-17 094dff34cea6a27ff251b23fc30ffafff6d3bcf2
widgets/searchL/Widget.js
@@ -55,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 == '  ') {
@@ -96,12 +98,15 @@
            $(".searchColce").click(function () {
               $('.searchLMain').hide();
               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);
@@ -133,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}`
@@ -310,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.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',
@@ -380,10 +387,14 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function(res, curr, count){
                     , 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="对应的值"
@@ -423,9 +434,9 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function(res, curr, count){
                     , done: function (res, curr, count) {
                        that.addTitle();
                       }
                     }
                  });
                  table.on('tool(test1)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
@@ -471,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) {
@@ -498,9 +513,9 @@
                     // , page: true //是否显示分页
                     , limits: false
                     , limit: 10 //每页默认显示的数量
                     , done: function(res, curr, count){
                     , done: function (res, curr, count) {
                        that.addTitle();
                       }
                     }
                  });
@@ -522,6 +537,9 @@
                     } else if (layEvent === 'edit') {
                        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();
@@ -574,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;