From 8c7c3ea7d62bd67aeb7cc645034ea296a485291b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E5=B8=85?= Date: Tue, 23 Aug 2022 11:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=BC=80=E5=8F=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Online/components/OnlineSupervision.tsx | 82 +++++---- .../Online/components/ReservedItems.tsx | 161 +++++++++--------- src/pages/VideoMonitor/Post/index.tsx | 87 +++++----- src/pages/VideoMonitor/Post/service.ts | 11 -- src/pages/VideoMonitor/ViewModal.tsx | 2 +- .../VideoMonitor/{Online => }/service.ts | 2 +- 6 files changed, 161 insertions(+), 184 deletions(-) delete mode 100644 src/pages/VideoMonitor/Post/service.ts rename src/pages/VideoMonitor/{Online => }/service.ts (66%) diff --git a/src/pages/VideoMonitor/Online/components/OnlineSupervision.tsx b/src/pages/VideoMonitor/Online/components/OnlineSupervision.tsx index 1cd872c..c10aea3 100644 --- a/src/pages/VideoMonitor/Online/components/OnlineSupervision.tsx +++ b/src/pages/VideoMonitor/Online/components/OnlineSupervision.tsx @@ -4,7 +4,7 @@ import { Button, Spin, message } from 'antd'; import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; import ViewModal from '../../ViewModal'; -import { getPage } from '../service'; +import { getPage } from '../../service'; interface ViewDetailsProps { entity?: { @@ -18,7 +18,6 @@ interface ViewDetailsProps { * @returns */ const OnlineSupervision: React.FC<{}> = () => { - const [spin, spinSet] = useState(false); const [visible, setVisible] = useState(false); const [record, setRecord] = useState([]); @@ -47,7 +46,6 @@ const OnlineSupervision: React.FC<{}> = () => { } const columns: ProColumns[] = [ - { valueType: 'index', align: 'center', @@ -63,52 +61,61 @@ const OnlineSupervision: React.FC<{}> = () => { { title: '项目编号', align: 'center', - dataIndex: 'projectNumber', + dataIndex: 'projectNum', hideInSearch: true, }, { title: '标段', align: 'center', - dataIndex: 'sectionName', + dataIndex: 'packageNames', hideInSearch: true, }, { title: '评审室名称', align: 'center', - dataIndex: 'reviewRoomName', + dataIndex: 'areaName', hideInSearch: false, width: '10%', }, { title: '预计评标开始时间', align: 'center', - dataIndex: 'startTime', + dataIndex: 'reserveStartDate', hideInSearch: true, width: '15%', }, { title: '预计评标结束时间', align: 'center', - dataIndex: 'endTime', + dataIndex: 'reserveEndDate', hideInSearch: true, width: '9.5%', }, { title: '状态', align: 'center', - dataIndex: 'state', + dataIndex: 'status', hideInSearch: true, width: '4.5%', valueEnum: { - 0: { - text: '未开始' + '-1': { + text: '待确认' }, - 1: { - text: '评标中' + '0': { + text: '未开启' }, - 2: { + '1': { + text: '进行中' + }, + '2': { text: '已结束' }, + '3': { + text: '已取消' + }, + '4': { + text: '结束未使用' + }, } }, { @@ -154,34 +161,25 @@ const OnlineSupervision: React.FC<{}> = () => { search={{ labelWidth: 'auto', span: 6 }} loading={false} request={async (params) => { - // spinSet(true); - // return await getPage({ - // ...params, - // basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, - // }).then((res) => { - // const result = { - // data: res.data.records, - // total: res.data.total, - // success: res.success, - // pageSize: res.data.size, - // current: res.data.current - // } - // return result; - // }).finally(() => { - // isNotEmpty(window.location.search) && history.push(window.location.pathname); - // spinSet(false); - // }) - return {data:[{projectName: '2022年中国联通集团大厦A1913会议室智能化改造项目', - projectNumber: 'SS25102022000211', - sectionName: '标段一', - reviewRoomName: '集团第一评审室', - state : 1, - startTime : '2022-07-13 12:30', - endTime : '2022-07-13 12:30'}], - total:1, - pageSize:10, - current:1} - + spinSet(true); + return await getPage({ + ...params, + basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, + queryType: 1, + areaRoomName: params.areaName + }).then((res) => { + const result = { + data: res.data.records, + total: res.data.total, + success: res.success, + pageSize: res.data.size, + current: res.data.current + } + return result; + }).finally(() => { + isNotEmpty(window.location.search) && history.push(window.location.pathname); + spinSet(false); + }) } } pagination={{ diff --git a/src/pages/VideoMonitor/Online/components/ReservedItems.tsx b/src/pages/VideoMonitor/Online/components/ReservedItems.tsx index 80a6f2f..4a40b4e 100644 --- a/src/pages/VideoMonitor/Online/components/ReservedItems.tsx +++ b/src/pages/VideoMonitor/Online/components/ReservedItems.tsx @@ -4,7 +4,7 @@ import { Button, Spin, Modal } from 'antd'; import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; import ViewModal from '../../ViewModal'; -import { getPage } from '../service'; +import { getPage } from '../../service'; /** * 预约项目列表 @@ -35,68 +35,76 @@ const ReservedItems: React.FC<{}> = () => { } const columns: ProColumns[] = [ - - { - valueType: 'index', - align: 'center', - hideInSearch: true, - }, - { - title: '项目名称', - align: 'center', - dataIndex: 'projectName', - width: '20%', - hideInSearch: false, - }, - { - title: '项目编号', - align: 'center', - dataIndex: 'projectNumber', - hideInSearch: true, - }, - { - title: '标段', - align: 'center', - dataIndex: 'sectionName', - hideInSearch: true, - }, - { - title: '评审室名称', - align: 'center', - dataIndex: 'reviewRoomName', - hideInSearch: false, - width: '10%', - }, - { - title: '预计评标开始时间', - align: 'center', - dataIndex: 'startTime', - hideInSearch: true, - width: '15%', - }, - { - title: '预计评标结束时间', - align: 'center', - dataIndex: 'endTime', - hideInSearch: true, - width: '9.5%', - }, + { + valueType: 'index', + align: 'center', + hideInSearch: true, + }, + { + title: '项目名称', + align: 'center', + dataIndex: 'projectName', + width: '20%', + hideInSearch: false, + }, + { + title: '项目编号', + align: 'center', + dataIndex: 'projectNum', + hideInSearch: true, + }, + { + title: '标段', + align: 'center', + dataIndex: 'packageNames', + hideInSearch: true, + }, + { + title: '评审室名称', + align: 'center', + dataIndex: 'areaName', + hideInSearch: false, + width: '10%', + }, + { + title: '预计评标开始时间', + align: 'center', + dataIndex: 'reserveStartDate', + hideInSearch: true, + width: '15%', + }, + { + title: '预计评标结束时间', + align: 'center', + dataIndex: 'reserveEndDate', + hideInSearch: true, + width: '9.5%', + }, { title: '状态', align: 'center', - dataIndex: 'state', + dataIndex: 'status', hideInSearch: true, width: '4.5%', valueEnum: { - 0: { - text: '未开始' + '-1': { + text: '待确认' }, - 1: { - text: '评标中' + '0': { + text: '未开启' }, - 2: { + '1': { + text: '进行中' + }, + '2': { text: '已结束' }, + '3': { + text: '已取消' + }, + '4': { + text: '结束未使用' + }, } }, { @@ -133,34 +141,25 @@ const ReservedItems: React.FC<{}> = () => { search={{ labelWidth: 'auto', span: 6 }} loading={false} request={async (params) => { - // spinSet(true); - // return await getPage({ - // ...params, - // basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, - // }).then((res) => { - // const result = { - // data: res.data.records, - // total: res.data.total, - // success: res.success, - // pageSize: res.data.size, - // current: res.data.current - // } - // return result; - // }).finally(() => { - // isNotEmpty(window.location.search) && history.push(window.location.pathname); - // spinSet(false); - // }) - return {data:[{projectName: '2022年中国联通集团大厦A1913会议室智能化改造项目', - projectNumber: 'SS25102022000211', - sectionName: '标段一', - reviewRoomName: '集团第一评审室', - state : 0, - startTime : '2022-07-13 12:30', - endTime : '2022-07-13 12:30'}], - total:1, - pageSize:10, - current:1} - + spinSet(true); + return await getPage({ + ...params, + basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, + queryType: 0, + areaRoomName: params.areaName + }).then((res) => { + const result = { + data: res.data.records, + total: res.data.total, + success: res.success, + pageSize: res.data.size, + current: res.data.current + } + return result; + }).finally(() => { + isNotEmpty(window.location.search) && history.push(window.location.pathname); + spinSet(false); + }) } } pagination={{ diff --git a/src/pages/VideoMonitor/Post/index.tsx b/src/pages/VideoMonitor/Post/index.tsx index 25d7c33..cf854b9 100644 --- a/src/pages/VideoMonitor/Post/index.tsx +++ b/src/pages/VideoMonitor/Post/index.tsx @@ -6,19 +6,11 @@ import { useHistory } from 'umi'; import ViewModal from '../ViewModal'; import { getPage } from '../service'; -interface ViewDetailsProps { - entity?: { - projectName?:string|null, - projectNumber?:string|null, - } | null, - visibleDefault?:boolean| false, -} /** * 事后监督列表 * @returns */ const PostSupervision: React.FC<{}> = () => { - const [spin, spinSet] = useState(false); const [visible, setVisible] = useState(false); const [record, setRecord] = useState([]); @@ -47,7 +39,6 @@ const PostSupervision: React.FC<{}> = () => { } const columns: ProColumns[] = [ - { valueType: 'index', align: 'center', @@ -63,52 +54,61 @@ const PostSupervision: React.FC<{}> = () => { { title: '项目编号', align: 'center', - dataIndex: 'projectNumber', + dataIndex: 'projectNum', hideInSearch: true, }, { title: '标段', align: 'center', - dataIndex: 'sectionName', + dataIndex: 'packageNames', hideInSearch: true, }, { title: '评审室名称', align: 'center', - dataIndex: 'reviewRoomName', + dataIndex: 'areaName', hideInSearch: false, width: '10%', }, { title: '预计评标开始时间', align: 'center', - dataIndex: 'startTime', + dataIndex: 'reserveStartDate', hideInSearch: true, width: '15%', }, { title: '预计评标结束时间', align: 'center', - dataIndex: 'endTime', + dataIndex: 'reserveEndDate', hideInSearch: true, width: '9.5%', }, { title: '状态', align: 'center', - dataIndex: 'state', + dataIndex: 'status', hideInSearch: true, width: '4.5%', valueEnum: { - 0: { - text: '未开始' + '-1': { + text: '待确认' }, - 1: { - text: '评标中' + '0': { + text: '未开启' }, - 2: { + '1': { + text: '进行中' + }, + '2': { text: '已结束' }, + '3': { + text: '已取消' + }, + '4': { + text: '结束未使用' + }, } }, { @@ -154,34 +154,25 @@ const PostSupervision: React.FC<{}> = () => { search={{ labelWidth: 'auto', span: 6 }} loading={false} request={async (params) => { - // spinSet(true); - // return await getPage({ - // ...params, - // basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, - // }).then((res) => { - // const result = { - // data: res.data.records, - // total: res.data.total, - // success: res.success, - // pageSize: res.data.size, - // current: res.data.current - // } - // return result; - // }).finally(() => { - // isNotEmpty(window.location.search) && history.push(window.location.pathname); - // spinSet(false); - // }) - return {data:[{projectName: '2022年中国联通集团大厦A1913会议室智能化改造项目', - projectNumber: 'SS25102022000211', - sectionName: '标段一', - reviewRoomName: '集团第一评审室', - state : 2, - startTime : '2022-07-13 12:30', - endTime : '2022-07-13 12:30'}], - total:1, - pageSize:10, - current:1} - + spinSet(true); + return await getPage({ + ...params, + basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize }, + queryType: 2, + areaRoomName: params.areaName + }).then((res) => { + const result = { + data: res.data.records, + total: res.data.total, + success: res.success, + pageSize: res.data.size, + current: res.data.current + } + return result; + }).finally(() => { + isNotEmpty(window.location.search) && history.push(window.location.pathname); + spinSet(false); + }) } } pagination={{ diff --git a/src/pages/VideoMonitor/Post/service.ts b/src/pages/VideoMonitor/Post/service.ts deleted file mode 100644 index 415ab84..0000000 --- a/src/pages/VideoMonitor/Post/service.ts +++ /dev/null @@ -1,11 +0,0 @@ -import request from '@/utils/request'; -/** - * 查询数据并分页 - * @param params - */ -export async function getPage(params?: any) { - return request('/api/biz-service-ebtp-project/v1/projectRecord/supervisor/getPage', { - method: 'POST', - data: params, - }); -} \ No newline at end of file diff --git a/src/pages/VideoMonitor/ViewModal.tsx b/src/pages/VideoMonitor/ViewModal.tsx index 5ac7e3b..cc7da17 100644 --- a/src/pages/VideoMonitor/ViewModal.tsx +++ b/src/pages/VideoMonitor/ViewModal.tsx @@ -108,7 +108,7 @@ const columns: ColumnsType = [ {data?.projectNumber} {data?.sectionName} - {data?.reviewRoomName} + {data?.areaRoomName} {getStateName(data?.state)} {data?.startTime} {data?.endTime} diff --git a/src/pages/VideoMonitor/Online/service.ts b/src/pages/VideoMonitor/service.ts similarity index 66% rename from src/pages/VideoMonitor/Online/service.ts rename to src/pages/VideoMonitor/service.ts index 415ab84..1777360 100644 --- a/src/pages/VideoMonitor/Online/service.ts +++ b/src/pages/VideoMonitor/service.ts @@ -4,7 +4,7 @@ import request from '@/utils/request'; * @param params */ export async function getPage(params?: any) { - return request('/api/biz-service-ebtp-project/v1/projectRecord/supervisor/getPage', { + return request('/api/biz-service-ebtp-evaluation//v1/eval/room/reserve/supervise/list', { method: 'POST', data: params, });