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

185 lines
7.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;
}
</style>
<title><%= ServerObject.atttable.get("TOPTITLE")%>
</title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var unitId = "";
var showPatrolContents = function (id, type) {
$.post(ext.contextPath + '/timeEfficiency/patrolContents/showPatrolContents.do', {
id: id,
type: type
}, function (data) {
$("#menuBox").html(data);
});
};
var initTreeView = function () {
var type = $('#patrolType').val();
$.post(ext.contextPath + '/timeEfficiency/patrolContents/getMenusJson.do', {
unitId: unitId,
type: type,
search_name_PointAndEq: $('#search_name_PointAndEq').val()
}, function (data) {
// console.info(data)
var treeList = data.treeList;
// console.info(treeList)
$('#tree').treeview({data: treeList});
$('#tree').on('nodeSelected', function (event, treeList) {
showPatrolContents(treeList.id, type);
});
}, 'json');
$("#menuBox").html("");
};
$(function () {
unitId = unitId;
initTreeView();
$.post(ext.contextPath + "/user/processSection/getPatrolType4Select.do", {}, function (data) {
$("#patrolType").empty();
var selelct_1 = $("#patrolType").select2({
data: data,
cache: false,
placeholder: '请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_1.trigger("change");
selelct_1.on("change", function (e) {
initTreeView();
});
}, 'json');
});
function refreshFun() {
var patrolType = $('#patrolType').val();//巡检类型
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 + '/timeEfficiency/patrolContents/refresh.do', {
unitId: unitId,
type: patrolType
}, function (data) {
var datajson = JSON.parse(data);
if (datajson.res > 0) {
showAlert('s', '同步成功', 'mainAlertdiv');
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', '同步失败', 'mainAlertdiv');
$("#table").bootstrapTable('refresh');
}
});
}
});
}
</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 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 form-inline">
<%--<button type="button" class="btn btn-default btn-sm" onclick="refreshFun();"><i
class="fa fa-refresh"></i> 从设备库同步</button>--%>
<div class="input-group input-group-sm" style="width: 140px;">
<input type="text" id="search_name_PointAndEq" name="search_name_PointAndEq"
class="form-control pull-right" placeholder="名称">
<div class="input-group-btn">
<button class="btn btn-default" onclick="initTreeView();"><i
class="fa fa-search"></i></button>
</div>
</div>
<select class="form-control select2 " id="patrolType" name="patrolType"
style="width: 140px;"></select>
</div>
</div>
<div class="box-body no-padding">
<div id="tree" style="height:700px;overflow:auto; "></div>
</div>
</div>
</div>
<div class="col-md-9" id="menuBox">
</div>
</div>
</section>
<!-- /.content -->
</div>
</div>
</body>
</html>