other-list.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
  3. ?>
  4. <!doctype html>
  5. <html class="fixed sidebar-left-collapsed">
  6. <head>
  7. <!-- jstree CSS -->
  8. <link rel="stylesheet" href="/Common/assets/vendor/jstree/themes/default/style.css" />
  9. <?php include("bim-support-header.html"); ?>
  10. <script src="./script/js/global.js"></script>
  11. <script src="./script/js/pdfobject.min.js"></script>
  12. <script type="application/javascript">
  13. var url_href = window.location.href;
  14. var url = new URL(url_href);
  15. var type = url.searchParams.get("type");
  16. if (type === null) {
  17. window.location.href = "other-list.php?type=收費建議";
  18. }
  19. var userName = '<?php echo $_SESSION['name']; ?>';
  20. var $grid;
  21. pageHeader = "BIM相關資源";
  22. </script>
  23. <style>
  24. .menu-item.active {
  25. color: #0088CC;
  26. }
  27. .jstree-anchor {
  28. width: 95%;
  29. text-overflow: ellipsis;
  30. overflow: hidden;
  31. white-space: nowrap;
  32. }
  33. th {
  34. text-align: center;
  35. width: 30%;
  36. font-size: 18px;
  37. }
  38. td {
  39. text-align: center;
  40. font-size: 18px;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <canvas id="c"></canvas>
  46. <section class="body">
  47. <!-- start: header -->
  48. <header-menu></header-menu>
  49. <!-- end: header -->
  50. <div class="inner-wrapper">
  51. <!-- start: sidebar -->
  52. <side-bar></side-bar>
  53. <!-- end: sidebar -->
  54. <section role="main" class="content-body">
  55. <header class="page-header">
  56. <h2>{{pageHeader}}</h2>
  57. </header>
  58. <!-- start: page -->
  59. <section class="content-with-menu content-with-menu-has-toolbar media-gallery">
  60. <div class="content-with-menu-container">
  61. <inner-menu>
  62. <template v-slot:inner-equipment>
  63. <other-list></other-list>
  64. </template>
  65. </inner-menu>
  66. <div class="inner-body mg-main">
  67. <div class="inner-toolbar">
  68. <ul>
  69. <search-bar></search-bar>
  70. <li id="reset" style="padding-top: 10px;">
  71. <div class="input-group input-search" style="table-layout: auto;">
  72. <button class="btn btn-primary" type="button" id="resetbtn" data-toggle="tooltip" ><i class="fa fa-undo"></i></button>
  73. </div>
  74. </li>
  75. </ul>
  76. </div>
  77. <filter-content2></filter-content2>
  78. <div class="row">
  79. <div class="col-md-6">
  80. <section class="panel">
  81. <div class="panel-body">
  82. <h5 class="text-semibold text-dark text-uppercase">檔案下載</h5>
  83. <div id="treeAjaxHTML" style="height:400px;overflow: auto;"></div>
  84. </div>
  85. </section>
  86. <section class="panel">
  87. <div class="panel-body">
  88. <h5 class="text-semibold text-dark text-uppercase">檔案資訊</h5>
  89. <div id="fileTable" style="height:200px">
  90. <table class="table table-bordered mb-none" style="height: 100%;">
  91. <tbody>
  92. <tr>
  93. <th>檔案名稱</th>
  94. <td id="fileName"></td>
  95. </tr>
  96. <tr>
  97. <th>詳細資訊</th>
  98. <td id="fileDetail">尚未填寫</td>
  99. </tr>
  100. <tr>
  101. <th>檔案日期</th>
  102. <td id="fileDate"></td>
  103. </tr>
  104. <tr>
  105. <th>下載連結</th>
  106. <td id="fileLink"><a id="fileHerf" href="#" target="_blank"><i class="fa fa-download">檔案下載</i></a></td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. </div>
  111. </div>
  112. </section>
  113. </div>
  114. <div class="col-md-6">
  115. <section class="panel">
  116. <div class="panel-body">
  117. <div id="pdfFile" style="height:720px"></div>
  118. </div>
  119. </section>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </section>
  125. <!-- end: page -->
  126. </section>
  127. </div>
  128. </section>
  129. <?php include("bim-support-body.html"); ?>
  130. <script>
  131. vm.mount('.body');
  132. $(document).ready(function() {
  133. PDFObject.embed("./assets/null.pdf", "#pdfFile");
  134. /*載入jstree */
  135. $('#treeAjaxHTML').jstree({
  136. 'core': {
  137. 'themes': {
  138. 'responsive': false
  139. },
  140. 'check_callback': true,
  141. 'data': {
  142. 'url': './script/php/getBIMData.php?folder=' + type, // 使用type獲取檔案目錄
  143. }
  144. },
  145. 'search': {
  146. 'show_only_matches': true,
  147. },
  148. 'types': { //依據檔案類型設定不同icon
  149. 'default': {
  150. 'icon': 'fa fa-folder'
  151. },
  152. 'file': {
  153. 'icon': 'fa fa-file-o'
  154. },
  155. 'pdf': {
  156. 'icon': 'fa fa-file-pdf-o'
  157. },
  158. 'word': {
  159. 'icon': 'fa fa-file-word-o'
  160. },
  161. 'excel': {
  162. 'icon': 'fa fa-file-excel-o'
  163. },
  164. 'ppt': {
  165. 'icon': 'fa fa-file-powerpoint-o'
  166. },
  167. 'f-open': {
  168. 'icon': 'fa fa-folder-open'
  169. },
  170. 'f-closed': {
  171. 'icon': 'fa fa-folder'
  172. }
  173. },
  174. 'plugins': ['types', 'search']
  175. }).on('select_node.jstree', function(event, data) {
  176. data.instance.toggle_node(data.node);
  177. //點選pdf時預覽
  178. if (data.node.text.includes(".pdf")) {
  179. PDFObject.embed(data.node.a_attr.href, "#pdfFile");
  180. } else {
  181. if (data.node.text.includes(".")) {
  182. PDFObject.embed("./assets/notPDF.pdf", "#pdfFile");
  183. }
  184. }
  185. //將檔案資訊填入下方表格
  186. if (data.node.text.includes(".")) {
  187. $("#fileName").empty();
  188. $("#fileName").append(data.node.text);
  189. $("#fileHerf").attr("href", data.node.a_attr.href);
  190. $("#fileDate").empty();
  191. $("#fileDate").append(data.node.a_attr.time);
  192. }
  193. }).bind('loaded.jstree', function(e, data) {
  194. });
  195. $("#treeAjaxHTML").on('open_node.jstree', function(event, data) {
  196. data.instance.set_type(data.node, 'f-open');
  197. });
  198. $("#treeAjaxHTML").on('close_node.jstree', function(event, data) {
  199. data.instance.set_type(data.node, 'f-closed');
  200. });
  201. });
  202. // 搜尋jstree
  203. $("#resetbtn").on('click', function(event) {
  204. $("#treeAjaxHTML").jstree("clear_search");
  205. $("#quicksearch").val('');
  206. })
  207. $("#searchBtn").on('click', function(event) {
  208. var search = $("#quicksearch").val();
  209. $("#treeAjaxHTML").jstree("search", search);
  210. })
  211. $("#quicksearch").on('keyup', function(e) {
  212. if (e.key === 'Enter' || e.keyCode === 13) {
  213. var search = $("#quicksearch").val();
  214. $("#treeAjaxHTML").jstree("search", search);
  215. }
  216. });
  217. $('[data-toggle="tooltip"]').tooltip({container: "body",placement:"right",title:"重置搜尋結果"});
  218. </script>
  219. <script src="/Common/assets/vendor/jstree/jstree.js"></script>
  220. </body>
  221. </html>