import React from 'react';
import { Button, Badge } from 'antd';
import { useNavigate } from 'react-router-dom';
import List from '@/components/Page/List';
import { getTaIssue } from '@/service/taissue';
import { getTdLocType } from '@/service/tdloctype';
import { getSysOrg } from '@/service/sysorg';
import { queryDict } from '@/utils/request';
import { processEnum, processStatus } from '@/utils/biz';
import { exportTaIssue } from '@/service/taissue';
import useBool from '@/utils/hooks/useBool';
const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
const today = (new Date()).toJSON().substring(0, 10);
export default (props) => {
const [loading, startLoading, stopLoading] = useBool();
const navigate = useNavigate();
const paramsRef = React.useRef();
const columns = [
{
title: "上报日期",
dataIndex: "createDate",
valueType: 'date',
hideInSearch: true,
},
{
title: "点位",
dataIndex: "locId",
valueType: 'select',
request: queryLocType,
},
{
title: "位置",
dataIndex: "addr",
hideInSearch: true,
},
{
title: "问题详情",
dataIndex: "content",
hideInSearch: true,
ellipsis: true,
},
{
title: "责任单位",
dataIndex: "orgId",
valueType: 'select',
request: queryOrg,
},
{
title: "流程状态",
dataIndex: "bizStatus",
valueType: 'select',
valueEnum: processEnum,
render: (_, row) => {
if (row.processNode != '03' && today >= row.expireDate) {
return ;
} else {
const st = processStatus.filter(x => x.value == row.processNode)[0];
return ;
}
}
},
{
title: "截止日期",
dataIndex: "expireDate",
hideInSearch: true,
}
];
const onExport = () => {
startLoading();
exportTaIssue(paramsRef.current).then(() => {
stopLoading();
}).catch(() => {
stopLoading();
});
}
const beforeSearchSubmit = (params) => {
paramsRef.current = params;
return params;
}
return (
[
]}
toolBarRender={() => [
(
)
]}
/>
)
}