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

99 lines
3.6 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>
<!-- 引用页头及CSS页-->
<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 + '/work/wordAnalysisReportStructure/doadd.do', {unitId:unitId,pid:pid} , function(data) {
$("#menuBox").html(data);
});
};
var editFun = function(id) {
$.post(ext.contextPath + '/work/wordAnalysisReportStructure/doedit.do', {unitId:unitId,id:id} , function(data) {
$("#menuBox").html(data);
});
};
var initTreeView = function() {
$.post(ext.contextPath + '/work/wordAnalysisReportStructure/getJson.do', {unitId:unitId} , function(data) {
//console.info(data)
$('#tree').treeview({
data: data,
levels:3
});
$('#tree').on('nodeSelected', function(event, data) {
editFun(data.id);
//var node=$('#tree').treeview('getSelected');
});
$("#tree li").each(function(){
var id=$(this).attr("id");
var levelLength=$(this).attr("data-nodeid").split(".").length-1;
if(levelLength==1){
$(this).append("<span class='fa fa-eye pull-right' style='padding-top:2px;' title='查看' onclick='viewrecordFun(\""+id+"\");'></span>");
}
});
},'json');
};
$(function() {
initTreeView();
});
function viewrecordFun(pid){
stopBubbleDefaultEvent();
$.post(ext.contextPath + '/work/wordAnalysisReportStructure/outWordStructureView.do',{pid:pid},function(data) {
$("#wordViewSubDiv").html(data);
openModal('wordViewSubModal');
});
}
// function outWord(){
// $.post(ext.contextPath + '/work/wordAnalysisReportStructure/outWord.do',{unitId:unitId},function(data) {
// });
// }
</script>
</head>
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
<div class="wrapper">
<div class="content-wrapper">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div class="row">
<div class="col-md-12">
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">层级结构</h3>
<!-- <button type="button" class="btn btn-default btn-sm" onclick="outWordView();"><i class="fa fa-file-word-o"></i> 预览</button> -->
<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:700px;overflow:auto;"></div>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
</div>
</div>
</body>
</html>