shuishen
2021-06-09 81695a6227625197cff2f8f1c219d20ae6bd3adc
Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
5 files modified
197 ■■■■ changed files
widgets/searchL/Widget.html 12 ●●●● patch | view | raw | blame | history
widgets/searchL/Widget.js 167 ●●●● patch | view | raw | blame | history
widgets/searchL/css/style.css 8 ●●●● patch | view | raw | blame | history
widgets/searchTabaPopup/Widget.js 3 ●●●● patch | view | raw | blame | history
widgets/searchTabaPopup/css/style.css 7 ●●●● patch | view | raw | blame | history
widgets/searchL/Widget.html
@@ -3,13 +3,13 @@
        style="border-radius: 5px 0 0px 5px;width:4.7rem;background-color: #3E9FFC;color: #fff;">关键字</div>
    <div id="i-f-zb" class="input-font" style="width:3.5rem">坐标</div>
    <!-- <input type="text" placeholder="输入关键字以搜索" class="input-sm /> -->
    <input id="local_data" autocomplete="off" value="鄱阳湖" data-provide="typeahead" type="text" class="input-sms"
        placeholder="输入关键字以搜索" />
    <input id="local_data" autocomplete="off"  data-provide="typeahead" type="text" class="input-sms"
        placeholder="输入关键字以搜索: 鄱阳湖" />
    <div id="inputTwo">
        <input id="local_data1" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
            placeholder="输入经度" />
        <input id="local_data2" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
            placeholder="输入纬度" />
        <input id="local_data1" autocomplete="off" data-provide="typeahead" type="number" class="input-sms1"
            placeholder="经度:115.5" />
        <input id="local_data2" autocomplete="off" data-provide="typeahead" type="number" class="input-sms1"
            placeholder="纬度:25.5" />
    </div>
    <img class="input_img searchImg" src="images/addL/sous.png">
    <div class="searchLMain">
widgets/searchL/Widget.js
@@ -55,29 +55,43 @@
                })
                $(".searchImg").click(function () {
                    // that.getInputData();
                    // that.setVal(that.searchDatas);
                    $('.searchLMain').show();
                    // console.log(2324345)
                    that.getInputData();
                    // console.log(that.searchDatas)
                    if(typeof that.searchDatas == 'string'){
                        var han = /^[\u4e00-\u9fa5]+$/;
                        if (han.test(that.searchDatas) || that.searchDatas == '  ') {
                            that.getData(0, that.searchDatas);
                            $('.searchLMain').show();
                        } else {
                            layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){
                                //得到各种内置组件
                                var layer = layui.layer //弹层
                                // layer.msg('请先填写关键字', { icon: 1, time: 1000, shift: 6 });
                                layer.tips('请先填写关键字', '.searchImg',{
                                    tips: [2,'#FF5722']
                                });
                            })
                            $('.searchLMain').hide();
                        }
                    }else{
                        if(that.searchDatas[0] && that.searchDatas[1]){
                            console.log(that.searchDatas);
                        }else{
                            layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){
                                //得到各种内置组件
                                var layer = layui.layer //弹层
                                // layer.msg('请先填写关键字', { icon: 1, time: 1000, shift: 6 });
                                layer.tips('请先填写完整坐标', '.searchImg',{
                                    tips: [2,'#FF5722']
                                });
                            })
                        }
                    }
                })
                $(".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 +101,59 @@
                    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) {
                val = val == '  '? '': 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 +164,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 +225,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,
@@ -239,7 +244,7 @@
                            if (layEvent === 'detail') {
                                //   layer.msg('查看操作');
                                window.open(obj.data.panAddress);
                                console.log(obj.data.panAddress)
                                // console.log(obj.data.panAddress)
                            } else if (layEvent === 'edit') {
                                that.goOnPosition([obj.data.lon, obj.data.lat]);
                            }
@@ -371,7 +376,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);
@@ -379,7 +386,7 @@
                                $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
                                $('.jimu-widget-searchTabaPopup').find('.p-main').eq(1).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
                                console.log(obj.data.name)
                                // console.log(obj.data.name)
                            } else if (layEvent === 'edit') {
                                that.goOnPosition([obj.data.lon, obj.data.lat]);
                            }
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
@@ -66,12 +66,13 @@
                var that = this;
                var option;
                console.log(this.myChart);
                // console.log(this.myChart);
                option = {
                    // 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%;