|
|
@@ -14,7 +14,6 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
var url_href = window.location.href;
|
|
|
var url = new URL(url_href);
|
|
|
name = url.searchParams.get("object");
|
|
|
- type = url.searchParams.get("type");
|
|
|
parent = url.searchParams.get("parent");
|
|
|
|
|
|
var userName = "<?php echo $_SESSION['name'] ?>";
|
|
|
@@ -70,7 +69,7 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
</label>
|
|
|
</li>
|
|
|
<li class="right">
|
|
|
- <a href="#" onclick="window.history.go(-1); return false;"><i class="fa fa-undo"></i> 返回</a>
|
|
|
+ <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>
|
|
|
@@ -86,15 +85,15 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
<a href="#content" data-toggle="tab" class="text-center">3D元件模型</a>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <a href="#2DImage" data-toggle="tab" class="text-center">2D圖例</a>
|
|
|
+ <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="2DImage" class="tab-pane" style="overflow: auto;">
|
|
|
-
|
|
|
+ <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>
|
|
|
@@ -139,11 +138,13 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
<?php include("bim-support-body.html"); ?>
|
|
|
<script>
|
|
|
$(document).ready(function() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$.ajax({
|
|
|
url: "./script/php/equipment_group_detail.php",
|
|
|
type: "GET",
|
|
|
data: {
|
|
|
- type: type,
|
|
|
object: name,
|
|
|
parent: parent
|
|
|
},
|
|
|
@@ -170,22 +171,14 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
for (var i = 0; i < sizeHeader.length; i++) {
|
|
|
if (value[i] == null)
|
|
|
value[i] = "";
|
|
|
- if (data.sizeHeader[i] != 0 && data.sizeValue[i] != 0) {
|
|
|
+ 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");
|
|
|
|
|
|
- $.ajax({
|
|
|
- url: "./assets/glb/Revit元件/Components/" + parent + "/" + type + "/" + name + ".PNG",
|
|
|
- success: function() {
|
|
|
- $("#2DImage").append("<img src='./assets/glb/Revit元件/Components/" + parent + "/" + type + "/" + name + ".PNG' style='width: 100%; aspect-ratio: 1 / 1;'>")
|
|
|
- },
|
|
|
- error: function() {
|
|
|
- $("#2DImage").append("<span>此元件沒有2D圖例</span>");
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
}).error(function(error) {
|
|
|
console.log(error.responseText);
|
|
|
@@ -195,7 +188,7 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
url: "./script/php/addFavorite.php",
|
|
|
type: "GET",
|
|
|
data: {
|
|
|
- CheckFavorite: parent + "/" + type + "/" + name
|
|
|
+ CheckFavorite: parent + "/" + name
|
|
|
},
|
|
|
contentType: "application/json",
|
|
|
dataType: "json"
|
|
|
@@ -214,24 +207,42 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
|
|
|
});
|
|
|
|
|
|
- for (var i = 0; i < jsonData.length; i++) {
|
|
|
- for (var j = 0; j < jsonData[i].children.length; j++) {
|
|
|
- $("a").each(function() {
|
|
|
- if (jsonData[i].category_name == parent) {
|
|
|
- if (jsonData[i].children[j].component_name == type) {
|
|
|
- var searchText = jsonData[i].children[j].component_name;
|
|
|
- var found;
|
|
|
-
|
|
|
- if ($(this).context.innerText == searchText && $(this).context.name == jsonData[i].category_name) {
|
|
|
- $(this).context.classList.add("highlight");
|
|
|
- $(this).context.parentNode.parentNode.parentNode.classList.add("nav-expanded");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ $(".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",
|
|
|
@@ -246,7 +257,7 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
url: "./script/php/addFavorite.php",
|
|
|
type: "POST",
|
|
|
data: {
|
|
|
- DelFavorite: parent + "/" + type + "/" + name,
|
|
|
+ DelFavorite: parent + "/" + name,
|
|
|
username: userName
|
|
|
}
|
|
|
}).done(function(data) {
|
|
|
@@ -277,7 +288,7 @@ include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_
|
|
|
url: "./script/php/addFavorite.php",
|
|
|
type: "POST",
|
|
|
data: {
|
|
|
- AddFavorite: parent + "/" + type + "/" + name,
|
|
|
+ AddFavorite: parent + "/" + name,
|
|
|
username: userName,
|
|
|
revitVersion: revitVersion
|
|
|
}
|