[Frontend]歷史資料月選擇及語系修改 | 告警系統棟別隱藏 $3

This commit is contained in:
Celeste 2023-10-04 15:10:38 +08:00
parent 22396c5736
commit cb9f14d136
3 changed files with 2375 additions and 2353 deletions

View File

@ -1050,6 +1050,9 @@
{
title: "棟別-樓層",
data: "buildingFloorName_zh",
render: (data) => {
return data.replace("$3", "");
},
},
{
title: "異常ID",

View File

@ -119,8 +119,25 @@
pageAct.hisBuiName = "";
hisFirst = true;
$(function () {
flatpickr(".selectDate", {});
flatpickr(".selectMonth", { dateFormat: "Y-m", });
flatpickr(".selectDate", {
locale: "zh_tw",
});
flatpickr(".selectMonth", {
dateFormat: "Y-m",
locale: "zh_tw",
onMonthChange: (selectedDates, dateStr, instance) => {
const curMon = new Date(
`${instance.currentYear}-${instance.currentMonth + 1}`
);
instance.setDate(curMon);
},
onYearChange: (selectedDates, dateStr, instance) => {
const curMon = new Date(
`${instance.currentYear}-${instance.currentMonth + 1}`
);
instance.setDate(curMon);
},
});
let html = "";
for (let building of pageAct.buildList) {
html += `<label class="btn btn-secondary">
@ -450,7 +467,7 @@
new Date(new Date().setDate(new Date().getDate() + 1)),
"date"
);
$(".flatpickr-innerContainer").show();
if (type == "day" || type == "today" || type == "ytd") {
let date = type == "ytd" ? ytd : now;
$("#his_startdate").css("display", "block");
@ -495,6 +512,7 @@
$("#his_enddate").css("display", "none");
$("#getmonth").css("display", "block");
$("#getmonth").val(now.substr(0, 7));
$(".flatpickr-innerContainer").hide();
} else if (type == "ytd") {
$("#his_startdate").css("display", "block");
$("#his_enddate").css("display", "none");

View File

@ -821,6 +821,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
+ src/../jquery-snippets.js (core) -->
<!-- verdors.bundle.js 已含有 jquery Library v3.5.1-->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="https://npmcdn.com/flatpickr@4.6.13/dist/l10n/zh-tw.js"></script>
<script src="lib/vendors.bundle.js"></script>
<!-- toast 第三方套件 若 require 此套件只能用 define 使用,先暫時 html 引用-->
<script src="lib/notifications/toastr/toastr.min.js"></script>