回归issue

This commit is contained in:
何童崇 2022-03-10 14:27:09 +08:00
parent f975ab0ec3
commit 7d37a565b3
4 changed files with 56 additions and 34 deletions

View File

@ -10,12 +10,12 @@ import img_parise from '../Images/parise.png';
import SpecialModal from './SpecialModal';
class IndexItem extends Component {
constructor(props){
constructor(props) {
super(props);
this.state={
visible:false,
user_apply_signatures:[],
project_id:undefined
this.state = {
visible: false,
user_apply_signatures: [],
project_id: undefined
}
}
TurnToDetail = (login, url) => {
@ -31,31 +31,31 @@ class IndexItem extends Component {
* is_secret:是否是特殊开源许可证项目
* id创建者login
* is_member:是否是项目成员(如果是项目成员可以直接进入项目)
* */
projectHref=(link , user_apply_signatures,project_id,is_secret , id,is_member)=>{
const { user , showLoginDialog } = this.props;
if(is_secret && (!user || (user && !user.login))){
* */
projectHref = (link, user_apply_signatures, project_id, is_secret, id, is_member) => {
const { user, showLoginDialog } = this.props;
if (is_secret && (!user || (user && !user.login))) {
showLoginDialog();
return;
}
let signa = user_apply_signatures && user_apply_signatures[0];
if((is_secret && !is_member && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){
if ((is_secret && !is_member && (!signa || (signa && signa.status !== "passed"))) && user.login !== id) {
this.setState({
visible:true,
user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined,
visible: true,
user_apply_signatures: user_apply_signatures.length > 0 ? user_apply_signatures[0] : undefined,
project_id
})
}else{
} else {
this.props.history.push(link);
}
}
hideModal=()=>{
hideModal = () => {
this.setState({
visible:false
visible: false
})
}
sureModal=()=>{
sureModal = () => {
this.hideModal();
const { getListData } = this.props;
getListData && getListData(1);
@ -63,26 +63,26 @@ class IndexItem extends Component {
render() {
const { projects } = this.props;
const { visible , user_apply_signatures , project_id } = this.state;
const { visible, user_apply_signatures, project_id } = this.state;
return (
<div className="project-list minH-670" style={{padding:"0px 20px"}}>
<div className="project-list minH-670" style={{ padding: "0px 20px" }}>
<SpecialModal {...this.props} visible={visible} hideModal={this.hideModal} user_apply_signatures={user_apply_signatures} project_id={project_id} sureModal={this.sureModal}></SpecialModal>
{ projects && projects.length > 0 ? projects.map((item, key) => {
{projects && projects.length > 0 ? projects.map((item, key) => {
return (
<div className="p-r-Item" key={key}>
{
item.platform === "educoder" ?
<a href="javascript:void(0)" style={{cursor:"default"}} className="show-user-link">
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a>
:
<Link to={`/${item.author && item.author.login}`} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
</Link>
<a href="javascript:void(0)" style={{ cursor: "default" }} className="show-user-link">
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a>
:
<Link to={`/${item.author && item.author.login}`} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
</Link>
}
<div className="p-r-Infos">
<div className="p-r-name">
<AlignCenter>
{/* <AlignCenter>
<Link to={`/${item.author.login}/${item.identifier}`} title={`${item.author.name}/${item.name}`} className="color-grey-3 font-18 task-hide " style={{maxWidth: 470 }}>
{item.author.name}/{item.name}
</Link>
@ -100,7 +100,27 @@ class IndexItem extends Component {
<i className="iconfont icon-banbenku font-18 color-green" />
</Tooltip>:""
}
</AlignCenter>
</AlignCenter> */}
<a onClick={() => this.projectHref(`/${item.author.login}/${item.identifier}`, item.user_apply_signatures, item.id, item.is_secret, item.author.login, item.is_member)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}>
{item.author.name}/{item.name}
{
item.forked_from_project_id ?
<span className="ml5">
<i className="iconfont icon-fork font-18 color-orange" />
</span>
: ""
}
{
item.type && item.type !== 0 ?
item.type === 2 ?
<Tooltip title="该项目是一个镜像" className="ml5">
<i className="iconfont icon-banbenku font-18 color-green" />
</Tooltip> :
<span className="ml5">
<i className="iconfont icon-jingxiang font-18 color-green" />
</span> : ""
}
</a>
<span className="p-r-tags">
<span className="pariseTag">
<img src={img_parise} alt="" className="pariseImg" /> {item.praises_count}
@ -110,7 +130,7 @@ class IndexItem extends Component {
</span>
</span>
</div>
<p className="break_word task-hide-2 mt10" style={{ maxHeight: "44px",lineHeight:"22px" }}>{item.description}</p>
<p className="break_word task-hide-2 mt10" style={{ maxHeight: "44px", lineHeight: "22px" }}>{item.description}</p>
<div className="p-r-about">
<span className="p-r-detail">
@ -122,7 +142,7 @@ class IndexItem extends Component {
</div>
)
}) : <Nodata _html="暂无数据~"></Nodata>
}
}
</div>
)
}

View File

@ -16,7 +16,6 @@ function SpecialModal({ visible , hideModal , sureModal , showNotification , use
function sure(){
if(!user_apply_signatures || (user_apply_signatures && user_apply_signatures.status !== "waiting")){
if(!id || (id && id.length === 0)){
window.open(getUrl(`/api/apply_signatures/template_file`));
const a = document.createElement('a');
a.href = getUrl(`/api/apply_signatures/template_file`);
a.click(); //

View File

@ -41,7 +41,7 @@ class ExportWord extends Component {
const activeDoc = document.getElementById(wordId).cloneNode(true); // 获取 dom 节点
// 默认样式
const defaultStyle = '.text-div{ text-decoration: underline; margin-right: 15px; } .textarea-div{ text-decoration: underline; }';
const defaultStyle = '.text-div{ text-decoration: underline; margin-right: 15px; } .textarea-div{ text-decoration: underline; } table td,table th{padding: 6px 13px;border: 1px solid #ddd;} table{border-collapse: collapse;}';
const mHtmlBottom = '\n--NEXT.ITEM-BOUNDARY--';// 文件尾信息
// 替换模板里的内容
@ -73,7 +73,7 @@ class ExportWord extends Component {
render() {
const { title,className } = this.props;
return (
<span className="editor-sany-word">
<span className="link">
<span className={className} onClick={this.exportWord}>{title}</span>
</span>
);

View File

@ -1,5 +1,6 @@
import React, { useEffect, useState, } from 'react';
import { Modal, Form, Input, } from 'antd';
import RenderHtml from 'src/components/render-html';
import Upload from 'military/components/Upload';
import ExportWord from 'military/components/ExportWord';
import { uploadAgreePaper,getAgreement } from "../../api";
@ -85,7 +86,9 @@ export default Form.create()(props => {
validateFirst: true
})(<Input style={{ display: 'none' }} />)}
</Form.Item>
<div id="wordExpert" style={{display:'none'}} dangerouslySetInnerHTML={{__html:content}}></div>
<div id="wordExpert" style={{display:'none'}} >
<RenderHtml className="break_word_comments imageLayerParent" value={content} />
</div>
</div>
</Modal>
)