Merge branch 'feature/headquartersSetting' into feature/dockerSetting
This commit is contained in:
commit
e0440027d5
Binary file not shown.
|
Before Width: | Height: | Size: 552 KiB After Width: | Height: | Size: 217 KiB |
@ -45,17 +45,8 @@ export const getSystemEnergyCostGrowth = async (building_ids) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getUserList = async (params = {}) => {
|
export const getUserList = async (params = {}) => {
|
||||||
const {
|
|
||||||
page = 1,
|
|
||||||
pageSize = 9999999
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
const requestData = {
|
const res = await instance.post(GET_USER_API, {});
|
||||||
Page: page,
|
|
||||||
PageSize: pageSize
|
|
||||||
};
|
|
||||||
|
|
||||||
const res = await instance.post(GET_USER_API, requestData);
|
|
||||||
|
|
||||||
return apihandler(res.code, res.data, {
|
return apihandler(res.code, res.data, {
|
||||||
msg: res.msg,
|
msg: res.msg,
|
||||||
|
|||||||
@ -39,8 +39,8 @@ const authPages = computed(() =>
|
|||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
const getSubMonitorPage = async (building_guid) => {
|
const getSubMonitorPage = async (building_guid) => {
|
||||||
const res = await getAllSysSidebar(building_guid);
|
const res = await getAllSysSidebar(building_guid);
|
||||||
buildingStore.mainSubSys = res.data.history_Main_Systems;
|
buildingStore.mainSubSys = res?.data?.history_Main_Systems ?? [];
|
||||||
menu_array.value = res.data.history_Main_Systems;
|
menu_array.value = res?.data?.history_Main_Systems ?? [];
|
||||||
};
|
};
|
||||||
const getSubPage = async (system_type) => {
|
const getSubPage = async (system_type) => {
|
||||||
const res = await getSideBar(system_type);
|
const res = await getSideBar(system_type);
|
||||||
|
|||||||
@ -12,9 +12,9 @@ const { iotSchemaTag } = inject("asset_modal_options");
|
|||||||
|
|
||||||
// MQTT相關
|
// MQTT相關
|
||||||
const receivedMessages = ref([]); // 儲存接收到的訊息
|
const receivedMessages = ref([]); // 儲存接收到的訊息
|
||||||
const countdown = ref(60); // 倒計時初始為 60 秒
|
// const countdown = ref(60); // 倒計時初始為 60 秒
|
||||||
const hasStartedCountdown = ref(false); // 是否已開始倒數
|
// const hasStartedCountdown = ref(false); // 是否已開始倒數
|
||||||
let timer = null; // 記錄計時器
|
// let timer = null; // 記錄計時器
|
||||||
let mqttInterval = null;
|
let mqttInterval = null;
|
||||||
const mqttCardDataList = ref([]); // 顯示在畫面上的卡片資料
|
const mqttCardDataList = ref([]); // 顯示在畫面上的卡片資料
|
||||||
|
|
||||||
@ -56,11 +56,11 @@ const openModal = async () => {
|
|||||||
time: payload.time,
|
time: payload.time,
|
||||||
});
|
});
|
||||||
|
|
||||||
// ⬇第一次收到資料才開始倒數
|
// // ⬇第一次收到資料才開始倒數
|
||||||
if (!hasStartedCountdown.value) {
|
// if (!hasStartedCountdown.value) {
|
||||||
hasStartedCountdown.value = true;
|
// hasStartedCountdown.value = true;
|
||||||
startCountdown();
|
// startCountdown();
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
// console.log("已存在相同時間略過:", payload.time);
|
// console.log("已存在相同時間略過:", payload.time);
|
||||||
}
|
}
|
||||||
@ -73,26 +73,26 @@ const openModal = async () => {
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const startCountdown = () => {
|
// const startCountdown = () => {
|
||||||
countdown.value = 60;
|
// countdown.value = 60;
|
||||||
|
//
|
||||||
timer = setInterval(() => {
|
// timer = setInterval(() => {
|
||||||
if (countdown.value > 1) {
|
// if (countdown.value > 1) {
|
||||||
countdown.value--;
|
// countdown.value--;
|
||||||
} else {
|
// } else {
|
||||||
clearInterval(timer);
|
// clearInterval(timer);
|
||||||
timer = null;
|
// timer = null;
|
||||||
onCancel(); // 60秒結束自動關閉
|
// onCancel(); // 60秒結束自動關閉
|
||||||
}
|
// }
|
||||||
}, 1000);
|
// }, 1000);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const onCancel = async () => {
|
const onCancel = async () => {
|
||||||
// 清空資料與狀態
|
// 清空資料與狀態
|
||||||
receivedMessages.value = [];
|
receivedMessages.value = [];
|
||||||
mqttCardDataList.value = [];
|
mqttCardDataList.value = [];
|
||||||
countdown.value = 60;
|
// countdown.value = 60;
|
||||||
hasStartedCountdown.value = false;
|
// hasStartedCountdown.value = false;
|
||||||
|
|
||||||
mqtt_test.close();
|
mqtt_test.close();
|
||||||
|
|
||||||
@ -112,11 +112,11 @@ const onCancel = async () => {
|
|||||||
mqttInterval = null;
|
mqttInterval = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除倒數 Timer
|
// // 清除倒數 Timer
|
||||||
if (timer) {
|
// if (timer) {
|
||||||
clearInterval(timer);
|
// clearInterval(timer);
|
||||||
timer = null;
|
// timer = null;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
@ -212,15 +212,6 @@ const onSubmit = async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #modalAction>
|
<template #modalAction>
|
||||||
<div class="relative w-full flex justify-end items-center gap-12">
|
<div class="relative w-full flex justify-end items-center gap-12">
|
||||||
<!-- 資料出現後才顯示倒數計時,置中顯示 -->
|
|
||||||
<div
|
|
||||||
v-if="mqttCardDataList.length > 0"
|
|
||||||
class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center gap-2 text-sm"
|
|
||||||
>
|
|
||||||
<span>Auto close in</span>
|
|
||||||
<span>{{ countdown }}s</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="reset"
|
||||||
class="btn btn-outline-success"
|
class="btn btn-outline-success"
|
||||||
|
|||||||
@ -13,7 +13,7 @@ let intervalId = null;
|
|||||||
const getEnergyInfos = async () => {
|
const getEnergyInfos = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getEnergyInfo(store.selectedBuilding.building_guid);
|
const res = await getEnergyInfo(store.selectedBuilding.building_guid);
|
||||||
const apiData = res.data;
|
const apiData = res?.data || {};
|
||||||
|
|
||||||
energyData.value = [
|
energyData.value = [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user