調整環境變數設定 | Alert 維運單號 的下拉式選項、調整AlertSubList組件的子系統過濾邏輯 | 修改報表管理的搜尋日期 | 首頁調理桶加 AI 資訊
This commit is contained in:
parent
fe1570e63b
commit
92e9990c1f
@ -1,3 +1,4 @@
|
||||
VITE_API_BASEURL = "https://pccv-api.production.mjmtech.com.tw"
|
||||
# VITE_API_BASEURL = "http://192.168.0.219:8010/"
|
||||
VITE_FILE_API_BASEURL = ""
|
||||
VITE_FORGE_BASEURL = "http://localhost:5173"
|
||||
@ -55,7 +55,7 @@ const getModalCompanyList = async () => {
|
||||
|
||||
const getAllOptions = async () => {
|
||||
Promise.all([getModalUserList(), getModalCompanyList()]).then(
|
||||
([devices, users, companies]) => {
|
||||
([users, companies]) => {
|
||||
model_data.value.model_userList = users;
|
||||
model_data.value.model_companyList = companies;
|
||||
}
|
||||
@ -120,6 +120,10 @@ watch(
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getAllOptions();
|
||||
});
|
||||
|
||||
provide("alert_modal", { model_data, search, updateEditRecord });
|
||||
provide("alert_table", {
|
||||
openModal,
|
||||
|
||||
@ -9,14 +9,13 @@ const { items, changeActiveBtn, setItems, selectedBtn } = useActiveBtn();
|
||||
const store = useBuildingStore();
|
||||
|
||||
const updateSubSystemsFromStore = () => {
|
||||
const subSystems = store.subSys
|
||||
.filter(subSystem => subSystem.is_alarm === 1)
|
||||
.map(subSystem => ({
|
||||
const filtered = store.subSys.filter(subSystem => subSystem.is_alarm === 1);
|
||||
const subSystems = filtered.map((subSystem, idx) => ({
|
||||
title: subSystem.full_name,
|
||||
key: subSystem.sub_system_tag,
|
||||
active: searchParams.value?.subSys_id
|
||||
? searchParams.value.subSys_id === subSystem.sub_system_tag
|
||||
: subSystem.sub_system_tag == "DP",
|
||||
: idx === 0,
|
||||
}));
|
||||
setItems(subSystems);
|
||||
};
|
||||
|
||||
@ -12,6 +12,12 @@ const tabs = [
|
||||
{ label: "AI" },
|
||||
];
|
||||
const activeTab = ref(tabs[0].label);
|
||||
|
||||
// 圖片顯示切換
|
||||
const showImages = ref(false);
|
||||
function toggleImages() {
|
||||
showImages.value = !showImages.value;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="card bg-slate-200 text-accent-content rounded-md w-[25rem]">
|
||||
@ -172,6 +178,44 @@ const activeTab = ref(tabs[0].label);
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'AI'">
|
||||
<template v-if="!showImages">
|
||||
<ul class="leading-7 tracking-wider text-slate-700 px-2">
|
||||
<li><b>訊息:</b> {{ pot.ai?.message }}</li>
|
||||
<li><b>模型推理燈號:</b> {{ pot.ai?.light }}</li>
|
||||
<li><b>軟水補料量:</b> {{ pot.ai?.abC_000 }}</li>
|
||||
<li><b>原醋補料量:</b> {{ pot.ai?.abC_002 }}</li>
|
||||
<li><b>液糖補料量:</b> {{ pot.ai?.r003 }}</li>
|
||||
<li>
|
||||
<b>圖片:</b>
|
||||
<button
|
||||
v-if="pot.ai?.images?.length > 0"
|
||||
class="btn btn-xs btn-info ms-2"
|
||||
@click="toggleImages"
|
||||
>
|
||||
查看圖片
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="flex gap-2 px-2 py-2 overflow-x-auto mb-8">
|
||||
<img
|
||||
v-for="(img, idx) in pot?.ai?.images"
|
||||
:key="idx"
|
||||
:src="img"
|
||||
alt="AI圖片"
|
||||
class="w-28 object-contain border border-slate-300 rounded"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
class="btn btn-xs btn-info mt-2 absolute right-3 bottom-3"
|
||||
@click="toggleImages"
|
||||
>
|
||||
返回資訊
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -98,6 +98,14 @@ const submit = async (e, type = "") => {
|
||||
e?.preventDefault?.();
|
||||
e?.stopPropagation?.();
|
||||
|
||||
// 搜尋邏輯
|
||||
searchState.value.start_date = dayjs(dateRange.value[0].value).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
searchState.value.end_date = dayjs(dateRange.value[1].value).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
|
||||
const key = selectedBtn.value?.key;
|
||||
if (!key) return;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user