調整環境變數設定 | 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 = "https://pccv-api.production.mjmtech.com.tw"
|
||||||
|
# VITE_API_BASEURL = "http://192.168.0.219:8010/"
|
||||||
VITE_FILE_API_BASEURL = ""
|
VITE_FILE_API_BASEURL = ""
|
||||||
VITE_FORGE_BASEURL = "http://localhost:5173"
|
VITE_FORGE_BASEURL = "http://localhost:5173"
|
||||||
@ -55,7 +55,7 @@ const getModalCompanyList = async () => {
|
|||||||
|
|
||||||
const getAllOptions = async () => {
|
const getAllOptions = async () => {
|
||||||
Promise.all([getModalUserList(), getModalCompanyList()]).then(
|
Promise.all([getModalUserList(), getModalCompanyList()]).then(
|
||||||
([devices, users, companies]) => {
|
([users, companies]) => {
|
||||||
model_data.value.model_userList = users;
|
model_data.value.model_userList = users;
|
||||||
model_data.value.model_companyList = companies;
|
model_data.value.model_companyList = companies;
|
||||||
}
|
}
|
||||||
@ -120,6 +120,10 @@ watch(
|
|||||||
{ immediate: true, deep: true }
|
{ immediate: true, deep: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getAllOptions();
|
||||||
|
});
|
||||||
|
|
||||||
provide("alert_modal", { model_data, search, updateEditRecord });
|
provide("alert_modal", { model_data, search, updateEditRecord });
|
||||||
provide("alert_table", {
|
provide("alert_table", {
|
||||||
openModal,
|
openModal,
|
||||||
|
|||||||
@ -9,15 +9,14 @@ const { items, changeActiveBtn, setItems, selectedBtn } = useActiveBtn();
|
|||||||
const store = useBuildingStore();
|
const store = useBuildingStore();
|
||||||
|
|
||||||
const updateSubSystemsFromStore = () => {
|
const updateSubSystemsFromStore = () => {
|
||||||
const subSystems = store.subSys
|
const filtered = store.subSys.filter(subSystem => subSystem.is_alarm === 1);
|
||||||
.filter(subSystem => subSystem.is_alarm === 1)
|
const subSystems = filtered.map((subSystem, idx) => ({
|
||||||
.map(subSystem => ({
|
title: subSystem.full_name,
|
||||||
title: subSystem.full_name,
|
key: subSystem.sub_system_tag,
|
||||||
key: subSystem.sub_system_tag,
|
active: searchParams.value?.subSys_id
|
||||||
active: searchParams.value?.subSys_id
|
? searchParams.value.subSys_id === subSystem.sub_system_tag
|
||||||
? searchParams.value.subSys_id === subSystem.sub_system_tag
|
: idx === 0,
|
||||||
: subSystem.sub_system_tag == "DP",
|
}));
|
||||||
}));
|
|
||||||
setItems(subSystems);
|
setItems(subSystems);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,12 @@ const tabs = [
|
|||||||
{ label: "AI" },
|
{ label: "AI" },
|
||||||
];
|
];
|
||||||
const activeTab = ref(tabs[0].label);
|
const activeTab = ref(tabs[0].label);
|
||||||
|
|
||||||
|
// 圖片顯示切換
|
||||||
|
const showImages = ref(false);
|
||||||
|
function toggleImages() {
|
||||||
|
showImages.value = !showImages.value;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="card bg-slate-200 text-accent-content rounded-md w-[25rem]">
|
<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"
|
||||||
:class="{
|
:class="{
|
||||||
'tab-active !bg-green-500 !text-white shadow-sm shadow-slate-800':
|
'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 }}
|
{{ tab.label }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-0">
|
<div class="p-0">
|
||||||
<div v-if="activeTab === '生產資訊'">
|
<div v-if="activeTab === '生產資訊'">
|
||||||
<ul class="leading-7 tracking-wider text-slate-700 px-2">
|
<ul class="leading-7 tracking-wider text-slate-700 px-2">
|
||||||
<li><b>品名:</b> {{ pot.productInfo?.product }}</li>
|
<li><b>品名:</b> {{ pot.productInfo?.product }}</li>
|
||||||
<li><b>鍋次:</b> 第{{ pot.productInfo?.batch || "__" }}鍋</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>
|
<li><b>狀態:</b> {{ pot.productInfo?.status }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="activeTab === '投料進度'">
|
<div v-else-if="activeTab === '投料進度'">
|
||||||
<div class="h-40 overflow-x-auto">
|
<div class="h-40 overflow-x-auto">
|
||||||
<table class="table table-sm table-pin-rows">
|
<table class="table table-sm table-pin-rows">
|
||||||
<thead>
|
<thead>
|
||||||
@ -77,7 +83,7 @@ const activeTab = ref(tabs[0].label);
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="activeTab === '品檢'">
|
<div v-else-if="activeTab === '品檢'">
|
||||||
<div class="h-40 overflow-x-auto">
|
<div class="h-40 overflow-x-auto">
|
||||||
<table class="table table-sm table-pin-rows whitespace-nowrap">
|
<table class="table table-sm table-pin-rows whitespace-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
@ -117,7 +123,7 @@ const activeTab = ref(tabs[0].label);
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="activeTab === '流量計'">
|
<div v-else-if="activeTab === '流量計'">
|
||||||
<div class="h-40 overflow-x-auto">
|
<div class="h-40 overflow-x-auto">
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
@ -145,7 +151,7 @@ const activeTab = ref(tabs[0].label);
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="activeTab === 'SIP'">
|
<div v-else-if="activeTab === 'SIP'">
|
||||||
<div class="">
|
<div class="">
|
||||||
<table class="table table-sm whitespace-nowrap">
|
<table class="table table-sm whitespace-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
@ -172,6 +178,44 @@ const activeTab = ref(tabs[0].label);
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -98,6 +98,14 @@ const submit = async (e, type = "") => {
|
|||||||
e?.preventDefault?.();
|
e?.preventDefault?.();
|
||||||
e?.stopPropagation?.();
|
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;
|
const key = selectedBtn.value?.key;
|
||||||
if (!key) return;
|
if (!key) return;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user