From d67ed9f9c91291f1fe49b117a02135761a6b58e5 Mon Sep 17 00:00:00 2001 From: hwj Date: Thu, 26 Feb 2026 10:52:40 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E9=85=8D=E6=96=B9=E5=BA=93-?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=BD=95=E5=85=A5=E5=8F=82=E6=95=B0-?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=8C=B9=E9=85=8D=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/FormulaLibraryDetailTabs.vue | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/views/formula/formulaLibrary/components/FormulaLibraryDetailTabs.vue b/src/views/formula/formulaLibrary/components/FormulaLibraryDetailTabs.vue index 0d5bf4b1..cac74e44 100644 --- a/src/views/formula/formulaLibrary/components/FormulaLibraryDetailTabs.vue +++ b/src/views/formula/formulaLibrary/components/FormulaLibraryDetailTabs.vue @@ -21,7 +21,11 @@ align="center" prop="dataUnit" width="120" - /> + > + + + > + + import { RecipePointRecordApi } from '@/api/iot/recipepointrecord' import { RecipeDeviceRecordApi } from '@/api/iot/recipeDeviceRecord' +import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit' defineOptions({ name: 'FormulaLibraryDetailTabs' }) @@ -156,6 +165,20 @@ const list = ref([]) const total = ref(0) const to = ref(0) +const unitList = ref([]) + +const ensureUnitList = async () => { + if (unitList.value.length > 0) return + unitList.value = await ProductUnitApi.getProductUnitSimpleList() +} + +const getUnitLabel = (dataUnit: unknown) => { + const id = String(dataUnit ?? '').trim() + if (!id) return '-' + const unit = unitList.value.find((u) => String(u.id) === id) + return unit?.name ?? id +} + const queryFormRef = ref() const queryParams = reactive({ pageNo: 1, @@ -192,6 +215,7 @@ const getList = async () => { } loading.value = true try { + await ensureUnitList() if (activeTab.value === 'manual') { const data = await RecipePointRecordApi.getRecipePointRecordPage(buildQueryParams()) list.value = data.list