first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1,102 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@page import="com.sipai.tools.CommString" %>
<%request.setAttribute("Active_True", CommString.Active_True); %>
<%request.setAttribute("Active_False", CommString.Active_False); %>
<!-- bootstrap switch -->
<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>
<style type="text/css">
</style>
<script type="text/javascript">
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {
//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/app/appMenuitem/dosave.do", $("#subForm").serialize(), function (data) {
if (data.code == 1) {
initTreeView();
} else if (data.code == 0) {
showAlert('d', data.msg);
} else {
showAlert('d', data.code);
}
}, 'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '排序不能为空'
}
}
}
}
});
</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" autocomplete="off">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" name="pid" id="pid" value="${param.pid}"/>
<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="${appMenuitem.name}">
</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="${Active_True}">启用</option>
<option value="${Active_False}">禁用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
value="${appMenuitem.morder}">
</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="location" name="location" placeholder="地址"
value="${appMenuitem.location}">
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,145 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@page import="com.sipai.tools.CommString" %>
<%request.setAttribute("Active_True", CommString.Active_True); %>
<%request.setAttribute("Active_False", CommString.Active_False); %>
<!-- bootstrap switch -->
<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>
<style type="text/css">
</style>
<script type="text/javascript">
$(function () {
$("#active").select2({minimumResultsForSearch: -1}).val("${appMenuitem.active}").trigger("change");
});
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {
//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/app/appMenuitem/doupdate.do", $("#subForm").serialize(), function (data) {
if (data.code == 1) {
initTreeView();
} else if (data.code == 0) {
showAlert('d', data.msg);
} else {
showAlert('d', data.code);
}
}, 'json');
}
}
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
morder: {
validators: {
notEmpty: {
message: '排序不能为空'
}
}
}
}
});
function dodel(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 + '/app/appMenuitem/dodel.do', {id: id}, function (data) {
if (data.code == 1) {
initTreeView();
} else {
showAlert('d', data.msg, 'alertDiv');
}
}, 'json');
}
});
}
</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('${appMenuitem.id}')" 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" autocomplete="off">
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<input type="hidden" name="id" id="id" value="${appMenuitem.id}"/>
<input type="hidden" name="pid" id="pid" value="${appMenuitem.pid}"/>
<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="${appMenuitem.name}">
</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="${Active_True}">启用</option>
<option value="${Active_False}">禁用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
value="${appMenuitem.morder}">
</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="location" name="location" placeholder="地址"
value="${appMenuitem.location}">
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,109 @@
<%@ 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 () {
var node = $('#tree').treeview('getSelected');
var pid = "";
if (node != null && node.length > 0) {
pid = node[0].id;
} else {
pid = "-1";
}
$.post(ext.contextPath + '/app/appMenuitem/doadd.do', {
unitId: unitId,
pid: pid,
menuType: '${param.menuType}'
}, function (data) {
$("#menuBox").html(data);
});
};
var editFun = function (id) {
$.post(ext.contextPath + '/app/appMenuitem/doedit.do', {
id: id,
menuType: '${param.menuType}'
}, function (data) {
$("#menuBox").html(data);
});
};
var initTreeView = function () {
$.post(ext.contextPath + '/app/appMenuitem/getTreeJson.do', {}, function (data) {
//console.info(data)
$('#tree').treeview({
data: data
});
$('#tree').on('nodeSelected', function (event, data) {
editFun(data.id);
});
}, 'json');
$("#menuBox").html("");
};
$(function () {
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) -->
<!-- Main content -->
<section class="content container-fluid">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<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-9" id="menuBox">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
</html>

View File

@ -0,0 +1,139 @@
<%@ 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;
}
</style>
<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>
<script type="text/javascript">
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {
$.post(ext.contextPath + "/app/appProductMonitor/dosave.do", $("#subForm").serialize(), function(result) {
if (result.code == 1) {
initTreeView();
}else{
showAlert('d',result.msg);
}
},'json');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
/* equipmentcardid: {
validators: {
notEmpty: {
message: '厂内编号编号不能为空'
},
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值获得一个json数据。例表示正确{"valid",true}
url: ext.contextPath + '/equipment/checkExist.do',//验证地址
message: '编号已存在',//提示消息
type: 'POST',//请求方式
data: function(validator) {
return {
equipmentcardid: $('#equipmentcardid').val(),
id : $('#id').val()
};
}
},
},
}, */
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
sname: {
validators: {
notEmpty: {
message: '简称不能为空'
}
}
},
}
});
// var showUser4SelectsFun = function() {
// var userIds= $("#inputuser").val();
// $.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"inputuser",textId:"auditMan",userIds:userIds} , function(data) {
// $("#user4SelectDiv").html(data);
// openModal("user4SelectModal");
// });
// };
$(function() {
// $.post(ext.contextPath + "/report/rptDeptSet/getDateType4Select.do", {}, function(data) {
// var selelct =$("#dateType").select2({
// data: data,
// placeholder:'请选择',//默认文字提示
// allowClear: true,//允许清空
// escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
// language: "zh-CN",
// minimumInputLength: 0,
// minimumResultsForSearch: 10,//数据大于10个启用搜索框
// formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
// formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
// });
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
// selelct.val('${rptDeptSet.dateType}').trigger("change");
// },'json');
$("#unitId").val(unitId);
});
</script>
<div class="box box-primary" style="margin-bottom:0px;">
<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 ">
<div id="user4SelectDiv"></div>
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${appProductMonitor.id}"/>
<input id="unitId" name="unitId" type="hidden" value="${appProductMonitor.unitId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></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="${appProductMonitor.name}">
</div>
<label class="col-sm-2 control-label">简称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="sname" name ="sname" placeholder="简称" value="${appProductMonitor.sname}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="number" class="form-control" id="morder" name ="morder" placeholder="顺序" value="${appProductMonitor.morder}">
</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="auditMan" name ="auditMan" placeholder="点击选择" onclick="showUser4SelectsFun();" value="${auditMan}">
<input id="inputuser" name="inputuser" type="hidden" value="${rptDeptSet.inputuser}" />
</div>
</div> -->
</form>
</div>
</div>

