first commit
This commit is contained in:
@ -0,0 +1,236 @@
|
||||
<%@ 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 bizid=$("#company_id").val();
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid=node[0].id;
|
||||
var pstatus=node[0].pid;
|
||||
|
||||
if(bizid==''){
|
||||
showAlert('d','请选择水厂!','mainAlertdiv');
|
||||
}else if(pstatus=='-1'){
|
||||
showAlert('d','请选择子节点!','mainAlertdiv');
|
||||
}
|
||||
else{
|
||||
$.post(ext.contextPath + '/report/drainageDataomprehensiveTableConfigure/doadd.do', {pid:pid,bizid:bizid} , function(data) {
|
||||
$("#configureBox").html(data);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
var editFun = function() {
|
||||
var bizid=$("#company_id").val();
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/report/drainageDataomprehensiveTableConfigure/doedit.do', {pid:pid,bizid:bizid} , function(data) {
|
||||
$("#configureBox").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 bizid=$("#company_id").val();
|
||||
$.post(ext.contextPath + '/report/drainageDataomprehensiveTableConfigure/getDrainageDataomprehensiveTableConfiguresJson.do',{bizid:bizid}, function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum>0){
|
||||
|
||||
}else{
|
||||
editFun(data.id);
|
||||
}
|
||||
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#configureBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$.post(ext.contextPath + '/user/getUnitForTree.do', { ng: '' }, function (data) {
|
||||
//console.log("data",data);
|
||||
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
|
||||
//当登陆者的pid以下没有子节点时显示单独一个span
|
||||
$("#company_id").val(data[0].id);
|
||||
$("#companyselect").hide();
|
||||
$("#companyName").text("公司:" + data[0].text);
|
||||
|
||||
} else if ((data.length == 1 && data.node != "") || data.length > 1) {
|
||||
//第一次加载时赋值
|
||||
//$("#company_id").val(data[0].id);
|
||||
//$("#cname_input").val(data[0].text);
|
||||
//$table.bootstrapTable('refresh');
|
||||
$('#companytree').treeview({
|
||||
data: data,
|
||||
showBorder: false,
|
||||
levels: 3
|
||||
});
|
||||
|
||||
$('#companytree').on('nodeSelected', function (event, data) {
|
||||
var nodesnum=0;
|
||||
if(data.nodes!=null){
|
||||
nodesnum=data.nodes.length;
|
||||
}else{
|
||||
nodesnum=nodesnum;
|
||||
}
|
||||
|
||||
if(nodesnum>0){
|
||||
|
||||
}else{
|
||||
$("#company_id").val(data.id);
|
||||
$("#cname_input").val(data.text);
|
||||
document.getElementById('ul_tree').style.display = "none";
|
||||
|
||||
initTreeView();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
//待完善
|
||||
};
|
||||
}, 'json');
|
||||
|
||||
//防止点击树收起下拉框
|
||||
$("#ul_tree").on("click", function (e) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
//点击树之外其他区域收起
|
||||
$(document).click(function(){
|
||||
$("#ul_tree").hide();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</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 class="form-group " style="margin-bottom:10px;">
|
||||
<!-- -->
|
||||
<input id="company_id" name="company_id" type="hidden" />
|
||||
<span id="companyName" style="width:220px;border: none;background: transparent;"></span>
|
||||
</div>
|
||||
<ul id="companyselect" style="list-style-type:none;padding-left:0px;width:300px;">
|
||||
<li class="dropdown" style="width:300px;">
|
||||
<!-- Menu toggle button -->
|
||||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" style="width:300px;"
|
||||
onclick="document.getElementById('ul_tree').style.display = 'block';">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">水厂列表:</span>
|
||||
<input class="form-control " id="cname_input" name="cname_input" style="height:31px;width: 220px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||||
readonly />
|
||||
</div><!-- /input-group -->
|
||||
</a>
|
||||
<ul id="ul_tree" class="dropdown-menu" data-stopPropagation="true">
|
||||
<li class="header">
|
||||
<div id="companytree" style="width: 275px;overflow:auto;"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<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-8" id="configureBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user