first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/saveBook.do", $(".form").serialize(), function(result) {
if (result.res == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showBookEdit.do?id="+result.id);
});
}else if(result.res == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增指导书" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="作业指导书" disabled />
<input id="doctype" name="doctype" type="hidden" value="C"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="" />
</td>
</tr>
<tr>
<th>启用</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
<option value="1" selected>启用</option>
<option value="0">禁用</option>
</select>
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/updateBook.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
}else if(result == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
if (r) {
$.post(ext.contextPath + "/document/deleteBook.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showBookAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', "删除失败", 'info');
}
});
}
});
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${data.id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑指导书" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${data.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="作业指导书" disabled />
<input id="doctype" name="doctype" type="hidden" value="C"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>启用</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
<option value="1">启用</option>
<option value="0">禁用</option>
</select>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,107 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/document/getDatasForSelect.do?doctype=C',
striped : true,
rownumbers : true,
singleSelect: false,
//ctrlSelect: true,
selectOnCheck: true,
checkOnSelect: true,
idField : 'id',
treeField: 'docname',
pagination : true,
pageSize : 20,
pageList : [20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '180', title : '名称', field : 'docname', sortable : true, align:'left',halign:'center'},
{width : '120', title : '编号', field : 'number', sortable : true, align:'center',halign:'center'},
{width : '100', title : '类型', field : 'doctype', sortable : true, align:'center',halign:'center', formatter : function(value, row, index) {
switch (value) {
case 'A':
return '工作指令';
case 'B':
return '图纸';
case 'C':
return '作业指导书';
}
}},
{width : '320', title : '地址', field : 'path', sortable : true, halign:'center'}
] ],
loadFilter: function (data){
resultData = data;
$.each(data.rows, function(i) {
var parentId = data.rows[i].pid;
if(parentId!='-1'){
data.rows[i]._parentId = parentId;
}else{
data.rows[i]._parentId =undefined;
}
});
return data;
},
toolbar : '#toolbar',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
}
});
});
function selectOK() {
//以json格式返回数据
var jsonstr = "";
var row = $('#grid').treegrid('getSelected');
if (row){
jsonstr = '{"id":"'+row.id
+'","docname":"'+row.docname
+'","number":"'+row.number
+'","path":"'+row.path
+'"}';
}
var dataset = $.parseJSON(jsonstr);
return dataset;
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<form id="searchForm">
<table class="tooltable">
<tr>
<td>名称</td>
<td><input name="search_name" class="easyui-textbox" /></td>
<td>编号</td>
<td><input name="search_code" class="easyui-textbox" /></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${data.id}').loadfile();
});
</script>
</head>
<body>
<div >
<form method="post" class="form">
<input type="hidden" name="id" value="${data.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>${data.docname}</td>
<th>上级</th>
<td>${pname}</td>
</tr>
<tr>
<th>编号</th>
<td>${data.number}</td>
<th>类型</th>
<td>作业指导书</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">${data.path}</td>
</tr>
<tr>
<th>
附件列表
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>状态</th>
<td colspan="3">
${data.st=="1"?"启用":"禁用"}
</td>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" style="width:100%;height:260px;">${data.details}</script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,273 @@
<%@page import="com.sipai.entity.document.Data"%>
<%@ 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("Contingency_Plan", Data.Contingency_Plan); %>
<!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>
<style>
.main-header{display:none;}
.content-header{display:none;}
.main-footer{display:none;}
</style>
<script type="text/javascript">
//新增节点
var addFun = function() {
deleteBoxStyleFun();
var node=$('#tree').treeview('getSelected');
var pid="-1";
console.info(node)
if(node!=null && node.length>0){
pid=node[0].id;
}
$.post(ext.contextPath + '/document/doaddData.do', {pid:pid,doctype:'${Contingency_Plan}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
};
//删除节点
function deleteFun() {
var node = $('#tree').treeview('getSelected');
var data = "";
if(node!=null && node.length>0){
data = node[0].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 + '/document/dodel.do', {id:data}, function(data) {
if(data.res>0){
initFun();
}else{
showAlert('d','删除失败');
}
},'json');
}
});
}else{
showAlert('d','请先选择记录','mainAlertdiv');
}
}
//编辑节点基本信息
var editFun = function() {
var node = $('#tree').treeview('getSelected');
var data = "";
if(node!=null && node.length>0){
data = node[0].id;
$.post(ext.contextPath + '/document/doeditData.do', {id:data,doctype:'${Contingency_Plan}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
}else{
showAlert('d','请先选择编辑的节点','mainAlertdiv');
}
};
//全局搜索资料
var searchFileFun = function() {
$.post(ext.contextPath + '/document/showSearchFile.do', {companyId:companyId,doctype:'${Contingency_Plan}',} , function(data) {
$("#fileList").html(data);
});
};
//编辑文件,点击节点后进入文件上传下载界面
var editFileFun = function(id,text) {
$.post(ext.contextPath + '/document/editDataFile.do', {id:id,text:text,doctype:'${Contingency_Plan}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
};
var addStyleFun = function(){
$('#tree').css("text-align","center");
$('#tree').css("line-height","550px");
$('#tree').css("color","#9FB6CD");
$('#tree').html('请您先新增节点!');
$('#faultBox').css("background-color","#FFFFFF");
$('#faultBox').css("text-align","center");
$('#faultBox').html("暂无资料!");
}
var deleteBoxStyleFun = function(){
$('#faultBox').html("");
$('#faultBox').css("background-color","");
$('#faultBox').css("text-align","");
}
var deleteTreeStyleFun = function(){
$('#tree').html('');
$('#tree').css("text-align","");
$('#tree').css("line-height","");
$('#tree').css("color","");
}
var initFun = function() {
$.post(ext.contextPath + '/document/getDataJson.do',{doctype:'${Contingency_Plan}',docname:$("#search_name").val(),companyId:companyId}, function(data) {
if(data.length == 0){
$('#tree').treeview({data: data});
addStyleFun();
}else{
deleteTreeStyleFun();
deleteBoxStyleFun();
$('#tree').treeview({data: data});
editFileFun(data[0].id,data[0].text);
}
console.info(data.length)
$('#tree').on('nodeSelected', function(event, data) {
editFileFun(data.id,data.text);
});
},'json');
};
var conpanyId = "";
$(function() {
var flag = IsApp();
if (flag==true){
}else{
$(".main-header").show();
$(".content-header").show();
$(".main-footer").show();
}
//简易公司combotree
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
$('#companySelectTree').html(data);
});
//initFun();
//jquery html()方法加载导致box无法执行boxwidget(),手动初始化
$('#searchBox').boxWidget();
$('#switchBtn').bootstrapSwitch({
onText:'是',
offText:'否',
size:"small",
onSwitchChange:function(event, state) {
if(state){
$("#files").show();
searchFileFun();
$("#nodes").hide();
}else{
$("#nodes").show();
$("#files").hide();
}
}
})
$("#file_search").hide();
$("#files").hide();
});
var dosearch = function() {
$("#faultBox").html("");
initFun();
searchFileFun();
};
</script>
</head>
<body onload="initMenu()" 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">
<!-- 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 id="doc4SelectDiv"></div>
<div id="fileInputDiv"></div>
<div id="equ4SelectDiv"></div>
<div class="row form-inline">
<div class="col-md-3" id="companySelectTree"></div>
<div class="col-md-3 pull-right">
<div class="switch" data-on="primary" data-off="info">
<label class="control-label">全局检索</label>
<input id ="switchBtn" type="checkbox" />
</div>
</div>
<!-- <div id="file_search" class="col-md-6 input-group input-group-sm pull-right" style="width:300px;">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();">资料检索<i class="fa fa-search"></i></button>
</div>
</div> -->
</div>
<div class="row" id="nodes">
<div class="col-md-3">
<div >
<security:authorize buttonUrl="document/add.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="addFun();"><i class="fa fa-plus"></i>新增节点</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="deleteFun();"><i class="fa fa-trash-o"></i> 删除节点</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="editFun();"><i class="fa fa-edit"></i> 编辑节点</button>
</security:authorize>
</div>
<div class="input-group input-group-sm" style="padding-top:5px;padding-bottom:3px">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="节点名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();"><i class="fa fa-search"></i></button>
</div>
</div>
<div class="box box-solid">
<!-- <div class="box-header with-border" style="height:100px;">
<h3 class="box-title"></h3>
<div class="box-tools">
</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-9" id="faultBox">
</div>
</div>
<!-- 全局搜索资料显示 -->
<div class="row" id="files">
<div class="col-md-12" id="fileList">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
<!-- bootstrap switch -->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
</html>

View File

@ -0,0 +1,103 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var showDocument4SelectFun = function() {
$.post(ext.contextPath + '/document/showDocumentList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname",doctype:"${param.doctype}",companyId:'${param.companyId}'} , function(data) {
$("#doc4SelectDiv").html(data);
openModal('doc4SelectModal');
});
};
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + '/document/dosave.do', $("#subForm").serialize(), function(result) {
if (result.res == 1) {
initFun();
editFileFun(result.id,result.name);
}else{
showAlert('d','保存失败');
}
},'json');
}
}
$(function() {
$("#st").select2({minimumResultsForSearch: 10});
});
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
docname: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
number: {
validators: {
notEmpty: {
message: '编号不能为空'
}
}
},
}
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">新增节点</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" />
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="fault4SelectDiv"></div>
<input type="hidden" id="doctype" name ="doctype" value="${param.doctype}" >
<input type="hidden" id="bizId" name ="bizId" value="${param.companyId}" >
<div class="form-group">
<label class="col-sm-2 control-label">*名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="docname" name ="docname" placeholder="名称" >
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showDocument4SelectFun();" value="${pname}">
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="number" name ="number" placeholder="编号">
</div>
<label class="col-sm-2 control-label">启用</label>
<div class="col-sm-4">
<select id ="st" name="st" class="form-control select2">
<option value="1" >启用</option>
<option value="0" >禁用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">简要说明</label>
<div class="col-sm-10">
<textarea class="form-control " id="details" name="details" rows="2"></textarea>
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,164 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var showDocument4SelectFun = function() {
$.post(ext.contextPath + '/document/showDocumentList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname",doctype:"${param.doctype}",companyId:'${param.companyId}',rootID:'${param.rootID}'} , function(data) {
$("#doc4SelectDiv").html(data);
openModal('doc4SelectModal');
});
};
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + '/document/doupdate.do', $("#subForm").serialize(), function(result) {
if (result == 1) {
initFun();
}else{
showAlert('d','保存失败');
}
});
}
}
function dodel() {
if('${data.id}'!='${param.rootID}'){
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 + '/document/dodel.do', $("#subForm").serialize(), function(data) {
if(data.res>0){
initFun();
}else{
showAlert('d','删除失败');
}
},'json');
}
});
}else{
showAlert('d','根节点无法删除');
}
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
docname: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
number: {
validators: {
notEmpty: {
message: '编号不能为空'
}
}
},
}
});
</script>
<div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">编辑节点详情</h3>
<div class="box-tools pull-right">
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${data.id}"/>
<input id="bizId" name="bizId" type="hidden" value="${data.bizId}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="fault4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="docname" name ="docname" placeholder="名称" value="${data.docname }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showDocument4SelectFun();" value="${data.pname}">
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="number" name ="number" placeholder="编号" value="${data.number}">
</div>
<label class="col-sm-2 control-label">启用</label>
<div class="col-sm-4">
<select id ="st" name="st" class="form-control select2">
<option value="1" >启用</option>
<option value="0" >禁用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">简要说明</label>
<div class="col-sm-10">
<textarea class="form-control " id="details" name="details" rows="2">${data.details}</textarea>
</div>
</div>
</form>
</div>
</div>
<%-- <div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">${param.text}</h3>
<div class="box-tools pull-right">
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<div >
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<button type="button" class="btn btn-default" onclick="fileinput();"><i class="fa fa-plus"></i>上传文件</button>
<!-- <button type="button" class="btn btn-default" onclick="delDocFun();"><i class="fa fa-trash"></i> 删除</button> -->
</div>
<div class="input-group input-group-sm pull-right" style="width:250px" >
<input type="text" id="search_fileName" name="search_fileName" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearchFile();"><i class="fa fa-search"></i></button>
</div>
</div>
<table id="fileTable"></table>
</div>
</div>
</div> --%>

View File

