187 lines
7.9 KiB
Plaintext
187 lines
7.9 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.entity.maintenance.Abnormity" %>
|
||
<%request.setAttribute("Type_Run", Abnormity.Type_Run); %>
|
||
<%request.setAttribute("Type_Equipment", Abnormity.Type_Equipment); %>
|
||
<%request.setAttribute("Type_Facilities", Abnormity.Type_Facilities); %>
|
||
|
||
<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 = '${masterId}';
|
||
var tbName = '${tbName}'; //数据表
|
||
var nameSpace = '${nameSpace}';//保存文件夹
|
||
var bucketName = '${nameSpace}';
|
||
// var previews = new Array();
|
||
// var previewConfigs = new Array();
|
||
|
||
$(function () {
|
||
//加载文件
|
||
<%--getFileListMinioPic('fileViewId', 'edit', '${id}', previews, previewConfigs);--%>
|
||
$("#fileTable").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/base/getInputFileList_minio2.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: masterId,
|
||
tbName: tbName,
|
||
bucketName: bucketName
|
||
}
|
||
},
|
||
sortName: 'insdt', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'filename', // 返回json数据中的name
|
||
title: '文件名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '30%'
|
||
},
|
||
{
|
||
field: 'user.caption', // 返回json数据中的name
|
||
title: '上传人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '20%'
|
||
},
|
||
{
|
||
field: 'insdt', // 返回json数据中的name
|
||
title: '上传时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '20%',
|
||
formatter: function (value, row, index) {
|
||
if (row.insdt != null && row.insdt != '') {
|
||
return row.insdt.substring(0, 19);
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'insdt', // 返回json数据中的name
|
||
title: '文件大小', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: '20%',
|
||
formatter: function (value, row, index) {
|
||
if (row.size != null && row.size != '') {
|
||
return row.size / 1000 + 'kb';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: '220',
|
||
formatter: function (value, row, index) {
|
||
var buts = '';
|
||
buts += '<button type="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 += '<button type="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 = '<div class="btn-group" >' + buts + '</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("fileTable");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
|
||
|
||
});
|
||
|
||
//下载文件
|
||
var fileDownload = function (id) {
|
||
// window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=" + tbName);
|
||
window.open(ext.contextPath + "/data/downloadCurveFile4minio.do?id=" + id);
|
||
};
|
||
|
||
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');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
};
|
||
|
||
|
||
</script>
|
||
<div class="modal fade" id="fileInputModal">
|
||
<div class="modal-dialog" style="height: 500px;width: 600px;">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">附件查看</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<table id="fileTable"></table>
|
||
<%-- <div class="form-group" style="margin:8px;">--%>
|
||
<%-- <input type="file" name="abnormityFileId" id="abnormityFileId" multiple--%>
|
||
<%-- class="file-loading"/>--%>
|
||
<%-- </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>
|