import PageContent from '@/components/PageContent';
import { Table } from 'antd';
import dayjs from 'dayjs';
import ReactZmage from 'react-zmage';
import styles from './detail.less';
const {
DeviceCode,
DeviceName,
MaintainTime,
EvaluationScore,
Operators,
RustRemoval,
AntiCorrosive,
MaterialConsumption,
Fasten,
Clean,
Lubrication,
Check,
Note,
Files = [],
} = JSON.parse(localStorage.maintain || '{}');
export default function DeviceMaintainDetail() {
const columns = [
{
title: '保养资料',
dataIndex: 'Name',
render: (text, item) => {
return (
);
},
},
{
title: '创建时间',
dataIndex: 'CreatedTime',
render: (text) => {
return text ? dayjs(text).format('YYYY年MM月DD日 HH:mm:ss') : null;
},
},
];
function getUser(params) {
let arr = [];
if (!params) {
return;
} else {
return (arr = params
.map((item) => {
return item.Operator?.CName;
})
.join(','));
}
}
return (
{DeviceCode}
{DeviceName}
{getUser(Operators)}
{MaterialConsumption}
{MaintainTime}
{Lubrication === 1 ? '是' : '否'}
{Check === 1 ? '是' : '否'}
{Clean === 1 ? '是' : '否'}
{Fasten === 1 ? '是' : '否'}
{RustRemoval === 1 ? '是' : '否'}
{AntiCorrosive === 1 ? '是' : '否'}
{EvaluationScore * 100}
{Note?.split('|').map((item) => (
{item}
))}
);
}