| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <div class="easyui-layout" fit="true">
- <div region="center" style="padding:0px;border:0px">
- <div id="tSysFileListtb" style="padding: 3px; height: 30px">
- <div style="float:left">
- <t:webUploader auto="true" busiTable="${webUpload.busiTable}"
- busiId="${webUpload.busiId}" bizType="${webUpload.bizType}"
- remark="${webUpload.remark}" name="${webUpload.bizType}"
- extensions="${webUpload.extensions}"
- duplicate="${webUpload.duplicate}"
- buttonText="上传附件"
- showHis="false" fileNumLimit="100000"
- displayTxt="false"
- readOnly='${webUpload.readOnly}'
- callback="tSysFileListAjaxCallback"
- nullMsg='<t:mutiLang langKey="common.file.nullmsg" langArg = "" ></t:mutiLang>'
- encryptpdf='${encryptpdf}'
- ></t:webUploader>
- </div>
- <div style="margin-top:12px">
- <span style="margin-left:12px">支持文件类型:
- <c:if test='${empty webUpload.extensions}'>jpg,png,pdf,doc,docx,xls,xlsx</c:if>
- <c:if test='${not empty webUpload.extensions}'>${webUpload.extensions}</c:if>
- </span>
- </div>
- </div>
- <t:datagrid name="tSysFileList" checkbox="false" sortName="createDate" pagination="true" fitColumns="true" title="" actionUrl="tSysFileController.do?datagrid" idField="id" fit="true" queryMode="group">
- <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="文件访问路径" field="fileUrl" queryMode="single" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="物理路径" field="fileRealpath" queryMode="single" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="业务表单" field="busiTable" queryMode="single" query="true" hidden="true" defaultVal="${webUpload.busiTable}" width="120"></t:dgCol>
- <t:dgCol title="业务id" field="busiId" queryMode="single" query="true" hidden="true" defaultVal="${webUpload.busiId}" width="120"></t:dgCol>
- <t:dgCol title="备注" field="remark" queryMode="single" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="文件种类" field="tagetType" queryMode="single" query="true" hidden="true" defaultVal="${webUpload.bizType}" width="120"></t:dgCol>
- <t:dgCol title="排序" field="orderNum" queryMode="single" hidden="true" width="120"></t:dgCol>
- <t:dgCol title="文件名称" field="fileName" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="上传者" field="createBy" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="是否预览Flg" field="isPreviewFlg" hidden="true" queryMode="single" width="120"></t:dgCol>
- <t:dgCol title="操作" field="opt"></t:dgCol>
- <c:if test='${"true"!= webUpload.readOnly}'>
- <c:if test='${"true"== webUpload.createrDelete}'>
- <t:dgFunOpt title="删除" exp='createBy#eq#${curUserName}' funname="deleteFile" urlclass="ace_button" urlfont="fa-trash-o" />
- </c:if>
- <c:if test='${"true"!= webUpload.createrDelete}'>
- <t:dgFunOpt title="删除" funname="deleteFile" urlclass="ace_button" urlfont="fa-trash-o" />
- </c:if>
- </c:if>
- <c:if test='${"true"== download}'>
- <t:dgFunOpt title="下载" funname="downloadFile" urlclass="ace_button" urlfont="fa-download" />
- </c:if>
- <t:dgFunOpt title="查看" exp="isPreviewFlg#eq#1" funname="showViewFile" urlclass="ace_button" urlfont="fa-file" />
- <c:if test='${"1"== encryptpdf}'>
- <t:dgFunOpt title="获取密码" funname="getPWD(id)" urlclass="ace_button" urlfont="fa-unlock" />
- </c:if>
- </t:datagrid>
- </div>
- </div>
- <input type="hidden" id="isreadOnly" value="${webUpload.readOnly}" >
- <script type="text/javascript">
- var showAndDownUrl = "${showAndDownUrl}";
- var encryptpdf = "${encryptpdf}";
- $(document).ready(function() {
- });
- function downloadFile(index) {
- var rows = $('#tSysFileList').datagrid('getRows');//获取所有当前加载的数据行
- var fileUrl = rows[index].fileUrl;
- //var downsrc = "tSysFileController/showOrDownByurl.do?dbPath=" + fileUrl + '&down=1';
- var downsrc = showAndDownUrl + fileUrl + '&down=1';
- location.href = downsrc;
- };
- function showViewFile(index) {
- var rows = $('#tSysFileList').datagrid('getRows');//获取所有当前加载的数据行
- var fileUrl = rows[index].fileUrl;
- //var downsrc = "tSysFileController/showViewFile.do?fileUrl=" + fileUrl ;
- //console.log(downsrc);
- //location.href = downsrc;
- //var urlSee = showAndDownUrl + fileUrl;
- // 默认文件不是在阿里云
- var aliyunflg = "0";
- var tempStr = "aliyun";
- if(showAndDownUrl.indexOf(tempStr) >= 0) {
- aliyunflg = "1";
- }
-
- $.dialog.setting.zIndex = getzIndex();
- $.dialog(
- {
- content : 'url:tSysFileController/showViewFile.do?fileUrl=' + fileUrl + '&aliyunflg=' + aliyunflg,
- //content : 'url:'+ urlSee,
- zIndex : getzIndex(),
- title : '查看文件',//选择框标题
- lock : true,//是否锁定 当为true 时 下层有蒙版,不允许用户在弹出窗口以外有其它操作
- width : '600px',// 选择框宽度
- height : '600px',//选择框高度
- opacity : 0.4,//透明度 (经过测试 效果好像不太明显 )
- button : [ {
- name : '关闭',
- focus : true,
- callback : function() {
- }
- } ]
- }).zindex();
- };
- function deleteFile(index) {
- $.messager.confirm("确认", "确定要删除这条数据?", function (r) {
- if (r) {
- var rows = $('#tSysFileList').datagrid('getRows');//获取所有当前加载的数据行
- var id = rows[index].id;
- var deleteurl = "tSysFileController.do?doDel&id=" + id;
- var readonly = $("#isreadOnly").val();
- if (undefined != readonly && 'true' == readonly) {
- tip('<t:mutiLang langKey="file.msg.readonly"/>');
- } else {
- $.post('tSysFileController.do?doDel', {
- id : id
- }, function(aj) {
- var data=JSON.parse(aj);
- tip(data.msg);
- tSysFileListsearch();
- });
- }
- }
- });
- };
- function getPWD(id) {
- $.post('tSysFileController.do?getPWD', {
- id : id
- }, function(aj) {
- var data = JSON.parse(aj);
- tip(data.msg);
- tSysFileListsearch();
- });
- }
- function tSysFileListAjaxCallback(data) {
- tip(data.msg);
- tSysFileListsearch();
- }
- </script>
|