調整環境變數設定 | Alert 維運單號 的下拉式選項、調整AlertSubList組件的子系統過濾邏輯 | 修改報表管理的搜尋日期 | 首頁調理桶加 AI 資訊

This commit is contained in:
koko1108 2025-10-20 16:15:14 +08:00
parent fe1570e63b
commit 92e9990c1f
5 changed files with 73 additions and 17 deletions

View File

@ -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"

View File

@ -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,

View File

@ -9,15 +9,14 @@ const { items, changeActiveBtn, setItems, selectedBtn } = useActiveBtn();
const store = useBuildingStore();
const updateSubSystemsFromStore = () => {
const subSystems = store.subSys
.filter(subSystem => subSystem.is_alarm === 1)
.map(subSystem => ({
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",
}));
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
: idx === 0,
}));
setItems(subSystems);
};

View File

@ -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]">
@ -28,15 +34,15 @@ const activeTab = ref(tabs[0].label);
class="tab"
:class="{
'tab-active !bg-green-500 !text-white shadow-sm shadow-slate-800':
activeTab === tab.label,
activeTab === tab.label,
}"
@click.prevent="activeTab = tab.label"
@click.prevent="activeTab = tab.label"
>
{{ tab.label }}
</a>
</div>
<div class="p-0">
<div v-if="activeTab === '生產資訊'">
<div v-if="activeTab === '生產資訊'">
<ul class="leading-7 tracking-wider text-slate-700 px-2">
<li><b>品名:</b> {{ pot.productInfo?.product }}</li>
<li><b>鍋次:</b> {{ pot.productInfo?.batch || "__" }}</li>
@ -45,7 +51,7 @@ const activeTab = ref(tabs[0].label);
<li><b>狀態:</b> {{ pot.productInfo?.status }}</li>
</ul>
</div>
<div v-else-if="activeTab === '投料進度'">
<div v-else-if="activeTab === '投料進度'">
<div class="h-40 overflow-x-auto">
<table class="table table-sm table-pin-rows">
<thead>
@ -77,7 +83,7 @@ const activeTab = ref(tabs[0].label);
</table>
</div>
</div>
<div v-else-if="activeTab === '品檢'">
<div v-else-if="activeTab === '品檢'">
<div class="h-40 overflow-x-auto">
<table class="table table-sm table-pin-rows whitespace-nowrap">
<thead>
@ -117,7 +123,7 @@ const activeTab = ref(tabs[0].label);
</table>
</div>
</div>
<div v-else-if="activeTab === '流量計'">
<div v-else-if="activeTab === '流量計'">
<div class="h-40 overflow-x-auto">
<table class="table table-sm">
<thead>
@ -145,7 +151,7 @@ const activeTab = ref(tabs[0].label);
</table>
</div>
</div>
<div v-else-if="activeTab === 'SIP'">
<div v-else-if="activeTab === 'SIP'">
<div class="">
<table class="table table-sm whitespace-nowrap">
<thead>
@ -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>

View File

@ -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;