|
|
|
|
@ -21,7 +21,11 @@
|
|
|
|
|
align="center"
|
|
|
|
|
prop="dataUnit"
|
|
|
|
|
width="120"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ getUnitLabel(scope.row?.dataUnit) }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.detailDeviceValueColumn')"
|
|
|
|
|
align="center"
|
|
|
|
|
@ -108,7 +112,11 @@
|
|
|
|
|
align="center"
|
|
|
|
|
prop="dataUnit"
|
|
|
|
|
width="140"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ getUnitLabel(scope.row?.dataUnit) }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.manualTableReferColumn')"
|
|
|
|
|
align="center"
|
|
|
|
|
@ -135,6 +143,7 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
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<RecipePointVO[]>([])
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
const to = ref(0)
|
|
|
|
|
|
|
|
|
|
const unitList = ref<ProductUnitVO[]>([])
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|