diff --git a/src/common/hooks/ImageLayer2.js b/src/common/hooks/ImageLayer2.js index 504e491c..ae429bab 100644 --- a/src/common/hooks/ImageLayer2.js +++ b/src/common/hooks/ImageLayer2.js @@ -12,32 +12,25 @@ function ImageLayer2(props) { setShowImage(false) setImageSrc('') } - const onDelegateClick = (event) => { - const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') - // 判断imageSrc是否是图片 - const fileName = event.target.innerHTML.trim() - if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) { - // 非回复里的头像图片; 非emoticons - if (imageSrc.indexOf('/images/avatars/User') === -1 && - imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { - setShowImage(true) - setImageSrc(imageSrc) - } - event.stopPropagation() - event.preventDefault && event.preventDefault() - event.originalEvent.preventDefault() - // event.originalEvent.stopPropagation() - // event.originalEvent.cancelBubble = true - return false; - } - } useEffect(() => { - $(parentSel) - .delegate(childSel, "click", onDelegateClick); - - return () => { - $(parentSel).undelegate(childSel, "click", onDelegateClick ) - } + $(parentSel).delegate(childSel, "click", (event) => { + const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') + // 判断imageSrc是否是图片 + const fileName = event.target.innerHTML.trim(); + + if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) { + // 非回复里的头像图片; 非emoticons + if (imageSrc.indexOf('/images/avatars/User') === -1 && + imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { + setShowImage(true) + setImageSrc(imageSrc) + } + event.stopPropagation() + event.preventDefault && event.preventDefault() + event.originalEvent.preventDefault() + return false; + } + }) }) return ( diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 50189780..c9f26b73 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -359,7 +359,7 @@ class MessageCount extends Component { diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index c9c38610..9d93c9cc 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -3,7 +3,7 @@ import { Link } from "react-router-dom"; import axios from "axios"; import { getImageUrl } from "educoder"; -import { Form , Popconfirm , Tag , Spin } from "antd"; +import { Form, Popconfirm, Tag, Spin } from "antd"; import Attachments from "../Upload/attachment"; import RenderHtml from "../../components/render-html"; import Comments from "../comments/comments"; @@ -44,7 +44,7 @@ class Detail extends Component { }; getDetail = () => { - const { projectsId, orderId,owner } = this.props.match.params; + const { projectsId, orderId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/issues/${orderId}.json`; axios .get(url) @@ -52,7 +52,7 @@ class Detail extends Component { if (result) { this.setState({ data: result.data, - isSpins:false + isSpins: false }); } }) @@ -74,7 +74,7 @@ class Detail extends Component { //删除任务信息 deletedetail = (id) => { - const { projectsId, orderId,owner } = this.props.match.params; + const { projectsId, orderId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/issues/${orderId}.json`; axios .delete(url, { @@ -95,7 +95,7 @@ class Detail extends Component { //关闭任务 closedetail = (id) => { - const { projectsId, orderId , owner } = this.props.match.params; + const { projectsId, orderId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/issues/${orderId}/close_issue.json`; axios .post(url, { @@ -122,7 +122,7 @@ class Detail extends Component { //复制 copydetail = () => { - const { projectsId, orderId , owner} = this.props.match.params; + const { projectsId, orderId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`; axios .post(url, { @@ -182,12 +182,12 @@ class Detail extends Component { }; commentCtx = (v) => { - return ; + return ; }; render() { - const { projectsId, orderId , owner } = this.props.match.params; - const { data , isSpins } = this.state; + const { projectsId, orderId, owner } = this.props.match.params; + const { data, isSpins } = this.state; const get_color = (type) => { if (type === "高") { return "#e67e22"; @@ -276,8 +276,8 @@ class Detail extends Component { ) : ( - "" - )} + "" + )} @@ -286,8 +286,8 @@ class Detail extends Component { {data && data.description && data.description.length > 0 ? ( this.commentCtx(data.description) ) : ( - 没有描述 - )} + 暂无描述 + )} {data && data.attachments && data.attachments.length > 0 ? ( ) : ( - "" - )} + "" + )} @@ -307,77 +307,66 @@ class Detail extends Component { />
-
-

- 分支: - {data && data.branch_name ? data.branch_name : "--"} -

- {/*

- 是否上链: - {data && data.issue_type==="2" ? '是' : "--"} -

- { - data && data.issue_type==="2" && -

- token值: - {data && data.token ? data.token : "--"} -

- } */} -

- 标签: - - {data && data.issue_tags ? ( - - - {data.issue_tags[0].name} - - ) : ( - "--" - )} - -

-

- 里程碑: - - {data && data.version ? data.version : "--"} - -

-

- 状态: - - {data && data.issue_status ? data.issue_status : "--"} - -

-

- 分类: - {data && data.tracker ? data.tracker : "--"} -

-

- 负责人: - - {data && data.assign_user_name ? data.assign_user_name : "--"} - -

-

- 开始日期: - {data && data.start_date ? data.start_date : "--"} -

-

- 结束日期: - {data && data.due_date ? data.due_date : "--"} -

+
+

+ 分支: + {data && data.branch_name ? data.branch_name : "--"} +

+

+ 标签: + + {data && data.issue_tags ? ( + + + {data.issue_tags[0].name} + + ) : ( + "--" + )} + +

+

+ 里程碑: + + {data && data.version ? data.version : "--"} + +

+

+ 状态: + + {data && data.issue_status ? data.issue_status : "--"} + +

+

+ 分类: + {data && data.tracker ? data.tracker : "--"} +

+

+ 负责人: + + {data && data.assign_user_name ? data.assign_user_name : "--"} + +

+

+ 开始日期: + {data && data.start_date ? data.start_date : "--"} +

+

+ 结束日期: + {data && data.due_date ? data.due_date : "--"} +

-

- 完成度: - {data && data.done_ratio ? data.done_ratio : "--"} -

+

+ 完成度: + {data && data.done_ratio ? data.done_ratio : "--"} +

+
- - + ); } } diff --git a/src/modules/comment/CommentsHOC.js b/src/modules/comment/CommentsHOC.js index 3b3a442e..6a9419ea 100644 --- a/src/modules/comment/CommentsHOC.js +++ b/src/modules/comment/CommentsHOC.js @@ -427,10 +427,6 @@ export function commentHOC(WrappedComponent) { }) } - // ----------------------------------------------------------------------------------------------评论 End - - // ----------------------------------------------------------------------------------------------评论 End - componentDidMount() { $(".commentsDelegateParent") .delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img", "click", (event) => {