From 9b5b689e4523b87ada57363216df8af04e62ca74 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Tue, 15 Nov 2022 10:28:57 +0800 Subject: [PATCH] =?UTF-8?q?11.15=20=E7=94=B5=E5=AD=90=E8=AF=84=E6=A0=87?= =?UTF-8?q?=E5=AE=A4=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElecEvaluation/AbnormalAlarm/index.tsx | 5 +- .../AppointmentManage/index.tsx | 13 +- .../ElecEvalReserve/MyReserve.tsx | 5 +- .../ElecEvaluation/ElecEvalReserve/index.tsx | 7 +- .../EvalSiteManage/PersonReport/index.tsx | 3 +- .../SiteUser/components/GroupPermission.tsx | 169 ++++++++--------- .../SiteUser/components/UserPermission.tsx | 175 +++++++++--------- .../Online/components/OnlineSupervision.tsx | 5 +- .../Online/components/ReservedItems.tsx | 103 ++++++----- .../VideoMonitor/Post/index.tsx | 11 +- 10 files changed, 253 insertions(+), 243 deletions(-) diff --git a/src/pages/ElecEvaluation/AbnormalAlarm/index.tsx b/src/pages/ElecEvaluation/AbnormalAlarm/index.tsx index 5018166..6c1227b 100644 --- a/src/pages/ElecEvaluation/AbnormalAlarm/index.tsx +++ b/src/pages/ElecEvaluation/AbnormalAlarm/index.tsx @@ -3,6 +3,7 @@ import { message, PageHeader, Button, Spin } from 'antd'; import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table'; import { getPage, handleAlarm } from './service'; import ViewEvalAlarmUpdateModal from '../../Evaluation/BidControl/BidControlManager/components/ViewEvalAlarmUpdateModal'; +import { btnAuthority } from '@/utils/authority'; interface alarmData { @@ -82,10 +83,10 @@ const AbnormalAalarm: React.FC<{}> = () => { render: (_, record) => { if (record.type === "1") { if (record.status === "0") { - return + return !btnAuthority(["ebtp-site-supervision"]) && } } else { - return ( + return (!btnAuthority(["ebtp-site-supervision"]) && ) } } diff --git a/src/pages/ElecEvaluation/AppointmentManage/index.tsx b/src/pages/ElecEvaluation/AppointmentManage/index.tsx index e3a9a6a..b92e594 100644 --- a/src/pages/ElecEvaluation/AppointmentManage/index.tsx +++ b/src/pages/ElecEvaluation/AppointmentManage/index.tsx @@ -7,6 +7,7 @@ import MeetingReservation from '@/components/ElecBidEvaluation/MeetingReservatio import { getRecordData, getSiteList } from './service'; import { isEmpty } from '@/utils/CommonUtils'; import { getSessionRoleData } from '@/utils/session'; +import { btnAuthority } from '@/utils/authority'; const orange_bg = { background: '#ffbc83', color: '#333333', cursor: 'pointer', width: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }; const light_orange_bg = { background: '#faf7e5' }; @@ -45,7 +46,7 @@ const ScreenTable = (props: { record: any, onCellClick: (id: any) => void, refre onCell: (record) => { return { style: record[ite.id]?.iskssj ? orange_bg : light_orange_bg, - onClick: record[ite.id]?.iskssj ? () => onCellClick(record[ite.id]) : void 0, + onClick: !btnAuthority(["ebtp-appointment", "ebtp-site-admin"]) && record[ite.id]?.iskssj ? () => onCellClick(record[ite.id]) : void 0, } }, render: (_: any, record: any) => { @@ -86,14 +87,14 @@ const ScreenTable = (props: { record: any, onCellClick: (id: any) => void, refre
{tableData.length > 0 && (
- + {!btnAuthority(["ebtp-appointment", "ebtp-site-admin"]) && - + }
可预约{roleCode == "ebtp-appointment" ? "会议室" : "电子评标室"}
已预约{roleCode == "ebtp-appointment" ? "会议室" : "电子评标室"}
@@ -172,15 +173,15 @@ export default () => {
- + } {roleCode == "ebtp-appointment" ? (//预约人员 ) : ( - )} diff --git a/src/pages/ElecEvaluation/ElecEvalReserve/MyReserve.tsx b/src/pages/ElecEvaluation/ElecEvalReserve/MyReserve.tsx index 4e8d0f2..56a5a61 100644 --- a/src/pages/ElecEvaluation/ElecEvalReserve/MyReserve.tsx +++ b/src/pages/ElecEvaluation/ElecEvalReserve/MyReserve.tsx @@ -7,6 +7,7 @@ import { getURLInformation, isNotEmpty } from '@/utils/CommonUtils'; import MeetingReservation from '@/components/ElecBidEvaluation/MeetingReservation'; import moment from 'moment'; import { dateTimeFormatter } from '@/utils/DateUtils'; +import { btnAuthority } from '@/utils/authority'; const MyReserve: React.FC<{}> = () => { const meetingRelationRef = useRef(); //操作数据后刷新列表 @@ -139,7 +140,7 @@ const MyReserve: React.FC<{}> = () => { search: false, render: (text: any, record: any) => { return ( - <> + !btnAuthority(["ebtp-appointment"]) && <> @@ -211,7 +212,7 @@ const MyReserve: React.FC<{}> = () => { > {searchConfig?.searchText} , - @@ -254,7 +255,7 @@ const Index: React.FC<{}> = () => { search: false, render: (text: any, record: any) => { return ( - <> + !btnAuthority(["ebtp-site-admin"]) && <> @@ -392,7 +393,7 @@ const Index: React.FC<{}> = () => { > {searchConfig?.searchText} , - , - ], - }} +
+ - request={(params) => { - let trueParams = { - ...params, - pageNo: params.current, - } - return new Promise((resolve, reject) => { - getGroupPageList(trueParams).then(res => { - if (res.code === 200) { - resolve({ - data: res.data.records, - success: res.success, - total: res.data.total, - }) - } else { - resolve({ - data: [], - success: false, - total: 0, - }) + [ + ...dom.reverse(), + !btnAuthority(["ebtp-site-admin"]) && , + ], + }} + + request={(params) => { + let trueParams = { + ...params, + pageNo: params.current, } - }) - }); - }} - pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 - /> - {/* 新增及编辑Modal */} - { - isEditModalVisible ? - { - await saveSiteGroup(value).then((res: any) => { - if (res.success === true) { - message.success("保存成功!"); - setIsEditModalVisible(false); - setEditForm({}); - checkRelationRef.current?.reload(); + return new Promise((resolve, reject) => { + getGroupPageList(trueParams).then(res => { + if (res.code === 200) { + resolve({ + data: res.data.records, + success: res.success, + total: res.data.total, + }) + } else { + resolve({ + data: [], + success: false, + total: 0, + }) } - }); - }} - onCancel={() => { - setIsEditModalVisible(!isEditModalVisible); - setEditForm({}); - }} - > - : null - } - {/* 授权Modal */} - { - isAuthorizeModalVisible ? - { - setAuthorizeModalVisible(!isAuthorizeModalVisible); - setEditForm({}); - }} - > - : null - } + }) + }); + }} + pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 + /> + {/* 新增及编辑Modal */} + { + isEditModalVisible ? + { + await saveSiteGroup(value).then((res: any) => { + if (res.success === true) { + message.success("保存成功!"); + setIsEditModalVisible(false); + setEditForm({}); + checkRelationRef.current?.reload(); + } + }); + }} + onCancel={() => { + setIsEditModalVisible(!isEditModalVisible); + setEditForm({}); + }} + > + : null + } + {/* 授权Modal */} + { + isAuthorizeModalVisible ? + { + setAuthorizeModalVisible(!isAuthorizeModalVisible); + setEditForm({}); + }} + > + : null + } - +
); diff --git a/src/pages/ElecEvaluation/EvalSiteManage/SiteUser/components/UserPermission.tsx b/src/pages/ElecEvaluation/EvalSiteManage/SiteUser/components/UserPermission.tsx index f98e8ed..c81f220 100644 --- a/src/pages/ElecEvaluation/EvalSiteManage/SiteUser/components/UserPermission.tsx +++ b/src/pages/ElecEvaluation/EvalSiteManage/SiteUser/components/UserPermission.tsx @@ -4,6 +4,7 @@ import { getUserList, saveSiteUser, delSiteUser, getGroupList } from '../service import { Button, Form, message, Spin, Popconfirm } from 'antd'; import SiteUserModal from './SiteUserModal'; import AuthorizeModal from './AuthorizeModal'; +import { btnAuthority } from '@/utils/authority'; const UserPermission: React.FC<{}> = () => { @@ -65,7 +66,7 @@ const UserPermission: React.FC<{}> = () => { // 是否关联分组:0-否,1-是 if (record.groupStatus == '0') { return ( - <> + !btnAuthority(["ebtp-site-admin"]) && <> setFormVals(record)}>编辑 setAuthorize(record)}>授权管理 { delUser(record.id); }} okText="确定" cancelText="取消" > 删除 @@ -73,13 +74,13 @@ const UserPermission: React.FC<{}> = () => { ) } else if (record.groupStatus == '1') { return ( - <> + !btnAuthority(["ebtp-site-admin"]) && <> setFormVals(record)}>编辑 { delUser(record.id); }} okText="确定" cancelText="取消" > 删除 ) } else { - return(<>) + return (<>) } } }, @@ -142,94 +143,94 @@ const UserPermission: React.FC<{}> = () => { return ( <> -
- - - [ - ...dom.reverse(), - , - ], - }} +
+ - request={(params) => { - let trueParams = { - ...params, - pageNo: params.current, - } - return new Promise((resolve, reject) => { - getUserList(trueParams).then(res => { - if (res.code === 200) { - resolve({ - data: res.data.records, - success: res.success, - total: res.data.total, - }) - } else { - resolve({ - data: [], - success: false, - total: 0, - }) + [ + ...dom.reverse(), + !btnAuthority(["ebtp-site-admin"]) && , + ], + }} + + request={(params) => { + let trueParams = { + ...params, + pageNo: params.current, } - }) - }); - }} - pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 - /> - {/* 新增及编辑银行账号Modal */} - { - isEditModalVisible ? - { - await saveSiteUser(value).then((res: any) => { - if (res.success === true) { - message.success("保存成功!"); - setIsEditModalVisible(false); - setEditForm({}); - checkRelationRef.current?.reload(); + return new Promise((resolve, reject) => { + getUserList(trueParams).then(res => { + if (res.code === 200) { + resolve({ + data: res.data.records, + success: res.success, + total: res.data.total, + }) + } else { + resolve({ + data: [], + success: false, + total: 0, + }) } - }); - }} - onCancel={() => { - setIsEditModalVisible(!isEditModalVisible); - setEditForm({}); - }} - > - : null - } - {/* 授权Modal */} - { - isAuthorizeModalVisible ? - { - setAuthorizeModalVisible(!isAuthorizeModalVisible); - setEditForm({}); - }} - > - : null - } + }) + }); + }} + pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数 + /> + {/* 新增及编辑银行账号Modal */} + { + isEditModalVisible ? + { + await saveSiteUser(value).then((res: any) => { + if (res.success === true) { + message.success("保存成功!"); + setIsEditModalVisible(false); + setEditForm({}); + checkRelationRef.current?.reload(); + } + }); + }} + onCancel={() => { + setIsEditModalVisible(!isEditModalVisible); + setEditForm({}); + }} + > + : null + } + {/* 授权Modal */} + { + isAuthorizeModalVisible ? + { + setAuthorizeModalVisible(!isAuthorizeModalVisible); + setEditForm({}); + }} + > + : null + } - +
); diff --git a/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx b/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx index 303313e..210d64b 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx @@ -5,6 +5,7 @@ import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; import ViewModal from '../../ViewModal'; import { getPage } from '../../service'; +import { btnAuthority } from '@/utils/authority'; /** * 在线监督列表 @@ -115,7 +116,7 @@ const OnlineSupervision: React.FC<{}> = () => { width: '9%', render: (_: any, record: any) => ( - <> + !btnAuthority(["ebtp-site-supervision"]) && <>
- closeViewDetails()} ref = {viewModalRef}/> + closeViewDetails()} ref={viewModalRef} /> ) } diff --git a/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx b/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx index de82073..f114adb 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx @@ -1,10 +1,11 @@ import { isNotEmpty } from '@/utils/CommonUtils'; import ProTable, { ProColumns } from '@ant-design/pro-table'; -import { Button, Spin, message } from 'antd'; +import { Button, Spin, message, Card } from 'antd'; import React, { useRef, useState } from 'react'; import { useHistory } from 'umi'; import ViewModal from '../ViewModal'; import { getPage } from '../service'; +import { btnAuthority } from '@/utils/authority'; /** * 事后监督列表 @@ -117,7 +118,7 @@ const PostSupervision: React.FC<{}> = () => { width: '10%', render: (_: any, record: any) => ( - <> + !btnAuthority(["ebtp-after-supervision"]) && <>