diff --git a/src/pages/ElecEvaluation/VideoMonitor/ViewModal.tsx b/src/pages/ElecEvaluation/VideoMonitor/ViewModal.tsx index 38f8f5b..6c576e8 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/ViewModal.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/ViewModal.tsx @@ -1,27 +1,28 @@ -import { Spin, Modal, Descriptions, Table, message } from 'antd'; -import type { ColumnsType } from 'antd/es/table'; +import { Spin, Modal, Descriptions, message, Button } from 'antd'; +// import type { ColumnsType } from 'antd/es/table'; import React, { useState, useImperativeHandle, forwardRef } from 'react'; import { getReservationInfo, getReportInfo } from './service'; +import ProTable from '@ant-design/pro-table'; interface ViewDetailsProps { modalVisible: boolean; //开启关闭控制 onCancel: () => void; //关闭方法传入 } -interface ReportInfo { - expertAmount ?: string; - purchaseExpertAmount ?: string; - manageAmount ?: string; - userList ?: DataType[]; -} +// interface ReportInfo { +// expertAmount ?: string; +// purchaseExpertAmount ?: string; +// manageAmount ?: string; +// userList ?: DataType[]; +// } -interface DataType { - key ?: string; - userName ?: string; - status: number; - reportStatus ?: string; - signDate ?: string; -} +// interface DataType { +// key ?: string; +// userName ?: string; +// status: number; +// reportStatus ?: string; +// signDate ?: string; +// } interface ReservationInfo { projectName ?: string; @@ -35,27 +36,49 @@ interface ReservationInfo { realEndDate ?: string; } -const columns: ColumnsType = [ +const columns: any = [ { title: '序号', - dataIndex: 'key', - key: 'key', - }, - { - title: '人员', - dataIndex: 'userName', - key: 'userName', - }, - { - title: '报到状态', - dataIndex: 'reportStatus', - key: 'reportStatus', - }, - { - title: '报到时间', - dataIndex: 'signDate', - key: 'signDate', - }, + valueType: 'index', + width: 80, + hideInSearch: true, + }, + { + title: '人员', + dataIndex: 'userName', + hideInSearch: true, + }, + { + title: '报道状态', + dataIndex: 'status', + hideInSearch: true, + valueEnum: { + 0: { text: '未报道' }, + 1: { text: '已报道' }, + }, + }, + { + title: '报道时间', + dataIndex: 'signDate', + valueType: 'dateTime', + hideInSearch: true, + }, + { + title: '签到状态', + dataIndex: 'loginStatus', + hideInSearch: true, + valueEnum: { + 1: { text: '未签到' }, + 2: { text: '已签到' }, + 3: { text: '已申请回避' }, + }, + }, + { + title: '签到时间', + dataIndex: 'loginDate', + valueType: 'dateTime', + hideInSearch: true, + }, ]; /** @@ -67,7 +90,7 @@ const columns: ColumnsType = [ const [initReservationInfo, setInitReservationInfo] = useState(false); const [initReportInfo, setInitReportInfo] = useState(false); const [reservationInfo, setReservationInfo] = useState(); - const [reportInfo, setReportInfo] = useState(); + const [reportInfo, setReportInfo] = useState({}); const InitData = (id:string) => { setInitReservationInfo(true); setInitReportInfo(true); @@ -88,19 +111,13 @@ const columns: ColumnsType = [ }); //获取报道信息 getReportInfo(id) - .then((res) => { + .then(res => { if (res.code == 200) { - let _data: DataType[] = res.data.userList; - _data?.forEach((item, index) =>{ - item.key = (index + 1).toString(); - item.reportStatus = getReportStatus(item.status); - }) setReportInfo(res.data); - }else{ + } else { message.error(res.message); } - }) - .catch(res => { + }).catch(res => { message.error(res.message); }) .finally(() => { @@ -134,18 +151,25 @@ const columns: ColumnsType = [ } return result; } - const getReportStatus = (state:number) => { - let result = ''; - switch(state){ - case 0: - result = '未报道'; - break; - case 1: - result = '已报道'; - break; - } - return result; - } + // const getReportStatus = (state:number) => { + // let result = ''; + // switch(state){ + // case 0: + // result = '未报道'; + // break; + // case 1: + // result = '已报道'; + // break; + // } + // return result; + // } + const renderFooter = () => { + return ( + <> + + + ); + } return ( = [ 详情 {reservationInfo?.projectName} } - footer={null} - width={1000} + footer={renderFooter()} + width={"60%"} > @@ -173,7 +197,13 @@ const columns: ColumnsType = [ {reportInfo?.manageAmount}人

报道信息

- + ) }) diff --git a/src/pages/ElecEvaluation/VideoMonitor/service.ts b/src/pages/ElecEvaluation/VideoMonitor/service.ts index 0f62e29..bd7f253 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/service.ts +++ b/src/pages/ElecEvaluation/VideoMonitor/service.ts @@ -25,7 +25,7 @@ export async function getPage(params?: any) { * @param params */ export async function getReportInfo(params?: string) { - return request('/api/biz-service-ebtp-evaluation/v1/eleceval/user/number/report/' + params, { + return request('/api/biz-service-ebtp-evaluation/v1/eleceval/expert/number/report/' + params, { method: 'GET' }); } \ No newline at end of file