新增学校(重点人员、案事件),护路护线(案事件)逻辑关系。
This commit is contained in:
parent
6acd5b166b
commit
c2a093d59a
@ -33,4 +33,9 @@ public class LineCaseRouteController extends DefaultBaseController {
|
||||
return new ModelAndView("linecase/list");
|
||||
}
|
||||
|
||||
@GetMapping("list-view")
|
||||
public ModelAndView listView() {
|
||||
return new ModelAndView("linecase/list-view");
|
||||
}
|
||||
|
||||
}
|
@ -33,4 +33,9 @@ public class SchoolKeyRouteController extends DefaultBaseController {
|
||||
return new ModelAndView("schoolkey/list");
|
||||
}
|
||||
|
||||
@GetMapping("list-view")
|
||||
public ModelAndView listView() {
|
||||
return new ModelAndView("schoolkey/list-view");
|
||||
}
|
||||
|
||||
}
|
@ -33,4 +33,9 @@ public class StuTeaSafeRouteController extends DefaultBaseController {
|
||||
return new ModelAndView("stuteasafe/list");
|
||||
}
|
||||
|
||||
@GetMapping("list-view")
|
||||
public ModelAndView listView() {
|
||||
return new ModelAndView("stuteasafe/list-view");
|
||||
}
|
||||
|
||||
}
|
@ -58,6 +58,8 @@ public class LineCaseDTO {
|
||||
private String locationCode;
|
||||
@ApiModelProperty(name = "grid", value = "所属网格")
|
||||
private String grid;
|
||||
@ApiModelProperty(name = "lineId", value = "护航弧线ID")
|
||||
private String lineId;
|
||||
|
||||
public String getLineCaseId() {
|
||||
return lineCaseId == null ? "" : lineCaseId.trim();
|
||||
@ -234,4 +236,12 @@ public class LineCaseDTO {
|
||||
public void setGrid(String grid) {
|
||||
this.grid = grid;
|
||||
}
|
||||
|
||||
public String getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setLineId(String lineId) {
|
||||
this.lineId = lineId;
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ public class LineCaseVO {
|
||||
private String locationCode;
|
||||
@ApiModelProperty(name = "grid", value = "所属网格")
|
||||
private String grid;
|
||||
@ApiModelProperty(name = "lineId", value = "护航弧线ID")
|
||||
private String lineId;
|
||||
|
||||
public String getCaseCode() {
|
||||
return caseCode == null ? "" : caseCode.trim();
|
||||
@ -231,4 +233,12 @@ public class LineCaseVO {
|
||||
public void setGrid(String grid) {
|
||||
this.grid = grid;
|
||||
}
|
||||
|
||||
public String getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setLineId(String lineId) {
|
||||
this.lineId = lineId;
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
<resultMap id="lineCaseDTO" type="cn.com.tenlion.systembase.pojo.dtos.linecase.LineCaseDTO">
|
||||
<result column="line_case_id" property="lineCaseId"/>
|
||||
<result column="line_id" property="lineId"/>
|
||||
<result column="case_code" property="caseCode"/>
|
||||
<result column="case_name" property="caseName"/>
|
||||
<result column="happen_time" property="happenTime"/>
|
||||
@ -75,6 +76,7 @@
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO data_line_case(
|
||||
line_case_id,
|
||||
line_id,
|
||||
case_code,
|
||||
case_name,
|
||||
happen_time,
|
||||
@ -103,6 +105,7 @@
|
||||
is_delete
|
||||
) VALUES(
|
||||
#{lineCaseId},
|
||||
#{lineId},
|
||||
#{caseCode},
|
||||
#{caseName},
|
||||
#{happenTime},
|
||||
@ -163,6 +166,9 @@
|
||||
UPDATE
|
||||
data_line_case
|
||||
SET
|
||||
<if test="lineId != null and lineId != ''">
|
||||
line_id = #{lineId},
|
||||
</if>
|
||||
<if test="caseCode != null and caseCode != ''">
|
||||
case_code = #{caseCode},
|
||||
</if>
|
||||
@ -236,6 +242,7 @@
|
||||
<!-- 涉及线、路案(事)件详情 -->
|
||||
<select id="get" parameterType="map" resultMap="lineCaseDTO">
|
||||
SELECT
|
||||
t1.line_id,
|
||||
t1.case_code,
|
||||
t1.case_name,
|
||||
t1.happen_time,
|
||||
@ -335,6 +342,7 @@
|
||||
<!-- 涉及线、路案(事)件列表 -->
|
||||
<select id="list" parameterType="map" resultMap="lineCaseDTO">
|
||||
SELECT
|
||||
t1.line_id,
|
||||
t1.line_case_id,
|
||||
t1.case_code,
|
||||
t1.case_name,
|
||||
@ -362,6 +370,11 @@
|
||||
data_line_case t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="lineId != null and lineId != ''">
|
||||
AND (
|
||||
t1.line_id = #{lineId}
|
||||
)
|
||||
</if>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
t1.case_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
|
@ -229,6 +229,12 @@
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'lineCase', fixed: 'right', width: 150, title: '涉及线路案(事)件', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="lineCase">案件列表</a>';
|
||||
return rowData;
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
@ -357,6 +363,30 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 巡查记录
|
||||
function lineCase(data) {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/linecase/list-view?lineId={lineId}', [data.lineId]),
|
||||
title: "案(事)件列表",
|
||||
width: '80%',
|
||||
height: '80%',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//监听行单击事件
|
||||
table.on('tool(dataTable)', function(obj){
|
||||
var data = obj.data;
|
||||
console.log(data)
|
||||
// 周边重点人员
|
||||
if('lineCase' == obj.event) {
|
||||
lineCase(data);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
304
src/main/resources/templates/linecase/list-view.html
Normal file
304
src/main/resources/templates/linecase/list-view.html
Normal file
@ -0,0 +1,304 @@
|
||||
<!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-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-normal layui-btn-sm" lay-event="viewEvent">
|
||||
<i class="fa fa-lg fa-edit"></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/linecase/listpage?lineId={lineId}';
|
||||
var lineId = top.restAjax.params(window.location.href).lineId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [lineId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
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: 'caseCode', width: 180, title: '案(事)件编号', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseName', width: 180, title: '案(事)件名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenTime', width: 180, title: '发生日期', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenAddress', width: 180, title: '发生地点', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseNatureName', width: 180, title: '案(事)件性质', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseNatureCode', width: 180, title: '案(事)件性质编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseSituation', width: 180, title: '案(事)件情况', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardCodeName', width: 180, title: '主犯(嫌疑人)证件代码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardCodeCode', width: 180, title: '主犯(嫌疑人)证件代码编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardNum', width: 180, title: '主犯(嫌疑人)证件号码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalName', width: 180, title: '主犯(嫌疑人)姓名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isSolve', width: 180, title: '是否破案', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'crimeCount', width: 180, title: '作案人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'atLargeCount', width: 180, title: '在逃人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'arrestCount', width: 180, title: '抓捕人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseSolve', 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, [lineId]),
|
||||
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('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'viewEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg('至少选择一条数据');
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg('同时只能查看一条数');
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/linecase/update?lineCaseId={lineCaseId}&isView={idView}', [checkDatas[0].lineCaseId, 'view']),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -22,6 +22,18 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item" id="lineDiv">
|
||||
<label class="layui-form-label">护航弧线<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="lineIdSelectTemplateBox" lay-filter="lineIdSelectTemplateBox"></div>
|
||||
<script id="lineIdSelectTemplate" type="text/html">
|
||||
<select id="lineId" name="lineId" lay-filter="lineId" lay-verify="required">
|
||||
<option value="">请选择护航弧线</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.lineId}}">{{item.lineName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 112px;">案(事)件编号</label>
|
||||
<div class="layui-input-block" style="margin-left: 112px;">
|
||||
@ -175,6 +187,19 @@
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
// 初始化学校
|
||||
function initLineSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/line/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('lineIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('lineIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
console.log(data)
|
||||
form.render('select', 'lineIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择所在地
|
||||
$(document).on('click', '#location', function() {
|
||||
top.dialog.open({
|
||||
@ -354,6 +379,7 @@
|
||||
initCaseSituationRichText();
|
||||
initCaseSolveRichText();
|
||||
initGridSelect();
|
||||
initLineSelect();
|
||||
}
|
||||
initData();
|
||||
|
||||
|
@ -22,6 +22,18 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item" id="lineDiv">
|
||||
<label class="layui-form-label">护航弧线<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="lineIdSelectTemplateBox" lay-filter="lineIdSelectTemplateBox"></div>
|
||||
<script id="lineIdSelectTemplate" type="text/html">
|
||||
<select id="lineId" name="lineId" lay-filter="lineId" lay-verify="required">
|
||||
<option value="">请选择护航弧线</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.lineId}}">{{item.lineName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 112px;">案(事)件编号</label>
|
||||
<div class="layui-input-block" style="margin-left: 112px;">
|
||||
@ -148,7 +160,7 @@
|
||||
<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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -172,11 +184,28 @@
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var lineCaseId = top.restAjax.params(window.location.href).lineCaseId;
|
||||
var isView = top.restAjax.params(window.location.href).isView;
|
||||
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
// 初始化组织名称
|
||||
function initLineSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/line/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('lineIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('lineIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'lineIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['lineId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择所在地
|
||||
$(document).on('click', '#location', function() {
|
||||
top.dialog.open({
|
||||
@ -377,6 +406,10 @@
|
||||
initCaseSituationRichText(data['caseSituation']);
|
||||
initCaseSolveRichText(data['caseSolve']);
|
||||
initGridSelect(data['locationCode'], data['grid']);
|
||||
initLineSelect(data['lineId']);
|
||||
if('view' == isView) {
|
||||
$('#submitBtn').hide();
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
|
@ -250,13 +250,13 @@
|
||||
},
|
||||
{field: 'schoolKey', fixed: 'right', width: 150, title: '周边重点人员', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="schoolKey">添加重点人员</a>';
|
||||
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="schoolKey">重点人员列表</a>';
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'stuteasafe', fixed: 'right', width: 150, title: '涉及师生安全案件', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="stuteasafe">添加案件</a>';
|
||||
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="stuteasafe">案件列表</a>';
|
||||
return rowData;
|
||||
}
|
||||
}
|
||||
@ -278,8 +278,8 @@
|
||||
// 巡查记录
|
||||
function schoolKey(data) {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/schoolkey/list?schoolId={schoolId}', [data.schoolId]),
|
||||
title: "巡查记录列表",
|
||||
url: top.restAjax.path('route/schoolkey/list-view?schoolId={schoolId}', [data.schoolId]),
|
||||
title: "重点人员列表",
|
||||
width: '80%',
|
||||
height: '80%',
|
||||
onClose: function() {
|
||||
@ -291,8 +291,8 @@
|
||||
// 巡查记录
|
||||
function stuteasafe(data) {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/stuteasafe/list?schoolId={schoolId}', [data.schoolId]),
|
||||
title: "巡查记录列表",
|
||||
url: top.restAjax.path('route/stuteasafe/list-view?schoolId={schoolId}', [data.schoolId]),
|
||||
title: "案(事)件列表",
|
||||
width: '80%',
|
||||
height: '80%',
|
||||
onClose: function() {
|
||||
|
187
src/main/resources/templates/schoolkey/list-view.html
Normal file
187
src/main/resources/templates/schoolkey/list-view.html
Normal file
@ -0,0 +1,187 @@
|
||||
<!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-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-normal layui-btn-sm" lay-event="viewEvent">
|
||||
<i class="fa fa-lg fa-edit"></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/schoolkey/listpage?schoolId={schoolId}';
|
||||
var schoolId = top.restAjax.params(window.location.href).schoolId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [schoolId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
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: 'degreeOfHarmName', width: 180, title: '危害程度', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'degreeOfHarmCode', width: 180, title: '危害程度编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isFollow', 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, [schoolId]),
|
||||
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('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg('请选择要查看的数据');
|
||||
} 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/schoolkey/update?schoolKeyId={schoolKeyId}&isView={isView}', [checkDatas[0].schoolKeyId, 'view']),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -87,6 +87,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="schoolDiv">
|
||||
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
|
||||
<script id="schoolIdSelectTemplate" type="text/html">
|
||||
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
|
||||
<option value="">请选择学校</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item layui-row">
|
||||
<div class="layui-col-lg6">
|
||||
<label class="layui-form-label">所在地</label>
|
||||
@ -159,7 +171,19 @@
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
var schoolId = top.restAjax.params(window.location.href).schoolId;
|
||||
|
||||
// 初始化学校
|
||||
function initSchoolSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
console.log(data)
|
||||
form.render('select', 'schoolIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择所在地
|
||||
$(document).on('click', '#location', function() {
|
||||
@ -289,6 +313,7 @@
|
||||
function initData() {
|
||||
initDegreeOfHarmSelect();
|
||||
initGridSelect();
|
||||
initSchoolSelect();
|
||||
}
|
||||
initData();
|
||||
|
||||
@ -302,7 +327,6 @@
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
formData.field['schoolId'] = schoolId;
|
||||
top.restAjax.post(top.restAjax.path('api/schoolkey/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
|
@ -87,6 +87,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="schoolDiv">
|
||||
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
|
||||
<script id="schoolIdSelectTemplate" type="text/html">
|
||||
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
|
||||
<option value="">请选择学校</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item layui-row">
|
||||
<div class="layui-col-lg6">
|
||||
<label class="layui-form-label">所在地</label>
|
||||
@ -133,7 +145,7 @@
|
||||
<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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -162,6 +174,22 @@
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
// 初始化组织名称
|
||||
function initSchoolSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'schoolIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['schoolId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择所在地
|
||||
$(document).on('click', '#location', function() {
|
||||
top.dialog.open({
|
||||
@ -307,6 +335,10 @@
|
||||
initDegreeOfHarmSelect(data['degreeOfHarm'] + ',' + data['degreeOfHarmCode']);
|
||||
queryBasePopulationInfo(data['cardNum']);
|
||||
initGridSelect(data['locationCode'], data['grid']);
|
||||
initSchoolSelect(data['schoolId']);
|
||||
if('view' == isView) {
|
||||
$('#submitBtn').hide();
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
|
322
src/main/resources/templates/stuteasafe/list-view.html
Normal file
322
src/main/resources/templates/stuteasafe/list-view.html
Normal file
@ -0,0 +1,322 @@
|
||||
<!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-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-normal layui-btn-sm" lay-event="viewEvent">
|
||||
<i class="fa fa-lg fa-edit"></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/stuteasafe/listpage?schoolId={schoolId}';
|
||||
var schoolId = top.restAjax.params(window.location.href).schoolId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [schoolId]),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
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: 'caseCode', width: 180, title: '案(事)件编号', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseName', width: 180, title: '案(事)件名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenTime', width: 180, title: '发生日期', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenLocationName', width: 180, title: '发案地', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenLocationCode', width: 180, title: '发案地编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'happenAddress', width: 180, title: '发生地点', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseNatureName', width: 180, title: '案(事)件性质', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseNatureCode', width: 180, title: '案(事)件性质编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseSituation', width: 180, title: '案件情况', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardCodeName', width: 180, title: '主犯(嫌疑人)证件代码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardCodeCode', width: 180, title: '主犯(嫌疑人)证件代码编码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalCardNum', width: 180, title: '主犯(嫌疑人)证件号码', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'principalName', width: 180, title: '主犯(嫌疑人)姓名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isSolve', width: 180, title: '是否破案', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'crimeCount', width: 180, title: '作案人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'atLargeCount', width: 180, title: '在逃人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'arrestCount', width: 180, title: '抓捕人数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'caseSolve', 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, [schoolId]),
|
||||
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('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'viewEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg('至少选择一条数据');
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg('同时只能查看一条数');
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/stuteasafe/update?stuTeaSafeId={stuTeaSafeId}&isView={isView}', [checkDatas[0].stuTeaSafeId, 'view']),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -65,15 +65,14 @@
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/stuteasafe/listpage?schoolId={schoolId}';
|
||||
var schoolId = top.restAjax.params(window.location.href).schoolId;
|
||||
var tableUrl = 'api/stuteasafe/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, [schoolId]),
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
@ -265,7 +264,7 @@
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [schoolId]),
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
@ -337,7 +336,7 @@
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/stuteasafe/save?schoolId={schoolId}', [schoolId]),
|
||||
content: top.restAjax.path('route/stuteasafe/save', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
|
@ -22,6 +22,18 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item" id="schoolDiv">
|
||||
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
|
||||
<script id="schoolIdSelectTemplate" type="text/html">
|
||||
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
|
||||
<option value="">请选择学校</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 113px;">案(事)件编号</label>
|
||||
<div class="layui-input-block" style="margin-left: 113px;">
|
||||
@ -174,7 +186,19 @@
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
var schoolId = top.restAjax.params(window.location.href).schoolId;
|
||||
|
||||
// 初始化学校
|
||||
function initSchoolSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
console.log(data)
|
||||
form.render('select', 'schoolIdSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化备注富文本
|
||||
function initCaseSituationRichText() {
|
||||
@ -354,6 +378,7 @@
|
||||
initCaseSituationRichText();
|
||||
initCaseSolveRichText();
|
||||
initGridSelect();
|
||||
initSchoolSelect();
|
||||
}
|
||||
|
||||
initData();
|
||||
@ -378,7 +403,6 @@
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
formData.field['schoolId'] = schoolId;
|
||||
top.restAjax.post(top.restAjax.path('api/stuteasafe/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
|
@ -22,6 +22,18 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item" id="schoolDiv">
|
||||
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
|
||||
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
|
||||
<script id="schoolIdSelectTemplate" type="text/html">
|
||||
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
|
||||
<option value="">请选择学校</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 113px;">案(事)件编号</label>
|
||||
<div class="layui-input-block" style="margin-left: 113px;">
|
||||
@ -148,7 +160,7 @@
|
||||
<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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -172,11 +184,28 @@
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var stuTeaSafeId = top.restAjax.params(window.location.href).stuTeaSafeId;
|
||||
var isView = top.restAjax.params(window.location.href).isView;
|
||||
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
// 初始化组织名称
|
||||
function initSchoolSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'schoolIdSelectTemplateBox');
|
||||
|
||||
var selectObj = {};
|
||||
selectObj['schoolId'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化备注富文本
|
||||
function initCaseSituationRichText(value) {
|
||||
var editor = new wangEditor('#caseSituation');
|
||||
@ -377,6 +406,10 @@
|
||||
initCaseSituationRichText(data['caseSituation']);
|
||||
initCaseSolveRichText(data['caseSolve']);
|
||||
initGridSelect(data['happenLocationCode'], data['grid']);
|
||||
initSchoolSelect(data['schoolId']);
|
||||
if('view' == isView) {
|
||||
$('#submitBtn').hide();
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
|
Loading…
Reference in New Issue
Block a user