style:模具组-维护-点检/保养-项目表单字段映射

main
黄伟杰 3 hours ago
parent 10e1b25761
commit 49f810c365

@ -423,7 +423,19 @@
</el-table-column>
<el-table-column :label="t('MoldManagement.MoldInspectionPlan.subjectCode')" align="center" prop="subjectCode" />
<el-table-column :label="t('MoldManagement.MoldInspectionPlan.subjectName')" align="center" prop="subjectName" />
<el-table-column :label="t('MoldManagement.MoldInspectionPlan.inspectionMethod')" align="center" prop="inspectionMethod" width="120" />
<el-table-column :label="t('MoldManagement.MoldInspectionPlan.inspectionMethod')" align="center" prop="inspectionMethod" width="120">
<template #default="scope">
<el-tag
effect="light"
:type="getTagType('Inspection_method', scope.row.inspectionMethod)"
:color="getTagColor('Inspection_method', scope.row.inspectionMethod)"
:style="getTagStyle('Inspection_method', scope.row.inspectionMethod)"
disable-transitions
>
{{ getTagLabel('Inspection_method', scope.row.inspectionMethod) }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="t('MoldManagement.MoldInspectionPlan.judgmentCriteria')" align="center" prop="judgmentCriteria" />
</el-table>
</div>
@ -472,6 +484,7 @@ import { MoldRepairApi, type MoldRepairVO } from '@/api/mold/moldrepair'
import { PlanMaintenanceApi } from '@/api/mold/planmaintenance'
import { getSimpleUserList, type UserVO } from '@/api/system/user'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { isHexColor } from '@/utils/color'
import { dateFormatter } from '@/utils/formatTime'
defineOptions({ name: 'MoldMaintainView' })
@ -582,6 +595,36 @@ const isReplaceNet = computed(() => maintainFormData.maintainType === 4)
const repairCodeDisabled = computed(() => repairFormData.isCode === true)
const failureLevelOptions = computed(() => getStrDictOptions(DICT_TYPE.FAILURE_LEVEL))
const getTagDict = (dictType: string, value: any) => {
const v = value === '' || value === null || value === undefined ? undefined : String(value)
if (!v) return undefined
return getStrDictOptions(dictType).find((d) => d.value === v)
}
const getTagLabel = (dictType: string, value: any) => {
const found = getTagDict(dictType, value)
return found?.label ?? (value ?? '')
}
const getTagType = (dictType: string, value: any) => {
const found = getTagDict(dictType, value)
const type = found?.colorType
if (type + '' === 'primary' || type + '' === 'default') return '' as any
return (type ?? '') as any
}
const getTagColor = (dictType: string, value: any) => {
const found = getTagDict(dictType, value)
if (found?.cssClass && isHexColor(found.cssClass)) return found.cssClass
return ''
}
const getTagStyle = (dictType: string, value: any) => {
const color = getTagColor(dictType, value)
if (!color) return ''
return 'color: #fff'
}
//
const maintainTypes = computed(() => [
{ value: 1, label: t('MoldManagement.MoldBrandPage.maintainTypeInspect'), icon: Search },

Loading…
Cancel
Save