Merge pull request '意见反馈' (#277) from durian/forgeplus-react:gitlink_server into gitlink_server

This commit is contained in:
jasder 2021-11-22 11:03:47 +08:00
commit eff12234fa
14 changed files with 189 additions and 89 deletions

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2340181 */ font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1637302844926') format('woff2'), src: url('iconfont.woff2?t=1637544235157') format('woff2'),
url('iconfont.woff?t=1637302844926') format('woff'), url('iconfont.woff?t=1637544235157') format('woff'),
url('iconfont.ttf?t=1637302844926') format('truetype'); url('iconfont.ttf?t=1637544235157') format('truetype');
} }
.iconfont { .iconfont {

View File

@ -313,17 +313,17 @@ li.ant-menu-item{
} }
} }
.-task-sidebar>div { .-task-sidebar>div {
height: 40px; height: 48px;
line-height: 40px; line-height: 48px;
box-sizing: border-box; box-sizing: border-box;
width: 40px; width: 48px;
color: #999; color: #999;
font-size: 20px; font-size: 20px;
text-align: center; text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
border-radius: 50%; border-radius: 50%;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0px 0px 10px 1px #F1F1F1; box-shadow: 0px 0px 12px 5px rgba(208, 208, 208, 0.2);
} }
.-task-sidebar>div i { .-task-sidebar>div i {
@ -334,36 +334,40 @@ li.ant-menu-item{
color: #fff !important; color: #fff !important;
} }
.-task-sidebar>div:hover{ .-task-sidebar>div:hover{
background: #1890FF; background: #466AFF;
box-shadow: 0px 0px 10px 2px #B6D0FC; box-shadow: 0px 0px 10px 2px #B6D0FC;
} }
.helpBox{ .helpBox{
width: 260px; width: 260px;
z-index: 103; z-index: 103;
&.shareContent{ &.shareContent{
width: 200px; width: 160px;
}
.ant-popover-title{
font-size: 16px;
} }
.ant-popover-inner-content{ .ant-popover-inner-content{
padding:0px; padding:0px;
} }
p.titlecontent{ p.titlecontent{
font-size: 18px; font-size: 16px;
color: #333; color: #333;
line-height: 20px; line-height: 20px;
padding:15px 20px; padding:15px 20px;
} }
.faqUl{ .faqUl{
padding:0px 20px 10px; padding:10px 15px;
max-height: 230px; max-height: 230px;
overflow-y: auto; overflow-y: auto;
font-size: 13px;
li{ li{
background: #F5F5F5; background: #F5F5F5;
border-radius: 20px; border-radius: 20px;
padding:0px 20px; padding:0px 15px;
color: #333; color: #333;
height: 34px; height: 30px;
line-height: 34px; line-height: 30px;
margin-bottom: 10px!important; margin-bottom: 3px !important;
a{ a{
display: block; display: block;
overflow: hidden; overflow: hidden;
@ -379,19 +383,18 @@ li.ant-menu-item{
} }
} }
.shareUl{ .shareUl{
padding:10px 0px;
display: flex; display: flex;
align-items: center; align-items: center;
.titlecontent{
margin-right: 20px;
}
li > i{ li > i{
font-size: 32px!important; font-size: 32px!important;
} }
} }
} }
// tooltip样式
.tooltipBox .ant-tooltip-inner{
padding: 8px 12px;
font-size: 15px;
}
.-task-desc { .-task-desc {
background: #494949; background: #494949;
@ -439,3 +442,21 @@ li.ant-menu-item{
border-left: 5px solid #494949; border-left: 5px solid #494949;
border-bottom: 6px solid transparent border-bottom: 6px solid transparent
} }
//头部输入框样式
.headSerach{
background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
padding-left: 20px;
//修改antd输入框默认样式
.ant-input,.ant-input:focus{
border: none !important;
background-color: rgba(255, 255, 255, 0) !important;
}
&:hover{
padding: 2px 20px 2px 20px;
background: #FFF;
& i{
color: #333;
}
}
}

View File

@ -23,9 +23,13 @@ $(window).scroll(function () {
function SiderBar() { function SiderBar() {
const [ data , setData ] = useState([]); const [ data , setData ] = useState([]);
const [ visible , setVisible ] = useState(false); const [ visible , setVisible ] = useState(false);
const [ login , setLogin ]= useState(false);
useEffect(()=>{ useEffect(()=>{
getFAQ(); getFAQ();
getCurrentUser();
//页面加载完成之后隐藏回到顶点
$(".-task-sidebar .gotop").hide();
},[]) },[])
function getFAQ(){ function getFAQ(){
@ -36,9 +40,19 @@ function SiderBar() {
} }
}).catch(error=>{}) }).catch(error=>{})
} }
//获取当前登录账号信息->用于建议反馈
function getCurrentUser(){
let url = `/users/get_user_info.json`;
axios.get(url).then((response) => {
if (response && response.data && response.data.login) {
setLogin(response.data.login);
}
}).catch(error=>{})
}
function content(list){ function content(list){
return <div> return <div>
<p className="titlecontent">帮助</p>
<ul className="faqUl"> <ul className="faqUl">
{ {
list && list.map((i,k)=>{ list && list.map((i,k)=>{
@ -59,31 +73,46 @@ function SiderBar() {
</ul> </ul>
</div> </div>
} }
return ( return (
<div className={"-task-sidebar"} > <div className={"-task-sidebar"} >
<ShareModal visible={visible} urlValue={window.location.href} onCancel={()=>setVisible(false)}/> {/* 平台反馈 */}
<Tooltip title="意见反馈" placement={"left"} overlayClassName="tooltipBox">
<div className="consult">
<a href={login ? `/Gitlink/forgeplus/issues/new?type=feedback`:`/login?go_page=/Gitlink/forgeplus/issues/new?type=feedback`}>
<i className="iconfont icon-yijianfankui2"></i>
</a>
</div>
</Tooltip>
{/* 帮助 */}
{ {
data && data.length > 0 && (data[0] && data[0].question) ? data && data.length > 0 && (data[0] && data[0].question) ?
<Popover content={content(data)} overlayClassName="helpBox" placement={"left"}> <Popover title="帮助" content={content(data)} overlayClassName="helpBox" placement={"left"}>
<div className="feedback"> <div className="feedback">
<i className="iconfont icon-bangzhu font-22"></i> <i className="iconfont icon-bangzhu1 font-22"></i>
</div> </div>
</Popover> </Popover>
:"" :""
} }
{/* 分享 */}
{/* <div className="scan pr" title=""> {/* <div className="scan pr" title="">
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span> <span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
</div>*/} </div>*/}
<ShareModal visible={visible} urlValue={window.location.href} onCancel={()=>setVisible(false)}/>
<Popover content={shareContent()} overlayClassName="helpBox shareContent" placement={"left"}> <Popover content={shareContent()} overlayClassName="helpBox shareContent" placement={"left"}>
<div className="consult"> <div className="consult">
<i className="iconfont icon-fenxiang1"></i> <i className="iconfont icon-fenxiang"></i>
</div> </div>
</Popover> </Popover>
<div className="gotop">
<Tooltip title="返回顶部" placement={"right"}> {/* 返回顶部 */}
<Tooltip title="返回顶部" placement={"left"} overlayClassName="tooltipBox">
<div className="gotop">
<a><i className="iconfont icon-huidaodingbu1"></i></a> <a><i className="iconfont icon-huidaodingbu1"></i></a>
</Tooltip> </div>
</div> </Tooltip>
</div> </div>
) )
} }

View File

@ -17,9 +17,9 @@ function SiderBarShareModal({visible,urlValue,onCancel}) {
value={urlValue} value={urlValue}
size={200} size={200}
fgColor="#000000" fgColor="#000000"
style={{margin:"20px"}} style={{margin:"0 20px 20px"}}
/>} />}
<p>打开微信扫一扫,点击右上角菜单即可将网页分享至朋友圈</p> <p>打开微信扫一扫点击右上角菜单即可将网页分享至朋友圈</p>
</div> </div>
</Modal> </Modal>
) )

View File

@ -337,6 +337,15 @@ function CoderDepot(props){
} }
}) })
} }
function createIssue(){
if(baseOper){
window.open(`/${owner}/${projectsId}/issues/new`,'_blank');
}else{
props.showLoginDialog(`/${owner}/${projectsId}/issues/new`);
}
}
let n = fileInfo && fileInfo.name; let n = fileInfo && fileInfo.name;
const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
@ -422,16 +431,16 @@ function CoderDepot(props){
</AlignCenter> </AlignCenter>
<AlignCenter className="depotBtn"> <AlignCenter className="depotBtn">
{ {
(baseOperate || baseOper) &&
<div className="addOptionBtn"> <div className="addOptionBtn">
{ {
baseOperate && baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile> <CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
} }
{ <a onClick={createIssue}>+ 易修</a>
{/* {
baseOper && baseOper &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile> <CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile>
} } */}
</div> </div>
} }
{ fileOperate && { fileOperate &&

View File

@ -2,9 +2,23 @@
import React, { Component } from "react"; import React, { Component } from "react";
import OrderForm from './order_form' import OrderForm from './order_form'
class New extends Component { class New extends Component {
constructor(props){
super(props);
this.state = {
type : undefined,
}
}
componentDidMount = () => {
const searchParams = new URLSearchParams(this.props.location.search.substring(1));
this.setState({
type : searchParams.get("type"),
})
}
render() { render() {
return ( return (
<OrderForm form_type="new" {...this.props}></OrderForm> <OrderForm form_type={this.state.type ? this.state.type : "new"} {...this.props}></OrderForm>
) )
} }
} }

View File

@ -342,22 +342,26 @@ class order extends Component {
console.log(error); console.log(error);
}); });
}; };
islogin=()=>{ createIssue = () => {
this.props.showLoginDialog();
}
renderNew =()=>{
const { data } = this.state; const { data } = this.state;
const { projectsId , owner } = this.props.match.params;
if(data && data.user_admin_or_member){ if(data && data.user_admin_or_member){
const { projectsId , owner } = this.props.match.params; window.open(`/${owner}/${projectsId}/issues/new`,'_blank');
return( }else{
<CheckProfile {...this.props} className="topWrapper_btn ml10" sureFunc={()=>{window.open(`/${owner}/${projectsId}/issues/new`,'_blank')}}> this.props.showLoginDialog(`/${owner}/${projectsId}/issues/new`);
+&nbsp;创建易修
</CheckProfile>
)
} }
} }
renderNew =()=>{
return(
// <CheckProfile {...this.props} className="topWrapper_btn ml10" sureoncFunc={()=>{createIssue()}}>
// +&nbsp;创建易修
// </CheckProfile>
<a className="topWrapper_btn ml10" onClick={this.createIssue}>+&nbsp;创建易修</a>
)
}
// 修改开始时间 // 修改开始时间
changeBeginTime = (data, value) => { changeBeginTime = (data, value) => {
const { status_type } = this.state; const { status_type } = this.state;

View File

@ -100,7 +100,22 @@ class order_form extends Component {
isSpin:false isSpin:false
}); });
if(this.props.form_type !== "new"){ if(this.props.form_type === "feedback"){
let data ={
//指派给段甲生类型缺陷优先度正常issue状态新增
tracker_id: "1",
assigned_to_id: "36480",
priority_id: "2",
status_id: "1",
description:"####问题描述\n\n\n####重现问题步骤\n\n\n####截图\n\n\n####建议解决办法\n",
}
this.setState({ ...data });
this.props.form.setFieldsValue({
...this.state,
fixed_version_id: milepostId || ""
});
}else if(this.props.form_type !== "new"){
this.get_detail(); this.get_detail();
}else{ }else{
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -321,7 +336,7 @@ class order_form extends Component {
<div className="list-right"> <div className="list-right">
<div className="pd20"> <div className="pd20">
<h3 className="mb15"> <h3 className="mb15">
{form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}易修 {form_type === "edit" ? "编辑" :( form_type === "copy" ? "复制" : "新建")}易修
</h3> </h3>
<Form.Item> <Form.Item>
{getFieldDecorator("subject", { {getFieldDecorator("subject", {
@ -378,14 +393,14 @@ class order_form extends Component {
onClick={this.handleSubmit} onClick={this.handleSubmit}
> >
<span className="plr10"> <span className="plr10">
{form_type === "new" ? "创建" : "提交"} {form_type === "new" || form_type === "feedback" ? "创建" : "提交"}
</span> </span>
</Button> </Button>
<Button <Button
type="default" type="default"
className="ml30" className="ml30"
onClick={()=> onClick={()=>
this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}`)} this.props.history.push(form_type === "new" || form_type === "feedback" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}`)}
> >
<span className="plr10">取消</span> <span className="plr10">取消</span>
</Button> </Button>

View File

@ -40,24 +40,22 @@
border-bottom: 0px solid #e8e8e8; border-bottom: 0px solid #e8e8e8;
} }
button{ .but25{height: 32px; }
padding:0 5px;
}
} }
button { // button {
color: #333333; // color: #333333;
background: #FAFBFC; // background: #FAFBFC;
border: 1px solid #D0D0D0; // border: 1px solid #D0D0D0;
border-radius: 4px; // border-radius: 4px;
height: 32px; // height: 32px;
} // }
button:hover { // button:hover {
background: #F3F4F6; // background: #F3F4F6;
} // }
button:active { // button:active {
background: #EBECF0; // background: #EBECF0;
} // }
.deleteBut{ .deleteBut{
color: #DF0002; color: #DF0002;

View File

@ -102,7 +102,8 @@ class LoginDialog extends Component {
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
weixinlogin: false, weixinlogin: false,
qqlogin: false qqlogin: false,
settings:undefined,
}; };
} }
enter = (num) => { enter = (num) => {
@ -324,7 +325,9 @@ class LoginDialog extends Component {
//true为PC端false为手机端 //true为PC端false为手机端
let flag = this.IsPC(); let flag = this.IsPC();
this.setState({ this.setState({
isphone: flag isphone: flag,
//查询第三方登录信息
settings: JSON.parse(localStorage.getItem("chromesetting")),
}) })
if (this.props.isRender != undefined) { if (this.props.isRender != undefined) {
@ -393,7 +396,8 @@ class LoginDialog extends Component {
isRender: false isRender: false
}) })
this.props.Modifyloginvalue(response.data); this.props.Modifyloginvalue(response.data);
window.location.reload(); this.props.gopage ? (window.location.href = this.props.gopage) : window.location.reload()
// window.location.reload();
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -454,8 +458,7 @@ class LoginDialog extends Component {
} }
render() { render() {
let { login, isGoing, isGoingValue, disabled , Phonenumberisnotco , dialogBox, isRender, weixinlogin } = this.state; let { login, isGoing, isGoingValue, disabled , Phonenumberisnotco , dialogBox, isRender, weixinlogin, settings } = this.state;
let { settings } = this.props;
if (isRender === undefined) { if (isRender === undefined) {
isRender = false isRender = false

View File

@ -9,18 +9,15 @@ import './LoginRegisterPage.scss';
function Login(props){ function Login(props){
const [message,setMessage] = useState(); const [message,setMessage] = useState();
const [setting, setSetting] = useState(undefined); const [setting, setSetting] = useState(undefined);
const {form} = props; const {form, location} = props;
const {getFieldDecorator } = form; const {getFieldDecorator } = form;
const {search} = location;
useEffect(()=>{ useEffect(()=>{
//DOMvalue //DOMvalue
clear; clear;
//settings.json //
axios.get(`/setting.json`).then((response) => { setSetting(JSON.parse(localStorage.getItem("chromesetting")));
if (response && response.data) {
setSetting(response.data.setting);
}
})
},[]) },[])
// //
@ -37,7 +34,10 @@ function Login(props){
} else { } else {
// //
cookie.save('autologin',values.remember); cookie.save('autologin',values.remember);
window.location.href = "/"+response.data.login; const searchParams = new URLSearchParams(search.substring(1));
const goPage = searchParams.get("go_page");
//
window.location.href = goPage ? goPage : `/${response.data.login}`
} }
}).catch((error) => { }).catch((error) => {
console.log('error',error); console.log('error',error);

View File

@ -8,7 +8,10 @@ import './LoginRegisterPage.scss';
function Register(props){ function Register(props){
const {form} = props; const {form} = props;
const {getFieldDecorator } = form; const {getFieldDecorator } = form;
//
const [emailStr, setEmailStr] = useState(undefined); const [emailStr, setEmailStr] = useState(undefined);
//check.json
const [loginStr, setLoginStr] = useState(undefined);
const [secondsStr, setSecondsStr] = useState(60); const [secondsStr, setSecondsStr] = useState(60);
const [countDown, setCountDown] = useState(false); const [countDown, setCountDown] = useState(false);
const [getCaptchaBut, setGetCaptchaBut] = useState(false); const [getCaptchaBut, setGetCaptchaBut] = useState(false);
@ -50,27 +53,29 @@ function Register(props){
//username //username
function usernameConfirm(rule, value, callback){ function usernameConfirm(rule, value, callback){
setUserNameGo(true); setUserNameGo(true);
value && userNameGo ? axios.post(`/accounts/check.json`, { value && (userNameGo || value !== loginStr) ? axios.post(`/accounts/check.json`, {
value: value, value: value,
type: 1 type: 1
}).then(response => { }).then(response => {
if (response.data.status === -1) { if (response.data.status === -1) {
callback('该名称已经被使用'); callback('该名称已经被使用');
} else { } else {
setLoginStr(value);
setUserNameGo(false); setUserNameGo(false);
callback(); callback();
} }
}):callback() }):callback();setLoginStr(undefined);
} }
// //
function emailConfirm(rule, value, callback) { function emailConfirm(rule, value, callback) {
setEmailGo(true); setEmailGo(true);
value && emailGo ? axios.post(`/accounts/check.json`, { value && (emailGo || value !== emailStr) ? axios.post(`/accounts/check.json`, {
value: value, value: value,
type: 2 type: 2
}).then(response => { }).then(response => {
if (response.data.status === -1) { if (response.data.status === -1) {
setGetCaptchaBut(false);
callback('该邮箱已被注册'); callback('该邮箱已被注册');
} else { } else {
setEmailStr(value); setEmailStr(value);

View File

@ -57,16 +57,17 @@ function ResetPassword(props) {
// //
function emailConfirm(rule, value, callback) { function emailConfirm(rule, value, callback) {
setEmailGo(true); setEmailGo(true);
value && emailGo ? axios.post(`/accounts/check.json`, { value && (emailGo || value !== emailStr) ? axios.post(`/accounts/check.json`, {
value: value, value: value,
type: 2 type: 2
}).then(response => { }).then(response => {
if (response.data && response.data.status === -1) { if (response.data && response.data.status === -1) {
setEmailStr(value) setEmailStr(value);
setGetCaptchaBut(true); setGetCaptchaBut(true);
setEmailGo(false); setEmailGo(false);
callback(); callback();
} else { } else {
setGetCaptchaBut(false);
callback('此邮箱未注册'); callback('此邮箱未注册');
} }
}):callback();setEmailStr(undefined); }):callback();setEmailStr(undefined);

View File

@ -29,7 +29,8 @@ export function TPMIndexHOC(WrappedComponent) {
email:undefined, email:undefined,
completeProfile:false, completeProfile:false,
showCP:false, showCP:false,
showNotice:true showNotice:true,
gopage: undefined,
} }
} }
@ -151,7 +152,6 @@ export function TPMIndexHOC(WrappedComponent) {
} }
fetchUsers = () => { fetchUsers = () => {
console.log(this.props.match)
if (this.props.match.path === "/") { if (this.props.match.path === "/") {
this.setState({ this.setState({
publicNav:true publicNav:true
@ -197,10 +197,11 @@ export function TPMIndexHOC(WrappedComponent) {
}) })
} }
showLoginDialog = () => { showLoginDialog = (gopage) => {
this.setState({ this.setState({
isRender: true, isRender: true,
isloginCancel: "iscancel" isloginCancel: "iscancel",
gopage: gopage,
}) })
} }
//验证登录是否成功方法 //验证登录是否成功方法