255 lines
11 KiB
Plaintext
255 lines
11 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); %>
|
||
|
||
<!-- 引入daterangepicker-->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
charset="utf-8"></script>
|
||
<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();
|
||
|
||
var beginTimeStore1 = '';
|
||
var endTimeStore1 = '';
|
||
|
||
function initDate() {
|
||
//定义locale汉化插件
|
||
beginTimeStore1 = moment().subtract(6, 'days').format('YYYY-MM-DD HH:mm');
|
||
endTimeStore1 = moment().subtract(-1, 'days').format('YYYY-MM-DD HH:mm');
|
||
var locale = {
|
||
"format": 'YYYY-MM-DD HH:mm',
|
||
"separator": " ~ ",
|
||
"applyLabel": "确定",
|
||
"cancelLabel": "取消",
|
||
"fromLabel": "起始时间",
|
||
"toLabel": "结束时间'",
|
||
"customRangeLabel": "自定义",
|
||
"weekLabel": "W",
|
||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||
"firstDay": 1
|
||
};
|
||
$('#reservationtime').daterangepicker({
|
||
"timePicker": true,
|
||
"timePicker24Hour": true,
|
||
"linkedCalendars": false,
|
||
"autoUpdateInput": false,
|
||
"timePickerIncrement": 10,
|
||
"locale": locale,
|
||
//汉化按钮部分
|
||
ranges: {
|
||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||
},
|
||
startDate: beginTimeStore1,
|
||
endDate: endTimeStore1
|
||
}, function (start, end, label) {
|
||
beginTimeStore1 = start.format(this.locale.format);
|
||
endTimeStore1 = end.format(this.locale.format);
|
||
if (!this.startDate) {
|
||
this.element.val('');
|
||
} else {
|
||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||
}
|
||
});
|
||
$('#reservationtime').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||
}
|
||
|
||
$(function () {
|
||
initDate();
|
||
//加载文件
|
||
<%--getFileListMinioPic('fileViewId', 'edit', '${id}', previews, previewConfigs);--%>
|
||
$("#fileTable").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/base/getInputFileList_minio3.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
masterId: masterId,
|
||
tbName: tbName,
|
||
bucketName: bucketName,
|
||
sdt: beginTimeStore1,
|
||
edt: endTimeStore1
|
||
}
|
||
},
|
||
columns: [
|
||
{
|
||
field: 'filename', // 返回json数据中的name
|
||
title: '文件名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle'
|
||
},
|
||
{
|
||
field: 'insdt', // 返回json数据中的name
|
||
title: '上传时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
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',
|
||
formatter: function (value, row, index) {
|
||
if (row.size != null && row.size != '') {
|
||
return row.size / 1000 + 'kb';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: '150',
|
||
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="showOnlinePic(\'' + row.id + '\',\'' + row.masterid + '\')"><i class="fa fa-eye"></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 + "/work/camera/downloadFile4minio.do?id=" + id);
|
||
};
|
||
|
||
function showOnlinePic(id, masterId) {
|
||
$.post(ext.contextPath + '/base/showFileOnlinePic.do', {
|
||
id: id,
|
||
masterId: masterId,
|
||
tbName: 'tb_work_camera_File',
|
||
nameSpace: 'cameraimg',
|
||
sdt: beginTimeStore1,
|
||
edt: endTimeStore1
|
||
}, function (data) {
|
||
$("#fileOnlinePicDiv").html(data);
|
||
openModal('fileOnlinePicModal');
|
||
});
|
||
}
|
||
|
||
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');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
};
|
||
|
||
function doCameraPicSearch() {
|
||
$("#fileTable").bootstrapTable('refresh');
|
||
}
|
||
|
||
</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">
|
||
<div class="input-group pull-left input-group-sm" style="padding-bottom: 10px;">
|
||
<input type="text" class="form-control pull-left" id="reservationtime" style="width:230px">
|
||
<div class="input-group-btn pull-left">
|
||
<button type="button" class="btn btn-default" onclick="doCameraPicSearch();"><i
|
||
class="fa fa-search"></i> 查询
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<!-- 新增界面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>
|