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"
- />
+ >
+
+ {{ getUnitLabel(scope.row?.dataUnit) }}
+
+
+ >
+
+ {{ getUnitLabel(scope.row?.dataUnit) }}
+
+
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