personalfile-message.jsp 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  4. <div class="easyui-layout" fit="true">
  5. <div region="center" style="padding:0px;border:0px">
  6. <t:datagrid name="tSysFileList" checkbox="false" sortName="createDate" pagination="true" fitColumns="true" title=""
  7. actionUrl="PersonalFileController.do?datagridmessage" idField="id" fit="true" queryMode="group">
  8. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  9. <t:dgCol title="文件访问路径" field="fileUrl" queryMode="single" hidden="true" width="120"></t:dgCol>
  10. <t:dgCol title="业务表单" field="busiTable" queryMode="single" hidden="true" width="120"></t:dgCol>
  11. <t:dgCol title="业务id" field="busiId" queryMode="single" hidden="true" width="120"></t:dgCol>
  12. <t:dgCol title="备注" field="remark" queryMode="single" hidden="true" width="120"></t:dgCol>
  13. <t:dgCol title="文件种类" field="tagetType" queryMode="single" hidden="true" width="120"></t:dgCol>
  14. <t:dgCol title="文件名称" field="fileName" query="true" queryMode="single" width="200"></t:dgCol>
  15. <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd" queryMode="single" width="120"></t:dgCol>
  16. <t:dgCol title="是否预览Flg" field="isPreviewFlg" hidden="true" queryMode="single" width="120"></t:dgCol>
  17. <t:dgCol title="操作" field="opt"></t:dgCol>
  18. <t:dgFunOpt title="下载" funname="downloadFile" urlclass="ace_button" urlfont="fa-download" />
  19. <t:dgFunOpt title="查看" exp="isPreviewFlg#eq#1" funname="showViewFile" urlclass="ace_button" urlfont="fa-file" />
  20. </t:datagrid>
  21. </div>
  22. </div>
  23. <script type="text/javascript">
  24. var showAndDownUrl = "${showAndDownUrl}";
  25. $(document).ready(function() {
  26. $(":input[name='fileName']").css("width","300px");
  27. $(":input[name='fileName']").css("margin","5px");
  28. });
  29. function downloadFile(index) {
  30. var rows = $('#tSysFileList').datagrid('getRows');//获取所有当前加载的数据行
  31. var fileUrl = rows[index].fileUrl;
  32. //var downsrc = "tSysFileController/showOrDownByurl.do?dbPath=" + fileUrl + '&down=1';
  33. var downsrc = showAndDownUrl + fileUrl + '&down=1';
  34. location.href = downsrc;
  35. };
  36. function showViewFile(index) {
  37. var rows = $('#tSysFileList').datagrid('getRows');//获取所有当前加载的数据行
  38. var fileUrl = rows[index].fileUrl;
  39. // 默认文件不是在阿里云
  40. var aliyunflg = "0";
  41. var tempStr = "aliyun";
  42. if(showAndDownUrl.indexOf(tempStr) >= 0) {
  43. aliyunflg = "1";
  44. }
  45. $.dialog.setting.zIndex = getzIndex();
  46. $.dialog(
  47. {
  48. content : 'url:tSysFileController/showViewFile.do?fileUrl=' + fileUrl + '&aliyunflg=' + aliyunflg,
  49. //content : 'url:'+ urlSee,
  50. zIndex : getzIndex(),
  51. title : '查看文件',//选择框标题
  52. lock : true,//是否锁定 当为true 时 下层有蒙版,不允许用户在弹出窗口以外有其它操作
  53. width : '600px',// 选择框宽度
  54. height : '600px',//选择框高度
  55. opacity : 0.4,//透明度 (经过测试 效果好像不太明显 )
  56. button : [ {
  57. name : '关闭',
  58. focus : true,
  59. callback : function() {
  60. }
  61. } ]
  62. }).zindex();
  63. };
  64. function tSysFileListAjaxCallback(data) {
  65. tip(data.msg);
  66. tSysFileListsearch();
  67. }
  68. </script>