detail.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" ng-app="app">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title>规范性文件台账详情</title>
  7. <link href="../../../AFrontEnd/css/animate.css" rel="stylesheet" />
  8. <link href="../../../AFrontEnd/css/fontawesome/css/font-awesome.css" rel="stylesheet" />
  9. <link href="../../../AFrontEnd/css/bootstrap.css" rel="stylesheet" />
  10. <link href="../../../AFrontEnd/css/style.css" rel="stylesheet" />
  11. <script>document.write("<link href='../../../AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
  12. </head>
  13. <body>
  14. <div ng-controller="detailCtrl as ctl" ng-cloak>
  15. <iframe id="iframe" ng-style="ctl.iframeStyle" src=""></iframe>
  16. <table class="sp-table" ng-if="ctl.list.length>0">
  17. <thead>
  18. <tr>
  19. <th>关联文号</th>
  20. <th>文件名称</th>
  21. <th>文件施行日期</th>
  22. <th>文件到期日期</th>
  23. <th>责任处室</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr ng-repeat="item in ctl.list">
  28. <td ng-bind="item.WH"></td>
  29. <td><a ng-bind="item.WJBT" ng-click="ctl.goUrl(item)"></a></td>
  30. <td ng-bind="item.WJSXRQ"></td>
  31. <td ng-bind="item.WJDQRQ"></td>
  32. <td ng-bind="item.ZRCS"></td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <script src="../../../AFrontEnd/js/jquery/jquery-2.1.4.min.js"></script>
  38. <script src="../../../AFrontEnd/js/laydate/laydate.js"></script>
  39. <script src="../../../AFrontEnd/js/angularjs/angular.js"></script>
  40. <script src="../../../AFrontEnd/js/angularjs/dirPagination.js"></script>
  41. <script src="../../../apiurljs.js"></script>
  42. <script src="../../../js/sm4.js"></script>
  43. <script>document.write('<scri' + 'pt src="../../../AFrontEnd/js/special/special.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>')</script>
  44. <script>
  45. 'use strict';
  46. var app = angular.module('app', [
  47. 'angularUtils.directives.dirPagination'
  48. ]);
  49. app.controller("detailCtrl", ["$scope", "$http", "$timeout", "$interval", function ($scope, $http, $timeout, $interval) {
  50. var self = this;
  51. var s4 = new SM4Util();
  52. self.userId = $.cookie("GlWorkPlatform-userid");
  53. self.userName = $.cookie("GlWorkPlatform-chineseName");
  54. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  55. var postCfg = {
  56. headers: {
  57. 'Content-Type': 'application/json',
  58. 'Authorization': "Bearer " + self.get_AccessToken
  59. }
  60. }
  61. self.goUrl = function (obj) {
  62. sp.openNewWindow("detail.html?id=" + obj.ID, obj.WJBT)
  63. }
  64. self.getDetail = function () {
  65. var data = {
  66. tablename: "FW_GFXWJTZ",
  67. colums: "*",
  68. order: "SORTID",
  69. sqlwhere: { ID: sp.getUrlName("id") },
  70. sqlinwhere: "",
  71. sqllikewhere: ""
  72. }
  73. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  74. .success(function (obj) {
  75. var res = strToJson(s4.decryptData_CBC(obj.data));
  76. self.iframeStyle = {
  77. "width": "100%",
  78. "height": res.data[0].GLWH == "" || res.data[0].GLWH == null ? $(window).height() - 10 : "750px",
  79. "border": "none"
  80. }
  81. self.getList(res.data[0].GLWH)
  82. var FILEEXT = res.data[0].WJDZ.slice(res.data[0].WJDZ.lastIndexOf(".") + 1);
  83. var set_convertType = 0;
  84. if (FILEEXT == "doc") {
  85. set_convertType = 0;
  86. } else if (FILEEXT == "pdf") {
  87. set_convertType = 20;
  88. } else if (FILEEXT == "ofd") {
  89. set_convertType = 570;
  90. } else {
  91. set_convertType = 0;
  92. }
  93. let postData = {
  94. convertType: set_convertType,
  95. isSignature: 1,
  96. isDownload: 1,
  97. isPrint: 1,
  98. fileUrl: res.data[0].WJDZ
  99. };
  100. var postCfg_transfer = {
  101. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  102. transformRequest: function (data) {
  103. return $.param(data);
  104. }
  105. };
  106. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  107. .success(function (res1) {
  108. if (res1.errorcode === 0) {
  109. $("#iframe").attr("src", res1.data.viewUrl)
  110. }
  111. });
  112. })
  113. }
  114. self.getDetail()
  115. self.getList = function (WH) {
  116. var data = {
  117. tablename: "FW_GFXWJTZ",
  118. colums: "*",
  119. order: "SORTID",
  120. sqlwhere: { WH: WH },
  121. sqlinwhere: "",
  122. sqllikewhere: ""
  123. }
  124. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  125. .success(function (obj) {
  126. var res = strToJson(s4.decryptData_CBC(obj.data));
  127. self.list = res.data;
  128. })
  129. }
  130. }])
  131. </script>
  132. <script src="../../../AFrontEnd/js/special/spng.js"></script>
  133. <script src="../../../AFrontEnd/js/special/spngvld.js"></script>
  134. </body>
  135. </html>