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.
82 lines
2.9 KiB
82 lines
2.9 KiB
import { jsx as _jsx } from "react/jsx-runtime"; |
|
import { ProTable } from '@ant-design/pro-components'; |
|
import { getRiskPageList } from './action'; |
|
import React, { useMemo } from 'react'; |
|
import { urlEncodeParams, useRoutes } from '@component/utils'; |
|
import { Link } from 'react-router-dom'; |
|
import { riskGradeStatus } from './constans'; |
|
export default function ({ riskUrl }) { |
|
const { paramsParse, historyPush } = useRoutes(); |
|
const columns = useMemo(() => [ |
|
{ |
|
title: '风险编号', |
|
dataIndex: 'riskNumber', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '风险名称', |
|
dataIndex: 'riskName', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '保单号', |
|
dataIndex: 'policyNumber', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '风险描述', |
|
dataIndex: 'riskContent', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '场所/部位', |
|
dataIndex: 'discoveredAddress', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '风险等级', |
|
dataIndex: 'riskGrade', |
|
ellipsis: true, |
|
search: false, |
|
render: (_, record) => riskGradeStatus.map((item, index) => { |
|
if (item.val == record.riskGrade) { |
|
return (_jsx("span", Object.assign({ style: { color: item.color } }, { children: item.text }), index)); |
|
} |
|
return null; |
|
}), |
|
}, |
|
{ |
|
title: '管控状态', |
|
dataIndex: 'status', |
|
ellipsis: true, |
|
search: false, |
|
render: (_, record) => record.status == '1' ? (_jsx("span", Object.assign({ style: { color: '#17a784' } }, { children: "\u5DF2\u7BA1\u63A7" }))) : record.status == '2' ? (_jsx("span", Object.assign({ style: { color: '#d9001b' } }, { children: "\u672A\u7BA1\u63A7" }))) : ('-'), |
|
}, |
|
{ |
|
title: '发现时间', |
|
dataIndex: 'discoveredAt', |
|
ellipsis: true, |
|
search: false, |
|
}, |
|
{ |
|
title: '操作', |
|
valueType: 'option', |
|
key: 'option', |
|
fixed: 'right', |
|
width: 80, |
|
align: 'center', |
|
render: (_, record) => (_jsx(Link, Object.assign({ to: `${riskUrl}${urlEncodeParams({ |
|
riskId: record === null || record === void 0 ? void 0 : record.riskId, |
|
})}` }, { children: "\u8BE6\u60C5" }))), |
|
}, |
|
]); |
|
return (_jsx(ProTable, { columns: columns, request: getRiskPageList, rowKey: "userId", toolBarRender: false, search: false, params: paramsParse, pagination: { |
|
pageSize: 10, |
|
showSizeChanger: false, |
|
} })); |
|
}
|
|
|