diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6..9ca6363a 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Issues/Component/comments/editComment.jsx b/src/forge/Issues/Component/comments/editComment.jsx index 81fa0167..7b376b12 100644 --- a/src/forge/Issues/Component/comments/editComment.jsx +++ b/src/forge/Issues/Component/comments/editComment.jsx @@ -12,7 +12,7 @@ import axios from 'axios'; function EditComment(props){ const {owner, projectsId, index} = props.match.params; - const {current_user, current_user:{login}, showLoginDialog, showNotification, reloadComment, cancelMd, parentId, replyId, updateId} = props; + const {current_user, current_user:{login}, showLoginDialog, showNotification, reloadComment, cancelMd, parentId, replyId, updateId, showUserImg=true} = props; const [content, setContent] = useState(props.content); const [quillFlag, setQuillFlag] = useState(false); // 确认评论按钮loading效果 @@ -80,6 +80,7 @@ function EditComment(props){ alt="" width="30" height="30" + style={{display: showUserImg ? '' : 'none'}} />
diff --git a/src/forge/Issues/Component/comments/list.jsx b/src/forge/Issues/Component/comments/list.jsx index 1d57ca80..fc079206 100644 --- a/src/forge/Issues/Component/comments/list.jsx +++ b/src/forge/Issues/Component/comments/list.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Button, Popconfirm, Radio, Input, message, Tooltip } from 'antd'; +import { Button, Popconfirm, Radio, Input, message, Tooltip, Spin } from 'antd'; import axios from 'axios'; import { getImageUrl, timeAgo } from 'educoder'; import RenderHtml from '../../../../components/render-html'; @@ -13,7 +13,7 @@ import { Link } from 'react-router-dom'; function IssueCommentList(props){ const{history, history: {location}, reload, reloadComment, showNotification, current_user:{login, admin, image_url, user_id}, isManager, showLoginDialog, issueInfo:{author}} = props; const {owner, projectsId, index} = props.match.params; - const [category, setCategory] = useState('all'); + const [category, setCategory] = useState('comment'); const [journals, setJournals] = useState(undefined); // 是否展示新建/编辑评论markdown部分新建评论1 编辑父级评论2 回复评论3 编辑回复内容4 回复子机评论5 const [showEdit, setShowEdit] = useState(false); @@ -23,6 +23,8 @@ function IssueCommentList(props){ const [updateId, setUpdateId] = useState(undefined); // 操作日志展开效果 const [open, setOpen] = useState(undefined); + // 加载中效果(缓冲css 线条效果) + const [spin, setSpin] = useState(false); // 操作记录 icon const journalsIcon ={ 'issue': 'icon-chuangjianqianbao', @@ -40,6 +42,7 @@ function IssueCommentList(props){ } useEffect(()=>{ + setSpin(true); axios.get(`/v1/${owner}/${projectsId}/issues/${index}/journals`,{params:{ category }}).then(res=>{ @@ -70,12 +73,13 @@ function IssueCommentList(props){ }) } setJournals(journals); + setSpin(false) } }) }, [reload, category]) function commentCtx(v){ - return ; + return ; }; // 删除评论内容 @@ -95,13 +99,21 @@ function IssueCommentList(props){ return(
+ {/* 全部 / 评论 / 操作日志 */} +
+ {setSpin(true);setCategory(e.target.value)}} value={category}> + 评论 + 操作日志 + 全部 + +
{/* 添加评论 */} -
- {login ? showEdit === 1 ? :
+
+ {login ? showEdit === 1 ? :
{setShowEdit(1)}}> - +
:
@@ -109,107 +121,104 @@ function IssueCommentList(props){ {showLoginDialog()}}>登录并参与评论与回复
}
- {/* 全部 / 评论 / 操作日志 */} -
- {setCategory(e.target.value)}} value={category}> - 全部 - 评论 - 操作日志 - -
{/* 评论/操作日志 展示列表 */} -
- {journals && (journals.length > 0 && journals.map(item=>{return item.is_journal_detail ? (!item.closeAndSpan || item.id === item.start || open === item.start) ?
- {/* 操作日志 */} -
-
-
- - - {item.user.name}  - {item.user.name}
}> - {timeAgo(item.created_at)} -
- {(item.closeAndSpan && item.id === item.start) && {setOpen(open === item.id ? undefined : item.id)}}>{open === item.id ? `点击收起操作日志` : `已折叠${item.numCount}条, 点击查看`}} -
-
-
: '' :
- {/* 评论 */} - {/* 判断是否是编辑状态 */} - {(showEdit === 2 && updateId === item.id) ?
:
-
-
-
-
- - {item.user.name} - {timeAgo(item.created_at)} + +
+ {journals && (journals.length > 0 && journals.map(item=>{return item.is_journal_detail ? (!item.closeAndSpan || item.id === item.start || open === item.start) ?
+ {/* 操作日志 */} +
+
+
+ +
+ + {item.user.name}  + {(item.user.name.length + item.operate_content.length) > 62 ? {item.user.name}
}> : }
- {login &&
- {/* 平台管理员/仓库管理员/发布评论者/issue创建者 */} - {(admin || isManager || login === item.user.login || user_id === author.id) && 0 ? '子评论也将被一起删除。' : ''}`} - okText="是" - cancelText="否" - onConfirm={() => deleteComment(item.id)} - > - - } - {/* 仅评论者可修改 */} - {login === item.user.login && } - {setParentId(item.id); setReplyId(item.id); setShowEdit(3)}}> -
} + {timeAgo(item.created_at)}
-
{commentCtx(item.notes)}
- {item && item.attachments && item.attachments.length > 0 &&
} + {(item.closeAndSpan && item.id === item.start) && {setOpen(open === item.id ? undefined : item.id)}}>{open === item.id ? `点击收起操作日志` : `已折叠${item.numCount}条, 点击查看`}}
-
} - {showEdit === 3 && replyId === item.id &&
} - {/* 评论回复部分 */} - {item.children_journals.map(i =>{return
- {(showEdit === 4 && updateId === i.id) ?
:
-
-
- - {i.user.name} - 回复 - {i.reply_user.name} - {timeAgo(i.created_at)} +
: '' :
+ {/* 评论 */} +
+ +
+ {/* 判断是否是编辑状态 */} + {(showEdit === 2 && updateId === item.id) ?
:
+
+
+
+ {item.user.name} + {timeAgo(item.created_at)} +
+ {login &&
+ {/* 平台管理员/仓库管理员/发布评论者/issue创建者 */} + {(admin || isManager || login === item.user.login || user_id === author.id) && 0 ? '子评论也将被一起删除。' : ''}`} + okText="是" + cancelText="否" + onConfirm={() => deleteComment(item.id)} + > + + } + {/* 仅评论者可修改 */} + {login === item.user.login && } + {setParentId(item.id); setReplyId(item.id); setShowEdit(3)}}> +
} +
+
{commentCtx(item.notes)}
+ {item && item.attachments && item.attachments.length > 0 &&
}
- {login &&
- {/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */} - {(admin || isManager || login === i.user.login || login === i.reply_user.login || user_id === author.id) && deleteComment(i.id)} - > - - } - {/* 仅回复评论者可修改 */} - {login === i.user.login && } - {setParentId(item.id);setReplyId(i.id); setShowEdit(5)}}> - - +
} + {showEdit === 3 && replyId === item.id &&
} + {/* 评论回复部分 */} + {item.children_journals.map(i =>{return
+ {(showEdit === 4 && updateId === i.id) ?
:
+
+
+ + {i.user.name} + 回复 + {i.reply_user.name} + {timeAgo(i.created_at)} +
+ {login &&
+ {/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */} + {(admin || isManager || login === i.user.login || login === i.reply_user.login || user_id === author.id) && deleteComment(i.id)} + > + + } + {/* 仅回复评论者可修改 */} + {login === i.user.login && } + {setParentId(item.id);setReplyId(i.id); setShowEdit(5)}}> + + +
} +
+
{commentCtx(i.notes)}
+ {i && i.attachments && i.attachments.length > 0 &&
}
} -
-
{commentCtx(i.notes)}
- {i && i.attachments && i.attachments.length > 0 &&
} -
} - {showEdit === 5 && replyId === i.id &&
} -
})} -
}))} -
+ {showEdit === 5 && replyId === i.id &&
} +
})} +
+
}))} +
+ {/* 无数据 */} {journals && !journals.length && }
diff --git a/src/forge/Issues/Component/comments/list.scss b/src/forge/Issues/Component/comments/list.scss index 804e5fe9..b4ee91e5 100644 --- a/src/forge/Issues/Component/comments/list.scss +++ b/src/forge/Issues/Component/comments/list.scss @@ -1,13 +1,15 @@ .typeActionBox{ - padding: 17px 20px 10px; - background-color:#fafcff; - border:1px solid rgba(42, 97, 255, 0.23); + padding: 10px 20px 4px; + background-color:rgba(241, 243, 252, 0.55); border-radius:4px; .typeActionRadio{ color: #333; display: inline-flex; align-items: center; - margin-right: 35px; + margin-right: 25px; + &.ant-radio-wrapper-checked{ + color: $primary-color; + } } } .commentUserImg{ @@ -16,7 +18,7 @@ border-radius: 50%; object-fit: cover; } -.commentsBox{ +.issueCommentsBox{ .iconBackBox{ display: inline-block; width:24px; @@ -26,43 +28,115 @@ text-align: center; background-color:#f2f3f5; } - .operationLogTopBor, .operationLogBottomBor{ - width: 1px; - height: 20px; - background-color:#eeeeee; - margin-left: 12px; + .operationLog, .commentContentBox{ + position: relative; + min-height: 62px; + display: flex; + >.flexCenter, >a{ + z-index: 2; + } + &::before, &::after{ + content: ''; + width: 1px; + height: 50%; + position: absolute; + background: #eee; + left: 12px; + z-index: 1; + } + &::after{ + background: #eee; + top: 50%; + } } - .operationLogTopBor{ - margin-bottom: -3px; + .commentContentBox+.operationLog .operationCommentBor, .operationLog+.commentContentBox .commentOperationBor{ + border-top: 1px solid #eee; + width: 98.5%; + position: absolute; + left: 12px; } - .operationLogBottomBor{ - margin-top: -4px; + .operationLog+.commentContentBox{ + &>a, &>.commentContentRight{ + margin-top: 25px; + } } .timeAgo{ color:#acb0bf; } - .operationLog:last-child .operationLogBottomBor, .operationLog:first-child .operationLogTopBor{ + .operationLog:last-child::after, .operationLog:first-child::before, .commentContentBox:last-child::after, &.justComment .commentContentBox::before, &.justComment .commentContentBox::after{ display: none; } - .commentContent, .commentContentBox+.operationLog{ - border-top: 1px solid #eeeeee; + .operationLog:first-child, .commentContentBox+.operationLog{ + margin-top: -15px; } - .commentContentBox:first-of-type .commentContent{ - border-top: none; + .commentContentBox:last-child::before{ + height: 35%; } .flexCenter{ display: flex; align-items: center; justify-content: space-between; } - .contentHtml, .commentReply{ - margin-left: 34px; + .commentRenderHtml.markdown-body p{ + font-size: 13px !important; } .commentReply{ - padding: 15px 0 15px 20px; + padding: 15px 0 0 20px; background-color: rgba(238, 240, 246, 0.41); - &+.commentReply{ - border-top: 1px dashed #eeeeee; + &>div{ + padding-bottom: 5px; + } + &+.commentReply>div{ + margin-top: -15px; + padding-top: 15px; + border-top: 1px dashed #eee; + } + } + .opBox{ + justify-content: flex-start; + // flex: 1; + // width: 100%; + } + .commentContentBox{ + display: flex; + } + .commentContentRight{ + flex: 1; + background-color:#fafafc; + border:1px solid rgba(42, 97, 255, 0.23); + border-radius:6px; + position: relative; + top: -6px; + padding: 10px 15px 16px; + &::before{ + content: ''; + display: block; + position: absolute; + top: 13px; + left: -14px; + width: 0; + height: 0; + overflow: hidden; + font-size: 0; + line-height: 0; + border: 7px; + border-style: solid; + border-color: transparent rgba(42, 97, 255, 0.23) transparent transparent; + } + &::after{ + content: ''; + display: block; + width: 0; + height: 0; + overflow: hidden; + font-size: 0; + line-height: 0; + border: 6px; + border-style: solid; + border-color: transparent #fafafc transparent transparent; + position: absolute; + top: 14px; + left: -11px; } } } @@ -71,14 +145,12 @@ } .attachmentBox{ margin-top: -8px; - margin-left: 27px; } .color-grey-89{ color: #898d9d; } // 添加评论样式 .unLoginComment{ - width:871px; height:58px; line-height: 58px; background-color:rgba(241, 243, 252, 0.55); @@ -92,4 +164,22 @@ color: red; margin-top: -10px; margin-bottom: 5px !important; +} +.addComments{ + display: flex; + align-items: center; + background-color:rgba(241, 243, 252, 0.55); + border-radius:4px; + padding:7px 10px; + &>img{ + height: 26px; + width: 26px; + border-radius: 50%; + margin-right: 13px; + } +} +.addCommentBox{ + width: 100%; + height: 30px; + border: none; } \ No newline at end of file diff --git a/src/forge/Issues/index.scss b/src/forge/Issues/index.scss index 03aee921..f5dd2180 100644 --- a/src/forge/Issues/index.scss +++ b/src/forge/Issues/index.scss @@ -652,20 +652,7 @@ } } -// 评论相关 -.addcomments{ - display: flex; - align-items: flex-start; - background-color:rgba(241, 243, 252, 0.55); - border-radius:4px; - padding:11px 20px; - &>img{ - height: 36px; - width: 36px; - border-radius: 50%; - margin-right: 13px; - } -} + .overlaydrop{ &.large{ width: 260px; diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index dbfe770f..5cf79b79 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -263,16 +263,10 @@ function Index(props) { // 新建分支按钮点击函数 function addBranchBtn(){ setAddBranch(true); - const url = `/v1/${owner}/${projectsId}/branches.json`; - Axios.get(url,{ - params:{ - page: 1, - limit: total - } - }).then(result=>{ + const url = `/v1/${owner}/${projectsId}/branches/all.json`; + Axios.get(url).then(result=>{ if(result){ - const {branches} = result.data; - setBranchList(branches); + setBranchList(result.data); } }).catch(error=>{console.log('error', error);}) } @@ -393,7 +387,7 @@ function Index(props) {
{newBranchError}
分支起点
- {setNewFormBranchName(value)}} getPopupContainer={triggerNode => triggerNode.parentNode}> {branchList && branchList.map((item, index)=>{ return {item.name} })} diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index 2ae943d3..f32add33 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -15,7 +15,9 @@ class Milepost extends Component { // 里程碑 开启/关闭 状态 status: 'open', order_name: undefined, - spinings: true + spinings: true, + // tooltip显隐 + visible: false } } componentDidUpdate(){ @@ -129,8 +131,16 @@ class Milepost extends Component { this.getList(1, pageSize, this.state.status, this.state.order_name, this.state.order_type); } + // tooltip判断是否显示 + // onVisibleChange = (visible, value) => { + // console.log('visible, value', visible, value); + // this.setState({ + // visible: value.length >24 ? visible : false + // }) + // } + render() { - const { data, limit, page, spinings, status, order_name, order_type } = this.state; + const { data, limit, page, spinings, status, order_name, order_type, visible } = this.state; const { projectsId , owner } = this.props.match.params; const { isManager, isDeveloper} = this.props; const menu = ( @@ -168,18 +178,21 @@ class Milepost extends Component {
{/* 创建里程碑按钮 */} -
+ {/*
{(isManager || isDeveloper) && } -
+
*/} {/* 里程碑列表表头 */}
this.opneMilelist(1)}>开启中{data && data.opening_milestone_count} this.opneMilelist(2)}>已关闭{data && data.closed_milestone_count}
+
+ {(isManager || isDeveloper) && } {order_name ? sortByMile[order_name][order_type] : '排序'} +
{/* 里程碑列表展示 */} {data && data.milestones && data.milestones.length === 0 &&
} @@ -191,12 +204,12 @@ class Milepost extends Component { {item.name}
- {item.description} + {item.description && item.description.length > 44 ? {item.description} : {item.description}}
- {item.effective_date || "暂无截止时间"} + 0 ? 'outTime' : ''}`}>{item.effective_date || "暂无截止时间"}
{item.opened_issues_count || 0}个开启 diff --git a/src/forge/Order/milepost.scss b/src/forge/Order/milepost.scss index b8aa29e1..5b5d122f 100644 --- a/src/forge/Order/milepost.scss +++ b/src/forge/Order/milepost.scss @@ -52,10 +52,13 @@ } .milepostInfo{ display: inline-block; - width: 500px; + width: 640px; } .actionMileBox{ width: 550px; + .outTime{ + color: red; + } } } .createMilepostBtn{ diff --git a/src/forge/users/Material/Phone.jsx b/src/forge/users/Material/Phone.jsx index 8eb78ae2..bc355542 100644 --- a/src/forge/users/Material/Phone.jsx +++ b/src/forge/users/Material/Phone.jsx @@ -20,7 +20,7 @@ export default Form.create()( function checkPsd(rule, value, callback){ const map = passMap; if(value){ - current_user && Axios.post(`/v1/${current_user.login}/check_password.json`,{ + current_user && value.length > 8 && Axios.post(`/v1/${current_user.login}/check_password.json`,{ password: value }).then(res=>{ if(res && !res.data.status){ @@ -50,7 +50,7 @@ export default Form.create()( callback("请先输入登录密码"); } if(value){ - current_user && value && value.length > 4 && Axios.post(`/v1/${current_user.login}/check_phone_verify_code.json`,{ + current_user && value && value.length > 5 && Axios.post(`/v1/${current_user.login}/check_phone_verify_code.json`,{ code_type: 4, phone: phoneValue, code: value @@ -192,7 +192,7 @@ export default Form.create()( {required:true,message:"请输入登录密码"}, {validator:(rule, value, callback)=>checkPsd(rule, value, callback)} ], - validateTrigger:"onBlur", + validateTrigger:"onChange", })( )} @@ -203,7 +203,7 @@ export default Form.create()( {required:true,message:"请输入新手机号码"}, {validator:(rule, value, callback)=>checkPhone(rule, value, callback)} ], - validateTrigger:"onBlur", + validateTrigger:"onChange", })( )} @@ -215,7 +215,7 @@ export default Form.create()( {required:true,message:"请输入短信验证码"}, {validator:(rule, value, callback)=>checkCode(rule, value, callback)} ], - validateTrigger:"onBlur", + validateTrigger:"onChange", })( )}