// 安全问题记录表 import { connect } from "umi"; import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"; import { ActionType, FormInstance, ProTable } from "@ant-design/pro-components"; import { useEffect, useRef, useState } from "react"; import { handleGetPATROLList, handlGetPatrolSecurityList } from "./service"; import moment from 'moment' import { encryptAES } from "@/utils/handleAes"; import { Drawer } from "antd"; import OperationReport from './index' const securityIssueList = () => { const actionRef = useRef(); const formRef = useRef(); const [collapsible, setCollapsible] = useState(false) // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() // 行数据信息 const [currentRow, setCurrentRow] = useState() // 显示详情抽屉 const [showDetailDrawer, setShowDetailDrawer] = useState(false) const columns: any = [ { title: '巡检时间', dataIndex: 'search_date', valueType: 'dateRange', hideInTable: true, hideInDescriptions: true, search: { transform: (value: any) => { return { PATROL_DATE_Start: value[0], PATROL_DATE_End: value[1], }; }, }, fieldProps: { ranges: { "本月": [moment().startOf('M'), moment()], "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], } }, initialValue: [moment().startOf('M'), moment()], }, { title: "序号", dataIndex: 'index', valueType: 'index', hideInSearch: true, align: 'center', width: 80, ellipsis: true }, { title: "片区名称", dataIndex: 'SPREGIONTYPE_NAME', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "服务区名称", dataIndex: 'SERVERPART_NAME', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "责任单位名称", dataIndex: 'DUTYUNIT_NAME', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "巡检位置", dataIndex: 'PATROL_POSITION', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "巡查情况", dataIndex: 'PATROL_SITUATION', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "巡检内容", dataIndex: 'PATROLDETAIL_CONTENT', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "巡检结果", dataIndex: 'PATROLDETAIL_RESULT', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "异常描述", dataIndex: 'EXCEPTION_CONTENT', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "整改期限", dataIndex: 'RECTIFICATION_PERIOD', hideInSearch: true, align: 'center', width: 150, ellipsis: true }, { title: "整改结果", dataIndex: 'RECTIFICATION_RESULT', hideInSearch: true, align: 'center', width: 150, ellipsis: true } ] return (
{ if (!selectedId) { return { data: [], success: true } } const req: any = { SearchParameter: { SERVERPART_IDS: selectedId, PATROL_DATE_Start: params?.PATROL_DATE_Start || "", PATROL_DATE_End: params?.PATROL_DATE_End || "", }, PageIndex: 1, PageSize: 999999, } let newReq: any = { name: "", value: encryptAES(JSON.stringify(req)) } const data = await handlGetPatrolSecurityList(newReq) if (data && data.length > 0) { return { data, success: true } } return { data: [], success: true } }} toolbar={{ actions: [ ] }} />
) } export default connect(({ user }: ConnectState) => ({ currentUser: user.data }))(securityIssueList);