Compare commits
2 Commits
c0006963db
...
18a3e7936c
Author | SHA1 | Date | |
---|---|---|---|
18a3e7936c | |||
391303809e |
@ -4,12 +4,14 @@ import LogoImg from '@/assets/img/logo.png';
|
||||
//导入菜单组件
|
||||
import Language from './Language';
|
||||
import User from './User';
|
||||
import MessageNotice from './MessageNotice';
|
||||
import './layout.less';
|
||||
const HeaderComponent: React.FC = () => {
|
||||
return (
|
||||
<div className="headerComponent">
|
||||
<img className="logo" src={LogoImg} alt="logo" />
|
||||
<div className="flex">
|
||||
<MessageNotice/>
|
||||
<Language />
|
||||
<User />
|
||||
</div>
|
||||
|
45
src/layouts/MessageNotice.tsx
Normal file
45
src/layouts/MessageNotice.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Badge, Tooltip } from 'antd';
|
||||
import { BellOutlined } from '@ant-design/icons';
|
||||
import { getCountMessage } from '@/servers/api/user';
|
||||
import { history } from 'umi';
|
||||
const MessageNotice: React.FC = () => {
|
||||
const [count, setCount] = useState<number>(0);
|
||||
const handleBellClick = () => {
|
||||
const activeKey = sessionStorage.getItem('activeKey') || '';
|
||||
if (activeKey === 'accountLogin') {
|
||||
history.push('/supplierMessage');
|
||||
} else {
|
||||
history.push('/backend/supplierNews');
|
||||
}
|
||||
setCount(0)
|
||||
};
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
// 拉未读数量
|
||||
(async () => {
|
||||
try {
|
||||
const res = await getCountMessage();
|
||||
// 兼容不同后端返回:res?.data 或 res?.count
|
||||
const c = res?.data ?? 0;
|
||||
if (alive) setCount(Number(c) || 0);
|
||||
} catch {
|
||||
if (alive) setCount(0);
|
||||
}
|
||||
})();
|
||||
return () => { alive = false; };
|
||||
}, []);
|
||||
|
||||
return count !== 0 ? (
|
||||
<Tooltip title="消息通知">
|
||||
<span onClick={handleBellClick} style={{ cursor: 'pointer' }} >
|
||||
<Badge count={count} overflowCount={99}>
|
||||
<BellOutlined style={{ fontSize: 18, cursor: 'pointer' }} />
|
||||
</Badge>
|
||||
</span>
|
||||
</Tooltip>
|
||||
) : null
|
||||
};
|
||||
|
||||
|
||||
export default MessageNotice;
|
@ -44,19 +44,6 @@ const LoginPage: React.FC = () => {
|
||||
|
||||
}, [activeKey]);
|
||||
|
||||
// 组件挂载时,检查是否有记住的用户名
|
||||
useEffect(() => {
|
||||
// const savedUser = localStorage.getItem('remember_user');
|
||||
// if (savedUser) {
|
||||
// const user = JSON.parse(savedUser);
|
||||
// form.setFieldsValue({
|
||||
// username: user.username,
|
||||
// password: user.password,
|
||||
// remember: true,
|
||||
// });
|
||||
// }
|
||||
}, [form]);
|
||||
|
||||
// 修改密码确认回调
|
||||
const handleChangePwd = async (values: { userId: string; newPassword: string; confirmPassword: string; }) => {
|
||||
try {
|
||||
@ -95,7 +82,7 @@ const LoginPage: React.FC = () => {
|
||||
} else {
|
||||
localStorage.removeItem('remember_user');
|
||||
}
|
||||
|
||||
sessionStorage.setItem('activeKey', activeKey)
|
||||
sessionStorage.setItem('token', loginRes.data.token);
|
||||
//存入供应商用户id
|
||||
if (activeKey === 'supplierLogin') {
|
||||
|
@ -22,6 +22,7 @@ interface coscoAccessSupplierLists {
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
orgName: string;
|
||||
reviewStatusText: string;
|
||||
approveStatusText: string;
|
||||
}
|
||||
@ -56,6 +57,7 @@ const ViewModal: React.FC<{
|
||||
<Spin spinning={loading}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
||||
<Descriptions.Item label="准入单位">{data.coscoAccessWork.orgName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
{data.coscoAccessSupplierList.map((item) => {
|
||||
|
@ -22,6 +22,7 @@ interface coscoAccessSupplierLists {
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
orgName: string;
|
||||
reviewStatusText: string;
|
||||
approveStatusText: string;
|
||||
}
|
||||
@ -56,6 +57,7 @@ const ViewModal: React.FC<{
|
||||
<Spin spinning={loading}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1}>
|
||||
<Descriptions.Item label="准入单位">{data.coscoAccessWork.orgName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
{data.coscoAccessSupplierList.map((item) => {
|
||||
|
@ -34,6 +34,7 @@ interface coscoAccessSupplierLists {
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
orgName: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
reviewStatusText: string;
|
||||
@ -72,6 +73,7 @@ const ViewModal: React.FC<{
|
||||
<Spin spinning={loading}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
||||
<Descriptions.Item label="准入单位">{data.coscoAccessWork.orgName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
{data.coscoAccessSupplierList.map((item) => {
|
||||
|
@ -133,6 +133,13 @@ const SupplierEntryReview: React.FC = () => {
|
||||
ellipsis: true,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '准入单位',
|
||||
dataIndex: 'orgName',
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '准入部门',
|
||||
dataIndex: 'deptName',
|
||||
@ -223,8 +230,8 @@ const SupplierEntryReview: React.FC = () => {
|
||||
<Form.Item name="accessType" label="准入方式">
|
||||
<AdmissionTypeSelect />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptId" label="准入部门">
|
||||
<AccessDepartmentSelect orgCategory='' />
|
||||
<Form.Item name="orgId" label="准入单位">
|
||||
<AccessDepartmentSelect />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="approveStatus" label="审批状态">
|
||||
|
@ -34,6 +34,7 @@ interface coscoAccessSupplierLists {
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
orgName: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
reviewStatusText: string;
|
||||
@ -74,6 +75,7 @@ const ViewModal: React.FC<{
|
||||
<Spin spinning={loading}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
||||
<Descriptions.Item label="准入单位">{data.coscoAccessWork.orgName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
{data.coscoAccessSupplierList.map((item) => {
|
||||
|
@ -34,6 +34,7 @@ interface coscoAccessSupplierLists {
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
deptName: string;
|
||||
orgName: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
reviewStatusText: string;
|
||||
@ -74,6 +75,7 @@ const ViewModal: React.FC<{
|
||||
<Spin spinning={loading}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
|
||||
<Descriptions.Item label="准入单位" >{data.coscoAccessWork.orgName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门" >{data.coscoAccessWork.deptName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
|
||||
|
@ -11,6 +11,8 @@ interface CategoryInfo {
|
||||
structure?: string;
|
||||
termOfValidity?: string;
|
||||
deptId?: string;
|
||||
applyOrgName?: string;
|
||||
orgName?: string;
|
||||
deptName?: string;
|
||||
categoryName?: string;
|
||||
area?: string;
|
||||
@ -74,6 +76,12 @@ const ViewModal: React.FC<{
|
||||
<Descriptions.Item label="有效期至">
|
||||
{categoryInfo?.termOfValidity || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="创建单位">
|
||||
{categoryInfo?.applyOrgName || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="所属单位">
|
||||
{categoryInfo?.orgName || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="负责部门">
|
||||
{categoryInfo?.deptName || '-'}
|
||||
</Descriptions.Item>
|
||||
|
@ -140,9 +140,7 @@ const ViewModal: React.FC<{
|
||||
<Descriptions.Item label="有效期至">
|
||||
{categoryInfo?.applyTime || '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="负责部门">
|
||||
{categoryInfo?.deptName || '-'}
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item label="区域">
|
||||
{categoryInfo?.area ? areaMap[categoryInfo.area] || categoryInfo?.area : '-'}
|
||||
</Descriptions.Item>
|
||||
|
@ -48,11 +48,11 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
// 可传查询条件 form.getFieldsValue()
|
||||
|
||||
const values = form.getFieldsValue();
|
||||
const { exitTheme, time, deptId } = values;
|
||||
const { time } = values;
|
||||
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
||||
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
||||
|
||||
const { code, data } = await getExitInfoPage({ supplierexitId: recordId, pageNo, pageSize, exitTheme, deptId, startTime, endTime });
|
||||
const { code, data } = await getExitInfoPage({ supplierexitId: recordId, pageNo, pageSize, ...values, startTime, endTime });
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||
@ -112,7 +112,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
<Form.Item name="exitTheme" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称" style={{ width: 150 }} allowClear maxLength={100} />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptId" label="发起单位">
|
||||
<Form.Item name="orgId" label="发起单位">
|
||||
<AccessDepartmentSelect placeholder={'请选择发起单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item name="time" label="退出时间">
|
||||
|
@ -48,11 +48,11 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
// 可传查询条件 form.getFieldsValue()
|
||||
|
||||
const values = form.getFieldsValue();
|
||||
const { exitTheme, time, deptId } = values;
|
||||
const { time } = values;
|
||||
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
||||
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
||||
|
||||
const { code, data } = await getExitInfoPage({ supplierexitId: recordId, pageNo, pageSize, exitTheme, deptId, startTime, endTime });
|
||||
const { code, data } = await getExitInfoPage({ supplierexitId: recordId, pageNo, pageSize, ...values, startTime, endTime });
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||
@ -112,7 +112,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
<Form.Item name="exitTheme" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称" style={{ width: 150 }} allowClear maxLength={100} />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptId" label="发起单位">
|
||||
<Form.Item name="orgId" label="发起单位">
|
||||
<AccessDepartmentSelect placeholder={'请选择发起单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item name="time" label="退出时间">
|
||||
|
@ -11,6 +11,14 @@ export async function getUserList(params: API.UserListRequest) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getCountMessage() {
|
||||
return request('/supplierMessage/getCountMessage', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取全国列表
|
||||
* @param params 查询参数
|
||||
|
Reference in New Issue
Block a user