issue
This commit is contained in:
parent
ca5c279ac0
commit
9577478e97
|
@ -23,6 +23,9 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
|
||||||
const [atPage, setAtPage] = useState(0);
|
const [atPage, setAtPage] = useState(0);
|
||||||
const [atUnreadList, setAtUnreadList] = useState([]);//未读@我列表
|
const [atUnreadList, setAtUnreadList] = useState([]);//未读@我列表
|
||||||
|
|
||||||
|
//记录用户点击的消息
|
||||||
|
const [clickItem, setClickItem] = useState(undefined);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
resetUserInfo();
|
resetUserInfo();
|
||||||
}, [noticeUnreadCount,atUnreadCount]);
|
}, [noticeUnreadCount,atUnreadCount]);
|
||||||
|
@ -150,24 +153,27 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
|
||||||
|
|
||||||
|
|
||||||
function changeReadMark(item) {
|
function changeReadMark(item) {
|
||||||
|
if (!clickItem || clickItem.id !== item.id){
|
||||||
if (item.type === "notification") {
|
if (item.type === "notification") {
|
||||||
let list = noticeUnreadList.slice();
|
let list = noticeUnreadList.slice();
|
||||||
let index = noticeUnreadList.indexOf(item);
|
let index = noticeUnreadList.indexOf(item);
|
||||||
list[index].status = 2;
|
if (list[index].status === 1 && noticeUnreadCount > 0) {
|
||||||
setNoticeUnreadList(list);
|
|
||||||
if (noticeUnreadCount > 0) {
|
|
||||||
setNoticeUnreadCount(noticeUnreadCount - 1);
|
setNoticeUnreadCount(noticeUnreadCount - 1);
|
||||||
}
|
}
|
||||||
|
list[index].status = 2;
|
||||||
|
setNoticeUnreadList(list);
|
||||||
} else if (item.type === "atme") {
|
} else if (item.type === "atme") {
|
||||||
let list = atUnreadList.slice();
|
let list = atUnreadList.slice();
|
||||||
let index = atUnreadList.indexOf(item);
|
let index = atUnreadList.indexOf(item);
|
||||||
list[index].status = 2;
|
if (list[index].status === 1 && atUnreadCount > 0) {
|
||||||
setAtUnreadList(list);
|
|
||||||
if (atUnreadCount > 0) {
|
|
||||||
setAtUnreadCount(atUnreadCount - 1);
|
setAtUnreadCount(atUnreadCount - 1);
|
||||||
}
|
}
|
||||||
|
list[index].status = 2;
|
||||||
|
setAtUnreadList(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setClickItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="messageHoverDiv notice01">
|
<div className="messageHoverDiv notice01">
|
||||||
|
@ -219,7 +225,7 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user:
|
||||||
{atUnreadList.map(item => {
|
{atUnreadList.map(item => {
|
||||||
return (
|
return (
|
||||||
<div key={item.id + Math.random()} className="noticeCont-back" onClick={() => { readItem(item) }}>
|
<div key={item.id + Math.random()} className="noticeCont-back" onClick={() => { readItem(item) }}>
|
||||||
<div className="noticeCont">
|
<div className={`noticeCont ${item.notification_url ? 'pointer' : ''}`}>
|
||||||
<span style={{ visibility: item.status === 1 ? 'visible' : 'hidden' }}>
|
<span style={{ visibility: item.status === 1 ? 'visible' : 'hidden' }}>
|
||||||
<Badge color="#FA2020" />
|
<Badge color="#FA2020" />
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -355,7 +355,7 @@ class order_form extends Component {
|
||||||
mdID={"order-new-description"}
|
mdID={"order-new-description"}
|
||||||
initValue={description}
|
initValue={description}
|
||||||
onChange={this.onContentChange}
|
onChange={this.onContentChange}
|
||||||
isCanAtme = {true}
|
isCanAtme = {form_type}
|
||||||
changeAtWhoLoginList = {this.changeAtWhoLoginList}
|
changeAtWhoLoginList = {this.changeAtWhoLoginList}
|
||||||
owner = {owner}
|
owner = {owner}
|
||||||
projectsId = {projectsId}
|
projectsId = {projectsId}
|
||||||
|
|
|
@ -38,11 +38,14 @@ function Register(props){
|
||||||
}).then((response)=>{
|
}).then((response)=>{
|
||||||
if(response.data && response.data.status === -6){
|
if(response.data && response.data.status === -6){
|
||||||
//验证码不正确
|
//验证码不正确
|
||||||
form.setFields({captcha: {value:values.captcha,errors:[new Error('验证码错误,请重新输入')]}})
|
form.setFields({captcha: {value:values.captcha,errors:[new Error('验证码错误,请重新输入')]}});
|
||||||
|
//设置邮箱内容-》不设置会被恢复成undefined,从而点击验证码失败
|
||||||
|
setEmailStr(values.email);
|
||||||
}else if(response.data && response.data.status === 0){
|
}else if(response.data && response.data.status === 0){
|
||||||
//注册成功,页面跳转即可,注册后登录流程forge处理了
|
//注册成功,页面跳转即可,注册后登录流程forge处理了
|
||||||
window.location.href = "/"+values.register_username;
|
window.location.href = "/"+values.register_username;
|
||||||
} else {
|
} else {
|
||||||
|
setEmailStr(values.email);
|
||||||
setMess(response.data.message);
|
setMess(response.data.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -134,6 +137,7 @@ function Register(props){
|
||||||
setCountDown(true);
|
setCountDown(true);
|
||||||
setGetCaptchaBut(false);
|
setGetCaptchaBut(false);
|
||||||
seconds.current = 60;
|
seconds.current = 60;
|
||||||
|
setSecondsStr(60);
|
||||||
!interval && clearInterval(interval);
|
!interval && clearInterval(interval);
|
||||||
interval = setInterval(() => {
|
interval = setInterval(() => {
|
||||||
if (seconds.current > 1) {
|
if (seconds.current > 1) {
|
||||||
|
|
|
@ -46,6 +46,8 @@ function ResetPassword(props) {
|
||||||
console.log('error',error);
|
console.log('error',error);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
//设置邮箱内容-》不设置会被恢复成undefined,从而点击验证码失败
|
||||||
|
setEmailStr(values.email);
|
||||||
const message = response.data.message;
|
const message = response.data.message;
|
||||||
message === "验证码不正确" ? form.setFields({captcha: {value:values.captcha,errors:[new Error('验证码错误,请重新输入')]}}) : setMess(message);
|
message === "验证码不正确" ? form.setFields({captcha: {value:values.captcha,errors:[new Error('验证码错误,请重新输入')]}}) : setMess(message);
|
||||||
}
|
}
|
||||||
|
@ -112,6 +114,7 @@ function ResetPassword(props) {
|
||||||
setCountDown(true);
|
setCountDown(true);
|
||||||
setGetCaptchaBut(false);
|
setGetCaptchaBut(false);
|
||||||
seconds.current = 60;
|
seconds.current = 60;
|
||||||
|
setSecondsStr(60);
|
||||||
!interval && clearInterval(interval);
|
!interval && clearInterval(interval);
|
||||||
interval = setInterval(() => {
|
interval = setInterval(() => {
|
||||||
if (seconds.current > 1) {
|
if (seconds.current > 1) {
|
||||||
|
|
|
@ -90,6 +90,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
||||||
const containerId = `mdEditor_${mdID}`;
|
const containerId = `mdEditor_${mdID}`;
|
||||||
const editorBodyId = `mdEditors_${mdID}`;
|
const editorBodyId = `mdEditors_${mdID}`;
|
||||||
const tipId = `e_tips_mdEditor_${mdID}`;
|
const tipId = `e_tips_mdEditor_${mdID}`;
|
||||||
|
const [init, setInit] = useState(true);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
//请求members接口获取全部可@列表
|
//请求members接口获取全部可@列表
|
||||||
|
@ -295,6 +296,17 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
||||||
|
|
||||||
const cmEl = editorInstance && editorInstance.cm
|
const cmEl = editorInstance && editorInstance.cm
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
//如果是复制issue则需要将原内容中的@谁录入 @列表中
|
||||||
|
if (init && cmEl && initValue && isCanAtme === "copy" && initValue.indexOf("@") !== -1) {
|
||||||
|
allUsers.map(item => {
|
||||||
|
initValue.indexOf(`[@${item.username}](/${item.login})`) !== -1 && selectAtWho(item.username);
|
||||||
|
})
|
||||||
|
setInit(false);
|
||||||
|
console.log('复制issue atWhoLoginList.current', atWhoLoginList.current, 'atWhoLoginListState', atWhoLoginListState);
|
||||||
|
}
|
||||||
|
}, [initValue])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(atWhoVisibleRef.current){
|
if(atWhoVisibleRef.current){
|
||||||
// 添加上下键、enter键监听事件
|
// 添加上下键、enter键监听事件
|
||||||
|
|
Loading…
Reference in New Issue