dc076746513f81183c57f3c67eec0441c7353526..f543f68bace7186c5c375d72d26acd29cbecfca5
2021-06-09 liuyg
搜索弹框 细节优化
f543f6 diff | tree
2021-06-09 liuyg
搜索 正式
12297c diff | tree
3 files modified
54 ■■■■ changed files
widgets/searchL/Widget.html 8 ●●●● patch | view | raw | blame | history
widgets/searchL/Widget.js 44 ●●●● patch | view | raw | blame | history
widgets/searchTabaPopup/Widget.js 2 ●●● patch | view | raw | blame | history
widgets/searchL/Widget.html
@@ -3,12 +3,12 @@
        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"
        <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="text" class="input-sms1"
        <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">
widgets/searchL/Widget.js
@@ -58,12 +58,35 @@
                    // 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();
                    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 () {
@@ -79,11 +102,12 @@
                }
            },
            getData: function (index, val) {
                val = val == '  '? '': val;
                var d = $('.searchLMain').find('.layui-tab-item').hide;
                // console.log(d)
                var that = this,
                    // 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}`
                    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, {
@@ -220,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]);
                            }
@@ -362,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/searchTabaPopup/Widget.js
@@ -66,7 +66,7 @@
                var that = this;
                var option;
                console.log(this.myChart);
                // console.log(this.myChart);
                option = {
                    // title: {