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

259 lines
9.4 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" %>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<style type="text/css">
.select2-container .select2-selection--single {
height: 34px;
line-height: 34px;
}
.select2-selection__arrow {
margin-top: 3px;
}
::-webkit-scrollbar {
width: 8px;
padding-right: 4px;
background-color: #d0d0d0;
/*其他样式,比如圆角等*/
}
/*滑块样式*/
::-webkit-scrollbar-thumb {
-webkit-border-radius: 4px;
border-radius: 4px;
background-color: #6C6C6C;
}
/*当前窗口失去焦点时的滑块样式*/
::-webkit-scrollbar-thumb:window-inactive {
background-color: blue;
}
/*默认隐藏滚动条*/
#tree {
overflow-y: hidden;
}
/*悬浮显示滚动条*/
#tree:hover {
overflow-y: auto;
}
.treeview .list-group-item {
cursor: pointer;
background-color: #15305F;
}
.box.box-solid {
border-top: 0;
background-color: #15305F;
}
/*element.style {*/
/* min-height: 265px;*/
/* background-color: #15305F;*/
/*}*/
</style>
<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 showList1 = function (id, type, unitId) {
$('#unitId').val(unitId);
if (type == 'p') {//点击工艺段
$('#processSectionId').val(id);
$.post(ext.contextPath + '/equipment/showList4Web.do', {
processSectionId: id,
unitId: unitId
}, function (data) {
$("#rightTools").html(data);
});
} else {//点击其他 如厂
$('#processSectionId').val('');
$.post(ext.contextPath + '/equipment/showList4Web.do', {
unitId: id
}, function (data) {
$("#rightTools").html(data);
});
}
};
var showList2 = function (id, type, unitId) {
$('#unitId').val(unitId);
if (type == 'e') {//点击设备类型
$('#equipmentClassId').val(id);
$.post(ext.contextPath + '/equipment/showList4Web.do', {
equipmentClassId: id,
unitId: unitId
}, function (data) {
$("#rightTools").html(data);
});
} else {//点击其他 如厂
$('#equipmentClassId').val('');
$.post(ext.contextPath + '/equipment/showList4Web.do', {
unitId: id
}, function (data) {
$("#rightTools").html(data);
});
}
};
/**
* 加载工艺段
*/
var proTreeView = function () {
$.post(ext.contextPath + '/equipment/getProcessSection4EquipmentCardTree.do', {
unitId: '${unitId}'
}, function (data) {
var treeData = data.result;
$('#tree').treeview({data: treeData, levels: 3, showTags: true});
$('#tree').on('nodeSelected', function (event, treeList) {
showList1(treeList.id, treeList.type, treeList.unitId);
});
}, 'json');
//$("#rightTools").html("");
};
/**
* 加载设备类型
*/
var equTreeView = function () {
$.post(ext.contextPath + '/equipment/getEquipmentClass4EquipmentCardTree.do', {
// $.post(ext.contextPath + '/equipment/equipmentClass/getTreeJson.do', {
unitId: '${unitId}'
}, function (data) {
var treeData = data.result;
$('#tree').treeview({data: treeData, levels: 3});
$('#tree').on('nodeSelected', function (event, treeList) {
showList2(treeList.id, treeList.type, treeList.unitId);
});
}, 'json');
//$("#rightTools").html("");
};
//点击工艺段(按钮)
function proFun() {
document.getElementById('button1').className = 'btn btn-primary btn-sm';
document.getElementById('button2').className = 'btn btn-default btn-sm';
proTreeView();
// $('#proButton').css('background-color', '#e8f5fe');
// $('#equButton').css('background-color', '#FFFFFF');
}
//点击设备类型(按钮)
function equFun() {
document.getElementById('button1').className = 'btn btn-default btn-sm';
document.getElementById('button2').className = 'btn btn-primary btn-sm';
equTreeView();
// $('#proButton').css('background-color', '#FFFFFF');
// $('#equButton').css('background-color', '#e8f5fe');
}
function framePackup() {
$("#leftToolsLvl2").css("display", "none");
$("#leftTools").animate({width: 'toggle'}, 500);
setTimeout('$("#leftToolsPackup").css("display","block");$("#leftToolsLvl2").css("display","none");', 500);
$('#rightTools').removeClass("col-md-10")
$('#rightTools').addClass("col-md-12")
}
function frameOpen() {
$("#leftTools").animate({width: 'toggle'}, 500);
setTimeout('$("#leftToolsPackup").css("display","none");$("#leftToolsLvl2").css("display","block");', 500);
$('#rightTools').removeClass("col-md-12")
$('#rightTools').addClass("col-md-10")
}
$(function () {
proTreeView();
//默认加载右边 Table
showList1(unitId, 'B', unitId)
});
</script>
</head>
<body style="opacity:0.8;background: transparent;">
<div class="wrapper">
<div class="content-wrapper" style="background-color: #15305F;color: #FFFFFF;">
<input type="hidden" name="unitId" id="unitId" value=""><%--厂id--%>
<input type="hidden" name="processSectionId" id="processSectionId" value=""><%--工艺段id--%>
<input type="hidden" name="equipmentClassId" id="equipmentClassId" value=""><%--设备类型id--%>
<section class="content container-fluid">
<div id="mainAlertdiv"></div>
<div class="row">
<!--隐藏时候的按钮-->
<div id="leftToolsPackup" onclick="frameOpen();"
style="display: none;position: absolute;z-index:9;left:0px;top:100px;width: 20px;height: 25px;border-radius: 4px;box-shadow: 2px 2px 4px 0px #696969, 0px 0px 4px 0px #696969;">
<button type="button" class="btn btn-box-tool"><i class="fa fa-forward"></i></button>
</div>
<!--左边树形框-->
<div class="col-md-3" id="leftTools" style="left:0px;top:0px;border-radius: 12px;">
<div class="box box-solid" id="leftToolsLvl2">
<div class="box-header with-border">
<div class="btn-group" style="width: 100%;color: #FFFFFF;">
<button type="button" id="button1" class="btn btn-primary btn-sm" onclick="proFun();">
工艺区域
</button>
<button type="button" id="button2" class="btn btn-default btn-sm" onclick="equFun();">
设备类型
</button>
<%--<div class="box-tools">
<button type="button" class="btn btn-box-tool" onclick="framePackup();">
<i class="fa fa-backward"></i></button>
</div>--%>
</div>
</div>
<div class="box-body no-padding">
<div id="tree" style="height:700px;"></div>
</div>
</div>
</div>
<!--右边table style="margin-left:-20px;"-->
<div class="col-md-9" id="rightTools" style="left:0px;top:0px;">
</div>
</div>
</section>
<!-- /.content -->
</div>
</div>
</body>
</html>