Merge branch 'release_20230224' into 'master'

【生产】2.24版本同步到Master

See merge request eshop/fe_service_ebtp_frontend!175
This commit is contained in:
jl-zhoujl2
2023-02-27 00:51:18 +00:00
4 changed files with 78 additions and 63 deletions

View File

@ -1,6 +1,6 @@
import { Avatar, Dropdown, Menu, message, Modal } from 'antd';
import { DownOutlined, UserOutlined, UserSwitchOutlined, CarryOutOutlined, HomeOutlined, ImportOutlined } from '@ant-design/icons';
import React, { useEffect } from 'react';
import React, { useEffect, useRef } from 'react';
import moment from 'moment'
import { connect, history } from 'umi';
import { ConnectState } from '@/models/connect';
@ -8,11 +8,13 @@ import logo from '../../assets/logo.svg';
import './index.less';
import { getMenu, getLogout } from './services'
import { getSessionUserData } from "@/utils/session";
import { getToSecondUrl } from '@/pages/LoadingPage/service';
const GlobalHeaderRight: React.FC<{}> = (props) => {
// let className = styles.right;
let data = getSessionUserData();
const [dataMenu, setDataMenu] = React.useState<any>([]);
const urlRef = useRef(null);
const handelRole = (item: any) => {
sessionStorage.setItem('roleData', JSON.stringify(item));
sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode]));
@ -74,13 +76,23 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
</Menu>
);
useEffect(() => {
const getUrl = async () => {
const response = await getToSecondUrl();
if (response?.success) {
urlRef.current = response?.data;
}
}
getUrl();
}, [])
return (
<div className="top-menu">
<div className="left-logo">
<img src={logo} alt="" />
</div>
<ul className="right-btns">
{/* <li><ImportOutlined /><a onClick={()=>window.open(REACT_APP_MALL_V2_URL)}>交易平台2.0</a></li> */}
<li><ImportOutlined /><a onClick={() => { urlRef.current && window.open(urlRef.current); }}>2.0</a></li>
<li><HomeOutlined /><a onClick={() => history.push('/Dashboard')}></a></li>
<li><CarryOutOutlined />{moment().format("YYYY-MM-DD")}</li>
{data?.organizationName == null ? null : (<li><UserSwitchOutlined />{data?.organizationName}</li>)}

View File

@ -176,7 +176,7 @@ const MonitorException: React.FC<{}> = () => {
}
useEffect(() => {
if (auth.current) {
const params = { pageNo: 1, pageSize: 10 };
const params = { pageNo: 1, pageSize: 20 };
getNoOpenNumber();
getThreeDayNoEnd(params, 0);
getNoOpenList(params, 0);

View File

@ -487,7 +487,7 @@ export const ScrollTable = (props: { dataSource: any[], columns: any[], ynum?: n
// 只有当大于10条数据的时候 才会看起滚动
const v = document.getElementsByClassName("ant-table-body")[tableKey];
timer.current = setInterval(() => {
v.scrollTop += 0.5;
v.scrollTop += 1;
if (
Math.ceil(v.scrollTop) >= parseFloat((v.scrollHeight - v.clientHeight).toString())
) {
@ -1773,7 +1773,7 @@ const MonitorHome: React.FC<{}> = () => {
<ScreenLabel title="今日开标" extra={<span>&nbsp;&nbsp;{isNotEmpty(todayOpeningData?.sectionNumber) ? todayOpeningData?.sectionNumber : 0}&nbsp;&nbsp;&nbsp;&nbsp;{isNotEmpty(todayOpeningData?.sectionNumber) && todayOpeningData?.sectionNumber != "0" ? Number(((Number(todayOpeningData?.banner) / todayOpeningData?.sectionNumber) * 100).toFixed(0)) : 0}%&nbsp;&nbsp;&nbsp;&nbsp;{(isNotEmpty(todayInfoData?.sectionNumber) && todayInfoData?.sectionNumber != "0") ? Number(((Number(todayInfoData?.resultNumber) / todayInfoData?.sectionNumber) * 100).toFixed(0)) : 0}%</span>} />
</div>
<div className="scroll-table">
<ScrollTable dataSource={todayOpeningData?.todayList} columns={columns} rowKey="sectionId" ynum={266} />
<ScrollTable dataSource={todayOpeningData?.todayList} columns={columns} rowKey="sectionId" ynum={260} rowClassName="scroll-select-bg0" tableKey={0} isScroll />
</div>
<div className="monitor-label-pointer" onClick={() => { window.open("/ElecMonitor/Supplier") }}>
<ScreenLabel title="活跃供应商排名Top20" />

View File

@ -309,10 +309,10 @@ const Index: React.FC<{}> = () => {
}
const handleOk = () => { // 确定修改密码
if (changeForm.getFieldValue("newPassword") !== changeForm.getFieldValue("newPassword1")) {
message.warn('两次密码输入不一致,请重新输入')
} else {
changeForm.validateFields().then(res => {
changeForm.validateFields().then(res => {
if (changeForm.getFieldValue("newPassword") !== changeForm.getFieldValue("newPassword1")) {
message.warn('两次密码输入不一致,请重新输入')
} else {
setSping(true);
const date = {
identityCard: changeForm.getFieldValue("identityCard"),
@ -330,9 +330,9 @@ const Index: React.FC<{}> = () => {
}
}).finally(() => {
setSping(false);
});;
})
}
});
}
})
}
//浏览器类型
const BrowserType = () => {
@ -652,62 +652,65 @@ const Index: React.FC<{}> = () => {
<Form.Item
label="新密码"
name="newPassword"
// rules={[
// {
// required: true,
// validator: (rule, value, callback) => {
// const oNumber = new RegExp(/\d/);
// const oLetter = new RegExp(/[a-zA-Z]/);
// const oSpecial = '.~!@#$%^&*()_+=-{}|:<>?,./[]-;\\"';
// if (!value) {
// callback('请输入新密码');
// return;
// }
// if (value.length < 6) {
// callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
// return;
// }
// try {
// [...value].forEach(val => {
// if (
// !(
// oNumber.test(val) ||
// oLetter.test(val) ||
// oSpecial.indexOf(val) >= 0
// )
// ) {
// throw new Error();
// }
// });
// } catch (e) {
// callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
// }
// const contain: boolean[] = [];
// [...value].forEach(val => {
// if (oNumber.test(val)) {
// contain[0] = true;
// }
// if (oLetter.test(val)) {
// contain[1] = true;
// }
// if (oSpecial.indexOf(val) >= 0) {
// contain[2] = true;
// }
// });
// if (contain.filter(item => item === true).length < 2) {
// callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
// return;
// }
// callback();
// }
// }
// ]}
rules={[
{
required: true,
validator: (rule, value, callback) => {
const oNumber = new RegExp(/\d/);
const oLetter = new RegExp(/[a-zA-Z]/);
const oSpecial = '.~!@#$%^&*()_+=-{}|:<>?,./[]-;\\"';
if (!value) {
callback('请输入新密码');
return;
}
if (value.length < 6) {
callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
return;
}
try {
[...value].forEach(val => {
if (
!(
oNumber.test(val) ||
oLetter.test(val) ||
oSpecial.indexOf(val) >= 0
)
) {
throw new Error();
}
});
} catch (e) {
callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
}
const contain: boolean[] = [];
[...value].forEach(val => {
if (oNumber.test(val)) {
contain[0] = true;
}
if (oLetter.test(val)) {
contain[1] = true;
}
if (oSpecial.indexOf(val) >= 0) {
contain[2] = true;
}
});
if (contain.filter(item => item === true).length < 2) {
callback('密码不能小于六位至少含字母、数字、特殊字符其中的2种');
return;
}
callback();
}
message: '请输入新密码',
}, {
pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[`~!@#$%^&*()\-_=+\\|[{}\];:'",<.>/?])[a-zA-Z0-9`~!@#$%^&*()\-_=+\\|[{}\];:'",<.>/?]{8,20}$/,
message: "密码不符合规则密码长度8-20位必须包含大小写字母、数字和特殊字符",
}
]}
// rules={[
// {
// required: true,
// message: '请输入新密码',
// },
// ]}
>
<Input.Password />
</Form.Item>