@ -0,0 +1,346 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
<style type="text/css">
.select2-container .select2-selection--single {
height: 34px;
line-height: 34px;
}
.select2-selection__arrow {
margin-top: 3px;
}
</style>
<!--编辑器-->
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/ckeditor5-build-balloon/ckeditor.js"
charset="utf-8"></script>
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/ckeditor5-build-balloon/translations/zh-cn.js"
charset="utf-8"></script>
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/wangeditor/wangEditor.min.js"></script>
<script type="text/javascript">
var masterId = '${data.id}';
var tbName = 'tb_doc_file'; //数据表
var nameSpace = 'Document';//保存文件夹
//上传文件
var fileinput = function () {
$.post(ext.contextPath + '/document/fileinput4data.do', {
masterId: masterId,
tbName: tbName,
nameSpace: nameSpace,
companyId: '${param.companyId}'
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
// 新增资料
var insertWord = function () {
$.post(ext.contextPath + '/documentData/doaddData.do', {
masterId: masterId,
tbName: tbName,
nameSpace: nameSpace,
companyId: '${param.companyId}'
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
var editEqu = function (id) {
$.post(ext.contextPath + '/document/fileEditEqu.do', {
id: id,
tbName: tbName,
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
//下载文件
var fileDownload = function (id) {
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=" + tbName);
};
var delFileFun = function (id) {
stopBubbleDefaultEvent();
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 + '/documentData/dodeleteFile.do', {id: id, tbName: tbName}, function (data) {
if (data == 1) {
$("#fileTable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
};
var dosearchFile = function () {
$("#fileTable").bootstrapTable("refresh");
};
//浏览
var viewFun = function (id) {
$.post(ext.contextPath + '/documentData/doview.do', {
id: id,
tbName: tbName
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputViewModal');
});
}
//浏览
var documentFun = function (id) {
$.post(ext.contextPath + '/documentData/doeditData.do', {
id: id,
masterId: masterId,
companyId: '${param.companyId}',
nameSpace: nameSpace,
tbName: tbName
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputEditModal');
});
}
//获取路径
var fileView = function (id) {
var tbName = 'tb_doc_file';
$.post(ext.contextPath + '/base/getInputFile4Id.do', {id: id, tbName: tbName}, function (data) {
if (data.length > 0) {
var jsonstr = $.parseJSON(data);
//图片路径转换
var path = jsonstr[0].abspath;
path = path.substring(path.indexOf('webapps') + 7, path.length);
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
;
//判断是否为图片
if (jsonstr[0].type.indexOf('image') != -1) {
showimg(path);
} else {
layer.msg("不是图片格式!");
}
}
});
}
//弹出图片 宽高自适应
function showimg(src) {
if (src == "") {
layer.msg("无图片!");
return;
}
//src = "../" + src;//加入 ../ 防止找不到图片
var img = new Image();
img.onload = function () {//避免图片还未加载完成无法获取到图片的大小。
//避免图片太大,导致弹出展示超出了网页显示访问,所以图片大于浏览器时下窗口可视区域时,进行等比例缩小。
var max_height = $(window).height() - 100;
var max_width = $(window).width();
//rate1rate2rate3 三个比例中取最小的。
var rate1 = max_height / img.height;
var rate2 = max_width / img.width;
var rate3 = 1;
var rate = Math.min(rate1, rate2, rate3);
//等比例缩放
var imgHeight = img.height * rate; //获取图片高度
var imgWidth = img.width * rate; //获取图片宽度
var imgHtml = "<img src='" + src + "' width='" + imgWidth + "px' height='" + imgHeight + "px'/>";
//弹出层
layer.open({
type: 1,
title: false,
closeBtn: 0,
area: ['auto', 'auto'],
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: imgHtml
});
}
img.src = src;
}
$(function () {
$("#search_fileName").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
//回车查询
dosearchFile();
event.stopPropagation();
}
})
$("#st").select2({minimumResultsForSearch: 10}).val("${data.st}").trigger("change");
$("#fileTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/documentData/getList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 15, 20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
masterId: '${nodeIds}',
tbName: tbName,
fileName: $("#search_fileName").val()
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
// field: 'filename', // 返回json数据中的name
//field: 'documentName', // 返回json数据中的name
field: 'wName', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},/* {
field: 'abspath', // 返回json数据中的name
title: '路径', // 表格表头显示文字
align: 'left', // 左右居中
valign: 'middle',// 上下居中
formatter:function(value,row,index){
return '<a onclick="fileDownload(\'' + row.id + '\')">'+value+'</a>'
}
}, */{
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
}, {
field: 'insertTime', // 返回json数据中的name
title: '上传时间', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
formatter: function (value, row, index) {
return value.substring(0, 19);
}
}, {
field: 'fileSum', // 返回json数据中的name
title: '附件数量', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
}, {
field: 'fileSize', // 返回json数据中的name
title: '附件大小', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
formatter: function (value, row, index) {
var size = '0KB'
var re = /([0-9]+\.[0-9]{2})[0-9]*/;
if (value > 1048576) {
var num = value/1024/1024
size = num.toString().replace(re,"$1") + 'MB'
} else if (value > 0) {
var num = value/1024
size = num.toString().replace(re,"$1") + 'KB'
}
return size
}
},
// {
// field: 'equipmentcardnames', // 返回json数据中的name
// title: '关联设备', // 表格表头显示文字
// align: 'center', // 左右居中
// valign: 'middle', // 上下居中
// },
/*{
field: 'st', // 返回json数据中的name
title: '状态', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, */
{
title: "操作",
align: 'center',
valign: 'middle',
width: 200, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" title="浏览" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">浏览</span></button>';
// buts += '<button class="btn btn-default btn-sm" title="图片预览" onclick="fileView(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">图片预览</span></button>';
// buts += '<button class="btn btn-default btn-sm" title="关联设备" onclick="editEqu(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg">关联设备</span></button>';
<%--buts += '<security:authorize buttonUrl="document/fileDownload.do">';--%>
<%--buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.id + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';--%>
<%--buts += '</security:authorize>';--%>
buts += '<security:authorize buttonUrl="document/fileDelete.do">';
buts += '<button class="btn btn-default btn-sm" title="文档编辑" onclick="documentFun(\'' + row.id + '\')"><i class="fa fa fa-file-text-o"></i><span class="hidden-md hidden-lg">编辑</span></button>';
buts += '</security:authorize>';
buts += '<security:authorize buttonUrl="document/fileDelete.do">';
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="delFileFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
buts += '</security:authorize>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
//$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
adjustBootstrapTableView("fileTable");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">${param.text}</h3>
<div class="box-tools pull-right">
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<div>
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<security:authorize buttonUrl="document/fileUpload.do">
<%-- <button type="button" class="btn btn-default" onclick="fileinput();"><i class="fa fa-plus"></i>上传文件--%>
<%-- </button>--%>
<%-- <!-- <button type="button" class="btn btn-default" onclick="delDocFun();"><i class="fa fa-trash"></i> 删除</button> -->--%>
</security:authorize>
<button type="button" class="btn btn-default" onclick="insertWord();"><i class="fa fa-plus"></i>新增资料
</button>
</div>
<div class="input-group input-group-sm pull-right" style="width:250px">
<input type="text" id="search_fileName" name="search_fileName" autocomplete="off" style="height:35px"
class="form-control pull-right" placeholder="资料名称">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearchFile();"><i
class="fa fa-search"></i></button>
</div>
</div>
<table id="fileTable"></table>
</div>
</div>
</div>

View File

@ -0,0 +1,303 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<style type="text/css">
.select2-container .select2-selection--single {
height: 34px;
line-height: 34px;
}
.select2-selection__arrow {
margin-top: 3px;
}
</style>
<script type="text/javascript">
var masterId = '${data.id}';
var tbName = 'tb_doc_file'; //数据表
var nameSpace = 'Document';//保存文件夹
//上传文件
var fileinput = function () {
$.post(ext.contextPath + '/document/fileinput4data.do', {
masterId: masterId,
tbName: tbName,
nameSpace: nameSpace,
companyId: '${param.companyId}'
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
var editEqu = function (id) {
$.post(ext.contextPath + '/document/fileEditEqu.do', {
id: id,
tbName: tbName,
}, function (data) {
$("#fileInputDiv").html(data);
openModal('fileInputModal');
});
};
//下载文件
var fileDownload = function (id) {
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=" + tbName);
};
var delFileFun = function (id) {
stopBubbleDefaultEvent();
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 + '/document/dodeleteFile.do', {id: id, tbName: tbName}, function (data) {
if (data == 1) {
$("#fileTable").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败', 'mainAlertdiv');
}
});
}
});
};
var dosearchFile = function () {
$("#fileTable").bootstrapTable("refresh");
};
//获取路径
var fileView = function (id) {
var tbName = 'tb_doc_file';
$.post(ext.contextPath + '/base/getInputFile4Id.do', {id: id, tbName: tbName}, function (data) {
if (data.length > 0) {
var jsonstr = $.parseJSON(data);
//图片路径转换
var path = jsonstr[0].abspath;
path = path.substring(path.indexOf('webapps') + 7, path.length);
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
;
//判断是否为图片
if (jsonstr[0].type.indexOf('image') != -1) {
showimg(path);
} else {
layer.msg("不是图片格式!");
}
}
});
}
//弹出图片 宽高自适应
function showimg(src) {
if (src == "") {
layer.msg("无图片!");
return;
}
//src = "../" + src;//加入 ../ 防止找不到图片
var img = new Image();
img.onload = function () {//避免图片还未加载完成无法获取到图片的大小。
//避免图片太大,导致弹出展示超出了网页显示访问,所以图片大于浏览器时下窗口可视区域时,进行等比例缩小。
var max_height = $(window).height() - 100;
var max_width = $(window).width();
//rate1rate2rate3 三个比例中取最小的。
var rate1 = max_height / img.height;
var rate2 = max_width / img.width;
var rate3 = 1;
var rate = Math.min(rate1, rate2, rate3);
//等比例缩放
var imgHeight = img.height * rate; //获取图片高度
var imgWidth = img.width * rate; //获取图片宽度
var imgHtml = "<img src='" + src + "' width='" + imgWidth + "px' height='" + imgHeight + "px'/>";
//弹出层
layer.open({
type: 1,
title: false,
closeBtn: 0,
area: ['auto', 'auto'],
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: imgHtml
});
}
img.src = src;
}
$(function () {
$("#search_fileName").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
//回车查询
dosearchFile();
event.stopPropagation();
}
})
$("#st").select2({minimumResultsForSearch: 10}).val("${data.st}").trigger("change");
$("#fileTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/getInputFileList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 15, 20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
masterId: '${nodeIds}',
tbName: tbName,
fileName: $("#search_fileName").val()
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'filename', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},/* {
field: 'abspath', // 返回json数据中的name
title: '路径', // 表格表头显示文字
align: 'left', // 左右居中
valign: 'middle',// 上下居中
formatter:function(value,row,index){
return '<a onclick="fileDownload(\'' + row.id + '\')">'+value+'</a>'
}
}, */{
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'left', // 左右居中
valign: 'middle',// 上下居中
}, {
field: 'equipmentcardnames', // 返回json数据中的name
title: '关联设备', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
},
/*{
field: 'st', // 返回json数据中的name
title: '状态', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, */
{
title: "操作",
align: 'center',
valign: 'middle',
width: 150, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" title="图片预览" onclick="fileView(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">图片预览</span></button>';
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.id + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
//$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
adjustBootstrapTableView("fileTable");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<%-- <div class="box box-primary" >
<div class="box-header with-border">
<h3 class="box-title">详情</h3>
<div class="box-tools pull-right">
<a onclick="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
<a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm">
<input id="id" name="id" type="hidden" value="${data.id}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="fault4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="docname" name ="docname" placeholder="名称" value="${data.docname }">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showDocument4SelectFun();" value="${data.pname}">
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="number" name ="number" placeholder="编号" value="${data.number}">
</div>
<label class="col-sm-2 control-label">启用</label>
<div class="col-sm-4">
<select id ="st" name="st" class="form-control select2">
<option value="1" >启用</option>
<option value="0" >禁用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">简要说明</label>
<div class="col-sm-10">
<textarea class="form-control " id="details" name="details" rows="2">${data.details}</textarea>
</div>
</div>
</form>
</div>
</div> --%>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">${param.text}</h3>
<div class="box-tools pull-right">
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<div>
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
<%--<security:authorize buttonUrl="document/fileUpload.do">
<button type="button" class="btn btn-default" onclick="fileinput();"><i class="fa fa-plus"></i>上传文件
</button>
</security:authorize>--%>
</div>
<div class="input-group input-group-sm pull-right" style="width:250px">
<input type="text" id="search_fileName" name="search_fileName" autocomplete="off" style="height:35px"
class="form-control pull-right" placeholder="资料名称/设备名称/设备编号">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearchFile();"><i
class="fa fa-search"></i></button>
</div>
</div>
<table id="fileTable"></table>
</div>
</div>
</div>

View File

@ -0,0 +1,304 @@
<%@page import="com.sipai.entity.document.Data"%>
<%@ 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("Science_File", Data.Science_File); %>
<!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>
<style>
.main-header {
display: none;
}
.content-header {
display: none;
}
.main-footer {
display: none;
}
</style>
<script type="text/javascript">
//新增节点
var addFun = function () {
deleteBoxStyleFun();
var node = $('#tree').treeview('getSelected');
var pid = "-1";
if (node != null && node.length > 0) {
if (node[0].id != "tree") {
pid = node[0].id;
}
}else{
var id = '${param.id}';
if (id != null && id.length > 0) {
pid = id;
}
}
$.post(ext.contextPath + '/document/doaddData.do', { pid: pid, doctype: '${Science_File}', companyId: companyId }, function (data) {
$("#faultBox").html(data);
});
};
//删除节点
function deleteFun() {
var node = $('#tree').treeview('getSelected');
var data = "";
if (node != null && node.length > 0) {
data = node[0].id;
if(data!='${param.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 + '/document/dodel.do', { id: data }, function (data) {
if (data.res > 0) {
initFun();
} else {
showAlert('d', '删除失败');
}
}, 'json');
}
});
}else{
showAlert('d', '根节点无法删除', 'mainAlertdiv');
}
} else {
showAlert('d', '请先选择记录', 'mainAlertdiv');
}
}
//编辑节点基本信息
var editFun = function () {
var node = $('#tree').treeview('getSelected');
var data = "";
if (node != null && node.length > 0) {
data = node[0].id;
$.post(ext.contextPath + '/document/doeditData.do', { id: data, doctype: '${Science_File}', companyId: companyId,rootID : '${param.id}' }, function (data) {
$("#faultBox").html(data);
});
} else {
showAlert('d', '请先选择编辑的节点', 'mainAlertdiv');
}
};
//全局搜索资料
var searchFileFun = function () {
$.post(ext.contextPath + '/document/showSearchFile.do', { companyId: companyId, doctype: '${Science_File}', }, function (data) {
$("#fileList").html(data);
});
};
//编辑文件,点击节点后进入文件上传下载界面
var editFileFun = function (id, text) {
$.post(ext.contextPath + '/document/editDataFile.do', { id: id, text: text, doctype: '${Science_File}', companyId: companyId }, function (data) {
$("#faultBox").html(data);
});
};
var addStyleFun = function () {
$('#tree').css("text-align", "center");
$('#tree').css("line-height", "550px");
$('#tree').css("color", "#9FB6CD");
$('#tree').html('请您先新增节点!');
$('#faultBox').css("background-color", "#FFFFFF");
$('#faultBox').css("text-align", "center");
$('#faultBox').html("暂无资料!");
}
var deleteBoxStyleFun = function () {
$('#faultBox').html("");
$('#faultBox').css("background-color", "");
$('#faultBox').css("text-align", "");
}
var deleteTreeStyleFun = function () {
$('#tree').html('');
$('#tree').css("text-align", "");
$('#tree').css("line-height", "");
$('#tree').css("color", "");
}
var initFun = function () {
$.post(ext.contextPath + '/document/getDataJson.do', { doctype: '${Science_File}', docname: $("#search_name").val(), companyId: companyId ,id:'${param.id}'}, function (data) {
if (data.length == 0) {
$('#tree').treeview({ data: data });
addStyleFun();
} else {
deleteTreeStyleFun();
deleteBoxStyleFun();
$('#tree').treeview({ data: data });
editFileFun(data[0].id, data[0].text);
}
console.info(data.length)
$('#tree').on('nodeSelected', function (event, data) {
editFileFun(data.id, data.text);
});
}, 'json');
};
var conpanyId = "${param.unitId}";
$(function () {
var flag = IsApp();
if (flag == true) {
} else {
$(".main-header").show();
$(".content-header").show();
$(".main-footer").show();
}
if(unitId==null || unitId==undefined || unitId==''){
unitId = conpanyId;
}
//简易公司combotree
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
$('#companySelectTree').html(data);
});
//initFun();
//jquery html()方法加载导致box无法执行boxwidget(),手动初始化
$('#searchBox').boxWidget();
$('#switchBtn').bootstrapSwitch({
onText: '是',
offText: '否',
size: "small",
onSwitchChange: function (event, state) {
if (state) {
$("#files").show();
searchFileFun();
$("#nodes").hide();
} else {
$("#nodes").show();
$("#files").hide();
}
}
})
$("#file_search").hide();
$("#files").hide();
});
var dosearch = function () {
$("#faultBox").html("");
initFun();
searchFileFun();
};
</script>
</head>
<body onload="initMenu()" 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 id="doc4SelectDiv"></div>
<div id="fileInputDiv"></div>
<div id="equ4SelectDiv"></div>
<div id="equ4SelectDiv2"></div>
<div class="row form-inline">
<div class="col-md-3" id="companySelectTree"></div>
<div class="col-md-3 pull-right">
<div class="switch" data-on="primary" data-off="info" text-align="right" align="right">
<label class="control-label">全局检索</label>
<input id="switchBtn" type="checkbox" />
</div>
</div>
<!-- <div id="file_search" class="col-md-6 input-group input-group-sm pull-right" style="width:300px;">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();">资料检索<i class="fa fa-search"></i></button>
</div>
</div> -->
</div>
<div class="row" id="nodes">
<div class="col-md-2">
<div>
<security:authorize buttonUrl="document/add.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="addFun();"><i
class="fa fa-plus"></i>新增节点</button>
</security:authorize>
<security:authorize buttonUrl="document/delete.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="deleteFun();"><i
class="fa fa-trash-o"></i> 删除节点</button>
</security:authorize>
<security:authorize buttonUrl="document/edit.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="editFun();"><i
class="fa fa-edit"></i> 编辑节点</button>
</security:authorize>
</div>
<div class="input-group input-group-sm" style="padding-top:5px;padding-bottom:3px">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px"
class="form-control pull-right" placeholder="节点名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();"><i
class="fa fa-search"></i></button>
</div>
</div>
<div class="box box-solid">
<!-- <div class="box-header with-border" style="height:100px;">
<h3 class="box-title"></h3>
<div class="box-tools">
</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="faultBox">
</div>
</div>
<!-- 全局搜索资料显示 -->
<div class="row" id="files">
<div class="col-md-12" id="fileList">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
<!-- bootstrap switch -->
<link rel="stylesheet"
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
charset="utf-8"></script>
</html>

View File

@ -0,0 +1,294 @@
<%@page import="com.sipai.entity.document.Data" %>
<%@ 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("Science_File", Data.Science_File); %>
<!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>
<style>
.main-header {
display: none;
}
.content-header {
display: none;
}
.main-footer {
display: none;
}
</style>
<script type="text/javascript">
//新增节点
var addFun = function () {
deleteBoxStyleFun();
var node = $('#tree').treeview('getSelected');
var pid = "-1";
console.info(node)
if (node != null && node.length > 0) {
pid = node[0].id;
}
$.post(ext.contextPath + '/document/doaddData.do', {
pid: pid,
doctype: '${Science_File}',
companyId: companyId
}, function (data) {
$("#faultBox").html(data);
});
};
//删除节点
function deleteFun() {
var node = $('#tree').treeview('getSelected');
var data = "";
if (node != null && node.length > 0) {
data = node[0].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 + '/document/dodel.do', {id: data}, function (data) {
if (data.res > 0) {
initFun();
} else {
showAlert('d', '删除失败');
}
}, 'json');
}
});
} else {
showAlert('d', '请先选择记录', 'mainAlertdiv');
}
}
//编辑节点基本信息
var editFun = function () {
var node = $('#tree').treeview('getSelected');
var data = "";
if (node != null && node.length > 0) {
data = node[0].id;
$.post(ext.contextPath + '/document/doeditData.do', {
id: data,
doctype: '${Science_File}',
companyId: companyId
}, function (data) {
$("#faultBox").html(data);
});
} else {
showAlert('d', '请先选择编辑的节点', 'mainAlertdiv');
}
};
//全局搜索资料
var searchFileFun = function () {
$.post(ext.contextPath + '/document/showSearchFile.do', {companyId: companyId, doctype: '${Science_File}',}, function (data) {
$("#fileList").html(data);
});
};
//编辑文件,点击节点后进入文件上传下载界面
var editFileFun = function (id, text) {
// $.post(ext.contextPath + '/document/editDataFile.do', {
$.post(ext.contextPath + '/document/viewDataFile.do', {
id: id,
text: text,
doctype: '${Science_File}',
companyId: companyId
}, function (data) {
$("#faultBox").html(data);
});
};
var addStyleFun = function () {
$('#tree').css("text-align", "center");
$('#tree').css("line-height", "550px");
$('#tree').css("color", "#9FB6CD");
$('#tree').html('请您先新增节点!');
$('#faultBox').css("background-color", "#FFFFFF");
$('#faultBox').css("text-align", "center");
$('#faultBox').html("暂无资料!");
}
var deleteBoxStyleFun = function () {
$('#faultBox').html("");
$('#faultBox').css("background-color", "");
$('#faultBox').css("text-align", "");
}
var deleteTreeStyleFun = function () {
$('#tree').html('');
$('#tree').css("text-align", "");
$('#tree').css("line-height", "");
$('#tree').css("color", "");
}
var initFun = function () {
$.post(ext.contextPath + '/document/getDataJsonView4YJ.do', {
doctype: '${Science_File}',
docname: $("#search_name").val(),
companyId: companyId
}, function (data) {
if (data.length == 0) {
$('#tree').treeview({data: data});
addStyleFun();
} else {
deleteTreeStyleFun();
deleteBoxStyleFun();
$('#tree').treeview({data: data});
editFileFun(data[0].id, data[0].text);
}
console.info(data.length)
$('#tree').on('nodeSelected', function (event, data) {
editFileFun(data.id, data.text);
});
}, 'json');
};
var conpanyId = "";
$(function () {
var flag = IsApp();
if (flag == true) {
} else {
$(".main-header").show();
$(".content-header").show();
$(".main-footer").show();
}
//简易公司combotree
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
$('#companySelectTree').html(data);
});
//initFun();
//jquery html()方法加载导致box无法执行boxwidget(),手动初始化
$('#searchBox').boxWidget();
$('#switchBtn').bootstrapSwitch({
onText: '是',
offText: '否',
size: "small",
onSwitchChange: function (event, state) {
if (state) {
$("#files").show();
searchFileFun();
$("#nodes").hide();
} else {
$("#nodes").show();
$("#files").hide();
}
}
})
$("#file_search").hide();
$("#files").hide();
});
var dosearch = function () {
$("#faultBox").html("");
initFun();
searchFileFun();
};
</script>
</head>
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
<div class="wrapper">
<div class="content-wrapper">
<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>
</ol>
</section>
<section class="content container-fluid">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div id="doc4SelectDiv"></div>
<div id="fileInputDiv"></div>
<div id="equ4SelectDiv"></div>
<div class="row form-inline">
<div class="col-md-3" id="companySelectTree"></div>
<div class="col-md-3 pull-right">
<div class="switch" data-on="primary" data-off="info" text-align="right" align="right">
<%--<label class="control-label">全局检索</label>
<input id="switchBtn" type="checkbox"/>--%>
</div>
</div>
</div>
<div class="row" id="nodes">
<div class="col-md-3">
<div>
<%--<security:authorize buttonUrl="document/add.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="addFun();"><i
class="fa fa-plus"></i>新增节点
</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="deleteFun();"><i
class="fa fa-trash-o"></i> 删除节点
</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="editFun();"><i
class="fa fa-edit"></i> 编辑节点
</button>
</security:authorize>--%>
</div>
<div class="input-group input-group-sm" style="padding-top:5px;padding-bottom:3px">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px"
class="form-control pull-right" placeholder="节点名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();"><i
class="fa fa-search"></i></button>
</div>
</div>
<div class="box box-solid">
<div class="box-body no-padding">
<div id="tree" style="height:550px;overflow:auto;"></div>
</div>
</div>
</div>
<div class="col-md-9" id="faultBox">
</div>
</div>
<!-- 全局搜索资料显示 -->
<div class="row" id="files">
<div class="col-md-12" id="fileList">
</div>
</div>
</section>
</div>
</div>
</body>
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
charset="utf-8"></script>
</html>

