first commit
This commit is contained in:
476
WebRoot/jsp/structure/capacityLoad.jsp
Normal file
476
WebRoot/jsp/structure/capacityLoad.jsp
Normal file
@ -0,0 +1,476 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%request.setAttribute("False", CommString.Active_False); %>
|
||||
<%request.setAttribute("True", CommString.Active_True); %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.table-hover>tbody>tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showMaintenanceList = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subMaintenanceModal');
|
||||
});
|
||||
};
|
||||
var showHandleDetailList = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('handleDetailModal');
|
||||
});
|
||||
};
|
||||
var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
|
||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
|
||||
$("#subEquipmentDiv").html(data);
|
||||
openModal('subEquipmentModal');
|
||||
});
|
||||
};
|
||||
//新增设备卡片
|
||||
var addFun = function() {
|
||||
$("#searchForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#searchForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + '/equipment/doadd.do', {companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
};
|
||||
//编辑资产类型
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/doedit.do', {id:id,companyId:companyId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看资产类型
|
||||
var viewFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条资产类型数据
|
||||
var deleteFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条资产类型数据
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
showAlert('d','请先选择记录','mainAlertdiv');
|
||||
}else{
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var companyId = "";
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
$("#bizId").val(unitId);
|
||||
initFun();
|
||||
/* $.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||||
if(data.length == 1){
|
||||
//选择厂区为一个厂时隐藏选择框
|
||||
$("#search_code").css("display", "none");
|
||||
$("#company").text(data[0].text);
|
||||
companyId=data[0].id;
|
||||
initFun();
|
||||
}else{
|
||||
$("#company").css("display", "none");
|
||||
var selelct=$("#search_code").select2({
|
||||
data : data ,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
initFun();
|
||||
selelct.on("change",function(e){
|
||||
companyId = $(this).val();
|
||||
initFun();
|
||||
});
|
||||
};
|
||||
},'json'); */
|
||||
//设备类型搜索
|
||||
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassForSelect.do", {}, function(data) {
|
||||
var selelct =$("#equipmentCardClass").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('').trigger("change");
|
||||
selelct.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
//输入框验证
|
||||
$("#searchForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
search_code: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '请先选择厂区'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $("#search_name").val(),
|
||||
companyId: companyId,
|
||||
pSectionId: $("#processSection").val(),
|
||||
equipmentCardClass : $("#equipmentCardClass").val(),
|
||||
}
|
||||
};
|
||||
//厂区选择后,初始化工艺段,加载表格
|
||||
var initFun = function(){
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ =$("#processSection").select2({
|
||||
data: data,
|
||||
cache : false,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change",function(e){
|
||||
dosearch();
|
||||
});
|
||||
},'json');
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/structure/getEquList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams:queryParamsFun,
|
||||
sortName: 'equipmentstatus', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
detailView: false, //是否显示父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'design', // 返回json数据中的name
|
||||
title: '最大设计能力', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},{
|
||||
field: 'adjustable', // 返回json数据中的name
|
||||
title: '可调能力', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},{
|
||||
field: 'current', // 返回json数据中的name
|
||||
title: '当前能力', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},{
|
||||
field: 'load', // 返回json数据中的name
|
||||
title: '当前负荷率', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value){
|
||||
case '${False}' :
|
||||
return "禁用";
|
||||
case '${True}' :
|
||||
return "启用";
|
||||
default :
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
//子表
|
||||
function InitSubTable(index, row, $detail){
|
||||
var cur_table = $detail.html('<table id="'+row.id+'" class="table table-bordered table-condensed"></table>').find('table');
|
||||
//关联测量点
|
||||
$(cur_table).bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId: row.bizid,
|
||||
pid:row.id,
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
/* {
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, */{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '数据', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field : 'ledcolor',
|
||||
title : '状态',
|
||||
align:'center',
|
||||
valign: 'middle', // 上下居中
|
||||
formatter : function(value,row){
|
||||
var pic;
|
||||
if(value == 0){
|
||||
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lg.png" style="width:20px;height:20px;" ></img>';
|
||||
}else{
|
||||
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lr.png" style="width:20px;height:20px;" ></img>';
|
||||
}
|
||||
return pic;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView(row.id);
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<input type="hidden" id="bizId" name="bizId" value="">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/top.jsp"></jsp:include>--%>
|
||||
<!-- 菜单栏 -->
|
||||
<%--<jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subEquipmentDiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="maintenanceDiv"></div>
|
||||
<div id="maintenanceDetailDiv"></div>
|
||||
<div id="emSubDiv"></div>
|
||||
<div id="subEditViewDiv"></div>
|
||||
<div id="equipment4SelectDiv"></div>
|
||||
<form id="searchForm">
|
||||
<div id="fileInputDiv"></div>
|
||||
<div >
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm pull-left">
|
||||
<label class="form-label">工艺段:</label>
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 160px;"></select>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%--<jsp:include page="/jsp/bottom.jsp"></jsp:include>--%>
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include>--%>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script> --%>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/JS/fileInput.js\"></sc"+"ript>")
|
||||
</script>
|
||||
<!-- 引入ChartJS-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
||||
<!-- echarts-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
</html>
|
||||
232
WebRoot/jsp/structure/mPointListForSelectsStructure.jsp
Normal file
232
WebRoot/jsp/structure/mPointListForSelectsStructure.jsp
Normal file
@ -0,0 +1,232 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
<script type="text/javascript">
|
||||
var dosearchMp = function() {
|
||||
$("#table_mpoints").bootstrapTable('refresh');
|
||||
};
|
||||
function doselect(dialog,grid) {
|
||||
var datas="";
|
||||
datas_name="";
|
||||
$.each(selectionIds, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item;
|
||||
});
|
||||
doMPointFinishSelects(datas);
|
||||
closeModal("mpsSubModal")
|
||||
};
|
||||
|
||||
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
var mpoints = eval('${mpoints}');
|
||||
if(mpoints!=null && mpoints != undefined){
|
||||
$.each(mpoints, function(index, item){
|
||||
if(row.id==item.id){
|
||||
flag=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
var $table;
|
||||
var switchStatus=false;
|
||||
var selectionIds = []; //保存选中ids
|
||||
function initialSelectionIds(){
|
||||
var check_array =eval('${mpoints}');
|
||||
if(check_array!=null&& check_array.length>0){
|
||||
selectionIds =new Array(check_array.length);
|
||||
for(var i=0;i<check_array.length;i++){
|
||||
selectionIds[i]=check_array[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getCheckedIds(){
|
||||
var ids="";
|
||||
var check_array =eval('${mpoints}');
|
||||
$.each(check_array, function(index, item){
|
||||
if(ids!=""){
|
||||
ids+=",";
|
||||
}
|
||||
ids+=item.id;
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
function queryParams(params) {
|
||||
|
||||
var temp={
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId: companyId,
|
||||
search_mpointcode : $('#search_mpointcode').val(),
|
||||
search_name : $('#search_mpointname').val(),
|
||||
};
|
||||
if(status){
|
||||
temp.checkedIds=getCheckedIds();
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
$(function() {
|
||||
|
||||
initialSelectionIds();
|
||||
|
||||
$table=$("#table_mpoints").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
clickToSelect:true,
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* showColumns: true,
|
||||
showRefresh: true, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '测量点ID', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
//width:Width/10
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'signaltype', // 返回json数据中的name
|
||||
title: '信号类型', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'active', // 返回json数据中的name
|
||||
title: '启用状态', // 表格表头显示文字
|
||||
sortable : true,
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
} // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_mpoints");
|
||||
|
||||
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//绑定选中事件、取消事件、全部选中、全部取消
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
||||
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
||||
return row.id;
|
||||
});
|
||||
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
||||
selectionIds = _[func](selectionIds, ids);
|
||||
});
|
||||
});
|
||||
//选中事件操作数组
|
||||
var union = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
if($.inArray(id,array)==-1){
|
||||
array[array.length] = id;
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
//取消选中事件操作数组
|
||||
var difference = function(array,ids){
|
||||
$.each(ids, function (i, id) {
|
||||
var index = $.inArray(id,array);
|
||||
if(index!=-1){
|
||||
array.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return array;
|
||||
};
|
||||
var _ = {"union":union,"difference":difference};
|
||||
|
||||
//表格分页之前处理多选框数据
|
||||
function responseHandler(res) {
|
||||
$.each(res.rows, function (i, row) {
|
||||
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="mpsSubModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="mpoint_mainAlertdiv"></div>
|
||||
<div class="form-group pull-right form-inline" >
|
||||
<div class="input-group input-group-sm " style="width: 220px;margin-left:30px">
|
||||
<input type="text" id="search_mpointname" name="search_mpointname" class="form-control pull-right" placeholder="名称">
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 220px;">
|
||||
|
||||
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control " placeholder="测量点Code">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearchMp();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table id="table_mpoints" style="overflow:auto;width:100%"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doselect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
39
WebRoot/jsp/structure/structureCard4select.jsp
Normal file
39
WebRoot/jsp/structure/structureCard4select.jsp
Normal file
@ -0,0 +1,39 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/structure/getStructureCardJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="fault4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
88
WebRoot/jsp/structure/structureCardAdd.jsp
Normal file
88
WebRoot/jsp/structure/structureCardAdd.jsp
Normal file
@ -0,0 +1,88 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showStructureCard4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/structure/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"_pname"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
//if ($("#subForm").form('validate')) {
|
||||
$.post(ext.contextPath + "/structure/dosave.do", $("#subForm").serialize(), function(result) {
|
||||
var data = eval("("+result+")");
|
||||
if (data.res == 1) {
|
||||
initTreeView();
|
||||
//showAlert('s','保存成功');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
});
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
$("#active").select2({minimumResultsForSearch: -1});
|
||||
$("#type").select2({minimumResultsForSearch: -1});
|
||||
});
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">新增</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<%-- <input id="id" name="id" type="hidden" />--%>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" ">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name ="_pname" placeholder="上级菜单" onclick="showStructureCard4SelectFun();" value="${pname}"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="type" name="type" class="form-control select2">
|
||||
<option value="0" >构筑物</option>
|
||||
<option value="1" >工艺单体</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value=0>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="active" name="active" class="form-control select2">
|
||||
<option value="1" >启用</option>
|
||||
<option value="0" >禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
742
WebRoot/jsp/structure/structureCardEdit.jsp
Normal file
742
WebRoot/jsp/structure/structureCardEdit.jsp
Normal file
@ -0,0 +1,742 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.tools {
|
||||
margin-right: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showStructureCard4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/structure/showList4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
//if ($("#subForm").form('validate')) {
|
||||
$.post(ext.contextPath + "/structure/doupdate.do", $("#subForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
//}
|
||||
}
|
||||
|
||||
var editPointFun = function (id, unitId) {
|
||||
$.post(ext.contextPath + '/structure/structureCardPicture/editRoutePoint.do', { id, unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function dodel() {
|
||||
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/structure/dodel.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res > 0) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function () {
|
||||
$("#active").select2({ minimumResultsForSearch: -1 }).val("${structureCard.active}").trigger("change");
|
||||
$("#type").select2({ minimumResultsForSearch: -1 }).val("${structureCard.type}").trigger("change");
|
||||
|
||||
//底图table
|
||||
$("#table_picture").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/structure/structureCardPicture/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
unitId: unitId,
|
||||
structureId: $('#id').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'name', // 返回json数据中的number
|
||||
title: '底图名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: '所属厂区',
|
||||
field: 'company.sname',
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
title: '所属类别',
|
||||
field: 'type',
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index){
|
||||
if(value == 'line'){
|
||||
return '巡检路线';
|
||||
}else if(value == 'area'){
|
||||
return '安全区域';
|
||||
}else{
|
||||
return '巡检路线';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'floor', // 返回json数据中的remark
|
||||
title: '楼层', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = "";
|
||||
/*str+='<button class="btn btn-default btn-sm" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i></button>';*/
|
||||
str += '<button class="btn btn-default btn-sm" onclick="editPicFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str += '<button class="btn btn-default btn-sm" onclick="editRouteFun(\'' + row.id + '\')" data-toggle="tooltip" title="巡检路线"><i class="fa fa-map-o"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
//注册加载子表的事件。index:父表当前行的行索引,row:父表当前行的Json数据对象,$detail:当前行下面创建的新行里面的td对象。
|
||||
onExpandRow: function (index, row, $detail) {
|
||||
initFittingsDetailTable(index, row, $detail);
|
||||
//存入sessionStorage
|
||||
sessionStorage.setItem("index", index);
|
||||
},
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//初始化子表
|
||||
var initFittingsDetailTable = function (index, row, $detail) {
|
||||
var id = row.id;
|
||||
var detailTable = $detail.html('<table></table>').find('table');
|
||||
$(detailTable).bootstrapTable({
|
||||
url: ext.contextPath + '/structure/structureCardPicture/getRoutePointsOrderbySort.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
floorId: id,
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
var subValue = value.substring(0, 19);
|
||||
return subValue;
|
||||
}
|
||||
}, {
|
||||
field: 'patrolContent', // 返回json数据中的name
|
||||
title: '点位名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str+='<button class="btn btn-default btn-sm" title="编辑" onclick="editPointFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("detailTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#table_equipmentLoseApplyDetail').bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/structure/getEquipment4StructureCard.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [5, 10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 5, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
structureId: '${structureCard.id}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '设备统一编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'equipmentcardid', // 返回json数据中的name
|
||||
title: '设备厂内编号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
}, {
|
||||
field: 'equipmentname', // 返回json数据中的name
|
||||
title: '设备名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_equipmentLoseApplyDetail");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
//运行参数
|
||||
dopoint('design');
|
||||
//设计参数
|
||||
dopoint('operation');
|
||||
//实际参数
|
||||
dopoint('actual');
|
||||
});
|
||||
function dopoint(structureCodeType) {
|
||||
|
||||
//关联测量点
|
||||
$("#table_" + structureCodeType).bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
companyId: companyId,
|
||||
structureId: '${structureCard.id}',
|
||||
structureCodeType: structureCodeType
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '数据', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'ledcolor',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row) {
|
||||
var pic;
|
||||
if (value == 0) {
|
||||
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lg.png" style="width:20px;height:20px;" ></img>';
|
||||
} else {
|
||||
pic = '<img src= "' + ext.contextPath + '/IMG/mpoint_pic/lr.png" style="width:20px;height:20px;" ></img>';
|
||||
}
|
||||
return pic;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_" + structureCodeType);
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
var doFinishSelects = function (data) {
|
||||
$.post(ext.contextPath + '/structure/saveEquipment4StructureCard.do', {
|
||||
structureId: '${structureCard.id}',
|
||||
equipmentCardIds: data
|
||||
}, function (data) {
|
||||
if (data.res) {
|
||||
$("#table_equipmentLoseApplyDetail").bootstrapTable('refresh');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//新增设备停用明细
|
||||
var addDetailFun = function () {
|
||||
var allTableData = $("#table_equipmentLoseApplyDetail").bootstrapTable('getData');
|
||||
var equipmentCardIds = "";
|
||||
$.each(allTableData, function (index, item) {
|
||||
|
||||
if (equipmentCardIds != "") {
|
||||
equipmentCardIds += ",";
|
||||
}
|
||||
equipmentCardIds += item.equipmentCardId;
|
||||
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/structure/selectEquipment4StructureCard.do', { equipmentCardIds: equipmentCardIds, companyId: '${company.id}' },
|
||||
function (data) {
|
||||
$("#equipmentCard4SelectsDiv").html(data);
|
||||
openModal('subDetailModal');
|
||||
});
|
||||
};
|
||||
//删除多条明细数据
|
||||
var deletesDetailFun = function () {
|
||||
var checkedItems = $("#table_equipmentLoseApplyDetail").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'alertDiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/structure/deletesEquipment4StructureCard.do', { ids: datas }, function (data) {
|
||||
|
||||
if (data.res) {
|
||||
$("#table_equipmentLoseApplyDetail").bootstrapTable('refresh');
|
||||
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'alertDiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var selectMPint = function (pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', { formId: 'subForm', hiddenId: pid, codeId: pid, textId: 'txt', valueId: 'value', mpid: $("#" + pid).val() }, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//保存选择点位
|
||||
var doMPointFinishSelects = function (mpoints) {
|
||||
var structureCodeType = $("#nowTable").val();
|
||||
$.post(ext.contextPath + '/structure/saveMPoint4StructureCard.do', {
|
||||
structureId: '${structureCard.id}',
|
||||
structureCodeType: structureCodeType, mpoints: mpoints, companyId: companyId
|
||||
}, function (data) {
|
||||
if (data.res) {
|
||||
$("#table_" + structureCodeType).bootstrapTable('refresh');
|
||||
}
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
//选择点位
|
||||
var addMPoint = function () {
|
||||
var structureCodeType = $("#nowTable").val();
|
||||
var allTableData = $("#table_" + structureCodeType).bootstrapTable('getData');
|
||||
var mpoints = "";
|
||||
$.each(allTableData, function (index, item) {
|
||||
|
||||
if (mpoints != "") {
|
||||
mpoints += ",";
|
||||
}
|
||||
mpoints += item.mpointcode;
|
||||
})
|
||||
|
||||
$.post(ext.contextPath + '/structure/showlistMPointForSelects.do', { mpoints: mpoints, companyId: companyId },
|
||||
function (data) {
|
||||
$("#mpoint4SelectsDiv").html(data);
|
||||
openModal('mpsSubModal');
|
||||
});
|
||||
};
|
||||
//删除选择点位
|
||||
var deletesMPoint = function () {
|
||||
var structureCodeType = $("#nowTable").val();
|
||||
var checkedItems = $("#table_" + structureCodeType).bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'alertDiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/structure/deletesMPoint4StructureCard.do', { ids: datas, companyId: companyId }, function (data) {
|
||||
|
||||
if (data.res) {
|
||||
$("#table_" + structureCodeType).bootstrapTable('refresh');
|
||||
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'alertDiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function activeTable(id) {
|
||||
$("#nowTable").val(id);
|
||||
}
|
||||
|
||||
var addPicFun = function () {
|
||||
var structureId = $("#id").val();
|
||||
$.post(ext.contextPath + '/structure/structureCardPicture/add.do', { unitId, structureId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal_floor');
|
||||
});
|
||||
};
|
||||
var editPicFun = function (id) {
|
||||
$.post(ext.contextPath + '/structure/structureCardPicture/edit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal_floor');
|
||||
});
|
||||
};
|
||||
var deletesPicFun = function () {
|
||||
var checkedItems = $("#table_picture").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/structure/structureCardPicture/dodeletes.do', { ids: datas }, function (data) {
|
||||
var data = JSON.parse(data);
|
||||
if (data.result > 0) {
|
||||
$("#table_picture").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var editRouteFun = function (id, unitId) {
|
||||
$.post(ext.contextPath + '/structure/structureCardPicture/editRoute.do', { id, unitId }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">详情</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
||||
class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${structureCard.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${structureCard.name }">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="上级菜单"
|
||||
onclick="showStructureCard4SelectFun();" value="${structureCard._pname}">
|
||||
<input id="pid" name="pid" type="hidden" value="${structureCard.pid}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<option value="0">构筑物</option>
|
||||
<option value="1">工艺单体</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">顺序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${structureCard.morder}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="active" name="active" class="form-control select2">
|
||||
<option value="true">启用</option>
|
||||
<option value="false">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">最大设计能力测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="designCode"
|
||||
value="${structureCard.designCode}" name="designCode" onclick="selectMPint('designCode')"
|
||||
placeholder="单击选择" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">可调能力测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="adjustableCode"
|
||||
value="${structureCard.adjustableCode}" name="adjustableCode" onclick="selectMPint('adjustableCode')"
|
||||
placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">当前能力测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="currentCode"
|
||||
value="${structureCard.currentCode}" name="currentCode" onclick="selectMPint('currentCode')"
|
||||
placeholder="单击选择" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">当前负荷率测量点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="loadCode"
|
||||
value="${structureCard.loadCode}" name="loadCode" onclick="selectMPint('loadCode')" placeholder="单击选择"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联底图</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addPicFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
||||
class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesPicFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_picture"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">关联设备</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
||||
class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_equipmentLoseApplyDetail"></table>
|
||||
</div>
|
||||
</div>
|
||||
<input id="nowTable" name="nowTable" type="hidden" value="design" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs" id="">
|
||||
<li class="active"><a href="#tab1" data-toggle="tab" index="0" aria-expanded="true"
|
||||
onclick="activeTable('design')">设计参数点位</a></li>
|
||||
<li class=""><a href="#tab2" data-toggle="tab" index="1" aria-expanded="false"
|
||||
onclick="activeTable('operation')">运行参数点位</a></li>
|
||||
<li class=""><a href="#tab3" data-toggle="tab" index="2" aria-expanded="false"
|
||||
onclick="activeTable('actual')">实际参数点位</a></li>
|
||||
<div class="tools pull-right">
|
||||
<a onclick="addMPoint()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
||||
class="glyphicon glyphicon-plus"></i></a>
|
||||
<a onclick="deletesMPoint()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
||||
class="glyphicon glyphicon-minus"></i></a>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class=" tab-pane active" id="tab1">
|
||||
<table id="table_design"></table>
|
||||
</div>
|
||||
<div class=" tab-pane " id="tab2">
|
||||
<table id="table_operation"></table>
|
||||
</div>
|
||||
<div class=" tab-pane " id="tab3">
|
||||
<table id="table_actual"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
188
WebRoot/jsp/structure/structureCardList.jsp
Normal file
188
WebRoot/jsp/structure/structureCardList.jsp
Normal file
@ -0,0 +1,188 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var companyId = "";
|
||||
|
||||
var equidToMpoint = function () {
|
||||
swal({
|
||||
text: "您确定要更新测量点主表的equipmentId吗?",
|
||||
dangerMode: false,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
|
||||
$.post(ext.contextPath + '/structure/equidToMpoint.do', { unitId: unitId }, function (data) {
|
||||
if (data > 0) {
|
||||
|
||||
showAlert('更新成功');
|
||||
} else {
|
||||
showAlert('d', '更新失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/structure/doadd.do', {pid:pid} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/structure/doedit.do', {id:id,companyId:companyId} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var initTreeView = function() {
|
||||
var height =$(window).height()-115;
|
||||
$('#tree').height(height);
|
||||
$.post(ext.contextPath + '/structure/getStructureCardJson.do', function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
console.log("11111", data)
|
||||
editFun(data.id);
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#faultBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/top.jsp"></jsp:include>--%>
|
||||
<!-- 菜单栏 -->
|
||||
<%--<jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="equipmentCard4SelectsDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="mpoint4SelectsDiv"></div>
|
||||
<div id="subDiv_detail"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="box box-solid" style=" margin-bottom:0px;">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">构筑物列表</h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
<!-- <button type="button" class="btn btn-box-tool" onclick="equidToMpoint();">equidToMpoint</i>
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8" id="faultBox"> </div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%--<jsp:include page="/jsp/bottom.jsp"></jsp:include>--%>
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include>--%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
207
WebRoot/jsp/structure/structureCardPictureAdd.jsp
Normal file
207
WebRoot/jsp/structure/structureCardPictureAdd.jsp
Normal file
@ -0,0 +1,207 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var masterId=$('#pictureId').val();
|
||||
var tbName='TB_EM_StructureCard_picture_file'; //数据表
|
||||
var nameSpace='StructureCardPicture';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
|
||||
function initFileInput_single(ctrlName, uploadUrl) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl, //上传的地址
|
||||
uploadAsync:true,
|
||||
allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove:false,
|
||||
showCaption: false,//是否显示标题
|
||||
showClose:false,//右上角关闭按钮
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount:true,
|
||||
previewFileIcon: "<i class='fa fa-file'></i>",
|
||||
preferIconicPreview: true,//是否强制相关文件展示icon
|
||||
initialPreviewAsData: true,
|
||||
autoReplace:true,
|
||||
dropZoneTitle:'可拖拽文件到选区',
|
||||
uploadExtraData:function (previewId, index) { //传参
|
||||
//var data = $("#subForm_floor").serialize();
|
||||
//console.info(data)
|
||||
var data = {
|
||||
"masterId": masterId, //此处自定义传参
|
||||
"tbName": tbName,
|
||||
"nameSpace": nameSpace
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates:{
|
||||
actionDelete:''
|
||||
},
|
||||
});
|
||||
control.on("filebatchselected", function (event, data, previewId, index) {
|
||||
|
||||
});
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
console.info(data)
|
||||
if(data.response.suc) {
|
||||
closeModal('subModal_floor');
|
||||
}
|
||||
});
|
||||
}
|
||||
function doSaveFloor() {
|
||||
$("#subForm_floor").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm_floor").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/structure/structureCardPicture/save.do", $("#subForm_floor").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$("#filelist").fileinput("upload");
|
||||
closeModal('subModal_floor')
|
||||
$("#table_picture").bootstrapTable('refresh');
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败','alertDiv_floor');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv_floor');
|
||||
}
|
||||
},'json');
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
$("#subForm_floor").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
floor: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '楼层不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function(){
|
||||
initFileInput_single('filelist',ext.contextPath+ "/base/inputFile.do");
|
||||
|
||||
$("#type").change(function(){
|
||||
if(this.value=="line"){
|
||||
$("#safeLevelLabel").hide();
|
||||
$("#safeLevelDiv").hide();
|
||||
$("#safeContentDiv").hide();
|
||||
}else if(this.value=="area"){
|
||||
$("#safeLevelLabel").show();
|
||||
$("#safeLevelDiv").show();
|
||||
$("#safeContentDiv").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal_floor">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增底图界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_floor" enctype="multipart/form-data">
|
||||
<input name="id" id="pictureId" type="hidden" value="${id}"/>
|
||||
<input name="unitId" type="hidden" value="${param.unitId}"/>
|
||||
<input name="structureId" id="structureId" type="hidden" value="${structureId}">
|
||||
<!-- <input name="patrolAreaId" type="hidden" value="${param.patrolAreaId}"/> -->
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv_floor"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">楼层</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="floor" name ="floor" placeholder="楼层" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="type" name="type" class="form-control select2">
|
||||
<option value="line" >巡检路线</option>
|
||||
<option value="area" >安全区域</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label id="safeLevelLabel" class="col-sm-2 control-label" style="display: none;">安全等级</label>
|
||||
<div id="safeLevelDiv" class="col-sm-4" style="display: none;">
|
||||
<select id ="safeLevel" name="safeLevel" class="form-control select2">
|
||||
<option value="A" >A级</option>
|
||||
<option value="B" >B级</option>
|
||||
<option value="C" >C级</option>
|
||||
<option value="D" >D级</option>
|
||||
<option value="S" >施工</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="safeContentDiv" class="form-group" style="display: none;">
|
||||
<label class="col-sm-2 control-label">安全备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="safeContent" name ="safeContent" placeholder="安全备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group" style="margin:8px">
|
||||
<button type="button" class="btn btn-default btn-file btn-sm" onclick="fileinput()" id="btn_save"><i class="fa fa-paperclip"></i> 上传图片</button>
|
||||
</div> -->
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSaveFloor()" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
279
WebRoot/jsp/structure/structureCardPictureEdit.jsp
Normal file
279
WebRoot/jsp/structure/structureCardPictureEdit.jsp
Normal file
@ -0,0 +1,279 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var masterId = $('#pictureId').val();
|
||||
var tbName = 'TB_EM_StructureCard_picture_file'; //数据表
|
||||
var nameSpace = 'StructureCardPicture';//保存文件夹
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
/* var student = {
|
||||
"caption":"lilei",
|
||||
|
||||
}
|
||||
previewConfigs[0]=student; */
|
||||
//初始化fileinput控件(第一次初始化)
|
||||
function showFileInput(ctrlName, uploadUrl, flag) {
|
||||
var control = $('#' + ctrlName);
|
||||
control.fileinput('destroy');
|
||||
control.fileinput({
|
||||
language: 'zh', //设置语言
|
||||
uploadUrl: uploadUrl,
|
||||
showUpload: false, //是否显示上传按钮
|
||||
showRemove: false,
|
||||
showCaption: false,//是否显示标题
|
||||
showBrowse: flag,//选择按钮
|
||||
showClose: false,//右上角关闭按钮
|
||||
dropZoneEnabled: flag,//是否显示拖拽区域
|
||||
fileActionSettings: {
|
||||
showDrag: false
|
||||
},
|
||||
browseClass: "btn btn-primary", //按钮样式
|
||||
maxFileCount: 1, //表示允许同时上传的最大文件个数
|
||||
enctype: 'multipart/form-data',
|
||||
validateInitialCount: true,
|
||||
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
||||
initialPreviewAsData: true,
|
||||
initialPreview: previews,
|
||||
initialPreviewConfig: previewConfigs,
|
||||
autoReplace: true,
|
||||
dropZoneTitle: '可拖拽文件到选区',
|
||||
uploadExtraData: function (previewId, index) { //传参
|
||||
//var data = $("#subForm_floor").serialize();
|
||||
//console.info(data)
|
||||
var data = {
|
||||
"masterId": masterId, //此处自定义传参
|
||||
"tbName": tbName,
|
||||
"nameSpace": nameSpace
|
||||
};
|
||||
return data;
|
||||
},
|
||||
layoutTemplates: {
|
||||
actionUpload: ''
|
||||
},
|
||||
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
||||
deleteExtraData: function () { //传参
|
||||
var data = {
|
||||
"tbName": tbName
|
||||
};
|
||||
return data;
|
||||
},
|
||||
});
|
||||
if (flag) {
|
||||
control.css('display', 'block'); //否则选择按钮无法点击
|
||||
}
|
||||
//导入文件上传完成之后的事件
|
||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||
console.info(data)
|
||||
if (data.response.suc) {
|
||||
closeModal('subModal_floor');
|
||||
}
|
||||
});
|
||||
control.on("filedeleted", function (event, id) {
|
||||
console.info('ssss');
|
||||
getFileList('filelist', ext.contextPath + "/base/inputFile.do");
|
||||
});
|
||||
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
||||
$(this).removeData("bs.modal");
|
||||
//modal重复打开会导致前面的滚动条失去作用
|
||||
$('.modal').css("overflow", "auto");
|
||||
});
|
||||
}
|
||||
//名称定义不可修改
|
||||
var getFileList = function (ctrlName, uploadUrl) {
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', { masterId: masterId, tbName: tbName }, function (data) {
|
||||
previews = new Array();
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var path = data[i].abspath;
|
||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");;
|
||||
var previewConfig = new Object();
|
||||
|
||||
previews.push(path);
|
||||
previewConfig['width'] = '50px';
|
||||
previewConfig['caption'] = data[i].filename;
|
||||
previewConfig['key'] = data[i].id;
|
||||
previewConfigs.push(previewConfig);
|
||||
|
||||
}
|
||||
var flag = true;
|
||||
if (data.length >= 1) {
|
||||
flag = false;
|
||||
}
|
||||
showFileInput(ctrlName, uploadUrl, flag);
|
||||
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
function doUpdateFloor() {
|
||||
$("#subForm_floor").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm_floor").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/structure/structureCardPicture/update.do", $("#subForm_floor").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#filelist").fileinput("upload");
|
||||
$("#table_picture").bootstrapTable('refresh');
|
||||
closeModal('subModal_floor');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败', 'alertDiv_floor');
|
||||
} else {
|
||||
showAlert('d', data.res, 'alertDiv_floor');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
$("#subForm_floor").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
floor: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '楼层不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function showmagic(){
|
||||
var type = "${structureCardPicture.type}";
|
||||
console.log(type);
|
||||
if (type == "line") {
|
||||
$("#safeLevelLabel").hide();
|
||||
$("#safeLevelDiv").hide();
|
||||
$("#safeContentDiv").hide();
|
||||
} else if (type == "area") {
|
||||
$("#safeLevelLabel").show();
|
||||
$("#safeLevelDiv").show();
|
||||
$("#safeContentDiv").show();
|
||||
}
|
||||
}
|
||||
$(function () {
|
||||
showmagic();
|
||||
$("#type").select2({ minimumResultsForSearch: -1 }).val("${structureCardPicture.type}").trigger("change");
|
||||
$("#safeLevel").select2({ minimumResultsForSearch: -1 }).val("${structureCardPicture.safeLevel}").trigger("change");
|
||||
getFileList('filelist', ext.contextPath + "/base/inputFile.do");
|
||||
|
||||
$("#type").change(function () {
|
||||
if (this.value == "line") {
|
||||
$("#safeLevelLabel").hide();
|
||||
$("#safeLevelDiv").hide();
|
||||
$("#safeContentDiv").hide();
|
||||
} else if (this.value == "area") {
|
||||
$("#safeLevelLabel").show();
|
||||
$("#safeLevelDiv").show();
|
||||
$("#safeContentDiv").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal_floor">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑底图界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_floor" enctype="multipart/form-data">
|
||||
<input name="id" id="pictureId" type="hidden" value="${structureCardPicture.id}" />
|
||||
<input name="structureId" type="hidden" value="${structureCardPicture.structureId}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv_floor"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
||||
value="${structureCardPicture.name }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*楼层</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="floor" name="floor" placeholder="楼层"
|
||||
value="${structureCardPicture.floor }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*顺序</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||||
value="${structureCardPicture.morder }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="type" name="type" class="form-control select2">
|
||||
<option value="line">巡检路线</option>
|
||||
<option value="area">安全区域</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label id="safeLevelLabel" class="col-sm-2 control-label"
|
||||
style="display: none;">安全等级</label>
|
||||
<div id="safeLevelDiv" class="col-sm-4" style="display: none;">
|
||||
<select id="safeLevel" name="safeLevel" class="form-control select2">
|
||||
<option value="A">A级</option>
|
||||
<option value="B">B级</option>
|
||||
<option value="C">C级</option>
|
||||
<option value="D">D级</option>
|
||||
<option value="S">施工</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="safeContentDiv" class="form-group" style="display: none;">
|
||||
<label class="col-sm-2 control-label">安全备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id="safeContent" name="safeContent"
|
||||
placeholder="安全备注...">${structureCardPicture.safeContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin:8px;">
|
||||
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doUpdateFloor()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
284
WebRoot/jsp/structure/structureCardPictureRouteEdit.jsp
Normal file
284
WebRoot/jsp/structure/structureCardPictureRouteEdit.jsp
Normal file
@ -0,0 +1,284 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<style type="text/css">
|
||||
#container {
|
||||
font: 62.5%/1 "楷体","Lucida Sans Unicode","Lucida Grande",Verdana,Arial,Helvetica,sans-serif;
|
||||
background-color: hsl(200,5%,15%);
|
||||
background-size: 8px 8px;
|
||||
background-image: -webkit-linear-gradient( 45deg, hsla(0,0%,0%,0) 0px,
|
||||
hsla(0,0%,0%,.10) 50%,
|
||||
hsla(0,0%,0%,0) 100% );
|
||||
}
|
||||
.has_active{
|
||||
background: #aaa;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/structure/LinkList.js"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/structure/path.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var modal = document.querySelector(".modal-content");
|
||||
var modalWidth = getStyle(modal,'width');
|
||||
var unitId = '${structureCardPicture.unitId}';
|
||||
var structureCardPictureId = '${structureCardPicture.id}';
|
||||
localStorage.removeItem("configOptions");
|
||||
getAllFloorList(structureCardPictureId,unitId,function(floors) {
|
||||
JSON.parse(floors).forEach(function(item, index) {
|
||||
if(localStorage.getItem('configOptions')) {
|
||||
if(item.id === JSON.parse(localStorage.getItem('configOptions')).floorId) {
|
||||
var selectedIndex = index;
|
||||
}
|
||||
} else {
|
||||
var selectedIndex = 0;
|
||||
}
|
||||
var floorHtml = $('<li id="' + item.id +'" class="' +
|
||||
(index === selectedIndex ? 'has_active' : '')
|
||||
+ '" style="list-style:none;padding:5px;cursor:pointer;border-radius:5px;">' + item.name + '</li>');
|
||||
$('#flool-list').append(floorHtml);
|
||||
if(selectedIndex === index){
|
||||
changeFloor(item.id, unitId);
|
||||
}
|
||||
$("#" + item.id).on("click", function(){
|
||||
if($(this).hasClass("has_active")) {
|
||||
localStorage.removeItem("configOptions");
|
||||
var floorId = item.id;
|
||||
changeFloor(floorId, unitId);
|
||||
localStorage.removeItem("configOptions");
|
||||
return;
|
||||
} else {
|
||||
$(".has_active").removeClass("has_active");
|
||||
$(this).addClass("has_active");
|
||||
localStorage.removeItem("configOptions");
|
||||
var floorId = item.id;
|
||||
changeFloor(floorId, unitId);
|
||||
localStorage.removeItem("configOptions");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#patrol-point-list").on("click",function(){
|
||||
$("#patrol-point-container").toggle();
|
||||
});
|
||||
$("#floor-list-btn").on("click",function(){
|
||||
$("#floor-list-container").toggle();
|
||||
});
|
||||
});
|
||||
function changeFloor(floorId, unitId) {
|
||||
console.log(floorId)
|
||||
console.log(unitId)
|
||||
getBgImg(floorId);
|
||||
$("#patrol-point-container").html('<ul id="patro-list-' + floorId + '" style="padding: 0;"></ul>');
|
||||
getRoutePointsFirst(floorId, '${structureCardPicture.id}',function(data1) {
|
||||
var data = deepClone(JSON.parse(data1).rows);
|
||||
data.forEach(function(item,index) {
|
||||
var insdt1 = item['insdt'].replace(' ', 'kongbai');
|
||||
var infos = {
|
||||
text: "新",
|
||||
state: 0,
|
||||
message: "新"
|
||||
};
|
||||
item['routeId'] = item.id;
|
||||
item['insdt'] = insdt1;
|
||||
item['infos'] = infos;
|
||||
item['posX'] = item.posx;
|
||||
item['posY'] = item.posy;
|
||||
});
|
||||
|
||||
if(localStorage.getItem("configOptions") === null) {
|
||||
var configOptions = {
|
||||
container: 'container', //容器id
|
||||
containerWidth: 2048, //容器宽度
|
||||
containerHeight: 1024, //容器高度
|
||||
// containerBgColor: '#fcc', //容器背景颜色
|
||||
draggable: true, // 点是否可拖拽
|
||||
//patrolAreaId: patrolAreaId,
|
||||
structureCardPictureId: '${structureCardPicture.id}',
|
||||
floorId: floorId,
|
||||
type: 'P',
|
||||
unitId: unitId,
|
||||
pointsStyle: {
|
||||
pointInflectionStyle: { // 拐点样式配置项
|
||||
radius: 10,
|
||||
borderWidth: 2,
|
||||
borderColor: '#ddd',
|
||||
borderStyle: 'solid',
|
||||
// fontSize: 10,
|
||||
// fontColor: '#ddd',
|
||||
// shadow: '1px 4px 6px #1c1d1f, 0 0 0 #000000, 1px 4px 6px #1c1d1f'
|
||||
},
|
||||
pointDefaultStyle: {
|
||||
radius: 10,
|
||||
borderWidth: 2,
|
||||
borderColor: '#ddd',
|
||||
borderStyle: 'solid',
|
||||
fontSize: 40,
|
||||
fontColor: '#ddd',
|
||||
// shadow: '1px 4px 6px #1c1d1f, 0 0 0 #000000, 1px 4px 6px #1c1d1f'
|
||||
},
|
||||
pointCompleteStyle: {
|
||||
radius: 30,
|
||||
borderWidth: 2,
|
||||
borderColor: '#93c913',
|
||||
borderStyle: 'solid',
|
||||
fontSize: 40,
|
||||
fontColor: '#93c913',
|
||||
shadow: '0 0 24px rgba(147, 201, 19, 0.6)'
|
||||
},
|
||||
pointAbnormalStyle: {
|
||||
radius: 30,
|
||||
borderWidth: 2,
|
||||
borderColor: '#daa520',
|
||||
borderStyle: 'solid',
|
||||
fontSize: 40,
|
||||
fontColor: '#daa520',
|
||||
shadow: '0 0 24px rgba(218,165,32, 0.6)'
|
||||
},
|
||||
pointAlarmStyle: {
|
||||
radius: 30,
|
||||
borderWidth: 2,
|
||||
borderColor: '#ff4847',
|
||||
borderStyle: 'solid',
|
||||
fontSize: 40,
|
||||
fontColor: '#ff4847',
|
||||
shadow: '0 0 24px rgba(255, 72, 71, 0.6)'
|
||||
}
|
||||
},
|
||||
linesStyle: {
|
||||
lineDefaultStyle: {
|
||||
lineWidth: 4,
|
||||
lineColor: '#ddd',
|
||||
lineStyle: 'dashed',
|
||||
arrowPosition: 23
|
||||
},
|
||||
lineCompleteStyle: {
|
||||
lineWidth: 2,
|
||||
lineColor: '#93c913',
|
||||
lineStyle: 'solid',
|
||||
shadow: '0 0 24px rgba(147, 201, 19, 0.6)',
|
||||
arrowPosition: 23
|
||||
},
|
||||
lineAbnormalStyle: {
|
||||
lineWidth: 2,
|
||||
lineColor: '#daa520',
|
||||
lineStyle: 'dashed',
|
||||
shadow: '0 0 24px rgba(218,165,32, 0.6)',
|
||||
arrowPosition: 23
|
||||
},
|
||||
lineAlarmStyle: {
|
||||
lineWidth: 2,
|
||||
lineColor: '#ff4847',
|
||||
lineStyle: 'dashed',
|
||||
shadow: '0 0 24px rgba(255, 72, 71, 0.6)',
|
||||
arrowPosition: 23
|
||||
}
|
||||
},
|
||||
points: deepClone(data)
|
||||
};
|
||||
localStorage.setItem("configOptions", JSON.stringify(configOptions));
|
||||
setContainer(configOptions);
|
||||
var configOptions = JSON.parse(localStorage.getItem("configOptions"));
|
||||
var patrolPointInContainer = configOptions.points.filter(function(item){return item['type'] === '0';});
|
||||
console.log(patrolPointInContainer);
|
||||
if(patrolPointInContainer.length === 0) {
|
||||
getPatrolPointsList1(configOptions);
|
||||
} else {
|
||||
getPatrolPointsList(configOptions);
|
||||
}
|
||||
drawPath(configOptions);
|
||||
} else {
|
||||
var configOptions = JSON.parse(localStorage.getItem("configOptions"));
|
||||
configOptions.points === data ? deepClone(data) : [];
|
||||
configOptions.floorId = floorId;
|
||||
localStorage.setItem("configOptions",JSON.stringify(configOptions));
|
||||
setContainer(configOptions);
|
||||
var configOptions = JSON.parse(localStorage.getItem("configOptions"));
|
||||
var patrolPointInContainer = configOptions.points.filter(function(item){return item['type'] === '0';});
|
||||
if(patrolPointInContainer.length === 0) {
|
||||
getPatrolPointsList1(configOptions);
|
||||
} else {
|
||||
getPatrolPointsList(configOptions);
|
||||
}
|
||||
drawPath(configOptions);
|
||||
};
|
||||
});
|
||||
$("#patrol-point-container").show();
|
||||
}
|
||||
|
||||
// 获取楼层背景底图
|
||||
function getBgImg(floorId) {
|
||||
// 数据表名
|
||||
$("#container").css("background", "");
|
||||
var tbName = 'TB_EM_StructureCard_picture_file';
|
||||
$.post(ext.contextPath + '/base/getInputFileList.do', {
|
||||
masterId: floorId,
|
||||
tbName: tbName
|
||||
} , function(data){
|
||||
if(JSON.parse(data).length > 0) {
|
||||
var path = JSON.parse(data)[0].abspath;
|
||||
// var fileName = JSON.parse(data)[0].filename;
|
||||
if(path) {
|
||||
path = path.substring(path.indexOf('webapps') + 7,path.length);
|
||||
path = ext.basePath.replace(ext.contextPath,'') + path.replace(/\\/g,"\/");
|
||||
console.log(path);
|
||||
console.log(decodeURIComponent(path));
|
||||
// $("#container").css("background", "url(" + path + ") no-repeat");
|
||||
// $("#container").css("background-size", "cover");
|
||||
$("#container").css({
|
||||
//"background-color": "hsl(200,5%,15%)",
|
||||
// "background-color": "rgb(255, 255, 255)",
|
||||
// "background-image": "url(" + path + ")",
|
||||
// "background-repeat": "no-repeat",
|
||||
// "background-size": "contain",
|
||||
// "background-position":"center"
|
||||
"background-color": "hsl(200,5%,15%)",
|
||||
"background-image": "url(" + path + ")",
|
||||
"background-repeat": "no-repeat",
|
||||
"background-size": "cover"
|
||||
});
|
||||
|
||||
var img = $(this);
|
||||
$("<img/>").attr("src", $(img).attr("src")).load(function() {
|
||||
//console.log("图片的宽度为:"+this.width);
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="subModal" style="overflow: auto;">
|
||||
<div class="modal-dialog modal-xlg" style="width: 2048px;">
|
||||
<div class="modal-content" >
|
||||
<input name="id" type="hidden" value="${structureCardPicture.id}"/>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">巡检路线</h4>
|
||||
<div style="position: fixed; right: 150px;top: 12px;">
|
||||
<!-- <button class="btn btn-warning" id="clearBtn" onclick="clear()">清空</button> -->
|
||||
<button class="btn btn-success" id="patrol-point-list">巡检点列表</button>
|
||||
<button class="btn btn-primary" id="floor-list-btn">底图列表</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="patrol-point-container" style="position: absolute;top:65px;left:5px;width: auto; height: auto;background: rgba(255,255,255,.8);border-radius: 5px;z-index: 920;">
|
||||
|
||||
</div>
|
||||
<div id="floor-list-container" style="position: absolute;top:65px;right:5px;width: 35px; height: auto;background: rgba(255,255,255,.8);border-radius: 5px;padding:2px;z-index: 920;">
|
||||
<ul id="flool-list" style="padding: 0;margin: 0;"></ul>
|
||||
|
||||
</div>
|
||||
<div class="modal-body" id="container">
|
||||
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
216
WebRoot/jsp/structure/structureCardPictureRoutePointEdit.jsp
Normal file
216
WebRoot/jsp/structure/structureCardPictureRoutePointEdit.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var editDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/doedit.do', {id:id} , function(data) {
|
||||
$("#subDiv_detail").html(data);
|
||||
openModal('subModal_detail');
|
||||
});
|
||||
};
|
||||
|
||||
var addDetailFun = function() {
|
||||
var pid=$('#id').val();
|
||||
// stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/doadd.do' ,{pid,unitId:unitId}, function(data) {
|
||||
$("#subDiv_detail").html(data);
|
||||
openModal('subModal_detail');
|
||||
});
|
||||
};
|
||||
|
||||
var deleteDetailFun = function(id) {
|
||||
// stopBubbleDefaultEvent();
|
||||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/dodelete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table_pointDetail").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// var deletesparamFun = function() {
|
||||
// var checkedItems = $("#table_pointDetail").bootstrapTable('getSelections');
|
||||
// var datas="";
|
||||
// $.each(checkedItems, function(index, item){
|
||||
// datas+=item.id+",";
|
||||
// });
|
||||
// if(datas==""){
|
||||
// showAlert('d','请先选择记录','mainAlertDetaildiv');
|
||||
// }else{
|
||||
// if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||||
// $.post(ext.contextPath + '/process/initialPoint/deletesNew.do', {ids:datas} , function(data) {
|
||||
// if(data>0){
|
||||
// $("#table_pointDetail").bootstrapTable('refresh');
|
||||
// }else{
|
||||
// showAlert('d','删除失败','mainAlertDetaildiv');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// }
|
||||
// };
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/structure/structureCardPicture/updateRoutePoint.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal');
|
||||
$("#table_picture").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '更新失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
// $("#subForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// name: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '名称不能为空'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function () {
|
||||
|
||||
$("#table_pointDetail").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/structure/structureCardPictureRoutePointdetail/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid : $('#id').val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
width: '120',
|
||||
field: 'contents', // 返回json数据中的name
|
||||
title: '巡检内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
width : '100',
|
||||
field: 'requirement', // 返回json数据中的shelfclass
|
||||
title: '巡检要求', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width : '100',
|
||||
field: 'num', // 返回json数据中的shelfclass
|
||||
title: '台数(项数)', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str="";
|
||||
str+='<button class="btn btn-default btn-sm" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit" title="编辑"></i></button>';
|
||||
str+='<button class="btn btn-default btn-sm" onclick="deleteDetailFun(\'' + row.id + '\')"><i class="fa fa-trash-o" title="删除"></i></button>';
|
||||
str='<div class="btn-group" >'+str+'</div>';
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_pointDetail");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${structureCardPictureRoute.id}" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">点位名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="patrolContent" name="patrolContent" class="form-control" placeholder="巡检要求" value="${structureCardPictureRoute.patrolContent}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- 参数配置 -->
|
||||
<div class="box box-primary" >
|
||||
<div id="mainAlertDetaildiv"></div>
|
||||
<div id="subDetailDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">巡检内容配置</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<!-- <a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a> -->
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i class="fa fa-cloud-upload"></i> 导入</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i class="fa fa-cloud-download"></i> 导出</button> -->
|
||||
<!-- <div class="form-group pull-right" >
|
||||
<div class="input-group input-group-sm" style="width: 180px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="参数名称/参数code">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table id="table_pointDetail"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,97 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
$("#subForm_detail").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm_detail").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/structure/structureCardPictureRoutePointdetail/dosave.do", $("#subForm_detail").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal_detail')
|
||||
$("#table_pointDetail").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
$("#subForm_detail").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '巡检内容不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal_detail">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_detail" enctype="multipart/form-data">
|
||||
|
||||
<input id="pid" name="pid" type="hidden" value="${pid}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*巡检内容</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contents" name="contents" class="form-control" placeholder="巡检内容">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">巡检要求</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="requirement" name="requirement" class="form-control" placeholder="巡检要求">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">台数(项数)</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="num" name="num" class="form-control" placeholder="台数(项数)">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="ord" name="ord" class="form-control" placeholder="顺序">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,89 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function doupdate() {
|
||||
$("#subForm_detail").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm_detail").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/structure/structureCardPictureRoutePointdetail/doupdate.do", $("#subForm_detail").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal_detail');
|
||||
$("#table_pointDetail").bootstrapTable('refresh');
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '更新失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
$("#subForm_detail").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
contents: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '巡检不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal_detail">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm_detail">
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${structureCardPictureRoutePointdetail.id}" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">*巡检内容</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contents" name="contents" class="form-control" placeholder="巡检内容" value="${structureCardPictureRoutePointdetail.contents}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">巡检要求</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="requirement" name="requirement" class="form-control" placeholder="巡检要求" value="${structureCardPictureRoutePointdetail.requirement}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">台数(项数)</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="num" name="num" class="form-control" placeholder="台数(项数)" value="${structureCardPictureRoutePointdetail.num}">
|
||||
</div>
|
||||
|
||||
<label class="col-sm-3 control-label">顺序</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="number" id="ord" name="ord" class="form-control" placeholder="顺序" value="${structureCardPictureRoutePointdetail.ord}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@ -0,0 +1,187 @@
|
||||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/processWebsite/doadd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/processWebsite/doedit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var forwardFun = function(website){
|
||||
window.open(website);
|
||||
}
|
||||
var deleteFun = function (id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/processWebsite/dodelete.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var initFun = function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/processWebsite/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
//showFooter: true,//添加页脚
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val(),
|
||||
}
|
||||
},
|
||||
sortName: 'ord', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
/* {
|
||||
checkbox: true, // 显示一个勾选框
|
||||
}, */{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width:240,
|
||||
}, {
|
||||
field: 'website', // 返回json数据中的name
|
||||
title: '接口链接', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="forwardFun(\'' + row.website + '\')" data-toggle="tooltip" title="跳转"><i class="fa fa-eye "></i><span class="hidden-md hidden-lg"> 跳转</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="editFun(\'' + row.id + '\')" data-toggle="tooltip" title="编辑"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="deleteFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
//注册加载子表的事件。index:父表当前行的行索引,row:父表当前行的Json数据对象,$detail:当前行下面创建的新行里面的td对象。
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
initFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div>
|
||||
<form id="searchForm">
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name"
|
||||
class="form-control pull-right" placeholder="名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增</button>
|
||||
|
||||
<!-- <button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除</button> -->
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
140
WebRoot/jsp/structure/structureCardView.jsp
Normal file
140
WebRoot/jsp/structure/structureCardView.jsp
Normal file
@ -0,0 +1,140 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
.tools{
|
||||
margin-right: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showStructureCard4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/structure/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"_pname"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
//设计参数
|
||||
dopoint('design');
|
||||
});
|
||||
function dopoint(structureCodeType){
|
||||
|
||||
//关联测量点
|
||||
$("#table_"+structureCodeType).bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name : $('#search_name').val(),
|
||||
companyId: companyId,
|
||||
structureId:'${structureCard.id}',
|
||||
structureCodeType:structureCodeType
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
/* checkbox: true, // 显示一个勾选框
|
||||
},{ */
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点Code', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '数据', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_"+structureCodeType);
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">详情</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${structureCard.id}"/>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${structureCard.name }</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">类型</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">
|
||||
<c:if test="${0==structureCard.type}">构筑物</c:if>
|
||||
<c:if test="${1==structureCard.type}">工艺单体</c:if>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">最大设计能力</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${structureCard._design }</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">可调能力</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${structureCard._adjustable }</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">当前能力</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${structureCard._current }</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">当前负荷率</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${structureCard._load }</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary" >
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">设计参数</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<table id="table_design"></table>
|
||||
</div>
|
||||
</div>
|
||||
152
WebRoot/jsp/structure/structureList.jsp
Normal file
152
WebRoot/jsp/structure/structureList.jsp
Normal file
@ -0,0 +1,152 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var companyId = "";
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/structure/doadd.do', {pid:pid} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
$.post(ext.contextPath + '/structure/doview.do', {id:id,companyId:companyId} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
//查看设备
|
||||
var viewEquFun = function(id){
|
||||
$.post(ext.contextPath + '/equipment/doviewBox.do', {id:id} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
//查看设备卡片
|
||||
var viewEquModel = function(id){
|
||||
$.post(ext.contextPath + '/equipment/doview.do', {id:id} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
swal({
|
||||
text: "您确定要删除此记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
var initTreeView = function() {
|
||||
var height =$(window).height()-115;
|
||||
$('#tree').height(height);
|
||||
$.post(ext.contextPath + '/structure/getStructureJson.do', function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
if(data.type!=2){
|
||||
viewFun(data.id);
|
||||
}else{
|
||||
viewEquFun(data.id);
|
||||
}
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#faultBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
companyId = unitId;
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/top.jsp"></jsp:include>--%>
|
||||
<!-- 菜单栏 -->
|
||||
<%--<jsp:include page="/jsp/left.jsp"></jsp:include>--%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id ="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="equipmentCard4SelectsDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="mpoint4SelectsDiv"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="box box-solid" style=" margin-bottom:0px;">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">综合列表</h3>
|
||||
<div class="box-tools">
|
||||
<!-- <button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8" id="faultBox"> </div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%--<jsp:include page="/jsp/bottom.jsp"></jsp:include>--%>
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include>--%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user