View File

@ -0,0 +1,325 @@
<%@ 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;
}
</style>
<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>
<script type="text/javascript">
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {
$.post(ext.contextPath + "/app/appProductMonitor/doupdate.do", $("#subForm").serialize(), function (result) {
if (result.code == 1) {
initTreeView();
} else {
showAlert('d', result.msg);
}
}, 'json');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
/* equipmentcardid: {
validators: {
notEmpty: {
message: '厂内编号编号不能为空'
},
remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值获得一个json数据。例表示正确{"valid",true}
url: ext.contextPath + '/equipment/checkExist.do',//验证地址
message: '编号已存在',//提示消息
type: 'POST',//请求方式
data: function(validator) {
return {
equipmentcardid: $('#equipmentcardid').val(),
id : $('#id').val()
};
}
},
},
}, */
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
sname: {
validators: {
notEmpty: {
message: '简称不能为空'
}
}
},
}
});
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 + '/app/appProductMonitor/dodelete.do', $("#subForm").serialize(), function (result) {
// var data= $.parseJSON(result);
if (result.code == 1) {
initTreeView();
} else {
showAlert('d', result.msg);
}
}, 'json');
}
});
}
function delMpointFun(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 + '/app/appProductMonitor/dodeleteMp.do', {id: id}, function (data) {
if (data.code == 1) {
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'alertDiv');
}
}, 'json');
}
});
}
/*var addMpointFuns = function () {
var allTableData = $("#table").bootstrapTable('getData');
var mPointIds = "";
$.each(allTableData, function (index, item) {
if (mPointIds != "") {
mPointIds += ",";
}
if (item.mPoint != null && item.mPoint != '') {
mPointIds += item.mPoint.mpointid;
}
})
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showMPoint4Select.do', {
mPointIds: mPointIds,
unitId: unitId
}, function (data) {
$("#menu4SelectDiv_func").html(data);
openModal('MPointModel');
});
};*/
var addMpointFuns = function () {
var allTableData = $("#table").bootstrapTable('getData');
var mpids = "";
$.each(allTableData, function (index, item) {
if (mpids != "") {
mpids += ",";
}
if (item.mPoint != null && item.mPoint != '') {
mpids += item.mPoint.id;
}
})
// console.log(mpids);
$.post(ext.contextPath + '/work/mpoint/mpointList4Layer.do', {
mpids: mpids,
fucname: 'doFinishSelectMPoint'
}, function (data) {
$("#menu4SelectDiv_func").html(data);
openModal('subModalMpoint');
});
};
var doFinishSelectMPoint = function (data) {
$.post(ext.contextPath + '/app/appProductMonitor/doimportMp.do', {
pid: '${appProductMonitor.id}',
mpids: data,
unitId: unitId
}, function (data) {
if (data.code) {
$("#table").bootstrapTable('refresh');
}
}, 'json');
};
$(function () {
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/app/appProductMonitor/getlistMp.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [5, 10, 15], // 设置页面可以显示的数据条数
pageSize: 5, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'client', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
pid: '${appProductMonitor.id}',
unitId: unitId
}
},
sortName: 'morder', // 要排序的字段
sortOrder: 'asc', // 排序规则
columns: [
{
field: 'mPoint', // 返回json数据中的name
title: '测量点编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '50%',
formatter: function (value, row, index) {
return value == null ? '' : value.mpointcode;
},
}, {
field: 'mPoint', // 返回json数据中的name
title: '测量点名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
width: '50%',
formatter: function (value, row, index) {
return value == null ? '' : value.parmname;
},
}, {
title: "操作",
align: 'center',
valign: 'middle',
width: 100, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return '<div class="btn-group">' +
'<button class="btn btn-default btn-sm" onclick="delMpointFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
}
}
],
onLoadSuccess: function () { //加载成功时执行
$(".bs-checkbox").css({'text-align': 'center', 'vertical-align': 'middle'})
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<div class="box box-primary" style="margin-bottom:0px;">
<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 ">
<div id="user4SelectDiv"></div>
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${appProductMonitor.id}"/>
<input id="unitId" name="unitId" type="hidden" value="${appProductMonitor.unitId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></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="${appProductMonitor.name}">
</div>
<label class="col-sm-2 control-label">简称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="sname" name="sname" placeholder="简称"
value="${appProductMonitor.sname}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
value="${appProductMonitor.morder}">
</div>
</div>
</form>
</div>
</div>
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">测量点配置</h3>
<div class="box-tools pull-right">
</div>
</div>
<div class="box-body ">
<div>
<div id="alertDiv_power"></div>
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default" onclick="addMpointFuns();"><i class="fa fa-plus"></i>选择测量点
</button>
</div>
<div id="powerDiv"></div>
<div id="menu4SelectDiv_func"></div>
<table id="table"></table>
</div>
</div>
</div>

View File

@ -0,0 +1,92 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page import="com.sipai.entity.base.ServerObject"%>
<!-- <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> -->
<!-- <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> -->
<!-- <%@ 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 + '/app/appProductMonitor/doadd.do', {} , function(data) {
$("#appProductMonitorEdit").html(data);
});
};
var editFun = function(id) {
$.post(ext.contextPath + '/app/appProductMonitor/doedit.do', {id: id} , function(data) {
$("#appProductMonitorEdit").html(data);
});
};
var initTreeView = function() {
$.post(ext.contextPath + '/app/appProductMonitor/getTree.do', {unitId:unitId} , function(data) {
var treeData = data.result;
$('#tree').treeview({data: treeData});
$('#tree').on('nodeSelected', function(event, treeData) {
editFun(treeData.id);
});
},'json');
$("#appProductMonitorEdit").html("");
};
$(function() {
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="equipmentClassSubDiv"></div> -->
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">APP生产监测</h3>
<div class="box-tools" id="addDiv">
<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:700px;overflow:auto; "></div>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-md-9" id="appProductMonitorEdit" ></div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
</html>

View File

@ -0,0 +1,99 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<script type="text/javascript">
function doSaveMainRole() {
// var checkedtree = $('#menu_func_tree').treeview('getChecked');
var datas = "";
var lis = $('[data-nodeid]');
// console.log(lis)
for (var i = 0; i < lis.length; i++) {
// if (lis[i].dataset.nodeid.split('.').length == 4) {
var lis_element = $('#' + lis[i].id);
if (lis_element.hasClass('node-checked')) {
var span = lis_element.children('.check-icon');
if (span.hasClass('glyphicon-check')) {
datas += lis[i].id + ",";
}
}
// }
}
/*$.each(checkedtree,function(index,item){
datas+=item.id+",";
});*/
$.post(ext.contextPath + "/app/appMenuitem/updateRoleMenu.do", {
menustr: datas,
roleid: "${roleid}"
}, function (result) {
if (result >= 0) {
closeModal('menuFuncModal');
} else {
showAlert('d', '保存失败')
}
}, 'json');
}
function selectNode() {
<%--console.log('${json}')--%>
$.each(eval('${json}'), function (index, item) {
var node = $('#menu_func_tree').treeview('findNodes', [item.menuid, 'id']);
$('#menu_func_tree').treeview('toggleNodeChecked', [node, {silent: true}]);
});
}
// List<RoleMenu> list = menuService.getFinalMenuByRoleId(roleid);
// JSONArray json=JSONArray.fromObject(list);
// model.addAttribute("json",json);
function initialTree() {
$.post(ext.contextPath + '/app/appMenuitem/getMenusJson.do', {roleid: '${roleid}'}, function (data) {
// console.info(data)
if (data.length > 0) {
$('#menu_func_tree').treeview({
data: data,
showCheckbox: true,
showTags: true,
showBorder: false,
hierarchicalCheck: true,//级联勾选
onInitialized: function (event, nodes) {
},
//无点击事件,通过节点选择实现
onNodeSelected: function (event, node) {
},
onRendered: function (event, nodes) {
setTimeout("selectNode();","10");
}
});
}
}, 'json');
}
$(function () {
initialTree();
});
</script>
<div class="modal fade" id="menuFuncModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-target="#menuFuncModal"
aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">${rolename }——app权限树</h4>
</div>
<div class="modal-body">
<div id="alertDiv"></div>
<div id="menu_func_tree" style="height:400px;overflow:auto; "></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" data-target="#menuFuncModal">关闭
</button>
<button type="button" class="btn btn-primary" onclick="doSaveMainRole()">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>