From 7d37a565b309115b9d6abf9369619d4286ba4ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Thu, 10 Mar 2022 14:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=BD=92issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/IndexItem.js | 80 ++++++++++++------- src/forge/Main/SpecialModal.jsx | 1 - src/military/components/ExportWord.js | 4 +- .../task/components/agreementModal/index.jsx | 5 +- 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index fecadb137..ac5eb23cd 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -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 ( -
+
- { projects && projects.length > 0 ? projects.map((item, key) => { + {projects && projects.length > 0 ? projects.map((item, key) => { return (
{ item.platform === "educoder" ? - - - - : - - - + + + + : + + + }
-

{item.description}

+

{item.description}

@@ -122,7 +142,7 @@ class IndexItem extends Component {
) }) : - } + }
) } diff --git a/src/forge/Main/SpecialModal.jsx b/src/forge/Main/SpecialModal.jsx index d234843f2..dd1fab9e1 100644 --- a/src/forge/Main/SpecialModal.jsx +++ b/src/forge/Main/SpecialModal.jsx @@ -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(); // 下载 diff --git a/src/military/components/ExportWord.js b/src/military/components/ExportWord.js index c978aa399..59a9511f5 100644 --- a/src/military/components/ExportWord.js +++ b/src/military/components/ExportWord.js @@ -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 ( - + {title} ); diff --git a/src/military/task/components/agreementModal/index.jsx b/src/military/task/components/agreementModal/index.jsx index e842cff7a..00cb937ba 100644 --- a/src/military/task/components/agreementModal/index.jsx +++ b/src/military/task/components/agreementModal/index.jsx @@ -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 })()} -
+
+ +
)