| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <?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>
- var isFavorite = false;
- var revitVersion = "";
- var url_href = window.location.href;
- var url = new URL(url_href);
- name = url.searchParams.get("object");
- parent = url.searchParams.get("parent");
- var userName = "<?php echo $_SESSION['name'] ?>";
- var role = "<?php echo ($groupName); ?>";
- var right = <?php echo ($right); ?>;
- var header = [];
- var sizeHeader = [];
- var value = [];
- var sizeValue = [];
- pageHeader = "元件庫";
- </script>
- <style>
- .hide-image {
- display: none;
- }
- .preview:hover .hide-image {
- display: block;
- position: absolute;
- padding: 8px;
- }
- </style>
- </head>
- <body>
- <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>
- <li>
- <label>
- <span id="insertComponentName" style="font-size: 30px; color: white;"></span>
- </label>
- </li>
- <li class="right">
- <a href="#" onclick="goBack()"><i class="fa fa-undo"></i> 返回</a>
- </li>
- <li class="right">
- <div style="cursor: pointer;" onclick="AddFavorite();"><i id="heart" class="fa fa-heart"></i><span id="favorite"> 加入清單</span></div>
- </li>
- </ul>
- </div>
- <div class="row">
- <div class="col-md-6">
- <div class="tabs">
- <ul class="nav nav-tabs nav-justified">
- <li class="active">
- <a href="#content" data-toggle="tab" class="text-center">3D元件模型</a>
- </li>
- <li>
- <a href="#2D-TAB" data-toggle="tab" class="text-center">2D圖例</a>
- </li>
- </ul>
- <div class="tab-content">
- <div id="content" class="tab-pane active" style="width:100%; position: relative; padding: 0 0 0;">
- </div>
- <div id="2D-TAB" class="tab-pane" style="overflow: auto;">
- <img id="2DImage" style="width: 100%; aspect-ratio: 1 / 1;" onerror="this.src='./assets/images/not-found-2D-image.png'">
- </div>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <section class="panel">
- <div class="panel-body" style="padding: 0px;">
- <div class="table-responsive">
- <table class="table table-bordered mb-none">
- <tbody id="table">
- </tbody>
- </table>
- </div>
- </div>
- </section>
- <h3>尺寸:</h3>
- <section class="panel">
- <div class="panel-body" style="padding: 0px;">
- <div class="table-responsive">
- <table class="table table-bordered mb-none">
- <tbody id="sizeTable">
- </tbody>
- </table>
- </div>
- </div>
- </section>
- </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() {
- $.ajax({
- url: "./script/php/equipment_group_detail.php",
- type: "GET",
- data: {
- object: name,
- parent: parent
- },
- contentType: "application/json",
- dataType: "json"
- }).done(function(data) {
- header = data.header;
- value = data.value;
- sizeHeader = data.sizeHeader;
- sizeValue = data.sizeValue;
- for (var i = 0; i < header.length; i++) {
- if (value[i] == null)
- value[i] = "";
- if (header[i] == "元件版本")
- revitVersion = value[i];
- if (data.header[i] == "族群品類" || data.header[i] == "族群名稱" || data.header[i] == "類型名稱") {
- $('#table').append("<tr><td><div class='preview'>" + data.header[i] + "<img src='/Common/assets/images/" + data.header[i] + ".jpg' class='hide-image'></div></td><td><div>" + data.value[i] + "</div></td></tr>");
- } else {
- $('#table').append("<tr><td><div>" + data.header[i] + "</div></td><td><div>" + data.value[i] + "</div></td></tr>");
- }
- }
- for (var i = 0; i < sizeHeader.length; i++) {
- if (value[i] == null)
- value[i] = "";
- if (data.sizeHeader[i] != "空" && data.sizeValue[i] != "空") {
- $('#sizeTable').append("<tr><td>" + data.sizeHeader[i] + "</td><td>" + data.sizeValue[i] + "</td></tr>");
- } else
- $('#sizeTable').append("<tr><td>無資料</td><td>無資料</td></tr>");
- }
- $("#insertComponentName").text(name);
- $("#2DImage").attr("src","./assets/glb/Revit元件/" + parent + "/" + name + ".PNG");
- }).error(function(error) {
- console.log(error.responseText);
- });
- $.ajax({
- url: "./script/php/addFavorite.php",
- type: "GET",
- data: {
- CheckFavorite: parent + "/" + name
- },
- contentType: "application/json",
- dataType: "json"
- }).done(function(data) {
- isFavorite = data;
- if (isFavorite) {
- $("#heart").css("color", "Tomato");
- $("#favorite").html('移出清單');
- } else {
- $("#heart").css("color", "white");
- $("#favorite").html('加入清單');
- }
- }).error(function(error) {
- console.log(error.responseText);
- });
- });
- $(".nav-parent").each(function() {
- var parents = [];
- var lastIndex = parent.lastIndexOf("/");
- if (parent.slice(0, lastIndex) == $(this).context.children[0].outerHTML.split('"')[3]) {
- parents = parent.split("/");
- $(this).context.classList.add("nav-expanded");
- var temp = $(this).context.parentNode.parentNode;
- for (var i = 0; i < parents.length - 1; i++) {
- temp.classList.add("nav-expanded");
- temp = temp.parentNode.parentNode;
- }
- }
- });
- $(".dropdown-btn, .menu-item").each(function() {
- if ($(this).css("background").includes("rgb(0, 136, 204)")) {
- $(this).css("background", "rgba(0,0,0,0)");
- }
- });
- $(".menu-item").each(function() {
- if ($(this).context.outerHTML.includes(parent)) {
- $(this).css("background", "#0088cc");
- }
- });
- function goBack() {
- window.location.href = "component-list.php?parent=" + parent;
- }
- $(".dropdown-btn").each(function() {
- $(this).context.href = "component-list.php?parent=" + $(this).context.innerText;
- });
- function AddFavorite() {
- var stack_bar_top = {
- "dir1": "down",
- "dir2": "right",
- "push": "top",
- "spacing1": 0,
- "spacing2": 0
- };
- if (isFavorite) {
- $.ajax({
- url: "./script/php/addFavorite.php",
- type: "POST",
- data: {
- DelFavorite: parent + "/" + name,
- username: userName
- }
- }).done(function(data) {
- var notice = new PNotify({
- title: '通知',
- text: '移出清單成功!',
- type: 'success',
- addclass: 'stack-bar-top',
- stack: stack_bar_top,
- width: "100%"
- });
- isFavorite = false;
- $("#heart").css("color", "white");
- $("#favorite").html('加入清單');
- }).error(function(error) {
- var notice = new PNotify({
- title: '通知',
- text: '移出清單失敗!',
- type: 'error',
- addclass: 'stack-bar-top',
- stack: stack_bar_top,
- width: "100%"
- });
- console.log(error);
- });
- } else {
- $.ajax({
- url: "./script/php/addFavorite.php",
- type: "POST",
- data: {
- AddFavorite: parent + "/" + name,
- username: userName,
- revitVersion: revitVersion
- }
- }).done(function(data) {
- var notice = new PNotify({
- title: '通知',
- text: '加入清單成功!',
- type: 'success',
- addclass: 'stack-bar-top',
- stack: stack_bar_top,
- width: "100%"
- });
- isFavorite = true;
- $("#heart").css("color", "Tomato");
- $("#favorite").html('移出清單');
- }).error(function() {
- var notice = new PNotify({
- title: '通知',
- text: '加入清單失敗!',
- type: 'error',
- addclass: 'stack-bar-top',
- stack: stack_bar_top,
- width: "100%"
- });
- });
- }
- }
- </script>
- <!-- Vendor -->
- <script src="script/js/3Dpic-detail.js" type="module" async></script>
- </body>
- </html>
|