| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?php
- include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
- ?>
- <!doctype html>
- <html class="fixed sidebar-left-collapsed">
- <head>
- <?php include("bim-support-header.html"); ?>
- <script src="./script/js/global.js"></script>
- <script type="application/javascript">
- var delFavoriteList = [];
- var i = 0;
- var path = [];
- var categoryList = [];
- var categoryTable = [];
- var id = [];
- var revitVersion = [];
- var userName = "<?php echo $_SESSION['name'] ?>";
- var role = "<?php echo ($groupName); ?>";
- var right = <?php echo ($right); ?>;
- var $grid;
- //var year = [];
- pageHeader = "元件庫";
- var parent = [];
- var object = [];
- </script>
- </head>
- <body>
- <canvas id="c"></canvas>
- <section class="body">
- <!-- start: header -->
- <header-menu></header-menu>
- <!-- end: header -->
- <div class="inner-wrapper">
- <!-- start: sidebar -->
- <side-bar></side-bar>
- <!-- end: sidebar -->
- <section role="main" class="content-body">
- <header class="page-header">
- <h2>{{pageHeader}}</h2>
- </header>
- <!-- start: page -->
- <section class="content-with-menu content-with-menu-has-toolbar media-gallery">
- <div class="content-with-menu-container">
- <inner-menu>
- <template v-slot:inner-equipment>
- <equipment-list></equipment-list>
- </template>
- </inner-menu>
- <div class="inner-body mg-main">
- <div class="inner-toolbar">
- <ul>
- <search-bar></search-bar>
- <filter-bar></filter-bar>
- <li class="right">
- <a href="#" id="mgSelectAll"><i class="fa fa-check-square"></i> <span data-all-text="選擇全部" data-none-text="取消全選">選擇全部</span></a>
- </li>
- <li class="right">
- <a href="#" onclick="DelFavorite();"><i class="fa fa-trash-o"></i> 移出清單</a>
- </li>
- </ul>
- </div>
- <filter-content></filter-content>
- <div class="row mg-files" data-sort-destination data-sort-id="media-gallery" id="content">
- </div>
- </div>
- </div>
- </section>
- <!-- end: page -->
- </section>
- </div>
- </section>
- <script>
- /*Vue */
- vm.mount('.body');
- addUserImage(userName.charAt(0), role);
- </script>
- <?php include("bim-support-body.html"); ?>
- <script>
- $(document).ready(function() {
- $("a").each(function() {
- var searchText = "清單列表";
- var found;
- if ($(this).context.innerText == searchText) {
- $(this).context.classList.add("highlight");
- }
- });
- $(".dropdown-btn").each(function(){
- $(this).context.href="component-list.php?parent=" + $(this).context.innerText;
- });
- //$.getJSON
- $.ajaxSetup({
- async: false
- });
- $.ajax({
- url: "./script/php/equipment_group_favorite.php",
- type: "GET",
- data: {
- userName: userName,
- },
- contentType: "application/json",
- dataType: "json"
- }).done(function(data) {
- id = data.id;
- path = data.path;
- for (let i = 0; i < path.length; i++) {
- var array = path[i].split('/');
- object[i] = array[array.length-1];
- parent[i] = path[i].replace("/" + object[i], "");
- }
- revitVersion = data.revitVersion;
- for (var i = 0; i < data.year.length; i++) {
- $("#revitVersion").append('<label><input type="checkbox" value=".' + data.year[i] + '" /> ' + data.year[i] + '</label> ');
- }
- $.when(initThreeJS()).then(function() {
- $grid = $("#content").isotope({
- itemSelector: ".isotope-item",
- layoutMode: 'fitRows'
- });
- }).then(function() {
- setTimeout(function() {
- $grid.isotope()
- }, 100);
- });
- }).error(function(error) {
- console.log(error);
- });
-
- });
- //刪除元件checkbox
- $(document).on("change", "input[name='delCheck']", function() {
- if ($(this).prop('checked') === true) {
- delFavoriteList.push($(this).attr('value'));
- } else {
- delFavoriteList.splice(delFavoriteList.indexOf($(this).attr('value')), 1);
- }
- });
- $('#mgSelectAll').on('click', function(ev) {
- ev.preventDefault();
- var $this = $(this),
- $label = $this.find('> span');
- $checks = $("input[name='delCheck']")
- if ($this.attr('data-all-selected')) {
- $this.removeAttr('data-all-selected');
- $checks.prop('checked', false).trigger('change');
- $label.html($label.data('all-text'));
- } else {
- $this.attr('data-all-selected', 'true');
- $checks.prop('checked', true).trigger('change');
- $label.html($label.data('none-text'));
- }
- });
- function DelFavorite() {
- $.ajax({
- url: "./script/php/addFavorite.php",
- type: "POST",
- data: {
- delFavoriteList: delFavoriteList,
- username: userName
- }
- }).done(function(data) {
- window.location.reload();
- }).error(function(error) {
- console.log(error);
- });
- }
- </script>
- <script src="./script/js/data-sort.js"></script>
- <script src="script/js/3Dpic-favorite.js" type="module"></script>
- </body>
- </html>
|