Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/command/menuManage.jsp
2026-01-16 14:13:44 +08:00

243 lines
8.9 KiB
Plaintext

<%@ 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"%>
<% request.setAttribute("Type_Catalogue", com.sipai.entity.command.EmergencyConfigure.Type_Catalogue); %>
<% request.setAttribute("Type_Setting", com.sipai.entity.command.EmergencyConfigure.Type_Setting); %>
<% request.setAttribute("Type_Step", com.sipai.entity.command.EmergencyConfigure.Type_Step); %>
<!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>
<!-- 流程图-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/logicFlow/logic-flow.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/logicFlow/logic-flow.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/logicFlow/extension.css"/>
<!-- 菜单-->
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/logicFlow/Menu.js" charset="utf-8"></script>
<!-- 拖拽-->
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/logicFlow/DndPanel.js" charset="utf-8"></script>
<!-- 选区-->
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/logicFlow/SelectionSelect.js" charset="utf-8"></script>
<!-- 流程图End-->
<script type="text/javascript">
var addFun = function() {
var node=$('#tree').treeview('getSelected');
var pid="";
var type="";
if(node!=null && node.length>0){
pid=node[0].id;
type=node[0].type;
}
if(type != undefined && type != null && (type == '${Type_Catalogue}' || type == '')){
$.post(ext.contextPath + '/command/emergencyConfigure/showMenuAdd_new.do', {pid,unitId} , function(data) {
$("#menuBox").html(data);
});
}else{
showAlert('w','预案需要关联在目录之下。','mainAlertdiv');
}
};
var editFun = function(id) {
$.post(ext.contextPath + '/command/emergencyConfigure/showMenuEdit_new.do', {id,unitId} , function(data) {
$("#menuBox").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 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 + '/work/group/deletes.do', {ids:datas} , function(data) {
if(data>0){
$("#table").bootstrapTable('refresh');
}else{
showAlert('d','删除失败','mainAlertdiv');
}
});
}
});
}
};
var initTreeView = function() {
$.post(ext.contextPath + '/command/emergencyConfigure/getMenusJson.do', {ng:'',unitId} , function(data) {
//console.info(data)
$('#tree').treeview({data: data,
});
$('#tree').on('nodeSelected', function(event, data) {
editFun(data.id);
//var node=$('#tree').treeview('getSelected');
});
},'json');
$("#menuBox").html("");
};
var addFunSimple = function () {
var node = $('#tree').treeview('getSelected');
var pid = "";
var type="";
if (node != null && node.length > 0) {
pid = node[0].id;
type=node[0].type;
} else {
pid = "-1";
}
if(type != undefined && type != null && (type == '${Type_Catalogue}' || type == '')){
$.post(ext.contextPath + '/command/emergencyConfigure/doaddSimple.do', {unitId: unitId, pid: pid}, function (data) {
$("#menuBox").html(data);
});
}else{
showAlert('w','目录需要关联在其他目录之下。','mainAlertdiv');
}
};
var addStepFun = function() {
var node=$('#tree').treeview('getSelected');
var pid="";
var type="";
if(node!=null && node.length>0){
pid=node[0].id;
type=node[0].type;
if(type != undefined && type != null && type == '${Type_Setting}'){
$.post(ext.contextPath + '/command/emergencyConfigure/stepAdd.do', {pid,unitId} , function(data) {
if (data == 2) {
showAlert('d','当前预案已配置内容,无法增加步骤。','mainAlertdiv');
}else{
$("#menuBox").html(data);
}
});
}else{
showAlert('w','步骤需要关联在预案之下。','mainAlertdiv');
}
}else{
showAlert('w','步骤需要关联在预案之下。','mainAlertdiv');
}
};
$(function() {
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">
<!-- Main content -->
<section class="content container-fluid">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div class="row">
<div class="col-md-2">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">所有类型</h3>
<div class="box-tools">
<button type="buttonB" class="btn btn-box-tool" onclick="addFunSimple();">
<i class="fa fa-plus"></i> 目录
</button>
<button type="buttonB" class="btn btn-box-tool" onclick="addFun();">
<i class="fa fa-plus"></i> 预案
</button>
<security:authorize buttonUrl="command/emergencyConfigure/stepAdd.do">
<button type="buttonB" class="btn btn-box-tool" onclick="addStepFun();">
<i class="fa fa-plus"></i> 步骤
</button>
</security:authorize>
</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-10" id="menuBox">
</div>
</div>
</section>
<!-- /.content -->
</div>
</div>
</body>
</html>