完善大数据页面
This commit is contained in:
parent
805cc08607
commit
a8a6a3da88
@ -0,0 +1,58 @@
|
||||
package com.cm.tenlion.pollutantdata.controller.api.alarmlog;
|
||||
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.pojo.ListPage;
|
||||
import com.cm.common.result.ErrorResult;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.tenlion.pollutantdata.pojo.dtos.alarmlog.AlarmLogDTO;
|
||||
import com.cm.tenlion.pollutantdata.service.alarmlog.IAlarmLogService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: DataMinuteController
|
||||
* @Description: 采集分钟数据
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-03-16 12:06:18
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "警告日志接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/alarmlog")
|
||||
public class AlarmLogController extends AbstractController {
|
||||
|
||||
@Autowired
|
||||
private IAlarmLogService alarmLogService;
|
||||
|
||||
@ApiOperation(value = "警告日志列表", notes = "警告日志列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<AlarmLogDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return alarmLogService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "警告日志分页列表", notes = "警告日志分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<AlarmLogDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return alarmLogService.listPage(page);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.cm.tenlion.pollutantdata.controller.route.alarmlog;
|
||||
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @ClassName: DataMinuteController
|
||||
* @Description: 采集分钟数据
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-03-16 12:06:18
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "警告日志路由")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/alarmlog")
|
||||
public class AlarmLogRouteController extends AbstractController {
|
||||
|
||||
@GetMapping("list-collector")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("alarmlog/list-collector");
|
||||
}
|
||||
|
||||
}
|
@ -30,9 +30,9 @@ public class DataMinuteRouteController extends AbstractController {
|
||||
return new ModelAndView("dataminute/update");
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
@GetMapping("list-collector")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("dataminute/list");
|
||||
return new ModelAndView("dataminute/list-collector");
|
||||
}
|
||||
|
||||
}
|
@ -20,6 +20,7 @@ public class AlarmLogDTO {
|
||||
private String collectorId;
|
||||
private String collectorName;
|
||||
private String pollId;
|
||||
private String pollName;
|
||||
private Double rtd;
|
||||
private Double zsRtd;
|
||||
private Double alarmValue;
|
||||
@ -89,6 +90,14 @@ public class AlarmLogDTO {
|
||||
this.pollId = pollId;
|
||||
}
|
||||
|
||||
public String getPollName() {
|
||||
return pollName == null ? "" : pollName;
|
||||
}
|
||||
|
||||
public void setPollName(String pollName) {
|
||||
this.pollName = pollName;
|
||||
}
|
||||
|
||||
public Double getRtd() {
|
||||
return rtd == null ? 0 : rtd;
|
||||
}
|
||||
|
@ -20,12 +20,20 @@ public class DataMinuteDTO {
|
||||
private String collectorSn;
|
||||
@ApiModelProperty(name = "enterpriseId", value = "企业ID")
|
||||
private String enterpriseId;
|
||||
@ApiModelProperty(name = "enterpriseName", value = "企业名称")
|
||||
private String enterpriseName;
|
||||
@ApiModelProperty(name = "instrumentId", value = "数采仪ID")
|
||||
private String instrumentId;
|
||||
@ApiModelProperty(name = "instrumentName", value = "数采仪名称")
|
||||
private String instrumentName;
|
||||
@ApiModelProperty(name = "collectorId", value = "采集器ID")
|
||||
private String collectorId;
|
||||
@ApiModelProperty(name = "collectorName", value = "采集器名称")
|
||||
private String collectorName;
|
||||
@ApiModelProperty(name = "pollId", value = "污染因子编码")
|
||||
private String pollId;
|
||||
@ApiModelProperty(name = "pollName", value = "污染因子名称")
|
||||
private String pollName;
|
||||
@ApiModelProperty(name = "sampleTime", value = "污染物采样时间")
|
||||
private String sampleTime;
|
||||
@ApiModelProperty(name = "flag", value = "数据标记")
|
||||
@ -93,6 +101,30 @@ public class DataMinuteDTO {
|
||||
this.collectorId = collectorId;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName == null ? "" : enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getInstrumentName() {
|
||||
return instrumentName == null ? "" : instrumentName;
|
||||
}
|
||||
|
||||
public void setInstrumentName(String instrumentName) {
|
||||
this.instrumentName = instrumentName;
|
||||
}
|
||||
|
||||
public String getCollectorName() {
|
||||
return collectorName == null ? "" : collectorName;
|
||||
}
|
||||
|
||||
public void setCollectorName(String collectorName) {
|
||||
this.collectorName = collectorName;
|
||||
}
|
||||
|
||||
public String getPollId() {
|
||||
return pollId == null ? "" : pollId.trim();
|
||||
}
|
||||
@ -101,6 +133,14 @@ public class DataMinuteDTO {
|
||||
this.pollId = pollId;
|
||||
}
|
||||
|
||||
public String getPollName() {
|
||||
return pollName == null ? "" : pollName;
|
||||
}
|
||||
|
||||
public void setPollName(String pollName) {
|
||||
this.pollName = pollName;
|
||||
}
|
||||
|
||||
public String getSampleTime() {
|
||||
return sampleTime == null ? "" : sampleTime.trim();
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ system:
|
||||
# 安全
|
||||
security:
|
||||
oauth2:
|
||||
oauth-server: http://192.168.0.106:7001/usercenter
|
||||
oauth-server: http://192.168.0.103:7001/usercenter
|
||||
oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url}
|
||||
client:
|
||||
client-id: 74e4b55ad48840f9b4de86ce5da58b53
|
||||
|
@ -11,6 +11,7 @@
|
||||
<result column="collector_id" property="collectorId"/>
|
||||
<result column="collector_name" property="collectorName"/>
|
||||
<result column="poll_id" property="pollId"/>
|
||||
<result column="poll_name" property="pollName"/>
|
||||
<result column="rtd" property="rtd"/>
|
||||
<result column="zs_rtd" property="zsRtd"/>
|
||||
<result column="alarm_value" property="alarmValue"/>
|
||||
@ -56,24 +57,80 @@
|
||||
<!-- 列表 -->
|
||||
<select id="list" parameterType="map" resultMap="alarmLogDTO">
|
||||
SELECT
|
||||
alarm_log_id,
|
||||
enterprise_id,
|
||||
enterprise_name,
|
||||
instrument_id,
|
||||
instrument_name,
|
||||
collector_id,
|
||||
collector_name,
|
||||
poll_id,
|
||||
rtd,
|
||||
zs_rtd,
|
||||
alarm_value,
|
||||
LEFT(gmt_create, 19) gmt_create
|
||||
t1.alarm_log_id,
|
||||
t1.enterprise_id,
|
||||
jt1.enterprise_name,
|
||||
t1.instrument_id,
|
||||
jt2.instrument_name,
|
||||
t1.collector_id,
|
||||
jt3.collector_name,
|
||||
t1.poll_id,
|
||||
jt4.poll_name,
|
||||
t1.rtd,
|
||||
t1.zs_rtd,
|
||||
t1.alarm_value,
|
||||
LEFT(t1.gmt_create, 19) gmt_create
|
||||
FROM
|
||||
pollute_alarm_log
|
||||
pollute_alarm_log t1
|
||||
LEFT JOIN
|
||||
pollute_enterprise jt1
|
||||
ON
|
||||
t1.enterprise_id = jt1.enterprise_id
|
||||
AND
|
||||
jt1.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_instrument jt2
|
||||
ON
|
||||
t1.instrument_id = jt2.instrument_id
|
||||
AND
|
||||
jt2.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_collector jt3
|
||||
ON
|
||||
t1.collector_id = jt3.collector_id
|
||||
AND
|
||||
jt3.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_poll jt4
|
||||
ON
|
||||
t1.poll_id = jt4.poll_no
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
t1.poll_id LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt1.enterprise_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt2.instrument_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt3.collector_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt4.poll_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
AND
|
||||
t1.enterprise_id = #{enterpriseId}
|
||||
</if>
|
||||
<if test="instrumentId != null and instrumentId != ''">
|
||||
AND
|
||||
t1.instrument_id = #{instrumentId}
|
||||
</if>
|
||||
<if test="collectorId != null and collectorId != ''">
|
||||
AND
|
||||
t1.collector_id = #{collectorId}
|
||||
</if>
|
||||
ORDER BY
|
||||
gmt_create DESC
|
||||
t1.gmt_create DESC
|
||||
</select>
|
||||
|
||||
<!-- 统计 -->
|
||||
|
@ -6,9 +6,13 @@
|
||||
<result column="data_id" property="dataId"/>
|
||||
<result column="collector_sn" property="collectorSn"/>
|
||||
<result column="enterprise_id" property="enterpriseId"/>
|
||||
<result column="enterprise_name" property="enterpriseName"/>
|
||||
<result column="instrument_id" property="instrumentId"/>
|
||||
<result column="instrument_name" property="instrumentName"/>
|
||||
<result column="collector_id" property="collectorId"/>
|
||||
<result column="collector_name" property="collectorName"/>
|
||||
<result column="poll_id" property="pollId"/>
|
||||
<result column="poll_name" property="pollName"/>
|
||||
<result column="sample_time" property="sampleTime"/>
|
||||
<result column="flag" property="flag"/>
|
||||
<result column="rtd" property="rtd"/>
|
||||
@ -293,9 +297,13 @@
|
||||
t1.data_id,
|
||||
t1.collector_sn,
|
||||
t1.enterprise_id,
|
||||
jt1.enterprise_name,
|
||||
t1.instrument_id,
|
||||
jt2.instrument_name,
|
||||
t1.collector_id,
|
||||
jt3.collector_name,
|
||||
t1.poll_id,
|
||||
jt4.poll_name,
|
||||
t1.sample_time,
|
||||
t1.flag,
|
||||
t1.rtd,
|
||||
@ -309,15 +317,46 @@
|
||||
t1.second,
|
||||
t1.info_id,
|
||||
t1.info,
|
||||
t1.gmt_create,
|
||||
1
|
||||
LEFT(t1.gmt_create, 19) gmt_create
|
||||
FROM
|
||||
pollute_data_minute t1
|
||||
LEFT JOIN
|
||||
pollute_enterprise jt1
|
||||
ON
|
||||
t1.enterprise_id = jt1.enterprise_id
|
||||
AND
|
||||
jt1.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_instrument jt2
|
||||
ON
|
||||
t1.instrument_id = jt2.instrument_id
|
||||
AND
|
||||
jt2.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_collector jt3
|
||||
ON
|
||||
t1.collector_id = jt3.collector_id
|
||||
AND
|
||||
jt3.is_delete = 0
|
||||
LEFT JOIN
|
||||
pollute_poll jt4
|
||||
ON
|
||||
t1.poll_id = jt4.poll_no
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
t1.collector_sn LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
t1.poll_id LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt1.enterprise_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt2.instrument_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt3.collector_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt4.poll_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
@ -328,6 +367,22 @@
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
AND
|
||||
t1.enterprise_id = #{enterpriseId}
|
||||
</if>
|
||||
<if test="instrumentId != null and instrumentId != ''">
|
||||
AND
|
||||
t1.instrument_id = #{instrumentId}
|
||||
</if>
|
||||
<if test="collectorId != null and collectorId != ''">
|
||||
AND
|
||||
t1.collector_id = #{collectorId}
|
||||
</if>
|
||||
<if test="descOrderBy != null and descOrderBy = 'gmtCreate'">
|
||||
ORDER BY
|
||||
t1.gmt_create DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 采集分钟数据列表 -->
|
||||
@ -438,6 +493,10 @@
|
||||
AND
|
||||
t1.poll_id = #{pollId}
|
||||
</if>
|
||||
<if test="day != null and day != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) = #{day}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 统计污染因子 -->
|
@ -28,15 +28,15 @@
|
||||
<div class="sycm">
|
||||
<ul class="clearfix">
|
||||
<li v-if="type == 'all'">
|
||||
<h2>{{count.enterprise}}</h2>
|
||||
<h2><a href="javascript:void(0);" @click="showEnterprise">{{count.enterprise}}</a></h2>
|
||||
<span>监控企业</span>
|
||||
</li>
|
||||
<li>
|
||||
<h2>{{count.instrument}}</h2>
|
||||
<h2><a href="javascript:void(0);" @click="showInstrument">{{count.instrument}}</a></h2>
|
||||
<span>采集仪数量</span>
|
||||
</li>
|
||||
<li>
|
||||
<h2>{{count.collector}}</h2>
|
||||
<h2><a href="javascript:void(0);" @click="showCollector">{{count.collector}}</a></h2>
|
||||
<span>采集器数量</span>
|
||||
</li>
|
||||
<li v-if="type == 'single'">
|
||||
@ -201,6 +201,36 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showEnterprise: function() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/bigdata/style1/list-enterprise.html'
|
||||
});
|
||||
},
|
||||
showInstrument: function() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/bigdata/style1/list-instrument.html'
|
||||
});
|
||||
},
|
||||
showCollector: function() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/bigdata/style1/list-collector.html'
|
||||
});
|
||||
},
|
||||
// 总数
|
||||
initCount: function() {
|
||||
var self = this;
|
||||
|
@ -0,0 +1,242 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<base href="/pollutant/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
background: url('assets/bigdata/style1/images/bg.jpg');
|
||||
}
|
||||
div, table, tr, th, button, select, input {
|
||||
background: transparent !important;
|
||||
}
|
||||
div, i, a, table, tr, th, select, input, button, span {
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<script type="text/html" id="headerToolBar">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
|
||||
<i class="fa fa-lg fa-plus"></i> 新增
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/collector/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'collectorMn', width: 180, title: '设备编号', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'collectorName', width: 180, title: '名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'collectorSummary', width: 180, title: '描述', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'address', width: 140, title: '位置', align:'center',
|
||||
templet: function(row) {
|
||||
var lng = row.collectorLng;
|
||||
var lat = row.collectorLat;
|
||||
if(lng && lat) {
|
||||
return '<i class="fa fa-location-arrow"> <a href="javascript:void(0);" data-lng="'+ lng +'" data-lat="'+ lat +'" lay-event="locationEvent">点击查看位置</a></i>';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'st', width: 180, title: '系统编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'alarmValue', width: 180, title: '报警值', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'enterpriseName', width: 180, title: '企业名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'instrumentName', width: 180, title: '数采仪名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '添加时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'locationEvent') {
|
||||
var positions = this.dataset;
|
||||
var lng = positions.lng;
|
||||
var lat = positions.lat;
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/map/get-location.html?lng='+ lng +'&lat='+ lat
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,181 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<base href="/pollutant/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
background: url('assets/bigdata/style1/images/bg.jpg');
|
||||
}
|
||||
div, table, tr, th, button, select, input {
|
||||
background: transparent !important;
|
||||
}
|
||||
div, i, a, table, tr, th, select, input, button, span {
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/enterprise/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'enterpriseName', width: 300, title: '名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'address', width: 140, title: '位置', align:'center',
|
||||
templet: function(row) {
|
||||
var lng = row.enterpriseLng;
|
||||
var lat = row.enterpriseLat;
|
||||
if(lng && lat) {
|
||||
return '<i class="fa fa-location-arrow"> <a href="javascript:void(0);" data-lng="'+ lng +'" data-lat="'+ lat +'" lay-event="locationEvent">点击查看位置</a></i>';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '添加时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'locationEvent') {
|
||||
var positions = this.dataset;
|
||||
var lng = positions.lng;
|
||||
var lat = positions.lat;
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/map/get-location.html?lng='+ lng +'&lat='+ lat
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,227 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<base href="/pollutant/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
background: url('assets/bigdata/style1/images/bg.jpg');
|
||||
}
|
||||
div, table, tr, th, button, select, input {
|
||||
background: transparent !important;
|
||||
}
|
||||
div, i, a, table, tr, th, select, input, button, span {
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/instrument/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'instrumentMn', width: 180, title: '设备编号', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'instrumentName', width: 180, title: '名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'instrumentSummary', width: 180, title: '说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
|
||||
{field: 'address', width: 140, title: '位置', align:'center',
|
||||
templet: function(row) {
|
||||
var lng = row.instrumentLng;
|
||||
var lat = row.instrumentLat;
|
||||
if(lng && lat) {
|
||||
return '<i class="fa fa-location-arrow"> <a href="javascript:void(0);" data-lng="'+ lng +'" data-lat="'+ lat +'" lay-event="locationEvent">点击查看位置</a></i>';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'st', width: 180, title: '系统编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'enterpriseName', width: 180, title: '企业名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'lastReportTime', width: 180, title: '最后上报时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '添加时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'locationEvent') {
|
||||
var positions = this.dataset;
|
||||
var lng = positions.lng;
|
||||
var lat = positions.lat;
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['80%', '80%'],
|
||||
content: 'route/map/get-location.html?lng='+ lng +'&lat='+ lat
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
294
src/main/resources/templates/alarmlog/list-collector.html
Normal file
294
src/main/resources/templates/alarmlog/list-collector.html
Normal file
@ -0,0 +1,294 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/alarmlog/listpage?collectorId={collectorId}';
|
||||
var collectorId = top.restAjax.params(window.location.href).collectorId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [collectorId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 60,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'rtd', width: 100, title: '实时数据', align:'center', fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'zsRtd', width: 100, title: '实时折算值', align:'center', fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'alarmValue', width: 100, title: '报警值', align:'center', fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'pollId', width: 180, title: '污染因子编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'pollName', width: 180, title: '污染因子', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'collectorSn', width: 180, title: '采集器编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'enterpriseName', width: 180, title: '企业名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'instrumentName', width: 180, title: '数采仪名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'collectorName', width: 180, title: '采集器名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '报警时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [collectorId]),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 60,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/dataminute/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/dataminute/save', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/dataminute/update?dataMinuteId={dataMinuteId}', [checkDatas[0].dataMinuteId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'removeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['dataMinuteId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -169,6 +169,16 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'dataMinute', width: 100, title: '上报记录', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="dataMinuteEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'alarmLog', width: 100, title: '警告记录', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="alarmLogEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
@ -311,6 +321,22 @@
|
||||
height: '500px',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'dataMinuteEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/dataminute/list-collector?collectorId={collectorId}', [data.collectorId]),
|
||||
title: '【'+ data.collectorName +'】的实时数据',
|
||||
width: '80%',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'alarmLogEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/alarmlog/list-collector?collectorId={collectorId}', [data.collectorId]),
|
||||
title: '【'+ data.collectorName +'】的报警数据',
|
||||
width: '80%',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -11,7 +11,7 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
@ -31,20 +31,6 @@
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<script type="text/html" id="headerToolBar">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
|
||||
<i class="fa fa-lg fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
|
||||
<i class="fa fa-lg fa-edit"></i> 编辑
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
|
||||
<i class="fa fa-lg fa-trash"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,28 +51,55 @@
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/dataminute/listpage';
|
||||
var tableUrl = 'api/dataminute/listpage?collectorId={collectorId}&descOrderBy={descOrderBy}';
|
||||
var collectorId = top.restAjax.params(window.location.href).collectorId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
url: top.restAjax.path(tableUrl, [collectorId, 'gmtCreate']),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
height: $win.height() - 60,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'dataId', width: 180, title: '', align:'center',
|
||||
{field: 'rtd', width: 100, title: '实时数据', align:'center', fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'zsRtd', width: 100, title: '实时折算值', align:'center', fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
|
||||
{field: 'pollId', width: 180, title: '污染因子编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'pollName', width: 180, title: '污染因子', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -104,7 +117,7 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'enterpriseId', width: 180, title: '企业ID', align:'center',
|
||||
{field: 'enterpriseName', width: 180, title: '企业名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -113,7 +126,7 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'instrumentId', width: 180, title: '数采仪ID', align:'center',
|
||||
{field: 'instrumentName', width: 180, title: '数采仪名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -122,16 +135,7 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'collectorId', width: 180, title: '采集器ID', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'pollId', width: 180, title: '污染因子编码', align:'center',
|
||||
{field: 'collectorName', width: 180, title: '采集器名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -158,78 +162,6 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'rtd', width: 180, title: '实时数据', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'zsRtd', width: 180, title: '实时折算值', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'yyyy', width: 180, title: '年', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'month', width: 180, title: '月', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'day', width: 180, title: '日', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'hour', width: 180, title: '时', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'minus', width: 180, title: '分', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'second', width: 180, title: '秒', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'infoId', width: 180, title: '设备信息编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
@ -273,7 +205,7 @@
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
url: top.restAjax.path(tableUrl, [collectorId, 'gmtCreate']),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
@ -282,7 +214,7 @@
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
height: $win.height() - 60,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
@ -1,277 +0,0 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">采集器编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="collectorSn" name="collectorSn" class="layui-input" value="" placeholder="请输入采集器编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">企业ID</label>
|
||||
<div class="layui-input-block layui-form" id="enterpriseIdSelectTemplateBox" lay-filter="enterpriseIdSelectTemplateBox"></div>
|
||||
<script id="enterpriseIdSelectTemplate" type="text/html">
|
||||
<select id="enterpriseId" name="enterpriseId">
|
||||
<option value="">请选择企业ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数采仪ID</label>
|
||||
<div class="layui-input-block layui-form" id="instrumentIdSelectTemplateBox" lay-filter="instrumentIdSelectTemplateBox"></div>
|
||||
<script id="instrumentIdSelectTemplate" type="text/html">
|
||||
<select id="instrumentId" name="instrumentId">
|
||||
<option value="">请选择数采仪ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">采集器ID</label>
|
||||
<div class="layui-input-block layui-form" id="collectorIdSelectTemplateBox" lay-filter="collectorIdSelectTemplateBox"></div>
|
||||
<script id="collectorIdSelectTemplate" type="text/html">
|
||||
<select id="collectorId" name="collectorId">
|
||||
<option value="">请选择采集器ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">污染因子编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="pollId" name="pollId" class="layui-input" value="" placeholder="请输入污染因子编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">污染物采样时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="sampleTime" name="sampleTime" class="layui-input" value="" placeholder="请输入污染物采样时间" maxlength="14">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数据标记</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="flag" name="flag" class="layui-input" value="" placeholder="请输入数据标记" maxlength="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">实时数据</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" step="0.01" id="rtd" name="rtd" class="layui-input" value="" placeholder="请输入实时数据" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">实时折算值</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" step="0.01" id="zsRtd" name="zsRtd" class="layui-input" value="" placeholder="请输入实时折算值" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">设备信息编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="infoId" name="infoId" class="layui-input" value="" placeholder="请输入设备信息编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">现场设备信息</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="info" name="info" class="layui-input" value="" placeholder="请输入现场设备信息" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/listfilebyfileid', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/downloadfile/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化企业ID下拉选择
|
||||
function initEnterpriseIdSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('enterpriseIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('enterpriseIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'enterpriseIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化数采仪ID下拉选择
|
||||
function initInstrumentIdSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('instrumentIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('instrumentIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'instrumentIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化采集器ID下拉选择
|
||||
function initCollectorIdSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('collectorIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('collectorIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'collectorIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
initEnterpriseIdSelect();
|
||||
initInstrumentIdSelect();
|
||||
initCollectorIdSelect();
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/dataminute/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,306 +0,0 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">采集器编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="collectorSn" name="collectorSn" class="layui-input" value="" placeholder="请输入采集器编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">企业ID</label>
|
||||
<div class="layui-input-block layui-form" id="enterpriseIdSelectTemplateBox" lay-filter="enterpriseIdSelectTemplateBox"></div>
|
||||
<script id="enterpriseIdSelectTemplate" type="text/html">
|
||||
<select id="enterpriseId" name="enterpriseId">
|
||||
<option value="">请选择企业ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数采仪ID</label>
|
||||
<div class="layui-input-block layui-form" id="instrumentIdSelectTemplateBox" lay-filter="instrumentIdSelectTemplateBox"></div>
|
||||
<script id="instrumentIdSelectTemplate" type="text/html">
|
||||
<select id="instrumentId" name="instrumentId">
|
||||
<option value="">请选择数采仪ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">采集器ID</label>
|
||||
<div class="layui-input-block layui-form" id="collectorIdSelectTemplateBox" lay-filter="collectorIdSelectTemplateBox"></div>
|
||||
<script id="collectorIdSelectTemplate" type="text/html">
|
||||
<select id="collectorId" name="collectorId">
|
||||
<option value="">请选择采集器ID</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.selectId}}">{{item.selectName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">污染因子编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="pollId" name="pollId" class="layui-input" value="" placeholder="请输入污染因子编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">污染物采样时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="sampleTime" name="sampleTime" class="layui-input" value="" placeholder="请输入污染物采样时间" maxlength="14">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">数据标记</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="flag" name="flag" class="layui-input" value="" placeholder="请输入数据标记" maxlength="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">实时数据</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" step="0.01" id="rtd" name="rtd" class="layui-input" value="" placeholder="请输入实时数据" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">实时折算值</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" step="0.01" id="zsRtd" name="zsRtd" class="layui-input" value="" placeholder="请输入实时折算值" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">设备信息编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="infoId" name="infoId" class="layui-input" value="" placeholder="请输入设备信息编码" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">现场设备信息</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="info" name="info" class="layui-input" value="" placeholder="请输入现场设备信息" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var dataMinuteId = top.restAjax.params(window.location.href).dataMinuteId;
|
||||
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/listfilebyfileid', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/downloadfile/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化企业ID下拉选择
|
||||
function initEnterpriseIdSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('enterpriseIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('enterpriseIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'enterpriseIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['enterpriseId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化数采仪ID下拉选择
|
||||
function initInstrumentIdSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('instrumentIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('instrumentIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'instrumentIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['instrumentId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化采集器ID下拉选择
|
||||
function initCollectorIdSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('collectorIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('collectorIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'collectorIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['collectorId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/dataminute/get/{dataMinuteId}', [dataMinuteId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
initEnterpriseIdSelect(data['enterpriseId']);
|
||||
initInstrumentIdSelect(data['instrumentId']);
|
||||
initCollectorIdSelect(data['collectorId']);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/dataminute/update/{dataMinuteId}', [dataMinuteId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -96,7 +96,7 @@ public class HJ212Test {
|
||||
});
|
||||
}
|
||||
});
|
||||
ChannelFuture channelFuture = bootstrap.connect("127.0.0.1", 6666).sync();
|
||||
ChannelFuture channelFuture = bootstrap.connect("124.67.110.246", 6666).sync();
|
||||
channelFuture.addListener((ChannelFutureListener) future -> {
|
||||
if (!future.isSuccess()) {
|
||||
future.channel().pipeline().fireChannelInactive();
|
||||
|
Loading…
Reference in New Issue
Block a user