From f04efcae7635378aed3bca570322a38cae97d722 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 11 Jun 2021 16:43:57 +0800
Subject: [PATCH] 搜索弹窗 表格
---
widgets/searchL/Widget.js | 99 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 74 insertions(+), 25 deletions(-)
diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
index e2bb50b..7a04cee 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -35,7 +35,7 @@
//关键词&&坐标
$("#i-f-gjz").click(function () {
that.states = 'one';
- $("#i-f-zb").css({ 'backgroundColor': '#fff', 'color': '#000' });
+ $("#i-f-zb").css({ 'backgroundColor': '#fff', 'color': '#969696' });
$("#i-f-gjz").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
// $("#inputTwo").css({ 'display': 'none' });
// $("#local_data").css({ 'display': 'inline-block' });
@@ -44,7 +44,7 @@
})
$("#i-f-zb").click(function () {
that.states = 'two';
- $("#i-f-gjz").css({ 'backgroundColor': '#fff', 'color': '#000' });
+ $("#i-f-gjz").css({ 'backgroundColor': '#fff', 'color': '#969696' });
$("#i-f-zb").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
// $("#local_data").css({ 'display': 'none' });
// $("#inputTwo").css({ 'display': 'inline-block' });
@@ -59,6 +59,9 @@
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(){
//得到各种内置组件
@@ -86,6 +89,7 @@
})
$(".searchColce").click(function () {
$('.searchLMain').hide();
+ that.map.entities.removeAll();
})
},
@@ -232,6 +236,7 @@
})
},
beginLayUi: function (data = 1, data1 = 1, data2 = 1) {
+ // console.log(data,data1,data2)
var that = this;
layui.use(function () {
var element = layui.element
@@ -242,8 +247,7 @@
table.render({
elem: '#test'
- // , url: './data'
- , height: 475
+ // , url: './data'全景
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
// layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
@@ -254,9 +258,9 @@
}
, cols: [[
{ field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
- , { field: 'name', width: 90, align: 'center', unresize: true, title: '图层名称' }
- , { field: 'remarks', width: 95, align: 'center', unresize: true, title: '图层属性1' }
- , { field: 'createTime', width: 95, align: 'center', unresize: true, title: '图层属性2' }
+ , { field: 'name', width: 90, align: 'center', unresize: true, title: '名称' }
+ , { field: 'protectArea', width: 95, align: 'center', unresize: true, title: '所属保护区' }
+ , { field: 'remarks', width: 95, align: 'center', unresize: true, title: '备注' }
, { fixed: 'right', align: 'center', unresize: true, title: '操作', toolbar: '#demoTable' }
]],
data: data,
@@ -280,10 +284,10 @@
});
}
if (data1 != 1) {
+
table.render({
elem: '#test1'
- // , url: './data'
- , height: 475
+ // , url: './data'//监控
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
// layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
@@ -294,9 +298,9 @@
}
, cols: [[
{ field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
- , { field: 'name', width: 90, align: 'center', unresize: true, title: '图层名称' }
- , { field: 'protectName', width: 95, align: 'center', unresize: true, title: '图层属性1' }
- , { field: 'serviceUrl', width: 95, align: 'center', unresize: true, title: '图层属性2' }
+ , { 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' }
]],
data: data1,
@@ -311,16 +315,46 @@
var data = obj.data //获得当前行数据
, layEvent = obj.event; //获得 lay-event 对应的值
if (layEvent === 'detail') {
- // layer.msg('查看操作');
- var dom = $('#poput-m-t-video'),
- str = `
- <div class="header">${obj.data.name}--实时视频</div>
- <video id="video1" class="video-js vjs-default-skin" width="100%" height="100%"
- data-setup='{"controls" : true, "autoplay" : true, "preload" : "auto"}'>
- <source src="${obj.data.flv}" type="video/x-flv">
- </video>`;
+ var dom = $('.header'),
+ str = `${obj.data.name}--实时视频`;
dom.empty();
dom.append(str);
+ if (obj.data.flv) {
+ var dom = $('#poput-m-t-video'),
+ // <div id="poput-m-t-video-login"><i class="layui-icon"></i></div>
+ str = `
+ <video id="poput-m-t-video-video" ></video>
+ `;
+ dom.empty();
+ dom.append(str);
+
+ // console.log(obj.data.name);
+ // console.log(obj.data.flv);
+
+ if (flvjs.isSupported()) {
+ var videoElement = document.getElementById('poput-m-t-video-video');
+ var flvPlayer = flvjs.createPlayer({
+ type: 'flv',
+ url: obj.data.flv
+ });
+ flvPlayer.attachMediaElement(videoElement);
+ flvPlayer.load();
+ flvPlayer.play();
+ }
+ window.$myVideoFlvplayer = flvPlayer;
+ // var time = setTimeout(() => {
+
+ // }, 2000);
+ } else {
+ var dom = $('#poput-m-t-video'),
+ str = `
+ <div id="poput-m-t-video-none" >·暂无视频</div>
+ `;
+ dom.empty();
+ dom.append(str);
+ }
+
+
$('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
$('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
@@ -333,8 +367,7 @@
table.render({
elem: '#test2'
- // , url: './data'
- , height: 475
+ // , url: './data'//检测
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
// layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
@@ -345,9 +378,9 @@
}
, cols: [[
{ field: 'tableId', width: 59, align: 'center', unresize: true, title: '序号' }
- , { field: 'name', width: 90, align: 'center', unresize: true, title: '图层名称' }
- , { field: 'stcd', width: 95, align: 'center', unresize: true, title: '图层属性1' }
- , { field: 'createTime', width: 95, align: 'center', unresize: true, title: '图层属性2' }
+ , { 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' }
]],
data: data2,
@@ -449,6 +482,22 @@
})
},
setshishidata: function (data, stcd, id = '#shuiwenshishi') {
+ //给默认时间
+ var date = new Date();
+ var date1 = new Date(+new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
+ var myDate = date.setDate(date.getDate() - 7);
+ var date2 = new Date(+new Date(myDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
+ // console.log([date1, date2], 123456789);
+ //设置value
+ $('#test-startDate-1').val(date2);
+ $('#test-endDate-1').val(date1);
+ window.defultEchartsTimes = [date2, date1];
+ // var time = setTimeout(() => {
+ $('.jimu-widget-searchTabaPopup').find('#query').click();
+ // clearTimeout(time);
+ // time = null;
+ // }, 500);
+
var str = '',
shuiwenDom = $('.jimu-widget-searchTabaPopup').find(id)
shuiwenDom.empty();
--
Gitblit v1.9.3