From ebefa651ad2d6edbfdb30fea3fc1ff97232a0aee Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 15 Jun 2021 11:07:52 +0800
Subject: [PATCH] 工具样式
---
widgets/searchL/Widget.js | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
index 7a04cee..2881845 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -75,6 +75,11 @@
}
} else {
if (that.searchDatas[0] && that.searchDatas[1]) {
+ that.map.camera.flyTo({
+ // destination: Cesium.Cartesian3.fromDegrees(Number(lng), Number(lat), Number(gaodu))
+ destination: Cesium.Cartesian3.fromDegrees(Number(that.searchDatas[0]), Number(that.searchDatas[1]), Number(8000))
+
+ });
} else {
layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){
//得到各种内置组件
@@ -90,6 +95,31 @@
$(".searchColce").click(function () {
$('.searchLMain').hide();
that.map.entities.removeAll();
+ })
+
+ $("#local_data").keyup(function (e) {
+ console.log(e);
+ that.getInputData();
+ if (e.keyCode == 13 && typeof that.searchDatas == 'string') {
+ var han = /^[\u4e00-\u9fa5]+$/;
+ if (han.test(that.searchDatas) || that.searchDatas == ' ') {
+ that.getData(0, that.searchDatas);
+ $('.searchLMain').show();
+ $('.searchLMain').find('ul.layui-tab-title li:eq(0)').addClass('layui-this').siblings().removeClass('layui-this');
+ $('.searchLMain').find('div.layui-tab-content > div.layui-tab-item:eq(0)').addClass('layui-show').siblings().removeClass('layui-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();
+ }
+ }
})
},
@@ -284,7 +314,7 @@
});
}
if (data1 != 1) {
-
+
table.render({
elem: '#test1'
// , url: './data'//监控
@@ -298,7 +328,7 @@
}
, cols: [[
{ field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
- , { field: 'name', width: 90, align: 'center', unresize: true, title: '名称' }
+ , { field: 'name', width: 90, align: 'center', unresize: true, title: '站点' }
, { field: 'protectName', width: 95, align: 'center', unresize: true, title: '所属保护区' }
, { field: 'remark', width: 95, align: 'center', unresize: true, title: '备注' }
, { fixed: 'right', align: 'center', unresize: true, title: '操作', toolbar: '#demoTable1' }
@@ -378,7 +408,7 @@
}
, cols: [[
{ field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
- , { field: 'name', width: 90, align: 'center', unresize: true, title: '名称' }
+ , { field: 'name', width: 90, align: 'center', unresize: true, title: '站点' }
, { field: 'wetlandName', width: 95, align: 'center', unresize: true, title: '所属保护区' }
, { field: 'remark', width: 95, align: 'center', unresize: true, title: '备注' }
, { fixed: 'right', align: 'center', unresize: true, title: '操作', toolbar: '#demoTable2' }
@@ -391,6 +421,7 @@
, limit: 10 //每页默认显示的数量
});
+
table.on('tool(test2)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
, layEvent = obj.event; //获得 lay-event 对应的值
@@ -411,9 +442,15 @@
}
});
}
-
+ that.addTitle();
//…
});
+ },
+ addTitle: function () {
+ let tdom = $("[data-field]");
+ for (var i = 0; i < tdom.length; i++) {
+ $(tdom[i]).attr("title", $(tdom[i]).text())
+ }
},
setXiangqing(obj) {
var str = '';
@@ -493,9 +530,9 @@
$('#test-endDate-1').val(date1);
window.defultEchartsTimes = [date2, date1];
// var time = setTimeout(() => {
- $('.jimu-widget-searchTabaPopup').find('#query').click();
- // clearTimeout(time);
- // time = null;
+ $('.jimu-widget-searchTabaPopup').find('#query').click();
+ // clearTimeout(time);
+ // time = null;
// }, 500);
var str = '',
--
Gitblit v1.9.3