[Frontend] 系統監控 電梯系統 頁面串接 | 電梯框架建置

This commit is contained in:
dev01 2022-11-22 18:40:09 +08:00
parent 1f58f537a6
commit 46d335a123

View File

@ -4,7 +4,7 @@
height:520px;
}
table.elevator-build {
border: 1px double #000;
/*border: 1px double #000;*/
}
table.elevator-build td {
padding: 0.2rem 0.5rem;
@ -876,16 +876,24 @@
</div>
<script>
var floors = ["B2F", "B1F", "1F", "2F", "3F", "4F", "5F", "6F"]
$(function () {
setBuildFloor();
setBuildFloor(floors.length,3);
})
function setBuildFloor(floorCnt = 10,eleCnt = 3) {
let tbody = creEle("tbody");
//樓層從小到大
let rfloors = floors.reverse();
let eleCircle = creDiv(["elevator-circle"]);
//樓層表格建置
for (let f = 1; f <= floorCnt; f++) {
let tr = creEle("tr");
for (let e = 1; e <= eleCnt; e++) {
for (let e = 1; e <= eleCnt + 2; e++) {
let td = creEle("td");
if (e == 1) {
td.text(rfloors[f - 1]);
}
tr.append(td);
}
tbody.append(tr);
@ -893,9 +901,19 @@
$("#floorTable").html(tbody);
$("#floorTable tbody tr td").each((index, td) => {
$("#floorTable tbody tr").each((index, tr) => {
$(tr).find("td:eq(0)").css("border-left", "0");
$(tr).find("td:eq(-1)").css("border-right", "0");
if (index == 0) {
$(tr).find("td").each((index, td) => {
$(td).css("border-top", "0");
})
} else if (index == $("#floorTable tbody tr").length - 1) {
$(tr).find("td").each((index, td) => {
$(td).css("border-bottom", "0");
})
}
})