| | |
| | | exportIndicator, |
| | | getIndicatorPage, |
| | | } from '#/api/mes/qc/indicator'; |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { DICT_TYPE, MesQcIndicatorItemType } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | import { $t } from '#/locales'; |
| | | |
| | |
| | | function getTypeLabel(type: number): string { |
| | | const item = typeDictOptions.find((d) => d.value === type); |
| | | return item?.label || String(type); |
| | | } |
| | | |
| | | function getItemTypeColor(itemType: number): string { |
| | | return itemType === MesQcIndicatorItemType.GROUP ? 'purple' : 'blue'; |
| | | } |
| | | |
| | | function getItemTypeLabel(itemType: number): string { |
| | | return itemType === MesQcIndicatorItemType.GROUP ? '分组项' : '录入项'; |
| | | } |
| | | |
| | | /** 刷新表格 */ |
| | |
| | | ]" |
| | | /> |
| | | </template> |
| | | <template #itemType="{ row }"> |
| | | <Tag v-if="row.itemType" :color="getItemTypeColor(row.itemType)"> |
| | | {{ getItemTypeLabel(row.itemType) }} |
| | | </Tag> |
| | | </template> |
| | | <template #parentName="{ row }"> |
| | | {{ row.parentName || '-' }} |
| | | </template> |
| | | <template #type="{ row }"> |
| | | <Tag v-if="row.type !== undefined && row.type !== null" :color="getTypeColor(row.type)"> |
| | | {{ getTypeLabel(row.type) }} |