|
|
|
@ -0,0 +1,142 @@
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
|
|
|
<head>
|
|
|
|
|
<th:block th:include="include :: header('删除子项')"/>
|
|
|
|
|
<th:block th:include="include :: select2-css"/>
|
|
|
|
|
|
|
|
|
|
<th:block th:include="include :: datetimepicker-css"/>
|
|
|
|
|
</head>
|
|
|
|
|
<body class="white-bg">
|
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
|
|
|
|
<a class="btn btn-danger" onclick="deleteInBatches() ">
|
|
|
|
|
<i class="fa fa-remove"></i> 删除
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
|
<table id="bootstrap-table" ></table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<th:block th:include="include :: footer"/>
|
|
|
|
|
<th:block th:include="include :: bootstrap-suggest-js"/>
|
|
|
|
|
<th:block th:include="include :: bootstrap-typeahead-js"/>
|
|
|
|
|
<th:block th:include="include :: select2-js"/>
|
|
|
|
|
<script th:src="@{/js/jquery.tmpl.js}"></script>
|
|
|
|
|
<script th:inline="javascript">
|
|
|
|
|
var monitorunitStatusDatas = [[${@dict.getType('monitorunit_status')}]];
|
|
|
|
|
var prefix = ctx + "base/monitorUnitInfo";
|
|
|
|
|
$("#form-sensorInfo-edit").validate({
|
|
|
|
|
focusCleanup: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
//先销毁表格,必须先销毁才能实现动态加载数据
|
|
|
|
|
$('#bootstrap-table').bootstrapTable('destroy');
|
|
|
|
|
$('#bootstrap-table').bootstrapTable({
|
|
|
|
|
method: "get", //向服务器请求数据的方式
|
|
|
|
|
url: prefix+"/listByParent?parentId="+[[${monitorunitId}]],
|
|
|
|
|
striped: true, //表格显示条纹
|
|
|
|
|
pagination: false, //不启动分页
|
|
|
|
|
pageSize: 1, //每页显示的记录数
|
|
|
|
|
pageNumber: 1, //当前第几页
|
|
|
|
|
pageList: [5, 10, 15, 20, 25], //记录数可选列表
|
|
|
|
|
striped: true, //显示行间隔色
|
|
|
|
|
sortOrder: "asc", //排序方式
|
|
|
|
|
sidePagination: "server",
|
|
|
|
|
queryParamsType: "undefined",
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
checkbox: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'monitorunitName',
|
|
|
|
|
title: '监控单元',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width:'160',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'parentName',
|
|
|
|
|
title: '父级监控单元',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: '140',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'monitorunitTypeName',
|
|
|
|
|
title: '监控单元类型',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'substationName',
|
|
|
|
|
title: '所属变电站',
|
|
|
|
|
align: 'left'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'monitorunitImage',
|
|
|
|
|
title: '设备模型',
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
// 图片预览(注意:如存储在本地直接获取数据库路径,如有配置context-path需要使用ctx+路径)
|
|
|
|
|
// 如:/profile/upload/2019/08/08/3b7a839aced67397bac694d77611ce72.png
|
|
|
|
|
if(index % 2 == 0){
|
|
|
|
|
return $.table.imageView('/img/profile.jpg');
|
|
|
|
|
}else {
|
|
|
|
|
return $.table.imageView(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'monitorunitStatus',
|
|
|
|
|
title: '当前状态',
|
|
|
|
|
align: 'left',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return $.table.selectDictLabel(monitorunitStatusDatas, value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'enableFlag',
|
|
|
|
|
title: '是否启用',
|
|
|
|
|
align: 'left',
|
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return $.table.selectDictLabel(enableFlagDatas, value);
|
|
|
|
|
},
|
|
|
|
|
visible: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'monitorunitId',
|
|
|
|
|
title: '监控单元编号',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: '280',
|
|
|
|
|
visible: false
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
onLoadSuccess: function () { //加载成功时执行
|
|
|
|
|
//layer.msg("加载成功");
|
|
|
|
|
},
|
|
|
|
|
onLoadError: function () { //加载失败时执行
|
|
|
|
|
layer.msg("加载数据失败", {time: 1500, icon: 2});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const deleteInBatches = () =>{
|
|
|
|
|
var row = $("#bootstrap-table").bootstrapTable('getSelections');
|
|
|
|
|
console.log(row)
|
|
|
|
|
if ($.common.isEmpty(row)) {
|
|
|
|
|
$.modal.alertWarning("请至少选择一条记录");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$.modal.confirm("确定删除所选信息吗?", function() {
|
|
|
|
|
let ids = [];
|
|
|
|
|
row.map(x=>{
|
|
|
|
|
ids.push(x.objId);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var data = { "ids": JSON.stringify(ids) };
|
|
|
|
|
$.operate.submit(prefix+"/deleteItem", "post", "json", data);
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|