View File

@ -0,0 +1,583 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.showechart {
margin: 1 auto;
width: 100%;
height: 100%;
}
#left {
width: 20%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right {
width: 80%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right_top {
width: 100%;
height: 80%;
float: left;
align: center;
}
#right_under {
width: 100%;
height: 20%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left {
width: 100%;
height: 100%;
float: left;
align: center;
}
#right_top_right {
width: 0%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天窗口*/
#right_top_right_top {
width: 100%;
height: 48%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天和视频的隔离带*/
#right_top_right_center {
width: 100%;
height: 4%;
float: left;
background: #FFFFFF;
align: center;
}
/*视频窗口*/
#right_top_right_under {
width: 100%;
height: 45%;
float: left;
background: #FFFFFF;
align: center;
}
/*操作内容 操作详情 负责人+4个按钮 div */
#right_top_left_top {
width: 100%;
height: 15%;
float: left;
align: center;
}
/*视频的div*/
#right_top_left_under {
width: 100%;
height: 85%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left_top_handle {
width: 70%;
height: 100%;
float: left;
background: #FFFFFF;
position: relative;
align: center;
}
#right_top_left_top_button {
width: 100%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/* #work_table{
width:791px;
height:75px;
border-radius:2px;
border:1px solid rgba(229,229,229,1);
} */
/*
根据不同分辨率显示不同px的文字大小
*/
@media (min-width: 400px) and (min-height: 300px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
}
#videoTitle {
font-size: 12px;
font-weight: bold;
}
}
@media (min-width: 768px) and (min-height: 432px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 992px) and (min-height: 558px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 14px;
margin: 6% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 18px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 1200px) and (min-height: 675px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 20px;
font-weight: bold;
padding: 9px 0px 0px 0px;
}
#videoTitle {
font-size: 16px;
font-weight: bold;
}
}
@media (min-width: 1400px) and (min-height: 875px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 20px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 22px;
font-weight: bold;
padding: 14px 0px 0px 0px;
}
#videoTitle {
font-size: 18px;
font-weight: bold;
}
}
.col-sm-2 {
width: 10%;
}
</style>
<script type="text/javascript">
var filelist = new Array();
var control;
//启动编辑器
var myEditor = null;
const E = window.wangEditor
const editor = new E('#div1')
function saveEditor() {
var editorText = editor.txt.html();
console.log(editorText)
}
//初始化fileinput控件第一次初始化
function initFileInput(ctrlName, uploadUrl) {
control = $('#' + ctrlName);
control.fileinput({
language: 'zh', //设置语言
uploadUrl: uploadUrl, //上传的地址
uploadAsync: true,
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove: false,
showCaption: true,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
maxFileSize: 1048576,
enctype: 'multipart/form-data',
dropZoneEnabled: false ,//是否显示拖拽区域
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) {
//var editorText = editor.txt.html();
//传参
var data = {
"masterId": '${documentId}', //此处自定义传参
"tbName": '${param.tbName}',
"nameSpace": '${param.nameSpace}',
"equipmentIds":$("#equipmentIds").val(),
//"wName":$("#wName").val(),
//"wContent": editorText
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
//actionDelete:'',
actionUpload:''
},
slugCallback: function (data,data2) {
console.log(data2);
return data;
},
});
/* control.on("filebatchselected", function (event, data, previewId, index) {
$(this).fileinput("upload");
}); */
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
var editorText = editor.txt.html();
$("#wContent").val(editorText);
$.post(ext.contextPath + "/documentData/dosave.do", $("#fileInputModalForm").serialize(), function(data) {
if (data.res == 1){
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
}else if(data.res == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
} else {
console.log("请检查文件并重试;")
}
if(!data.response.pdf) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
showAlert('d','上传的文件转换为预览PDF格式失败');
}
});
}
$(function() {
initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
var div3 = document.getElementById('div1');
editor.config.height = div3.clientHeight - 120;
//取消自动 focus
editor.config.focus = false
// 配置全屏功能按钮是否展示
editor.config.showFullScreen = true
// 隐藏菜单栏提示
editor.config.showMenuTooltips = false
// 配置 onchange 回调函数
editor.config.onchange = function (newHtml) {
//console.log('change 之后最新的 html', newHtml)
}
// 配置触发 onchange 的时间频率,默认为 200ms
editor.config.onchangeTimeout = 500 // 修改为 500ms
//图片上传
editor.config.uploadFileName = 'myFile'; //设置文件上传的参数名称
editor.config.uploadImgServer = ext.contextPath + "/command/emergencyConfigure/upload4WangEditor.do";
editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']// 图片格式限制
editor.config.uploadImgMaxSize = 10 * 1024 * 1024 // 图片大小限制10M
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
editor.create();
editor.config.pasteTextHandle = function (content) {
// content 即粘贴过来的内容html 或 纯文本),可进行自定义处理然后返回
if (content == '' && !content) return ''
var str = content
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
str = str.replace(/<\/?[^>]*>/g, '')
str = str.replace(/[ | ]*\n/g, '\n')
str = str.replace(/'&nbsp;'/g, '')
str = str.replace(/''/g, ':')
return str
}
editor.txt.html('${memo}') // 重新设置编辑器内容
editor.config.uploadImgHooks = {
customInsert: function (insertImgFn, result) {
// result 即服务端返回的接口
//console.log('customInsert', result)
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
insertImgFn(result.data[0])
}
}
})
//导入上传文件的数据
function uploadFun(){
console.log($("#filelist").val())
var editorText = editor.txt.html();
if ($("#wName").val() == null || $("#wName").val()=="") {
showAlert('d','文档名称不可为空!','alertFileAddDiv');
/* } else if ($("#wName").val().length > 10){
showAlert('d','文档名称不可超过20个字符','alertFileAddDiv');*/
} else if ($("#filelist").val() == null || $("#filelist").val()==""){
showAlert('d','上传的文件不能为空!','alertFileAddDiv');
/* } else if ($('#equipmentIds').val() == null || $('#equipmentIds').val() == ""){
showAlert('d','请选择设备!','alertFileAddDiv');*/
/* } else if (editorText == "" || editorText == null) {
showAlert('d','请填充资料内容!','alertFileAddDiv');*/
}else {
control.fileinput("upload");
}
}
function isOneDevice() {
$('#isOne').val("是");
}
var showEquipment4SelectsFun = function (formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
unitId: companyId,
equipmentIds: equipmentIds,
}, function (data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
//保存选择设备 datas为id
var doFinishSelectEquipment = function (datas_id, datas_name) {
$('#equipmentIds').val(datas_id);
$('#equipname').val(datas_name);
closeModal("equipment4SelectModal");
}
/* var showEquipment4SelectsFun = function (formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {
companyId: companyId,
equipmentId: equipmentIds,
isone: '1'
}, function (data) {
$("#equ4SelectDiv").html(data);
openModal("emSubModal");
});
};*/
<%--var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {--%>
<%-- var companyId='${param.companyId}';--%>
<%-- var equipmentIds=$('#'+hiddenId).val();;--%>
<%-- $.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {formId:formId,hiddenId:hiddenId,textId:textId,unitId:unitId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {--%>
<%-- $("#equ4SelectDiv").html(data);--%>
<%-- openModal("equipment4SelectModal");--%>
<%-- }); --%>
<%--};--%>
//保存选择设备 datas为id
<%-- var doFinishSelectEquipment = function (datas_id, datas_name) {--%>
<%-- $('#equipmentIds').val(datas_id);--%>
<%-- $('#equipname').val(datas_name);--%>
<%-- closeModal("equipment4SelectModal");--%>
<%-- }--%>
</script>
<div class="modal fade" id="fileInputModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">新增资料</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileAddDiv"></div>
<input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}">
<input type="hidden" class="form-control" id ="id" name ="id" value="${documentId}">
<textarea id ="wContent" name ="wContent" style="display:none;"></textarea>
<div class="form-group">
<label class="col-sm-2 control-label">文档名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="wName" name="wName"
placeholder="文档名称">
</div>
</div>
<div class="form-group" id="equipmentIdsDiv">
<label class="col-sm-2 control-label">关联设备</label>
<div class="col-sm-10">
<input id="equipmentIds" name="equipmentIds" type="hidden" value="" />
<input id="equipcode" name="equipcode" type="hidden" value="" />
<input class="form-control" id="equipname" name ="equipname" autocomplete="off" onclick="showEquipment4SelectsFun('fileInputModalForm','equipmentIds','equipname','equipcode');" placeholder="请点击选择">
</div>
</div>
<div class="form-group" >
<label class="col-sm-2 control-label">上传文件</label>
<div class="col-sm-10">
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
</div>
</div>
<div style="background:#FFFFFF;height:500px;text-align:center;" valign="middle"
align="left">
<div id="titleDiv2">
<font id="content">资料内容</font>
</div>
<%-- 资料内容 --%>
<div class="box-body" align="left">
<div id="div1" style="height:400px;">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,695 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.showechart {
margin: 1 auto;
width: 100%;
height: 100%;
}
#left {
width: 20%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right {
width: 80%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right_top {
width: 100%;
height: 80%;
float: left;
align: center;
}
#right_under {
width: 100%;
height: 20%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left {
width: 100%;
height: 100%;
float: left;
align: center;
}
#right_top_right {
width: 0%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天窗口*/
#right_top_right_top {
width: 100%;
height: 48%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天和视频的隔离带*/
#right_top_right_center {
width: 100%;
height: 4%;
float: left;
background: #FFFFFF;
align: center;
}
/*视频窗口*/
#right_top_right_under {
width: 100%;
height: 45%;
float: left;
background: #FFFFFF;
align: center;
}
/*操作内容 操作详情 负责人+4个按钮 div */
#right_top_left_top {
width: 100%;
height: 15%;
float: left;
align: center;
}
/*视频的div*/
#right_top_left_under {
width: 100%;
height: 85%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left_top_handle {
width: 70%;
height: 100%;
float: left;
background: #FFFFFF;
position: relative;
align: center;
}
#right_top_left_top_button {
width: 100%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/* #work_table{
width:791px;
height:75px;
border-radius:2px;
border:1px solid rgba(229,229,229,1);
} */
/*
根据不同分辨率显示不同px的文字大小
*/
@media (min-width: 400px) and (min-height: 300px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
}
#videoTitle {
font-size: 12px;
font-weight: bold;
}
}
@media (min-width: 768px) and (min-height: 432px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 992px) and (min-height: 558px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 14px;
margin: 6% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 18px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 1200px) and (min-height: 675px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 20px;
font-weight: bold;
padding: 9px 0px 0px 0px;
}
#videoTitle {
font-size: 16px;
font-weight: bold;
}
}
@media (min-width: 1400px) and (min-height: 875px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 20px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 22px;
font-weight: bold;
padding: 14px 0px 0px 0px;
}
#videoTitle {
font-size: 18px;
font-weight: bold;
}
}
.col-sm-2 {
width: 10%;
}
</style>
<!-- 文件上传-->
<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 filelist = new Array();
var control;
//启动编辑器
var myEditor = null;
const E = window.wangEditor
const editor = new E('#div1')
var id = '${document.id}';
//var masterId = '${param.masterId}';
var masterId = '${document.id}';
var tbName = '${param.tbName}'; //数据表
var previews = new Array();
var previewConfigs = new Array();
function showFileInput(ctrlName) {
control = $('#' + ctrlName);
//control.fileinput('destroy');
control.fileinput({
language: 'zh', //设置语言
uploadUrl: ext.contextPath+ "/document/inputFile.do", //上传的地址
uploadAsync: true,
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove: false,
showCaption: true,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
maxFileSize: 1048576,
enctype: 'multipart/form-data',
dropZoneEnabled: false ,//是否显示拖拽区域
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
overwriteInitial: false,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) {
var editorText = editor.txt.html();
//传参
var data = {
"masterId": '${document.id}', //此处自定义传参
"tbName": '${param.tbName}',
"nameSpace": '${param.nameSpace}',
"equipmentIds":$("#equipmentIds").val(),
// "wName":$("#wName").val(),
// "wContent": editorText
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
//actionDelete:'',
actionUpload:''
},
slugCallback: function (data,data2) {
console.log(data2);
return data;
},
initialPreview: previews,
initialPreviewConfig: previewConfigs,
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
deleteExtraData: function () { //传参
var data = {
"tbName": tbName
};
return data;
}
});
control.on('filezoomhide', function (event, params) {
//关闭预览模态框后清空内部,防止音视频继续播放
$(params.modal).find('.kv-zoom-body').empty();
});
$('#kvFileinputModal').on("hidden.bs.modal", function () {
$(this).removeData("bs.modal");
//modal重复打开会导致前面的滚动条失去作用
$('.modal').css("overflow", "auto");
});
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
closeModal('fileInputEditModal');
$("#fileTable").bootstrapTable('refresh');
}
if(!data.response.pdf) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
showAlert('d','上传的文件转换为预览PDF格式失败');
}
});
}
//名称定义不可修改
var getFileList = function () {
$.post(ext.contextPath + '/base/getInputFileListById.do', {
id: id,
masterId: masterId,
tbName: tbName
}, function (data) {
//console.info(data)
if (data.length > 0) {
previews = new Array();
$('#maintenancefile').show();
for (var i = 0; i < data.length; i++) {
var previewConfig = new Object();
var path = data[i].abspath;
path = path.substring(path.indexOf('webapps') + 7, path.length);
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
;
previews.push(path);
previewConfig['width'] = '2500px';
previewConfig['caption'] = data[i].filename;
previewConfig['key'] = data[i].id;
if (data[i].type.split("/")[0] == 'application') {
previewConfig['type'] = 'pdf';
} else {
previewConfig['type'] = data[i].type.split("/")[0];
}
previewConfig['size'] = data[i].size;
previewConfig['filetype'] = data[i].type;
previewConfigs.push(previewConfig);
}
}
showFileInput("filelist");
/*else {
$('#filelist').hide();
}*/
}, 'json');
};
// var closeModal = function () {
// setTimeout(function () {
// $("#subDiv").empty();
// }, 2000);
// };
function saveEditor() {
var editorText = editor.txt.html();
console.log(editorText)
}
$(function() {
if (tbName == null || tbName == '' || tbName == undefined) {
tbName = 'tb_teacher_file';
}
getFileList();
//initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
var div3 = document.getElementById('div1');
editor.config.height = div3.clientHeight - 120;
//取消自动 focus
editor.config.focus = false
// 配置全屏功能按钮是否展示
editor.config.showFullScreen = true
// 隐藏菜单栏提示
editor.config.showMenuTooltips = false
// 配置 onchange 回调函数
editor.config.onchange = function (newHtml) {
//console.log('change 之后最新的 html', newHtml)
}
// 配置触发 onchange 的时间频率,默认为 200ms
editor.config.onchangeTimeout = 500 // 修改为 500ms
//图片上传
editor.config.uploadFileName = 'myFile'; //设置文件上传的参数名称
editor.config.uploadImgServer = ext.contextPath + "/command/emergencyConfigure/upload4WangEditor.do";
editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']// 图片格式限制
editor.config.uploadImgMaxSize = 10 * 1024 * 1024 // 图片大小限制10M
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
editor.create();
editor.config.pasteTextHandle = function (content) {
// content 即粘贴过来的内容html 或 纯文本),可进行自定义处理然后返回
if (content == '' && !content) return ''
var str = content
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
str = str.replace(/<\/?[^>]*>/g, '')
str = str.replace(/[ | ]*\n/g, '\n')
str = str.replace(/'&nbsp;'/g, '')
str = str.replace(/''/g, ':')
return str
}
editor.txt.html('${document.wContent}') // 重新设置编辑器内容
editor.config.uploadImgHooks = {
customInsert: function (insertImgFn, result) {
// result 即服务端返回的接口
//console.log('customInsert', result)
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
insertImgFn(result.data[0])
}
}
})
//导入上传文件的数据
function uploadFun(){
if($("#filelist").val() == null || $("#filelist").val()==""){
showAlert('d','上传的文件不能为空!','alertFileEditDiv');
}else{
control.fileinput("upload");
}
}
function isOneDevice() {
$('#isOne').val("是");
}
/* var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,unitId:unitId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {
$("#equ4SelectDiv2").html(data);
openModal("equipment4SelectModal");
});
};*/
function doedit() {
console.log($("#filelist").val() == null || $("#filelist").val()=="");
var editorText = editor.txt.html();
if ($("#wName").val() == null || $("#wName").val()=="") {
showAlert('d','文档名称不可为空!','alertFileEditDiv');
/* } else if ($("#wName").val().length > 10){
showAlert('d','文档名称不可超过20个字符','alertFileEditDiv');*/
} else if ($("#filelist").val() == null || $("#filelist").val()==""){
if($(".file-preview-thumbnails").html() == null || $(".file-preview-thumbnails").html().length==0 || $.trim($(".file-preview-thumbnails").html())==''){
showAlert('d','上传的文件不能为空!','alertFileEditDiv');
} else {
$.post(ext.contextPath + "/documentData/doupdate.do", $("#fileInputModalForm").serialize(), function (data) {
if (data.res == 1){
$("#fileTable").bootstrapTable('refresh');
control.fileinput("upload");
closeModal('fileInputEditModal')
} else {
showAlert('d','修改异常!请检查数据或联系管理员!','alertFileEditDiv');
}
},'json');
}
/* } else if ($('#equipmentIds').val() == null || $('#equipmentIds').val() == ""){
showAlert('d','请选择设备!','alertFileEditDiv');*/
/* } else if (editorText == "" || editorText == null) {
showAlert('d','请填充资料内容!','alertFileEditDiv');*/
} else {
var editorText = editor.txt.html();
$("#wContent").val(editorText);
$.post(ext.contextPath + "/documentData/doupdate.do", $("#fileInputModalForm").serialize(), function (data) {
if (data.res == 1){
$("#fileTable").bootstrapTable('refresh');
control.fileinput("upload");
closeModal('fileInputEditModal')
} else {
showAlert('d','修改异常!请检查数据或联系管理员!','alertFileEditDiv');
}
},'json');
}
}
var doupdate = function() {
var id=$('#id').val();
var equipmentIds=$('#equipmentIds').val();
$.post(ext.contextPath + '/document/fileupdate4equ.do', {equipmentIds:equipmentIds,id:id} , function(data) {
closeModal('fileInputEditModal')
$("#fileTable").bootstrapTable('refresh');
});
}
var showEquipment4SelectsFun = function (formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {
unitId: companyId,
equipmentIds: equipmentIds,
}, function (data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
//保存选择设备 datas为id
var doFinishSelectEquipment = function (datas_id, datas_name) {
$('#equipmentIds').val(datas_id);
$('#equipname').val(datas_name);
closeModal("equipment4SelectModal");
}
/*var showEquipment4SelectsFun = function (formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {
companyId: companyId,
equipmentId: equipmentIds,
isone: '1'
}, function (data) {
$("#equ4SelectDiv").html(data);
openModal("emSubModal");
});
};*/
<%--var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {--%>
<%-- var companyId='${param.companyId}';--%>
<%-- var equipmentIds=$('#'+hiddenId).val();;--%>
<%-- $.post(ext.contextPath + '/equipment/selectEquipmentCard4Choice.do', {formId:formId,hiddenId:hiddenId,textId:textId,unitId:unitId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {--%>
<%-- $("#equ4SelectDiv2").html(data);--%>
<%-- openModal("equipment4SelectModal");--%>
<%-- });--%>
<%--};--%>
//保存选择设备 datas为id
// var doFinishSelectEquipment = function (datas_id, datas_name) {
// $('#equipmentIds').val(datas_id);
// $('#equipname').val(datas_name);
// console.log(111111)
// closeModal("equipment4SelectModal");
// }
</script>
<div class="modal fade" id="fileInputEditModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">修改</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileEditDiv"></div>
<input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${document.masterId}">
<input type="hidden" class="form-control" id ="id" name ="id" value="${document.id}">
<textarea id ="wContent" name ="wContent" style="display:none;">${document.wContent}</textarea>
<div class="form-group">
<label class="col-sm-2 control-label">*资料名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="wName" name="wName"
value="${document.wName}"
placeholder="资料名称">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">关联设备</label>
<div class="col-sm-10">
<input id="equipmentIds" name="equipmentIds" type="hidden" value="${CommonFile.equipmentcardids}" />
<input id="equipcode" name="equipcode" type="hidden" value="" />
<input class="form-control" id="equipname" name ="equipname" value="${CommonFile.equipmentcardnames}"
onclick="showEquipment4SelectsFun('fileInputModalForm','equipmentIds','equipname','equipcode');" placeholder="请点击选择">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*文件</label>
<div class="col-sm-10" style="margin:8px;">
<input type="file" name="filelist" id="filelist" multiple class="file-loading"/>
</div>
</div>
<div style="background:#FFFFFF;text-align:center;min-height: 300px;" valign="middle"
align="left">
<div id="titleDiv2">
<font id="content">资料内容</font>
</div>
<%-- 资料内容 --%>
<div class="box-body" align="left">
<div id="div1" style="min-height: 250px;">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doedit()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>修改文档</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,37 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
$.post(ext.contextPath + '/document/getDataJson.do', {doctype:"${param.doctype}",companyId:'${param.companyId}',id:'${param.rootID}'} , function(data) {
if(data.length>0){
$('#document_select_tree').treeview({
data: data,
});
$('#document_select_tree').on('nodeSelected', function(event, data) {
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
$('#${param.formId} #${param.textId}').val(data.text);
closeModal("doc4SelectModal")
});
}
},'json');
});
</script>
<div class="modal fade" id="doc4SelectModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择上级菜单</h4>
</div>
<div class="modal-body">
<div id="document_select_tree" style="height:430px;overflow:auto;width:100%"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,621 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.showechart {
margin: 1 auto;
width: 100%;
height: 100%;
}
#left {
width: 20%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right {
width: 80%;
height: 100%;
background: #FFFFFF;
float: left;
align: center;
}
#right_top {
width: 100%;
height: 80%;
float: left;
align: center;
}
#right_under {
width: 100%;
height: 20%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left {
width: 100%;
height: 100%;
float: left;
align: center;
}
#right_top_right {
width: 0%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天窗口*/
#right_top_right_top {
width: 100%;
height: 48%;
float: left;
background: #FFFFFF;
align: center;
}
/*聊天和视频的隔离带*/
#right_top_right_center {
width: 100%;
height: 4%;
float: left;
background: #FFFFFF;
align: center;
}
/*视频窗口*/
#right_top_right_under {
width: 100%;
height: 45%;
float: left;
background: #FFFFFF;
align: center;
}
/*操作内容 操作详情 负责人+4个按钮 div */
#right_top_left_top {
width: 100%;
height: 15%;
float: left;
align: center;
}
/*视频的div*/
#right_top_left_under {
width: 100%;
height: 85%;
float: left;
background: #FFFFFF;
align: center;
}
#right_top_left_top_handle {
width: 70%;
height: 100%;
float: left;
background: #FFFFFF;
position: relative;
align: center;
}
#right_top_left_top_button {
width: 100%;
height: 100%;
float: left;
background: #FFFFFF;
align: center;
}
/* #work_table{
width:791px;
height:75px;
border-radius:2px;
border:1px solid rgba(229,229,229,1);
} */
/*
根据不同分辨率显示不同px的文字大小
*/
@media (min-width: 400px) and (min-height: 300px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
}
#videoTitle {
font-size: 12px;
font-weight: bold;
}
}
@media (min-width: 768px) and (min-height: 432px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 16%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 5% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 992px) and (min-height: 558px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 14px;
margin: 6% 0px 0px 0px;
}
/*文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 18px;
font-weight: bold;
padding: 6px 0px 0px 0px;
}
#videoTitle {
font-size: 14px;
font-weight: bold;
}
}
@media (min-width: 1200px) and (min-height: 675px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 16px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 20px;
font-weight: bold;
padding: 9px 0px 0px 0px;
}
#videoTitle {
font-size: 16px;
font-weight: bold;
}
}
@media (min-width: 1400px) and (min-height: 875px) {
/*上面一排按钮div的样式*/
.buttonDiv {
width: 17%;
height: 100%;
float: left;
border: 2px solid #0EA5FF;
line-height: 16px;
cursor: pointer;
}
/*上面一排按钮里面文字的样式*/
.buttonFont {
display: inline-block;
font-size: 20px;
margin: 7% 0px 0px 0px;
}
/*事项名称文字样式---颜色框*/
#titleDiv2 {
width: 100%;
height: 10%;
border-bottom: 1px solid #E5E5E5;
font-size: 22px;
font-weight: bold;
padding: 14px 0px 0px 0px;
}
#videoTitle {
font-size: 18px;
font-weight: bold;
}
}
.col-sm-2 {
width: 10%;
}
</style>
<!-- 文件上传-->
<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 filelistView = new Array();
var control;
//启动编辑器
var myEditor = null;
const E = window.wangEditor
const editor = new E('#div1')
var id = '${document.id}';
//var masterId = '${param.masterId}';
var masterId = '${document.id}';
var tbName = '${param.tbName}'; //数据表
var previews = new Array();
var previewConfigs = new Array();
function showFileInputView(ctrlName) {
control = $('#' + ctrlName);
control.fileinput('destroy');
control.fileinput({
language: 'zh', //设置语言
showUpload: false, //是否显示上传按钮
allowedFileExtensions: ['jpg', 'png', 'gif', 'pdf', 'doc', 'xls', 'docx', 'ppt', 'pptx', 'xlsx', 'wmv', 'mp4'],
showRemove: false,
showCaption: false,//是否显示标题
showBrowse: false,//选择按钮
showClose: false,//右上角关闭按钮
dropZoneEnabled: false,//是否显示拖拽区域
fileActionSettings: {
showDrag: false,
showDownload: true, // 显示下载按钮 (这个也很重要)
},
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount: true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
initialPreview: previews,
initialPreviewConfig: previewConfigs,
layoutTemplates: {
actionDelete: '', //这行可以隐藏删除按钮
actionUpload: '' //这行可以隐藏上传按钮
}
});
control.on('filezoomhide', function (event, params) {
//关闭预览模态框后清空内部,防止音视频继续播放
$(params.modal).find('.kv-zoom-body').empty();
});
$('#kvFileinputModal').on("hidden.bs.modal", function () {
$(this).removeData("bs.modal");
//modal重复打开会导致前面的滚动条失去作用
$('.modal').css("overflow", "auto");
});
}
//名称定义不可修改
var getFileListView = function () {
$.post(ext.contextPath + '/base/getInputFileListById.do', {
id: id,
masterId: masterId,
tbName: tbName
}, function (data) {
//console.info(data)
if (data.length > 0) {
previews = new Array();
$('#maintenancefile').show();
for (var i = 0; i < data.length; i++) {
var previewConfig = new Object();
var path = data[i].abspath;
path = path.substring(path.indexOf('webapps') + 7, path.length);
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
;
previews.push(path);
previewConfig['width'] = '2500px';
previewConfig['caption'] = data[i].filename;
previewConfig['key'] = data[i].id;
if (data[i].type.split("/")[0] == 'application') {
previewConfig['type'] = 'pdf';
} else {
previewConfig['type'] = data[i].type.split("/")[0];
}
previewConfig['downloadUrl'] = ext.contextPath + "/base/downloadFile.do?key=" + data[i].id + "&tbName=" + tbName;//这个是显示下载按钮的关键,如果没有此属性,下载按钮是不会显示的。
previewConfig['size'] = data[i].size;
previewConfig['filetype'] = data[i].type;
previewConfigs.push(previewConfig);
}
}
showFileInputView("filelistView");
/*else {
$('#filelistView').hide();
}*/
}, 'json');
};
// var closeModal = function () {
// setTimeout(function () {
// $("#subDiv").empty();
// }, 2000);
// };
function saveEditor() {
var editorText = editor.txt.html();
console.log(editorText)
}
//初始化fileinput控件第一次初始化
function initFileInput(ctrlName, uploadUrl) {
control = $('#' + ctrlName);
control.fileinput({
language: 'zh', //设置语言
uploadUrl: uploadUrl, //上传的地址
uploadAsync: true,
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove: false,
showCaption: true,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
dropZoneEnabled: false ,//是否显示拖拽区域
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) {
var editorText = editor.txt.html();
//传参
var data = {
"masterId": '${document.id}', //此处自定义传参
"tbName": '${param.tbName}',
"nameSpace": '${param.nameSpace}',
"equipmentIds":$("#equipmentIds").val(),
// "wName":$("#wName").val(),
// "wContent": editorText
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
//actionDelete:'',
actionUpload:''
},
slugCallback: function (data,data2) {
console.log(data2);
return data;
},
});
/* control.on("filebatchselected", function (event, data, previewId, index) {
$(this).fileinput("upload");
}); */
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
var editorText = editor.txt.html();
$("#wContent").val(editorText);
$.post(ext.contextPath + "/documentData/doupdate.do", $("#fileInputModalForm").serialize(), function(data) {
if (data.res == 1){
closeModal('fileInputViewModal');
$("#fileTable").bootstrapTable('refresh');
}else if(data.res == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
if(!data.response.pdf) {
closeModal('fileInputViewModal');
$("#fileTable").bootstrapTable('refresh');
showAlert('d','上传的文件转换为预览PDF格式失败');
}
});
}
$(function() {
if (tbName == null || tbName == '' || tbName == undefined) {
tbName = 'tb_teacher_file';
}
getFileListView();
//initFileInput("filelistView",ext.contextPath+ "/document/inputFile.do");
var div3 = document.getElementById('div1');
editor.config.height = div3.clientHeight - 120;
//取消自动 focus
editor.config.focus = false
// 配置全屏功能按钮是否展示
editor.config.showFullScreen = false
// 隐藏菜单栏提示
editor.config.showMenuTooltips = true
// 配置 onchange 回调函数
editor.config.onchange = function (newHtml) {
//console.log('change 之后最新的 html', newHtml)
}
// 配置触发 onchange 的时间频率,默认为 200ms
editor.config.onchangeTimeout = 500 // 修改为 500ms
//图片上传
editor.config.uploadFileName = 'myFile'; //设置文件上传的参数名称
editor.config.uploadImgServer = ext.contextPath + "/command/emergencyConfigure/upload4WangEditor.do";
editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']// 图片格式限制
editor.config.uploadImgMaxSize = 10 * 1024 * 1024 // 图片大小限制10M
editor.config.uploadImgMaxLength = 1; // 一次最多上传 1 个图片
editor.create();
editor.config.pasteTextHandle = function (content) {
// content 即粘贴过来的内容html 或 纯文本),可进行自定义处理然后返回
if (content == '' && !content) return ''
var str = content
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
str = str.replace(/<\/?[^>]*>/g, '')
str = str.replace(/[ | ]*\n/g, '\n')
str = str.replace(/'&nbsp;'/g, '')
str = str.replace(/''/g, ':')
return str
}
editor.txt.html('${document.wContent}') // 重新设置编辑器内容
editor.config.uploadImgHooks = {
customInsert: function (insertImgFn, result) {
// result 即服务端返回的接口
//console.log('customInsert', result)
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
insertImgFn(result.data[0])
}
}
})
</script>
<div class="modal fade" id="fileInputViewModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">浏览</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileDiv"></div>
<input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${document.masterId}">
<input type="hidden" class="form-control" id ="id" name ="id" value="${document.id}">
<textarea id ="wContent" name ="wContent" style="display:none;">${document.wContent}</textarea>
<div class="form-group">
<label class="col-md-2 col-xs-3 control-label">资料名称</label>
<div class="col-md-10 col-xs-9">
<p class="form-control-static">${document.wName}</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-xs-3 control-label">关联设备</label>
<div class="col-md-10 col-xs-9">
<p class="form-control-static">${CommonFile.equipmentcardnames}</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-xs-12 control-label">文件</label>
<div class="col-md-10 col-xs-12">
<input type="file" name="filelistView" id="filelistView" multiple class="file-loading"/>
</div>
</div>
<div style="background:#FFFFFF;text-align:center;min-height: 300px;" valign="middle"
align="left">
<div id="titleDiv2">
<font id="content">资料内容</font>
</div>
<%-- 资料内容 --%>
<div class="box-body" align="left">
<div id="div1" style="min-height: 250px;">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/saveDrawing.do", $(".form").serialize(), function(result) {
if (result.res == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingEdit.do?id="+result.id);
});
}else if(result.res == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增图纸" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="图纸" disabled />
<input id="doctype" name="doctype" type="hidden" value="B"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="" />
</td>
</tr>
<tr>
<th>启用</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
<option value="1" selected>启用</option>
<option value="0">禁用</option>
</select>
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/updateDrawing.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
}else if(result == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
if (r) {
$.post(ext.contextPath + "/document/deleteDrawing.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', "删除失败", 'info');
}
});
}
});
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${data.id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑图纸" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${data.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="图纸" disabled />
<input id="doctype" name="doctype" type="hidden" value="B"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>启用</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
<option value="1">启用</option>
<option value="0">禁用</option>
</select>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,107 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/document/getDatasForSelect.do?doctype=B',
striped : true,
rownumbers : true,
singleSelect: false,
//ctrlSelect: true,
selectOnCheck: true,
checkOnSelect: true,
idField : 'id',
treeField: 'docname',
pagination : true,
pageSize : 20,
pageList : [20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '180', title : '名称', field : 'docname', sortable : true, align:'left',halign:'center'},
{width : '120', title : '编号', field : 'number', sortable : true, align:'center',halign:'center'},
{width : '100', title : '类型', field : 'doctype', sortable : true, align:'center',halign:'center', formatter : function(value, row, index) {
switch (value) {
case 'A':
return '工作指令';
case 'B':
return '图纸';
case 'C':
return '作业指导书';
}
}},
{width : '320', title : '地址', field : 'path', sortable : true, halign:'center'}
] ],
loadFilter: function (data){
resultData = data;
$.each(data.rows, function(i) {
var parentId = data.rows[i].pid;
if(parentId!='-1'){
data.rows[i]._parentId = parentId;
}else{
data.rows[i]._parentId =undefined;
}
});
return data;
},
toolbar : '#toolbar',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
}
});
});
function selectOK() {
//以json格式返回数据
var jsonstr = "";
var row = $('#grid').treegrid('getSelected');
if (row){
jsonstr = '{"id":"'+row.id
+'","docname":"'+row.docname
+'","number":"'+row.number
+'","path":"'+row.path
+'"}';
}
var dataset = $.parseJSON(jsonstr);
return dataset;
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<form id="searchForm">
<table class="tooltable">
<tr>
<td>名称</td>
<td><input name="search_name" class="easyui-textbox" /></td>
<td>编号</td>
<td><input name="search_code" class="easyui-textbox" /></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,123 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
var filelist = new Array();
var control;
//初始化fileinput控件第一次初始化
function initFileInput(ctrlName, uploadUrl) {
control = $('#' + ctrlName);
control.fileinput({
language: 'zh', //设置语言
uploadUrl: uploadUrl, //上传的地址
uploadAsync:true,
allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove:false,
showCaption: false,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) { //传参
var data = {
"tbName": '${tbName}',//此处自定义传参
"nameSpace": '${nameSpace}',
"equipmentIds":'${equipmentId}',
"masterId": '${masterId}'
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
actionDelete:'',
actionUpload:''
},
});
/* control.on("filebatchselected", function (event, data, previewId, index) {
$(this).fileinput("upload");
}); */
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
}
});
}
$(function() {
initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
//提示
$("#uploadAlert").popover({
trigger:'manual',
placement : 'bottom', //placement of the popover. also can use top, bottom, left or right
title : '<div style="text-align:center; color:red; font-size:14px;">温馨提示</div>', //this is the top title bar of the popover. add some basic css
html: 'true', //needed to show html of course
content : '<div id="popOverBox">设备中上传的资料,只能在技术档案菜单的全局搜索中查看,请您知悉!</div>', //this is the content of the html box. add the image here or anything you want really.
animation: false
}).on("mouseenter", function () {
var _this = this;
$(this).popover("show");
$(this).siblings(".popover").on("mouseleave", function () {
$(_this).popover('hide');
});
}).on("mouseleave", function () {
var _this = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(_this).popover("hide")
}
}, 100);
});
})
//导入上传文件的数据
function uploadFun(){
if($("#filelist").val() == null || $("#filelist").val()==""){
showAlert('d','上传的文件不能为空!','alertFileDiv');
}else{
control.fileinput("upload");
}
}
</script>
<div class="modal fade" id="fileInputModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">上传 &nbsp;&nbsp;<i id="uploadAlert" class="icon fa fa-warning"></i></h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileDiv"></div>
<div class="form-group" >
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,108 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
var filelist = new Array();
var control;
//初始化fileinput控件第一次初始化
function initFileInput(ctrlName, uploadUrl) {
control = $('#' + ctrlName);
control.fileinput({
language: 'zh', //设置语言
uploadUrl: uploadUrl, //上传的地址
uploadAsync:true,
allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove:false,
showCaption: false,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;margin-left:-100px"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;margin-left:-100px"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12;margin-left:-100px "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;margin-left:-100px"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) { //传参
var data = {
"masterId": '${masterId}', //此处自定义传参
"tbName": '${tbName}',
"nameSpace": '${nameSpace}',
"equipmentIds":$("#equipmentIds").val()
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
actionDelete:'',
actionUpload:''
},
});
/* control.on("filebatchselected", function (event, data, previewId, index) {
$(this).fileinput("upload");
}); */
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
}
});
}
$(function() {
initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
})
//导入上传文件的数据
function uploadFun(){
if($("#filelist").val() == null || $("#filelist").val()==""){
showAlert('d','上传的文件不能为空!','alertFileDiv');
}else{
control.fileinput("upload");
}
}
var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
</script>
<div class="modal fade" id="fileInputModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">上传</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileDiv"></div>
<div class="form-group" >
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,134 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
var filelist = new Array();
var control;
//初始化fileinput控件第一次初始化
function initFileInput(ctrlName, uploadUrl) {
control = $('#' + ctrlName);
control.fileinput({
language: 'zh', //设置语言
uploadUrl: uploadUrl, //上传的地址
uploadAsync: true,
//allowedFileExtensions : ['jpg', 'png','gif','pdf','doc','xls','docx','ppt','pptx','xlsx'],//接收的文件后缀
showUpload: false, //是否显示上传按钮
showRemove: false,
showCaption: true,//是否显示标题
showClose:false,//右上角关闭按钮
browseClass: "btn btn-primary", //按钮样式
maxFileCount: 10, //表示允许同时上传的最大文件个数
enctype: 'multipart/form-data',
dropZoneEnabled: false ,//是否显示拖拽区域
validateInitialCount:true,
previewFileIcon: "<i class='fa fa-file'></i>",
preferIconicPreview: true,//是否强制相关文件展示icon
initialPreviewAsData: true,
previewFileIconSettings: {
'doc': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'docx': '<i class="fa fa-file-word-o" style="color:#3c8dbc;"></i>',
'xls': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'xlsx': '<i class="fa fa-file-excel-o" style="color:#00a65a ;"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
'ppt': '<i class="fa fa-file-powerpoint-o" style="color:#f39c12; "></i>',
//'jpg': '<i class="fa fa-file-image-o" style="color:#00a65a "></i>',
'pdf': '<i class="fa fa-file-pdf-o" style="color:#dd4b39 ;"></i>',
'zip': '<i class="fa fa-file-zip-o" ></i>',
},
uploadExtraData:function (previewId, index) { //传参
var data = {
"masterId": '${masterId}', //此处自定义传参
"tbName": '${tbName}',
"nameSpace": '${nameSpace}',
"equipmentIds":$("#equipmentIds").val()
};
return data;
},
//设置缩略图上的按钮,为空不显示,默认显示
layoutTemplates:{
//actionDelete:'',
actionUpload:''
},
slugCallback: function (data,data2) {
console.log(data2);
return data;
},
});
/* control.on("filebatchselected", function (event, data, previewId, index) {
$(this).fileinput("upload");
}); */
//导入文件上传完成之后的事件
control.on("fileuploaded", function (event, data, previewId, index) {
if(data.response.suc) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
}
if(!data.response.pdf) {
closeModal('fileInputModal');
$("#fileTable").bootstrapTable('refresh');
showAlert('d','上传的文件转换为预览PDF格式失败');
}
});
}
$(function() {
initFileInput("filelist",ext.contextPath+ "/document/inputFile.do");
})
//导入上传文件的数据
function uploadFun(){
if($("#filelist").val() == null || $("#filelist").val()==""){
showAlert('d','上传的文件不能为空!','alertFileDiv');
}else{
control.fileinput("upload");
}
}
var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
</script>
<div class="modal fade" id="fileInputModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">上传</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<div id="alertFileDiv"></div>
<%-- <input type="hidden" class="form-control" id ="masterId" name ="masterId" value="${masterId}"> --%>
<div class="form-group" >
<input type="file" name="filelist" id="filelist" multiple class="file-loading" />
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">关联设备</span>
<input id="equipmentIds" name="equipmentIds" type="hidden" value="" />
<input id="equipcode" name="equipcode" type="hidden" value="" />
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('fileInputModalForm','equipmentIds','equipname','equipcode');" placeholder="请点击选择">
</div>
<!-- <label class="col-sm-2 control-label">关联设备</label>
<div class="col-sm-10">
<input id="equipmentIds" name="equipmentIds" type="hidden" value="" />
<input id="equipcode" name="equipcode" type="hidden" value="" />
<input class="form-control" id="equipname" name ="equipname" onclick="showEquipment4SelectsFun('fileInputModalForm','equipmentIds','equipname','equipcode');" placeholder="请点击选择">
</div> -->
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="uploadFun()" id="btn_upload"><i class="glyphicon glyphicon-upload"></i>上传</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,239 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchFile = function() {
$("#selectFileTable").bootstrapTable('refresh');
};
function doSelectFile() {
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
var datas="";
datas_name="";
$.each(selectionIds, function(index, item){
if(datas!=""){
datas+=",";
}
datas+=item;
});
if(datas!=""){
$.post(ext.contextPath + '/equipment/saveEquipmentFile.do', {equipmentId:'${param.equipmentId}',fileIds : datas}, function(resp) {
if(resp.res>0){
closeModal('subFileModal');
$("#fileTable").bootstrapTable('refresh');
}else if(resp.res == 0){
showAlert('d','保存失败','fileAlertDiv');
}else{
showAlert('d',resp.res,'fileAlertDiv');
}
},'json');
}else{
showAlert('d','请选择文件!','fileAlertDiv');
}
};
function stateFormatter(value, row, index) {
var flag=false;
$.each(eval('${fileIds}'), function(index, item){
if(row.id==item.id){
flag=true;
}
});
if (flag)
return {
checked : true//设置选中
};
return value;
}
var $table;
var switchStatus=false;
var selectionIds = []; //保存选中ids
function initialSelectionIds(){
console.info('${fileIds}')
var check_array =eval('${fileIds}');
if(check_array!=null&& check_array.length>0){
selectionIds =new Array(check_array.length);
for(var i=0;i<check_array.length;i++){
selectionIds[i]=check_array[i].id;
}
}
}
function getCheckedIds(){
var ids="";
var check_array =eval('${fileIds}');
$.each(check_array, function(index, item){
if(ids!=""){
ids+=",";
}
ids+=item.id;
});
return ids;
}
function queryParams(params) {
var temp={
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
tbName : tbName,
masterId : '${dataIds}',
fileName : $('#search_fileName').val(),
};
var status =$('#switchBtn').bootstrapSwitch('state')
if(status){
temp.checkedIds=getCheckedIds();
}
return temp;
}
$(function() {
//jquery html()方法加载导致box无法执行boxwidget(),手动初始化
$('#searchBox').boxWidget();
$('#switchBtn').bootstrapSwitch({
onText:'是',
offText:'否',
size:"small",
})
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
initialSelectionIds();
$table = $("#selectFileTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/getInputFileList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: queryParams,
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
checkbox: true, // 显示一个勾选框
//formatter: stateFormatter
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
return {
checked : true // 存在则选中
}
}
}
},{
field: 'filename', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("selectFileTable");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
//绑定选中事件、取消事件、全部选中、全部取消
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
return row.id;
});
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
selectionIds = _[func](selectionIds, ids);
});
});
//选中事件操作数组
var union = function(array,ids){
$.each(ids, function (i, id) {
if($.inArray(id,array)==-1){
array[array.length] = id;
}
});
return array;
};
//取消选中事件操作数组
var difference = function(array,ids){
$.each(ids, function (i, id) {
var index = $.inArray(id,array);
if(index!=-1){
array.splice(index, 1);
}
});
return array;
};
var _ = {"union":union,"difference":difference};
//表格分页之前处理多选框数据
function responseHandler(res) {
$.each(res.rows, function (i, row) {
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组存在则将多选框状态变为true
});
return res;
}
</script>
<div class="modal fade" id="subFileModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择资料</h4>
</div>
<div class="modal-body " style="width:100%">
<div id="fileAlertDiv"></div>
<div class="box box-primary box-solid collapsed-box" id="searchBox" collapsed>
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn btn-primary btn-sm pull-right" data-widget="collapse"
style="margin-right: 5px;">
<i class="fa fa-plus"></i></button>
</div>
<!-- /. tools -->
<i class="fa fa-search"></i>
</div>
<div class="box-body collapse" >
<form class="form-horizontal " style="padding:0;">
<div class="form-group" style="margin-right: 20px;">
<label class="control-label col-sm-2 ">名称</label>
<div class="col-sm-4">
<input type="text" id="search_fileName" name="search_fileName" class="form-control input-sm" placeholder="名称" style="width:170px;">
</div>
</div>
<div class="form-group" style="margin-right: 20px;">
<label class="col-sm-2 control-label">只看选中</label>
<div class="col-sm-4">
<div class="switch" data-on="primary" data-off="info">
<input id ="switchBtn" type="checkbox" />
</div>
</div>
<div class=" col-sm-6 button-group" style="padding: 0;">
<button type ="button" class="btn btn-default btn-sm pull-right" onclick="doSearchFile();"><i class="fa fa-search"> 搜索</i></button>
</div>
</div>
</form>
</div>
</div>
<div>
<div id="selectFileTable" style="height:230px;overflow:auto;width:100%"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSelectFile()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,111 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
var masterId='${data.id}';
var tbName ='tb_doc_file'; //数据表
var nameSpace='Document';//保存文件夹
//下载文件
var fileDownload = function(id) {
window.open(ext.contextPath + "/base/downloadFile.do?key="+id+"&tbName="+tbName);
};
var dosearchFileTab = function() {
$("#searchFileTable").bootstrapTable("refresh");
};
$(function() {
$("#search_file").keyup(function(){
if (event.keyCode == 13) {
event.preventDefault();
//回车查询
dosearchFileTab();
event.stopPropagation();
}
})
$("#st").select2({minimumResultsForSearch: 10}).val("${data.st}").trigger("change");
$("#searchFileTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/getInputFileList.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
masterId: '${nodeIds}',
tbName : tbName,
fileName:$("#search_file").val()
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
field: 'filename', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'left', // 左右居中
valign: 'middle',// 上下居中
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 100, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts= '';
buts+='<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\''+row.id+'\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
/* buts+= '<security:authorize buttonUrl="document/fileDelete.do">';
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="delFileFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
buts+= '</security:authorize>'; */
buts='<div class="btn-group" >'+buts+'</div>';
return buts;
}
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("searchFileTable");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<div class="box" >
<%-- <div class="box-header with-border">
<h3 class="box-title">${param.text}</h3>
<div class="box-tools pull-right">
</div>
</div> --%>
<!-- /.box-header -->
<div class="box-body ">
<div >
<div class="input-group input-group-sm pull-right" style="width:250px;padding-bottom:10px" >
<input type="text" id="search_file" name="search_file" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearchFileTab();"><i class="fa fa-search"></i></button>
</div>
</div>
<table id="searchFileTable"></table>
</div>
</div>
</div>

View File

@ -0,0 +1,65 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<script type="text/javascript">
var doupdate = function() {
var id=$('#id').val();
var equipmentIds=$('#equipmentIds').val();
$.post(ext.contextPath + '/document/fileupdate4equ.do', {equipmentIds:equipmentIds,id:id} , function(data) {
closeModal('fileInputModal')
$("#fileTable").bootstrapTable('refresh');
});
}
var showEquipment4SelectsFun = function(formId,hiddenId,textId,equipcode) {
var companyId='${param.companyId}';
var equipmentIds=$('#'+hiddenId).val();;
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelects.do', {formId:formId,hiddenId:hiddenId,textId:textId,companyId:companyId,equipmentIds:equipmentIds,equipcode:equipcode} , function(data) {
$("#equ4SelectDiv").html(data);
openModal("equipment4SelectModal");
});
};
</script>
<div class="modal fade" id="fileInputModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">修改关联设备</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="fileInputModalForm" style="padding:10px">
<input id="id" name="id" type="hidden" value="${CommonFile.id}" />
<div id="alertFileDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">文件名:</label>
<div class="col-sm-10"><p class="form-control-static">${CommonFile.filename}</p></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">大小:</label>
<div class="col-sm-10"><p class="form-control-static"><fmt:formatNumber type="number" value="${CommonFile.size/1024}" groupingUsed="false" maxFractionDigits="2"/> KB</p></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">上传者</label>
<div class="col-sm-10"><p class="form-control-static">${CommonFile.user.caption}</p></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">关联设备</label>
<div class="col-sm-10">
<input id="equipmentIds" name="equipmentIds" type="hidden" value="${CommonFile.equipmentcardids}" />
<input id="equipcode" name="equipcode" type="hidden" value="" />
<input class="form-control" id="equipname" name ="equipname" value="${CommonFile.equipmentcardnames}"
onclick="showEquipment4SelectsFun('fileInputModalForm','equipmentIds','equipname','equipcode');" placeholder="请点击选择">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" >关闭</button>
<button type="button" class="btn btn-primary" onclick="doupdate()" >修改</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,273 @@
<%@page import="com.sipai.entity.document.Data"%>
<%@ 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("Manage_File", Data.Manage_File); %>
<!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>
<style>
.main-header{display:none;}
.content-header{display:none;}
.main-footer{display:none;}
</style>
<script type="text/javascript">
//新增节点
var addFun = function() {
deleteBoxStyleFun();
var node=$('#tree').treeview('getSelected');
var pid="-1";
console.info(node)
if(node!=null && node.length>0){
pid=node[0].id;
}
$.post(ext.contextPath + '/document/doaddData.do', {pid:pid,doctype:'${Manage_File}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
};
//删除节点
function deleteFun() {
var node = $('#tree').treeview('getSelected');
var data = "";
if(node!=null && node.length>0){
data = node[0].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 + '/document/dodel.do', {id:data}, function(data) {
if(data.res>0){
initFun();
}else{
showAlert('d','删除失败');
}
},'json');
}
});
}else{
showAlert('d','请先选择记录','mainAlertdiv');
}
}
//编辑节点基本信息
var editFun = function() {
var node = $('#tree').treeview('getSelected');
var data = "";
if(node!=null && node.length>0){
data = node[0].id;
$.post(ext.contextPath + '/document/doeditData.do', {id:data,doctype:'${Manage_File}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
}else{
showAlert('d','请先选择编辑的节点','mainAlertdiv');
}
};
//全局搜索资料
var searchFileFun = function() {
$.post(ext.contextPath + '/document/showSearchFile.do', {companyId:companyId,doctype:'${Manage_File}',} , function(data) {
$("#fileList").html(data);
});
};
//编辑文件,点击节点后进入文件上传下载界面
var editFileFun = function(id,text) {
$.post(ext.contextPath + '/document/editDataFile.do', {id:id,text:text,doctype:'${Manage_File}',companyId:companyId} , function(data) {
$("#faultBox").html(data);
});
};
var addStyleFun = function(){
$('#tree').css("text-align","center");
$('#tree').css("line-height","550px");
$('#tree').css("color","#9FB6CD");
$('#tree').html('请您先新增节点!');
$('#faultBox').css("background-color","#FFFFFF");
$('#faultBox').css("text-align","center");
$('#faultBox').html("暂无资料!");
}
var deleteBoxStyleFun = function(){
$('#faultBox').html("");
$('#faultBox').css("background-color","");
$('#faultBox').css("text-align","");
}
var deleteTreeStyleFun = function(){
$('#tree').html('');
$('#tree').css("text-align","");
$('#tree').css("line-height","");
$('#tree').css("color","");
}
var initFun = function() {
$.post(ext.contextPath + '/document/getDataJson.do',{doctype:'${Manage_File}',docname:$("#search_name").val(),companyId:companyId}, function(data) {
if(data.length == 0){
$('#tree').treeview({data: data});
addStyleFun();
}else{
deleteTreeStyleFun();
deleteBoxStyleFun();
$('#tree').treeview({data: data});
editFileFun(data[0].id,data[0].text);
}
console.info(data.length)
$('#tree').on('nodeSelected', function(event, data) {
editFileFun(data.id,data.text);
});
},'json');
};
var conpanyId = "";
$(function() {
var flag = IsApp();
if (flag==true){
}else{
$(".main-header").show();
$(".content-header").show();
$(".main-footer").show();
}
//简易公司combotree
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
$('#companySelectTree').html(data);
});
//initFun();
//jquery html()方法加载导致box无法执行boxwidget(),手动初始化
$('#searchBox').boxWidget();
$('#switchBtn').bootstrapSwitch({
onText:'是',
offText:'否',
size:"small",
onSwitchChange:function(event, state) {
if(state){
$("#files").show();
searchFileFun();
$("#nodes").hide();
}else{
$("#nodes").show();
$("#files").hide();
}
}
})
$("#file_search").hide();
$("#files").hide();
});
var dosearch = function() {
$("#faultBox").html("");
initFun();
searchFileFun();
};
</script>
</head>
<body onload="initMenu()" 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">
<!-- 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 id="doc4SelectDiv"></div>
<div id="fileInputDiv"></div>
<div id="equ4SelectDiv"></div>
<div class="row form-inline">
<div class="col-md-3" id="companySelectTree"></div>
<div class="col-md-3 pull-right">
<div class="switch" data-on="primary" data-off="info">
<label class="control-label">全局检索</label>
<input id ="switchBtn" type="checkbox" />
</div>
</div>
<!-- <div id="file_search" class="col-md-6 input-group input-group-sm pull-right" style="width:300px;">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="资料名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();">资料检索<i class="fa fa-search"></i></button>
</div>
</div> -->
</div>
<div class="row" id="nodes">
<div class="col-md-3">
<div >
<security:authorize buttonUrl="document/add.do">
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="addFun();"><i class="fa fa-plus"></i>新增节点</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="deleteFun();"><i class="fa fa-trash-o"></i> 删除节点</button>
<button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" onclick="editFun();"><i class="fa fa-edit"></i> 编辑节点</button>
</security:authorize>
</div>
<div class="input-group input-group-sm" style="padding-top:5px;padding-bottom:3px">
<input type="text" id="search_name" name="search_name" autocomplete="off" style="height:35px" class="form-control pull-right" placeholder="节点名称...">
<div class="input-group-btn">
<button class="btn btn-default" style="height:35px" onclick="dosearch();"><i class="fa fa-search"></i></button>
</div>
</div>
<div class="box box-solid">
<!-- <div class="box-header with-border" style="height:100px;">
<h3 class="box-title"></h3>
<div class="box-tools">
</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-9" id="faultBox">
</div>
</div>
<!-- 全局搜索资料显示 -->
<div class="row" id="files">
<div class="col-md-12" id="fileList">
</div>
</div>
</section>
<!-- /.content -->
</div>
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
</div>
</body>
<!-- bootstrap switch -->
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js" charset="utf-8"></script>
</html>

