forked from Gitlink/forgeplus-react
回归第三方测试代码
This commit is contained in:
parent
ade93746ab
commit
b64d29a9a6
|
@ -5,7 +5,7 @@ export const getBranch = async (id,owner)=>{
|
||||||
}
|
}
|
||||||
// 获取标签列表
|
// 获取标签列表
|
||||||
export const getTag = async (id,owner)=>{
|
export const getTag = async (id,owner)=>{
|
||||||
return (await axios.get(`/${owner}/${id}/tags.json`)).data;
|
return (await axios.get(`/${owner}/${id}/tags.json`,{params:{only_name:true}})).data.tags;
|
||||||
}
|
}
|
||||||
// 获取hooks(仓库设置-管理web钩子)列表
|
// 获取hooks(仓库设置-管理web钩子)列表
|
||||||
export const getHooks = async (id,params)=>{
|
export const getHooks = async (id,params)=>{
|
||||||
|
|
|
@ -14,10 +14,10 @@ export default (( props, { projectDetail }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (projectsId) {
|
if (projectsId) {
|
||||||
const url = `/${owner}/${projectsId}/tags.json`;
|
const url = `/${owner}/${projectsId}/tags.json`;
|
||||||
axios.get(url).then((result) => {
|
axios.get(url,{params:{page:1,limit:1000}}).then((result) => {
|
||||||
if (result) {
|
if (result.data) {
|
||||||
setSpin(false);
|
setSpin(false);
|
||||||
setData(result.data);
|
setData(result.data.tags);
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
@ -272,11 +272,11 @@ class Index extends Component {
|
||||||
newItem = ()=>{
|
newItem = ()=>{
|
||||||
return(
|
return(
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li onClick={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目
|
||||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目</CheckProfile>
|
{/* <CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目</CheckProfile> */}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li onClick={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目
|
||||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile>
|
{/* <CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile> */}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React,{ useEffect , useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import SubMenu from '../sub/SubMenu';
|
import SubMenu from '../sub/SubMenu';
|
||||||
import { Table , Tooltip , Spin } from 'antd';
|
import { Table, Tooltip, Spin,Pagination } from 'antd';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { truncateCommitId } from '../../common/util';
|
import { truncateCommitId } from '../../common/util';
|
||||||
|
@ -12,32 +12,41 @@ import moment from 'moment';
|
||||||
|
|
||||||
function Tags(props) {
|
function Tags(props) {
|
||||||
|
|
||||||
const [ source , setSource ] = useState(undefined);
|
const [source, setSource] = useState(undefined);
|
||||||
const [ isSpin , setIsSpin ] = useState(true);
|
const [isSpin, setIsSpin] = useState(true);
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
const { projectsId , owner } = props.match.params;
|
const [total,setTotal] =useState(0);
|
||||||
|
const [limit,setLimit] =useState(10);
|
||||||
|
const { projectsId, owner } = props.match.params;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (projectsId) {
|
if (projectsId) {
|
||||||
|
setIsSpin(true);
|
||||||
const url = `/${owner}/${projectsId}/tags.json`;
|
const url = `/${owner}/${projectsId}/tags.json`;
|
||||||
axios.get(url).then((result) => {
|
axios.get(url, {
|
||||||
|
params: {
|
||||||
|
limit,
|
||||||
|
page: page
|
||||||
|
}
|
||||||
|
}).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
setSource(result.data);
|
setSource(result.data.tags);
|
||||||
|
setTotal(result.data.total_count);
|
||||||
setIsSpin(false);
|
setIsSpin(false);
|
||||||
}
|
}
|
||||||
}).catch(error => {})
|
}).catch(error => { })
|
||||||
}
|
}
|
||||||
}, [owner, projectsId]);
|
}, [owner, projectsId,page]);
|
||||||
|
|
||||||
const columns=[
|
const columns = [
|
||||||
{
|
{
|
||||||
title:"标签名",
|
title: "标签名",
|
||||||
dataIndex:"name",
|
dataIndex: "name",
|
||||||
key:1,
|
key: 1,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
width:"200px",
|
width: "200px",
|
||||||
render:(txt,item)=>{
|
render: (txt, item) => {
|
||||||
return(
|
return (
|
||||||
<div className="tagBranch">
|
<div className="tagBranch">
|
||||||
<Link className="hover tagClass" to={`/${owner}/${projectsId}/tree/${item.name}`}>{item.name}</Link>
|
<Link className="hover tagClass" to={`/${owner}/${projectsId}/tree/${item.name}`}>{item.name}</Link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,11 +54,11 @@ function Tags(props) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:"创建时间",
|
title: "创建时间",
|
||||||
dataIndex:"time_ago",
|
dataIndex: "time_ago",
|
||||||
key:2,
|
key: 2,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
render:(txt,item)=>{
|
render: (txt, item) => {
|
||||||
return (
|
return (
|
||||||
<span className="color-grey-3 tagModel">
|
<span className="color-grey-3 tagModel">
|
||||||
{
|
{
|
||||||
|
@ -58,11 +67,11 @@ function Tags(props) {
|
||||||
{
|
{
|
||||||
item.tagger.id ?
|
item.tagger.id ?
|
||||||
<Link className="mr3 tagModelImg" to={`/${item.tagger.login}`} >
|
<Link className="mr3 tagModelImg" to={`/${item.tagger.login}`} >
|
||||||
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt=""/>
|
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt="" />
|
||||||
</Link>
|
</Link>
|
||||||
:
|
:
|
||||||
<span className="mr3 tagModelImg" style={{cursor:"default"}}>
|
<span className="mr3 tagModelImg" style={{ cursor: "default" }}>
|
||||||
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt=""/>
|
<img src={getImageUrl(`/${item.tagger && item.tagger.image_url}`)} alt="" />
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
@ -73,36 +82,36 @@ function Tags(props) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:"提交ID",
|
title: "提交ID",
|
||||||
dataIndex:"id",
|
dataIndex: "id",
|
||||||
key:3,
|
key: 3,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
render:(txt,item)=>{
|
render: (txt, item) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip placement="top" title={`最后提交日期:${item.created_at_unix ? moment(item.created_at_unix*1000).format('YYYY-MM-DD'):''}`}>
|
<Tooltip placement="top" title={`最后提交日期:${item.created_at_unix ? moment(item.created_at_unix * 1000).format('YYYY-MM-DD') : ''}`}>
|
||||||
<img src={Tree} alt="提交ID" width="22px" className="mr4"/>
|
<img src={Tree} alt="提交ID" width="22px" className="mr4" />
|
||||||
<Link className="hover color-blue" to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`}>{truncateCommitId(item.id)}</Link>
|
<Link className="hover color-blue" to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`}>{truncateCommitId(item.id)}</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:"描述信息",
|
title: "描述信息",
|
||||||
dataIndex:"message",
|
dataIndex: "message",
|
||||||
key:4,
|
key: 4,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
render:(txt,item)=>{
|
render: (txt, item) => {
|
||||||
return item.message || "--"
|
return item.message || "--"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:"下载",
|
title: "下载",
|
||||||
dataIndex:"stage_type",
|
dataIndex: "stage_type",
|
||||||
key:5,
|
key: 5,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align:"center",
|
align: "center",
|
||||||
width:"204px",
|
width: "204px",
|
||||||
render:(txt,item)=>{
|
render: (txt, item) => {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<a href={`${item.tarball_url}`} download className="btn-83">
|
<a href={`${item.tarball_url}`} download className="btn-83">
|
||||||
|
@ -116,19 +125,35 @@ function Tags(props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
return(
|
|
||||||
|
|
||||||
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
|
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner} />
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<div className="tagSpin">
|
<div className="tagSpin">
|
||||||
{
|
{
|
||||||
source && source.length > 0 &&
|
source && source.length > 0 &&
|
||||||
<Table
|
<Table
|
||||||
|
rowKey={(record) => record.id}
|
||||||
className="tagTable"
|
className="tagTable"
|
||||||
dataSource={source} columns={columns} pagination={false}></Table>
|
dataSource={source} columns={columns} pagination={false}></Table>
|
||||||
}
|
}
|
||||||
|
{total > limit ? (
|
||||||
|
<div className="mt30 mb50 edu-txt-center">
|
||||||
|
<Pagination
|
||||||
|
simple
|
||||||
|
current={page}
|
||||||
|
total={total}
|
||||||
|
pageSize={limit}
|
||||||
|
onChange={(e)=>{setPage(e)}}
|
||||||
|
></Pagination>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
{
|
{
|
||||||
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
|
source && source.length === 0 && <Nonedata _html={'暂无数据~'} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</Spin>
|
</Spin>
|
||||||
|
|
|
@ -61,12 +61,12 @@ export default Form.create()(
|
||||||
const url = `/${owner}/${projectsId}/tags.json`;
|
const url = `/${owner}/${projectsId}/tags.json`;
|
||||||
axios
|
axios
|
||||||
.get(url,{params:{
|
.get(url,{params:{
|
||||||
limit:1000
|
page:1,limit:1000
|
||||||
}})
|
}})
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result) {
|
if (result.data) {
|
||||||
setTagList(result.data);
|
setTagList(result.data.tags);
|
||||||
setOptions(renderTagList(result.data));
|
setOptions(renderTagList(result.data.tags));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
@ -103,11 +103,11 @@ function List(props){
|
||||||
)
|
)
|
||||||
const menu_new=(
|
const menu_new=(
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li onClick={()=>{this.props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建项目
|
||||||
<CheckProfile {...props} sureFunc={()=>{props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建项目</CheckProfile>
|
{/* <CheckProfile {...props} sureFunc={()=>{props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建项目</CheckProfile> */}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li onClick={()=>{this.props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>导入项目
|
||||||
<CheckProfile {...props} sureFunc={()=>{props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>导入项目</CheckProfile>
|
{/* <CheckProfile {...props} sureFunc={()=>{props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>导入项目</CheckProfile> */}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
)
|
)
|
||||||
|
|
|
@ -171,11 +171,12 @@ function ConcentrateBox({ visible , onCancel , onSure , getProjectListUrl , choo
|
||||||
{
|
{
|
||||||
(list && list.length === 0) && (copyList && copyList.length === 0) &&
|
(list && list.length === 0) && (copyList && copyList.length === 0) &&
|
||||||
<div style={{textAlign:"center"}}>您还没有公开的{search && `“${search}”`}项目,先去
|
<div style={{textAlign:"center"}}>您还没有公开的{search && `“${search}”`}项目,先去
|
||||||
<CheckProfile
|
<span onClick={()=>{history.push(createProjectUrl)}} className="color-blue">新建项目</span>
|
||||||
|
{/* <CheckProfile
|
||||||
showCompeleteDialog={showCompeleteDialog}
|
showCompeleteDialog={showCompeleteDialog}
|
||||||
completeProfile={completeProfile}
|
completeProfile={completeProfile}
|
||||||
sureFunc={()=>{history.push(createProjectUrl)}}
|
sureFunc={()=>{history.push(createProjectUrl)}}
|
||||||
className="color-blue">新建项目</CheckProfile>
|
className="color-blue">新建项目</CheckProfile> */}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</Spin>
|
</Spin>
|
||||||
|
|
|
@ -115,12 +115,18 @@ class InfosUser extends Component {
|
||||||
|
|
||||||
newItem =()=> (
|
newItem =()=> (
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li onClick={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目
|
||||||
|
{/* <CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}}>新建项目</CheckProfile> */}
|
||||||
|
</li>
|
||||||
|
<li onClick={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目
|
||||||
|
{/* <CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile> */}
|
||||||
|
</li>
|
||||||
|
{/* <li>
|
||||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}} >新建项目</CheckProfile>
|
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}} >新建项目</CheckProfile>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile>
|
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>导入项目</CheckProfile>
|
||||||
</li>
|
</li> */}
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -643,3 +643,12 @@ export function followTaskList(params) {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证验证码
|
||||||
|
export function checkVerificationCode(data) {
|
||||||
|
return fetch({
|
||||||
|
url: `/api/weixin/checkVerificationCode`,
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
|
@ -34,6 +34,7 @@
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
border-radius:5px 0px 0px 5px;
|
border-radius:5px 0px 0px 5px;
|
||||||
|
cursor: pointer;
|
||||||
&:hover
|
&:hover
|
||||||
{
|
{
|
||||||
background-color: #F3F4F6;
|
background-color: #F3F4F6;
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { Form, Input, Button, Modal, message } from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { setmiyah, isMobile } from 'educoder';
|
||||||
|
import { formModalLayout } from '../static';
|
||||||
|
import {checkVerificationCode} from '../api';
|
||||||
|
|
||||||
|
export default Form.create()(({ visible, history, form, setVisible,changeContactPhone }) => {
|
||||||
|
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||||
|
const [getCaptchaBut, setGetCaptchaBut] = useState(false);
|
||||||
|
const [num, setNum] = useState(0) // 倒计时
|
||||||
|
const [isSend, setIsSend] = useState(false) // 是否发送验证码
|
||||||
|
|
||||||
|
const helper = useCallback(
|
||||||
|
(label, name, rules, widget, initialValue, rightComponent) => (
|
||||||
|
<Form.Item label={label}>
|
||||||
|
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
|
||||||
|
{rightComponent}
|
||||||
|
</Form.Item>
|
||||||
|
), []);
|
||||||
|
|
||||||
|
/** 倒计时显示*/
|
||||||
|
useEffect(() => {
|
||||||
|
let timer = 0;
|
||||||
|
if (isSend && num !== 0) {
|
||||||
|
timer = setInterval(() => {
|
||||||
|
setNum(n => {
|
||||||
|
if (n === 1) {
|
||||||
|
setIsSend(false)
|
||||||
|
clearInterval(timer)
|
||||||
|
}
|
||||||
|
return n - 1;
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
// 组件销毁时,清除定时器
|
||||||
|
clearInterval(timer)
|
||||||
|
};
|
||||||
|
}, [isSend]);
|
||||||
|
|
||||||
|
function getCode() {
|
||||||
|
setIsSend(true);
|
||||||
|
setNum(60);
|
||||||
|
validateFields(['phone'], (err, values) => {
|
||||||
|
//请求获取验证码接口
|
||||||
|
axios.get(`/accounts/get_verification_code.json`, {
|
||||||
|
params: {
|
||||||
|
login: values.phone,
|
||||||
|
type: 5,
|
||||||
|
smscode: setmiyah(values.phone),
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
debugger
|
||||||
|
if (res && res.data && res.data && res.data.status === 0) {
|
||||||
|
//验证码发送成功
|
||||||
|
message.success({
|
||||||
|
content: <span>验证码已发送,请注意查收。</span>,
|
||||||
|
getContainer: document.querySelector('.phoneEdit')
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//验证码发送失败,获取验证码按钮变灰并且文案变回【获取验证码】
|
||||||
|
message.error({ content: <span>验证码发送失败</span> ,
|
||||||
|
getContainer: document.querySelector('.phoneEdit')});
|
||||||
|
setGetCaptchaBut(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkItem() {
|
||||||
|
validateFields((err, values) => {
|
||||||
|
// 验证验证码接口
|
||||||
|
checkVerificationCode({
|
||||||
|
phoneNumber: values.phone,
|
||||||
|
verificationCode:values.code,
|
||||||
|
}).then(res=>{
|
||||||
|
if(res&&res.data){
|
||||||
|
message.success({
|
||||||
|
content: <span>修改联系手机号成功!</span>,
|
||||||
|
getContainer: document.querySelector('.phoneEdit')
|
||||||
|
});
|
||||||
|
changeContactPhone(values.phone)
|
||||||
|
setVisible(false)
|
||||||
|
}else{
|
||||||
|
message.error({ content: '验证失败',
|
||||||
|
getContainer: document.querySelector('.phoneEdit')});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title="修改联系电话"
|
||||||
|
visible={visible}
|
||||||
|
onOk={checkItem}
|
||||||
|
onCancel={() => { setVisible(false) }}
|
||||||
|
className="form-edit-modal phoneEdit"
|
||||||
|
>
|
||||||
|
<Form {...formModalLayout}>
|
||||||
|
<Form.Item label={"新手机号码:"} >
|
||||||
|
{getFieldDecorator('phone', {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入手机号"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: (rule, val, callback) => {
|
||||||
|
const pattern = /^1(3|4|5|6|7|8|9)\d{9}$/;
|
||||||
|
if (pattern.test(val)) {
|
||||||
|
setGetCaptchaBut(true);
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
setGetCaptchaBut(false);
|
||||||
|
callback('请输入正确的手机号码!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
validateTrigger: "onChange",
|
||||||
|
validateFirst: true,
|
||||||
|
})(<Input className="tel-input" placeholder="请输入手机号" />)}
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label={"验证码:"} >
|
||||||
|
{getFieldDecorator('code', {
|
||||||
|
rules: [{
|
||||||
|
required: true,
|
||||||
|
message: "请输入验证码"
|
||||||
|
}],
|
||||||
|
validateTrigger: "onBlur",
|
||||||
|
})(
|
||||||
|
<Input className="code-input" placeholder="请输入验证码" />
|
||||||
|
)}
|
||||||
|
<Button className="ml10" type="primary" disabled={num !== 0 || !getCaptchaBut} onClick={getCode}>{num || '获取验证码'}</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
})
|
|
@ -9,6 +9,7 @@ import { httpUrl } from '../fetch';
|
||||||
import { getTaskDetail, addTask, updateTask, getTaskCategory, getCompanyInfo } from '../api';
|
import { getTaskDetail, addTask, updateTask, getTaskCategory, getCompanyInfo } from '../api';
|
||||||
import { formItemLayout, formModalLayout } from '../static';
|
import { formItemLayout, formModalLayout } from '../static';
|
||||||
import { editorConfig } from '../../components/config';
|
import { editorConfig } from '../../components/config';
|
||||||
|
import CodeModal from './codeModal';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
const { info } = Modal;
|
const { info } = Modal;
|
||||||
|
@ -111,14 +112,14 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
||||||
if (res && res.message === 'success') {
|
if (res && res.message === 'success') {
|
||||||
setEnterpriseName(res.data.enterpriseName);
|
setEnterpriseName(res.data.enterpriseName);
|
||||||
setFieldsValue({
|
setFieldsValue({
|
||||||
contactPhone:res.data.phone,
|
contactPhone: res.data.phone,
|
||||||
contactName:res.data.userName,
|
contactName: res.data.userName,
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
showNotification(res.message);
|
showNotification(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},[]);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getTaskCategory().then(data => {
|
getTaskCategory().then(data => {
|
||||||
|
@ -152,11 +153,6 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
||||||
};
|
};
|
||||||
}, [isSend]);
|
}, [isSend]);
|
||||||
|
|
||||||
function getCode() {
|
|
||||||
setIsSend(true);
|
|
||||||
setNum(60);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 上传附件后得到的文件数组
|
// 上传附件后得到的文件数组
|
||||||
function UploadFunc(fileList) {
|
function UploadFunc(fileList) {
|
||||||
setFileList(fileList);
|
setFileList(fileList);
|
||||||
|
@ -195,11 +191,12 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
||||||
// 新增或者修改后的处理函数
|
// 新增或者修改后的处理函数
|
||||||
const publishDeal = useCallback((status, publishMode, res) => {
|
const publishDeal = useCallback((status, publishMode, res) => {
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
showNotification("任务保存成功!");
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
history.push("/task/myTask?published=false");
|
history.push("/task/myTask?published=false");
|
||||||
|
showNotification("任务保存成功!");
|
||||||
} else if (current_user.admin) {
|
} else if (current_user.admin) {
|
||||||
history.push("/task");
|
history.push("/task");
|
||||||
|
showNotification("任务发布成功!");
|
||||||
} else {
|
} else {
|
||||||
info({
|
info({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
@ -263,6 +260,12 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
||||||
setDisplayTime({ collectingTime, choosingTime, makePublicTime, signingTime, payingTime });
|
setDisplayTime({ collectingTime, choosingTime, makePublicTime, signingTime, payingTime });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeContactPhone(e){
|
||||||
|
console.log(e);
|
||||||
|
setFieldsValue({
|
||||||
|
contactPhone:e
|
||||||
|
})
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className="centerbox">
|
<div className="centerbox">
|
||||||
<div className="head-navigation">
|
<div className="head-navigation">
|
||||||
|
@ -521,29 +524,8 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
||||||
<Button className="mr20" type={"primary"} onClick={() => { saveItem(0) }}>保存</Button>
|
<Button className="mr20" type={"primary"} onClick={() => { saveItem(0) }}>保存</Button>
|
||||||
<Button onClick={() => { history.go(-1) }}>取消</Button>
|
<Button onClick={() => { history.go(-1) }}>取消</Button>
|
||||||
|
|
||||||
<Modal
|
<CodeModal visible={visible} setVisible={setVisible} changeContactPhone={changeContactPhone}/>
|
||||||
title="修改联系电话"
|
|
||||||
visible={visible}
|
|
||||||
// onOk={checkItem}
|
|
||||||
onCancel={() => { setVisible(false) }}
|
|
||||||
className="form-edit-modal"
|
|
||||||
>
|
|
||||||
<Form {...formModalLayout}>
|
|
||||||
<Form.Item label={"新手机号码:"} >
|
|
||||||
<Input
|
|
||||||
className="tel-input"
|
|
||||||
placeholder="请输入11位手机号"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label={"验证码:"} >
|
|
||||||
<Input
|
|
||||||
className="code-input"
|
|
||||||
placeholder="请输入验证码"
|
|
||||||
/>
|
|
||||||
<Button className="ml10" type="primary" disabled={num !== 0} onClick={getCode}>{num || '获取验证码'}</Button>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -152,3 +152,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phoneEdit{
|
||||||
|
.ant-form-explain{
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-message{
|
||||||
|
z-index: 1040;
|
||||||
|
}
|
Loading…
Reference in New Issue