4.23 项目监督管理限制特殊账号赋予公开项目权限

This commit is contained in:
jl-zhoujl2
2023-04-23 16:35:29 +08:00
parent a582655e85
commit 77dbb08f9c
4 changed files with 39 additions and 9 deletions

View File

@ -13,6 +13,7 @@ interface FavoritesListProps {
isPublic?: string | null, isPublic?: string | null,
current?: string | null, current?: string | null,
tabs: string | null, tabs: string | null,
publicShow: boolean,
} }
/** /**
* 监督项目收藏列表 * 监督项目收藏列表
@ -20,7 +21,7 @@ interface FavoritesListProps {
* @returns * @returns
*/ */
const FavoritesList: React.FC<FavoritesListProps> = (props) => { const FavoritesList: React.FC<FavoritesListProps> = (props) => {
const { projectName, bidMethodDict, current, businessModule, isPublic, tabs } = props const { projectName, bidMethodDict, current, businessModule, isPublic, tabs, publicShow } = props
const [spin, spinSet] = useState<boolean>(false); const [spin, spinSet] = useState<boolean>(false);
//查询分页数据 //查询分页数据
@ -122,7 +123,8 @@ const FavoritesList: React.FC<FavoritesListProps> = (props) => {
}, },
}, },
initialValue: tabs === 'favoritesList' ? isNotEmpty(isPublic) ? isPublic : null : null, initialValue: tabs === 'favoritesList' ? isNotEmpty(isPublic) ? isPublic : null : null,
hideInSearch: !publicShow,
hideInTable: !publicShow,
}, },
{ {
title: '操作', title: '操作',
@ -265,7 +267,7 @@ const FavoritesList: React.FC<FavoritesListProps> = (props) => {
}} }}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }} onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
rowKey={"id"} rowKey={"id"}
rowSelection={{ rowSelection={publicShow && {
columnWidth: '1px', columnWidth: '1px',
fixed: true, fixed: true,
selectedRowKeys: selectedRows, selectedRowKeys: selectedRows,

View File

@ -13,6 +13,7 @@ interface ProjectManageProps {
businessModule?: string | null, businessModule?: string | null,
isPublic?: string | null, isPublic?: string | null,
tabs: string | null, tabs: string | null,
publicShow: boolean,
} }
/** /**
* 项目管理列表 * 项目管理列表
@ -20,7 +21,7 @@ interface ProjectManageProps {
* @returns * @returns
*/ */
const ProjectManage: React.FC<ProjectManageProps> = (props) => { const ProjectManage: React.FC<ProjectManageProps> = (props) => {
const { projectName, bidMethodDict, current, businessModule, isPublic, tabs } = props const { projectName, bidMethodDict, current, businessModule, isPublic, tabs, publicShow } = props
const [spin, spinSet] = useState<boolean>(false); const [spin, spinSet] = useState<boolean>(false);
//查询分页数据 //查询分页数据
@ -108,7 +109,8 @@ const ProjectManage: React.FC<ProjectManageProps> = (props) => {
}, },
}, },
initialValue: tabs === 'projectList' ? isNotEmpty(isPublic) ? isPublic : null : null, initialValue: tabs === 'projectList' ? isNotEmpty(isPublic) ? isPublic : null : null,
hideInSearch: !publicShow,
hideInTable: !publicShow,
}, },
{ {
title: '操作', title: '操作',
@ -219,7 +221,7 @@ const ProjectManage: React.FC<ProjectManageProps> = (props) => {
}} }}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }} onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
rowKey={"id"} rowKey={"id"}
rowSelection={{ rowSelection={publicShow && {
columnWidth: '1px', columnWidth: '1px',
fixed: true, fixed: true,
selectedRowKeys: selectedRows, selectedRowKeys: selectedRows,

View File

@ -1,8 +1,10 @@
import { getURLInformation, getUrlParam, isNotEmpty } from '@/utils/CommonUtils'; import { getURLInformation, getUrlParam, isNotEmpty } from '@/utils/CommonUtils';
import { Card, Radio } from 'antd'; import { Card, Radio } from 'antd';
import React, { useState } from 'react'; import React, { useEffect, useState } from 'react';
import FavoritesList from './components/FavoritesList'; import FavoritesList from './components/FavoritesList';
import ProjectManage from './components/ProjectManage'; import ProjectManage from './components/ProjectManage';
import { getSessionRoleData, getSessionUserData } from '@/utils/session';
import { isViewPublic } from './service';
/** /**
* 监督项目管理 * 监督项目管理
* @returns * @returns
@ -22,11 +24,23 @@ const Index: React.FC<{}> = () => {
const tabs = getURLInformation("tabs"); const tabs = getURLInformation("tabs");
//radio value //radio value
const [mode, setMode] = useState<string>(isNotEmpty(tabs) ? String(tabs) : 'projectList'); const [mode, setMode] = useState<string>(isNotEmpty(tabs) ? String(tabs) : 'projectList');
//show public true-展示 false-不展示
const [publicShow, setPublicShow] = useState<boolean>(false);
const handleModeChange = (e: any) => { const handleModeChange = (e: any) => {
const mode = e.target.value; const mode = e.target.value;
setMode(mode); setMode(mode);
}; };
const showPublic = async () => {
const userId = getSessionUserData().userId;
const roleCode = getSessionRoleData().roleCode;
const params = { key: userId, role: roleCode };
const result = await isViewPublic(params);
setPublicShow(result?.data);
}
useEffect(() => {
showPublic();
}, [])
return ( return (
<Card style={{ borderRadius: 6 }} bodyStyle={{ padding: '16px 24px 0px' }}> <Card style={{ borderRadius: 6 }} bodyStyle={{ padding: '16px 24px 0px' }}>
@ -36,9 +50,9 @@ const Index: React.FC<{}> = () => {
</Radio.Group> </Radio.Group>
{ {
mode === 'projectList' ? ( mode === 'projectList' ? (
<ProjectManage projectName={projectName} bidMethodDict={bidMethodDict} current={current} businessModule={businessModule} isPublic={isPublic} tabs={tabs} /> <ProjectManage projectName={projectName} bidMethodDict={bidMethodDict} current={current} businessModule={businessModule} isPublic={isPublic} tabs={tabs} publicShow={publicShow} />
) : ( ) : (
<FavoritesList projectName={projectName} bidMethodDict={bidMethodDict} current={current} businessModule={businessModule} isPublic={isPublic} tabs={tabs} /> <FavoritesList projectName={projectName} bidMethodDict={bidMethodDict} current={current} businessModule={businessModule} isPublic={isPublic} tabs={tabs} publicShow={publicShow} />
) )
} }
</Card> </Card>

View File

@ -52,4 +52,16 @@ export async function toPublic(params: any) {
method: 'POST', method: 'POST',
data: params, data: params,
}); });
}
/**
* 是否展示公开项目
* @param params
* @returns
*/
export async function isViewPublic(params: any) {
return request('/api/biz-service-ebtp-extend/v1/userswitch/findUser', {
method: 'POST',
params
});
} }