43 lines
1.0 KiB
JavaScript
43 lines
1.0 KiB
JavaScript
import { ref, reactive } from 'vue'
|
|
import nx from '@/nx'
|
|
export const detailSchema = [
|
|
{ label: '设备名称', value: 'deviceName' },
|
|
{ label: '别名', value: 'alias' },
|
|
{ label: '设备型号', value: 'modelNo' },
|
|
{ label: '设备编码', value: 'deviceCode' },
|
|
{ label: '生产厂商', value: 'manufacturer' },
|
|
{ label: '使用班组', value: 'deptName' }
|
|
]
|
|
export const column = reactive([
|
|
{
|
|
label: '点检人',
|
|
name: 'checkUserName',
|
|
width: 200
|
|
},
|
|
{
|
|
label: '点检日期',
|
|
name: 'checkDate',
|
|
width: 200,
|
|
formatter: true
|
|
},
|
|
{
|
|
label: '备注',
|
|
name: 'content',
|
|
width: 200
|
|
},
|
|
{
|
|
name: 'operation',
|
|
type: 'operation',
|
|
label: '操作',
|
|
renders: [{ name: '详情', func: 'detail' }]
|
|
}
|
|
])
|
|
export function columnFormatter(row, column, rowIndex, columnIndex) {
|
|
// 判断是哪一列需要格式化
|
|
if (column.name === 'checkDate') {
|
|
return nx.$helper.formateToDateTime(row.checkDate)
|
|
}
|
|
// 对于不需要特殊格式化的列,返回原始值
|
|
return row[column.name]
|
|
}
|