View File

@ -0,0 +1,215 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.sipai.entity.document.Data"%>
<%request.setAttribute("Science_File", Data.Science_File); %>
<script type="text/javascript">
$(function (){
$.ajax({
type: "GET",//请求方式
url: ext.contextPath + '/document/getDataJson.do',
data: {
doctype:'${Science_File}',
companyId:unitId
},
async: false,
dataType: 'json',
success: function(data) {
if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
//没有子节点时显示单独一个span
$("#docId").val(data[0].id);
$("#contnetSelect").hide();
$("#oneContentName").text("资料名称:" + data[0].text);
// showtable();
} else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
$('#contentTree').treeview({
data: data,
showBorder: false,
showCheckbox: false,
levels: 2
});
$("#docId").val(data[0].id);
$("#contentName").val(data[0].text);
$('#contentTree').on('nodeSelected', function (event, data) {
$("#docId").val(data.id);
$("#contentName").val(data.text);
document.getElementById('dropdownContent').style.display = "none";
$("ul#dropdownContent").hide();
$("#docFileRelationTable").bootstrapTable('refresh');
});
} else {
//待完善
}
}
});
// $.post(ext.contextPath + '/document/getDataJson.do', { doctype: '${Science_File}', companyId: unitId }, function (data) {
// //console.log("data",data[0]);
// if (data.length == 1 && !data[0].hasOwnProperty("nodes")) {
// //没有子节点时显示单独一个span
// $("#docId").val(data[0].id);
// $("#contnetSelect").hide();
// $("#oneContentName").text("资料类型:" + data[0].text);
// // showtable();
// } else if ((data.length == 1 && data.nodes != "") || data.length > 1) {
// $('#contentTree').treeview({
// data: data,
// showBorder: false,
// showCheckbox: false,
// levels: 1
// });
// $("#docId").val(data[0].id);
// $("#contentName").val(data[0].text);
// $('#contentTree').on('nodeSelected', function (event, data) {
// $("#docId").val(data.id);
// $("#contentName").val(data.text);
// document.getElementById('dropdownContent').style.display = "none";
// $("ul#dropdownContent").hide();
// $("#docFileRelationTable").bootstrapTable('refresh');
// });
// } else {
// //待完善
// }
// }, 'json');
//防止点击树收起下拉框
$("#dropdownContent").on("click", function (e) {
event.stopPropagation();
});
//点击树之外其他区域收起
$(document).click(function () {
$("#dropdownContent").hide();
});
$("#docFileRelationTable").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/document/getInputFileListForSelect.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 15, 20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order, // 排序规则
masterId: $('#docId').val(),
tbName: 'tb_doc_file'
// fileName: $("#search_fileName").val()
}
},
sortName: 'insdt', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
checkbox: true, // 显示一个勾选框
},
{
field: 'filename', // 返回json数据中的name
title: '资料名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},/* {
field: 'abspath', // 返回json数据中的name
title: '路径', // 表格表头显示文字
align: 'left', // 左右居中
valign: 'middle',// 上下居中
formatter:function(value,row,index){
return '<a onclick="fileDownload(\'' + row.id + '\')">'+value+'</a>'
}
}, */{
field: 'user.caption', // 返回json数据中的name
title: '上传者', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',// 上下居中
}
],
onLoadSuccess: function () { //加载成功时执行
//$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
adjustBootstrapTableView("fileTable");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
})
});
function doFileRelation(){
var checkedItems = $("#docFileRelationTable").bootstrapTable('getSelections');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
if(datas==""){
showAlert('d','请先选择记录','maindocFileRelationAlertdiv');
}else{
$.post(ext.contextPath + '/document/docFileRelation/dosave.do', {datas:datas,masterid:'${param.masterid}',type:'${param.type}'}, function(data) {
if (data.code == 1) {
closeModal('docFileRelationModal');
$("#fileRelationTable").bootstrapTable('refresh');
}else{
showAlert('d','保存失败');
}
},'json');
}
}
</script>
<div class="modal fade" id="docFileRelationModal">
<div class="modal-dialog">
<div class="modal-content" style="float:left;width:100%;">
<div class="modal-header" style="float:left;width:100%;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">选择资料</h4>
</div>
<div class="modal-body" style="float:left;width:100%;">
<div id="maindocFileRelationAlertdiv"></div>
<div style="float:left;width:100%;height:60px;">
<div class="input-group input-group-sm pull-left" >
<input id="docId" name="docId" type="hidden"/>
<span id="oneContentName" style="width:220px;border: none;background: transparent;"></span>
<ul id="contnetSelect"
style="list-style-type:none;padding-left:10px;margin-top:8px;width:190px;">
<li class="dropdown messages-menu">
<!-- Menu toggle button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="width:120px;"
onclick="document.getElementById('dropdownContent').style.display = 'block';">
<div class="input-group" style="height: 25px">
<span class="input-group-addon"
style="height:25px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">资料列表:</span>
<input class="form-control " id="contentName" name="contentName"
style="height:28px;width:120px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;text-align:center;"
readonly/>
</div>
</a>
<ul id="dropdownContent" class="dropdown-menu" data-stopPropagation="true">
<li>
<div id="contentTree" style="width: 275px;overflow:auto;max-height:500px;">
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div style="float:left;width:100%;">
<table id="docFileRelationTable"></table>
</div>
</div>
<div class="modal-footer" style="float:left;width:100%;">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doFileRelation()" id="btn_save">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/saveWorkOrder.do", $(".form").serialize(), function(result) {
if (result.res == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderEdit.do?id="+result.id);
});
}else if(result.res == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增工作指令" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
<input id="doctype" name="doctype" type="hidden" value="A"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="" />
</td>
</tr>
<tr>
<th>状态</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'"">
<option value="1" selected>启用</option>
<option value="0">禁用</option>
</select>
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/document/updateWorkOrder.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
}else if(result == 0) {
top.$.messager.alert('提示', "保存失败", 'info');
} else{
top.$.messager.alert('提示', result.res, 'info');
}
},'json');
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
if (r) {
$.post(ext.contextPath + "/document/deleteWorkOrder.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', "删除失败", 'info');
}
});
}
});
}
$(function() {
var ue = UE.getEditor('details');
$('#pname').combotree({
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
//附件加载
new commfile('document.DocFileMapper','${data.id}').loadfile();
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑工作指令" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${data.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
</td>
</tr>
<tr>
<th>编号</th>
<td>
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
</td>
<th>类型</th>
<td>
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
<input id="doctype" name="doctype" type="hidden" value="A"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
</td>
</tr>
<tr>
<th>
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
</th>
<td colspan="3">
<div id="fileList"></div>
</td>
</tr>
<tr>
<th>启用</th>
<td colspan="3">
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
<option value="1">启用</option>
<option value="0">禁用</option>
</select>
</tr>
<tr>
<th>内容</th>
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
</tr>
</table>
</form>
</div>
</body>
</html>