You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

125 lines
4.2 KiB

import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useMemo } from 'react';
import { ProTable } from '@ant-design/pro-components';
import { Button } from 'antd';
import { dateFormatter, useRoutes } from '@component/utils';
import { getDictValList } from './action';
import { dangerStatus } from './constants';
export function HiddenListWait({ getTableList, type, run }) {
const { historyPush } = useRoutes();
const waitColumns = useMemo(() => [
{
title: '隐患描述',
dataIndex: 'description',
search: false,
width: 300,
},
{
title: '保单号',
// dataIndex: 'policyNumber',
hideInTable: type,
search: type && type !== 'expert',
dataIndex: 'policyNumber',
ellipsis: true,
order: 3,
fieldProps: {
placeholder: '请输入保单号',
},
formItemProps: {
name: 'policyNumber',
},
},
{
title: '被服务对象',
dataIndex: 'customerName',
ellipsis: true,
order: 4,
fieldProps: {
placeholder: '请输入隐患/被服务对象名称',
},
formItemProps: { label: '关键字', name: 'keyword' },
},
{
title: '隐患类型',
dataIndex: 'classifyName',
ellipsis: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择隐患类型',
},
request: getDictValList,
params: { dictId: '20' },
formItemProps: {
name: 'classifyId',
},
},
{
title: '隐患等级',
dataIndex: 'hiddenTroubleGrade',
valueType: 'select',
fieldProps: {
placeholder: '请选择隐患等级',
},
formItemProps: {
name: 'hiddenTroubleGrade',
},
ellipsis: true,
order: 2,
render: (_, record) => dangerStatus.map((item, index) => {
if (item.value == record.hiddenTroubleGrade) {
return (_jsx("span", Object.assign({ style: { color: item.color } }, { children: item.text }), index));
}
return null;
}),
valueEnum: {
1: {
text: '一般隐患',
},
3: {
text: '重大隐患',
},
},
},
{
title: '最后提交时间',
dataIndex: 'changedAt',
ellipsis: true,
search: false,
renderText: dateFormatter,
},
{
title: '隐患发现时间',
dataIndex: 'discoveredAt',
ellipsis: true,
search: false,
renderText: dateFormatter,
},
{
title: '操作',
ellipsis: true,
valueType: 'option',
fixed: 'right',
width: 100,
render: (_, record) => type === 'expert' ? (_jsx(Button, Object.assign({ type: "link", onClick: () => {
historyPush('detail', {
hiddenDangerId: record.hiddenDangerId,
type: 'expert',
show: true,
});
} }, { children: "\u6574\u6539\u5BA1\u6838" }))) : (_jsx(Button, Object.assign({ type: "link", onClick: () => {
historyPush('detail', {
hiddenDangerId: record.hiddenDangerId,
show: true,
});
} }, { children: "\u5BA1\u6838" }))),
},
], []);
return (_jsx(_Fragment, { children: _jsx(ProTable, { columns: waitColumns, request: (params) => {
run(params);
return getTableList(params);
}, toolBarRender: false, params: { auditStatus: '1' }, tableClassName: "tableClassName",
// rowKey="policyNumber"
rowKey: "hiddenDangerId", pagination: {
pageSize: 10,
} }) }));
}