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-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1637302844926') format('woff2'),
url('iconfont.woff?t=1637302844926') format('woff'),
url('iconfont.ttf?t=1637302844926') format('truetype');
src: url('iconfont.woff2?t=1637544235157') format('woff2'),
url('iconfont.woff?t=1637544235157') format('woff'),
url('iconfont.ttf?t=1637544235157') format('truetype');
}
.iconfont {

View File

@ -313,17 +313,17 @@ li.ant-menu-item{
}
}
.-task-sidebar>div {
height: 40px;
line-height: 40px;
height: 48px;
line-height: 48px;
box-sizing: border-box;
width: 40px;
width: 48px;
color: #999;
font-size: 20px;
text-align: center;
margin-bottom: 20px;
border-radius: 50%;
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 {
@ -334,36 +334,40 @@ li.ant-menu-item{
color: #fff !important;
}
.-task-sidebar>div:hover{
background: #1890FF;
background: #466AFF;
box-shadow: 0px 0px 10px 2px #B6D0FC;
}
.helpBox{
width: 260px;
z-index: 103;
&.shareContent{
width: 200px;
width: 160px;
}
.ant-popover-title{
font-size: 16px;
}
.ant-popover-inner-content{
padding:0px;
}
p.titlecontent{
font-size: 18px;
font-size: 16px;
color: #333;
line-height: 20px;
padding:15px 20px;
}
.faqUl{
padding:0px 20px 10px;
padding:10px 15px;
max-height: 230px;
overflow-y: auto;
font-size: 13px;
li{
background: #F5F5F5;
border-radius: 20px;
padding:0px 20px;
padding:0px 15px;
color: #333;
height: 34px;
line-height: 34px;
margin-bottom: 10px!important;
height: 30px;
line-height: 30px;
margin-bottom: 3px !important;
a{
display: block;
overflow: hidden;
@ -379,19 +383,18 @@ li.ant-menu-item{
}
}
.shareUl{
padding:10px 0px;
display: flex;
align-items: center;
.titlecontent{
margin-right: 20px;
}
li > i{
font-size: 32px!important;
}
}
}
// tooltip样式
.tooltipBox .ant-tooltip-inner{
padding: 8px 12px;
font-size: 15px;
}
.-task-desc {
background: #494949;
@ -439,3 +442,21 @@ li.ant-menu-item{
border-left: 5px solid #494949;
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() {
const [ data , setData ] = useState([]);
const [ visible , setVisible ] = useState(false);
const [ login , setLogin ]= useState(false);
useEffect(()=>{
getFAQ();
getCurrentUser();
//页面加载完成之后隐藏回到顶点
$(".-task-sidebar .gotop").hide();
},[])
function getFAQ(){
@ -36,9 +40,19 @@ function SiderBar() {
}
}).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){
return <div>
<p className="titlecontent">帮助</p>
<ul className="faqUl">
{
list && list.map((i,k)=>{
@ -59,31 +73,46 @@ function SiderBar() {
</ul>
</div>
}
return (
<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) ?
<Popover content={content(data)} overlayClassName="helpBox" placement={"left"}>
<Popover title="帮助" content={content(data)} overlayClassName="helpBox" placement={"left"}>
<div className="feedback">
<i className="iconfont icon-bangzhu font-22"></i>
<i className="iconfont icon-bangzhu1 font-22"></i>
</div>
</Popover>
:""
}
{/* 分享 */}
{/* <div className="scan pr" title="">
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
</div>*/}
<ShareModal visible={visible} urlValue={window.location.href} onCancel={()=>setVisible(false)}/>
<Popover content={shareContent()} overlayClassName="helpBox shareContent" placement={"left"}>
<div className="consult">
<i className="iconfont icon-fenxiang1"></i>
<i className="iconfont icon-fenxiang"></i>
</div>
</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>
</Tooltip>
</div>
</div>
</Tooltip>
</div>
)
}

View File

@ -17,9 +17,9 @@ function SiderBarShareModal({visible,urlValue,onCancel}) {
value={urlValue}
size={200}
fgColor="#000000"
style={{margin:"20px"}}
style={{margin:"0 20px 20px"}}
/>}
<p>打开微信扫一扫,点击右上角菜单即可将网页分享至朋友圈</p>
<p>打开微信扫一扫点击右上角菜单即可将网页分享至朋友圈</p>
</div>
</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;
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
@ -422,16 +431,16 @@ function CoderDepot(props){
</AlignCenter>
<AlignCenter className="depotBtn">
{
(baseOperate || baseOper) &&
<div className="addOptionBtn">
{
baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
}
{
<a onClick={createIssue}>+ 易修</a>
{/* {
baseOper &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 易修</CheckProfile>
}
} */}
</div>
}
{ fileOperate &&

View File

@ -2,9 +2,23 @@
import React, { Component } from "react";
import OrderForm from './order_form'
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() {
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);
});
};
islogin=()=>{
this.props.showLoginDialog();
}
renderNew =()=>{
createIssue = () => {
const { data } = this.state;
const { projectsId , owner } = this.props.match.params;
if(data && data.user_admin_or_member){
const { projectsId , owner } = this.props.match.params;
return(
<CheckProfile {...this.props} className="topWrapper_btn ml10" sureFunc={()=>{window.open(`/${owner}/${projectsId}/issues/new`,'_blank')}}>
+&nbsp;创建易修
</CheckProfile>
)
window.open(`/${owner}/${projectsId}/issues/new`,'_blank');
}else{
this.props.showLoginDialog(`/${owner}/${projectsId}/issues/new`);
}
}
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) => {
const { status_type } = this.state;

View File

@ -100,7 +100,22 @@ class order_form extends Component {
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();
}else{
this.props.form.setFieldsValue({
@ -321,7 +336,7 @@ class order_form extends Component {
<div className="list-right">
<div className="pd20">
<h3 className="mb15">
{form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}易修
{form_type === "edit" ? "编辑" :( form_type === "copy" ? "复制" : "新建")}易修
</h3>
<Form.Item>
{getFieldDecorator("subject", {
@ -378,14 +393,14 @@ class order_form extends Component {
onClick={this.handleSubmit}
>
<span className="plr10">
{form_type === "new" ? "创建" : "提交"}
{form_type === "new" || form_type === "feedback" ? "创建" : "提交"}
</span>
</Button>
<Button
type="default"
className="ml30"
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>
</Button>

View File

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

View File

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

View File

@ -9,18 +9,15 @@ import './LoginRegisterPage.scss';
function Login(props){
const [message,setMessage] = useState();
const [setting, setSetting] = useState(undefined);
const {form} = props;
const {form, location} = props;
const {getFieldDecorator } = form;
const {search} = location;
useEffect(()=>{
//DOMvalue
clear;
//settings.json
axios.get(`/setting.json`).then((response) => {
if (response && response.data) {
setSetting(response.data.setting);
}
})
//
setSetting(JSON.parse(localStorage.getItem("chromesetting")));
},[])
//
@ -37,7 +34,10 @@ function Login(props){
} else {
//
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) => {
console.log('error',error);

View File

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

View File

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

View File

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