liuyg
2021-06-09 dc076746513f81183c57f3c67eec0441c7353526
数据对接  更改
5 files modified
159 ■■■■ changed files
widgets/searchL/Widget.html 4 ●●●● patch | view | raw | blame | history
widgets/searchL/Widget.js 139 ●●●●● patch | view | raw | blame | history
widgets/searchL/css/style.css 8 ●●●● patch | view | raw | blame | history
widgets/searchTabaPopup/Widget.js 1 ●●●● patch | view | raw | blame | history
widgets/searchTabaPopup/css/style.css 7 ●●●● patch | view | raw | blame | history
widgets/searchL/Widget.html
@@ -7,9 +7,9 @@
        placeholder="输入关键字以搜索" />
    <div id="inputTwo">
        <input id="local_data1" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
            placeholder="输入经度" />
            placeholder="经度:115.5" />
        <input id="local_data2" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
            placeholder="输入纬度" />
            placeholder="纬度:25.5" />
    </div>
    <img class="input_img searchImg" src="images/addL/sous.png">
    <div class="searchLMain">
widgets/searchL/Widget.js
@@ -55,29 +55,20 @@
                })
                $(".searchImg").click(function () {
                    // that.getInputData();
                    // that.setVal(that.searchDatas);
                    $('.searchLMain').show();
                    // console.log(2324345)
                    that.getInputData();
                    // console.log(that.searchDatas)
                    var han = /^[\u4e00-\u9fa5]+$/;
                    if (han.test(that.searchDatas)) {
                        that.getData(0, that.searchDatas);
                        $('.searchLMain').show();
                    } else {
                        $('.searchLMain').hide();
                    }
                })
                $(".searchColce").click(function () {
                    $('.searchLMain').hide();
                })
                // that.getInputData();
                // that.setVal(that.searchDatas);
                // 自动展开面板   面板和搜索无关!
                $('.searchLMain').show();
            },
            closeToolBox: function (item) {
                // if (item != this.name) {
                //     $('.tool-y-box').hide();
                // }
            },
            getInputData: function () {
@@ -87,76 +78,58 @@
                    this.searchDatas = [$('#local_data1').val(), $('#local_data2').val()];
                }
            },
            setVal: function (val) {
                var that = this;
                if (typeof val == "string") {
                    var url = 'http://171.34.76.171:8880/pyh-wetResource/GeoData/queryGeoData?name=' + val + '&protectAreald=&type=0&dataSort=1',
                        token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMxMTYwMzYsImV4cCI6MTYyNTcwODAzNn0.p2qqmcWrC9QDLAFgu1n0eR4k4wrr3udFKKhjBqGJXAzz1jdR57agyyYMsTZPXIPkH7hviE64uHLW8T7fM_VvNw';
                    axios.get(url, {
                        headers: {
                            'token': token
                        }
                    }).then((res) => {
                        if (res.status == 200) {
                            var data = res.data.data;
                            that.createData(data);
                        } else {
                            console.log('请求访问失败')
                        }
                    })
                } else if (typeof val == "object") {
                }
            },
            createData: function (d) {
                var i = 1;
                for (var k in d) {
                    d[k].tableId = i++;
                }
                var data = d;
                this.beginLayUi(data);
            },
            getData: function (index) {
            getData: function (index, val) {
                var d = $('.searchLMain').find('.layui-tab-item').hide;
                // console.log(d)
                var that = this,
                    url = index == 0 ?
                        'http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorRecords?name=&startTime=&endTime=&type=2&startPage=1&limit=10&soId=056c6f9fa3f14c168fa90cf1563cd01f'
                        :
                        index == 1 ?
                            'http://171.34.76.171:8880/pyh-station/video/queryPyhVideoByFilter?id=&protectAreaId=&name=&buildTime=&buildType=&start=1&limit=10'
                            :
                            index == 2 ?
                                'http://171.34.76.171:8880/pyh-station/monitorStation/queryMonitorStationByFilter?leftTreeId=&isShow=&stcd=&stnm=&status=&startPage=1&limit=10' :
                                false
                    , token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMxMzIzMjYsImV4cCI6MTYyNTcyNDMyNn0.2ug9No32Ij3DxXCw8utXbahYsAe6l_FdzRTH5ysaBsOuKLbmQ80faGclncCdNahQ3rgiV54U-gawqw9JhGsAJA';
                    // url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${index}`
                    url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=&start&limit&type=${index}`
                    , token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyMjU5OTcsImV4cCI6MTYyNTgxNzk5N30.zWpoKa5AK7xLIPNm-CXoHY9D5kpk9AiUTGkuAQOZi2Rdl2BfroT4IqxjBpyUPZlgwCjG2CoJqy_7rnnodpmqNw';
                axios.get(url, {
                    headers: {
                        'token': token
                    }
                }).then((res) => {
                    if (res.status == 200) {
                        var data = res.data.data;
                        that.createDatas(data, index);
                    if (res.data.code == 200) {
                        var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || [];
                        // console.log(data)
                        var val = index;//数据的2和1对调
                        if (index == 1) {
                            val = 2;
                        } else if (index == 2) {
                            val = 1;
                        }
                        that.createDatas(data, val);
                    } else {
                        console.log('请求访问失败')
                    }
                })
            },
            createDatas: function (d, n) {
                var i = 1;
                for (var k in d) {
                    d[k].tableId = i++;
                }
                var data = d;
                if (n == 0) {
                    this.beginLayUi(data);
                } else if (n == 1) {
                    this.beginLayUi(1, data);
                } else if (n == 2) {
                    this.beginLayUi(1, 1, data);
                if (d == []) {
                    if (n == 0) {
                        this.beginLayUi(d);
                    } else if (n == 1) {
                        this.beginLayUi(1, d);
                    } else if (n == 2) {
                        this.beginLayUi(1, 1, d);
                    }
                } else {
                    var i = 1;
                    for (var k in d) {
                        d[k].tableId = i++;
                    }
                    var data = d;
                    if (n == 0) {
                        this.beginLayUi(data);
                    } else if (n == 1) {
                        this.beginLayUi(1, data);
                    } else if (n == 2) {
                        this.beginLayUi(1, 1, data);
                    }
                }
            },
            onOpen: function () {
@@ -167,7 +140,15 @@
                    var $ = layui.jquery
                        , element = layui.element;
                    element.on('tab(docDemoTabBrief)', function (elem) {
                        that.getData(elem.index)
                        var val = elem.index;//数据的2和1对调
                        if (elem.index == 1) {
                            val = 2;
                        } else if (elem.index == 2) {
                            val = 1;
                        }
                        that.getData(val, that.searchDatas);
                    });
                });
            },
@@ -220,8 +201,8 @@
                            , cols: [[
                                { field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
                                , { field: 'name', width: 90, align: 'center', unresize: true, title: '图层名称' }
                                , { field: 'protectArea', width: 95, align: 'center', unresize: true, title: '图层属性1' }
                                , { field: 'protectArea', width: 95, align: 'center', unresize: true, title: '图层属性2' }
                                , { field: 'remarks', width: 95, align: 'center', unresize: true, title: '图层属性1' }
                                , { field: 'createTime', width: 95, align: 'center', unresize: true, title: '图层属性2' }
                                , { fixed: 'right', align: 'center', unresize: true, title: '操作', toolbar: '#demoTable' }
                            ]],
                            data: data,
@@ -371,7 +352,9 @@
                                        </tr>
                                        <tr>
                                            <th>图片:</th>
                                            <td class="left" colspan="3"></td>
                                            <td class="left" colspan="3">
                                            <img src="${obj.data.attList[0].uaOriginPath}" alt="">
                                            </td>
                                        </tr>`;
                                str += '</table>';
                                XQDom.append(str);
widgets/searchL/css/style.css
@@ -3,7 +3,7 @@
  font-size: 14px;
  height: 35px !important;
  line-height: 32px;
  width: 300px !important;
  width: 320px !important;
  top: 20px !important;
  left: calc(50% - 150px) !important;
  /* left: calc(100%-300); */
@@ -32,7 +32,7 @@
}
.jimu-widget-searchL .input-sms {
  width: 260px;
  width: 280px;
  height: 35px;
  line-height: 40px;
  font-size: 14px;
@@ -51,7 +51,7 @@
.jimu-widget-searchL #inputTwo {
  display: none;
  width: 260px;
  width: 280px;
  height: 35px;
  font-size: 14px;
  align-items: center;
@@ -60,7 +60,7 @@
.jimu-widget-searchL #inputTwo #local_data2 {
  position: relative;
  left: -15px;
  left: -5px;
}
.jimu-widget-searchL .input-sms1 {
widgets/searchTabaPopup/Widget.js
@@ -72,6 +72,7 @@
                    // title: {
                    //     text: '折线图堆叠'
                    // },
                    animationDuration: 1000,
                    dataZoom: [{
                        type: 'slider'
                    }, {
widgets/searchTabaPopup/css/style.css
@@ -127,7 +127,7 @@
  padding-right: 5px;
  font-size: 14px;
}
.jimu-widget-searchTabaPopup .xiangqing tr:nth-child(6) td {
.jimu-widget-searchTabaPopup .xiangqing tr:nth-child(6) td , .jimu-widget-searchTabaPopup .xiangqing tr:nth-child(7) td{
  text-align-last: left;
  text-indent: 2em;
  padding-left: 5px;
@@ -136,7 +136,10 @@
.jimu-widget-searchTabaPopup .xiangqing th, .jimu-widget-searchTabaPopup .xiangqing td ,.jimu-widget-searchTabaPopup .xiangqing table{
  border-color: rgba(0, 0, 0, .1);
}
.jimu-widget-searchTabaPopup .xiangqing img{
  width: 175px;
padding: 10px 10px 10px 0;
}
.jimu-widget-searchTabaPopup .shishishuju {
  width: 100%;
  height: 100%;