Merge branch 'gitlink_server' of https://gitlink.org.cn/Gitlink/forgeplus-react into gitlink_server

This commit is contained in:
谢思 2023-12-15 15:22:43 +08:00
commit 42975ca188
14 changed files with 695 additions and 29 deletions

View File

@ -177,7 +177,7 @@
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },
"proxy": "http://localhost:3000", "proxy": "http://172.20.32.202:4000",
"port": "3007", "port": "3007",
"devDependencies": { "devDependencies": {
"@babel/runtime": "7.0.0-beta.51", "@babel/runtime": "7.0.0-beta.51",

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN" class="notranslate translated-ltr" translate="no"> <html lang="zh-hans-CN" class="notranslate translated-ltr" translate="no">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -20,7 +20,7 @@
<meta name="octolytics-dimension-repository_nwo" content="GitLink"></meta> <meta name="octolytics-dimension-repository_nwo" content="GitLink"></meta>
<meta name="octolytics-dimension-repository_network_root_nwo" content="GitLink"></meta> <meta name="octolytics-dimension-repository_network_root_nwo" content="GitLink"></meta>
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> -->
<meta content="IE=edge" http-equiv="X-UA-Compatible"> <meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="twitter:image:src" content="https://www.gitlink.org.cn/images/logo.png"> <meta name="twitter:image:src" content="https://www.gitlink.org.cn/images/logo.png">
<meta name="twitter:site" content="@gitlink"> <meta name="twitter:site" content="@gitlink">

View File

@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) {
// 判断网络是否连接 // 判断网络是否连接
initOnlineOfflineListener(); initOnlineOfflineListener();
var proxy = "https://testforgeplus.trustie.net"; var proxy = "http://172.20.32.202:4000";
//响应前的设置 //响应前的设置
axios.interceptors.request.use( axios.interceptors.request.use(
@ -43,18 +43,20 @@ export function initAxiosInterceptors(props) {
requestProxy(config); requestProxy(config);
let url = `/api${config.url}`; let url = `/api${config.url}`;
if (`${config[0]}` !== `true`) { // if (`${config[0]}` !== `true`) {
if (window.location.port === "3007") { // if (window.location.port === "3007") {
config.url = `${proxy}${url}`; // config.url = `${proxy}${url}`;
if (config.url.indexOf('?') === -1) { // if (config.url.indexOf('?') === -1) {
config.url = `${config.url}?debug=${debugType}`; // config.url = `${config.url}`;
} else { // } else {
config.url = `${config.url}&debug=${debugType}`; // config.url = `${config.url}`;
} // }
} else { // } else {
config.url = url; // config.url = url;
} // }
} // }
config.url = url;
config.withCredentials = false;
return config; return config;
}, },
err => { err => {

View File

@ -140,10 +140,10 @@ export function setImagesUrl(path){
} }
export function getUrl(path, goTest) { export function getUrl(path, goTest) {
const local = 'https://testforgeplus.trustie.net' // const local = 'http://172.20.32.202:8080'
if (isDev) { // if (isDev) {
return `${local}${path?path:''}` // return `${local}${path?path:''}`
} // }
return `${path ? path: ''}`; return `${path ? path: ''}`;
} }

View File

@ -27,7 +27,7 @@ function Releases({ owner, projectsId, releaseVersions, distribution }) {
}) })
: :
<div className="mt8"> <div className="mt8">
您暂未发布任何版本 暂无发行版
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>创建新版本</Link>} {distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>创建新版本</Link>}
</div> </div>
} }

View File

@ -0,0 +1,167 @@
import React from 'react';
import { Button, message } from 'antd';
import { getImageUrl } from 'educoder';
import MDEditor from "../../../../modules/tpm/challengesnew/tpm-md-editor";
import Upload from "../../../../forge/Upload/Index";
import Attachments from "../../../../forge/Upload/attachment";
import UploadImg from "../../../../forge/Images/upload.png";
import './list.scss';
import '../../../../forge/Order/order.scss';
import { useState } from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
import { addComment, editComment } from '../../api'
function EditComment(props){
const {owner, projectsId, index} = props.match.params;
const {current_user, current_user:{login}, docId, showNotification, reloadComment, cancelMd, parentId, replyId, updateId, showUserImg=true} = props;
const [content, setContent] = useState(props.content);
const [quillFlag, setQuillFlag] = useState(false);
// loading
const [journalSpin, setJournalSpin] = useState(false);
const [atWhoLoginList, setAtWhoLoginList] = useState(undefined);
const [fileList, setFileList] = useState(undefined);
const [attachmentClean, setAttachmentClean] = useState(true);
const [ save , setSave ] = useState(undefined);
useState(()=>{
setSave(props.defaultFileList);
},[props.defaultFileList])
//
function addJournals(){
if(!content){
setQuillFlag(true);
return
}
setJournalSpin(true);
console.log(updateId)
if(updateId){
//
const params = {
id: updateId,
notes: content,
attachmentIds: fileList,
receivers_login:atWhoLoginList
}
editComment(docId, params).then(res=>{
if(res && res.data && res.data.data){
//
reloadComment();
message.success('评论成功');
cancelMd();
setContent(undefined);
}
setJournalSpin(false);
})
}else{
//
const params = {
parentId: parentId,
replyId: replyId,
notes: content,
attachmentIds: fileList,
}
addComment(docId, params).then(res=>{
if(res && res.data && res.data.data){
//
reloadComment();
message.success('评论成功');
cancelMd();
setContent(undefined);
}
setJournalSpin(false);
})
}
};
function deleteLoad(id){
let arr = [];
let list = save;
if(list && list.length>0 ){
arr = list.filter(i=>i.id !== id);
}
setFileList(arr.map(i=>{return i.id}));
setSave(arr);
}
function UploadFunc(f){
let list = [];
let arr = [];
if(save && save.length>0 ){
arr = save.map(i=>{return i.id});
}
list = arr && arr.length>0 ? f.concat(arr) : f ;
setFileList(list);
};
return(
<div className="grid-item-top pb10">
<Link
to={`/${current_user && current_user.login}`}
className="show-user-link mr10"
>
<img
className="radius"
src={getImageUrl(
`/${current_user && current_user.image_url}`
)}
alt=""
width="30"
height="30"
style={{display: showUserImg ? '' : 'none'}}
/>
</Link>
<div style={{position:"relative"}}>
<MDEditor
placeholder={"添加评论..."}
height={300}
mdID={"orderdetail-add-descriptions" + replyId}
initValue={content}
onChange={(value)=>{setQuillFlag(false);setContent(value);}}
changeAtWhoLoginList = {(loginList)=>{setAtWhoLoginList(loginList); setAttachmentClean(true)}}
owner = {owner}
projectsId = {projectsId}
></MDEditor>
<p className="quillFlagBox">
{quillFlag && <span>请输入评论内容</span>}
</p>
<Upload
className="commentStyle"
isComplete={attachmentClean}
load={UploadFunc}
icon={
<img
src={UploadImg}
width="58"
alt=""
style={{ marginBottom: 15 }}
/>
}
size={100}
showNotification={showNotification}
// defaultFileList={props.defaultFileList}
/>
{props.defaultFileList && props.defaultFileList.length > 0 &&
<Attachments
attachments={props.defaultFileList}
showNotification={props.showNotification}
canDelete={true}
deleteLoad={deleteLoad}
></Attachments>
}
<p className="clearfix mt20">
<Button
type="primary"
onClick={addJournals}
loading={journalSpin}
className="mr15 colorButton"
>
评论
</Button>
<Button className="colorButton2" onClick={()=>{cancelMd()}}>取消</Button>
</p>
</div>
</div>
)
}
export default EditComment;

View File

@ -0,0 +1,226 @@
import React, { useEffect, useState } from 'react';
import { Button, Popconfirm, Radio, Input, message, Tooltip, Spin, Pagination } from 'antd';
import axios from 'axios';
import { getImageUrl, timeAgo } from 'educoder';
import RenderHtml from '../../../../components/render-html';
import Attachment from '../../../Upload/attachment';
import EditComment from './editComment';
import Nodata from '../../../Nodata';
import CheckProfile from '../../../Component/ProfileModal/Profile';
import './list.scss';
import { Link } from 'react-router-dom';
import { getCommentList, deleteComment } from '../../api'
function IssueCommentList(props){
const{docId, history: {location}, reload, reloadComment, showNotification, current_user:{login, admin, image_url, username}, isManager, showLoginDialog, author} = props;
const {owner, projectsId, index} = props.match.params;
const [category, setCategory] = useState('comment');
const [journals, setJournals] = useState(undefined);
// /markdown1 2 3 4 5
const [showEdit, setShowEdit] = useState(false);
const [parentId, setParentId] = useState(undefined);
const [replyId, setReplyId] = useState(undefined);
// id
const [updateId, setUpdateId] = useState(undefined);
//
const [open, setOpen] = useState(undefined);
// css 线
const [spin, setSpin] = useState(false);
// issue
const [journalsCount, setJournalsCount] = useState(undefined);
//
const limit = 50;
const [page, setPage] = useState(1);
const [totalCount, setTotalCount] = useState(undefined);
// icon
const journalsIcon ={
'issue': 'icon-chuangjianqianbao',
'branch_name': 'icon-fenzhi3',
'assigner': 'icon-chengyuan2',
'status_id': 'icon-xiugaibaobiaomoban',
'fixed_version_id': 'icon-lichengbeiicon2',
'due_date': 'icon-riqi',
'issue_tag': 'icon-biaoji2',
'description': 'icon-xiugaibaobiaomoban',
'subject': 'icon-xiugaibaobiaomoban',
'start_date': 'icon-riqi',
'priority_id': 'icon-youxian',
'attachment': 'icon-xiugaibaobiaomoban'
}
useEffect(()=>{
setSpin(true);
let params = {
limit: limit,
page: page
}
getCommentList(docId, params).then(res=>{
if(res && res.data && res.data.data){
const {journals, total_comment_journals_count, total_count} = res.data.data;
if(category === 'all'){
const array = [];
let start = undefined;
let isJournalCount = 0;
journals.map((item, index)=>{
!isJournalCount && (start = index)
item.is_journal_detail && (isJournalCount++)
if(!item.is_journal_detail && isJournalCount < 10){
isJournalCount = 0;
return
}
if(isJournalCount >= 10 && (!item.is_journal_detail || journals.length-1 === index)){
array.push({start, count: isJournalCount});
isJournalCount = 0;
}
})
array.map((item, i)=>{
journals[item.start].numCount = item.count-1;
for (let index = 0; index < item.count; index++) {
journals[item.start+index].start = journals[item.start].id;
journals[item.start+index].closeAndSpan = true;
}
})
}
setTotalCount(total_count);
setJournalsCount(total_comment_journals_count);
setJournals(journals);
setSpin(false)
}
})
}, [reload, category, page])
function commentCtx(v){
return <RenderHtml owner={owner} projectsId={projectsId} className="break_word_comments imageLayerParent commentRenderHtml" value={v} url={location}/>;
};
//
function deleteCommentFunc(id){
deleteComment(docId, id).then(res=>{
if(res && res.data && !res.data.data.status){
reloadComment();
message.success('删除成功');
}
})
}
// markdown
function cancelMd(){
setShowEdit(false);
}
return(
<div className="commentListBox">
{/* 评论 */}
<div className={`${!login && journalsCount > 0 && 'pb15'}`}>
<div className='typeActionBox mb20'>
<div className='line'></div>
<div>评论{ journalsCount > 0 && `(共${ journalsCount }条评论)` }</div>
</div>
</div>
{/* 评论快速入口-仅有评论且登录时展示 */}
{login && category !== 'operate' && journalsCount > 0 && <div className={`pb30 ${journalsCount > 0 && 'pt15'}`}><div className='gotoComment'>点击<a className='ml5' href='#addComments'>添加评论</a></div></div>}
{/* 评论/操作日志 展示列表 */}
<Spin spinning={spin}>
<div className={`issueCommentsBox ${category === 'comment' && !spin && 'justComment'}`}>
{journals && (journals.length > 0 && journals.map(item=>{return <div key={item.id} className='commentContentBox pb30'>
{/* 评论 */}
<div className='commentOperationBor'></div>
<Link to={`/${item.user.login}`}><img src={getImageUrl(item.user.image_url)} alt="" className='commentUserImg mr15'/></Link>
<div className='commentContentRight'>
{/* 判断是否是编辑状态 */}
{(showEdit === 2 && updateId === item.id) ? <div className='mt15 mr20'><EditComment {...props} cancelMd={cancelMd} updateId={updateId} reloadComment={reloadComment} content={item.notes} defaultFileList={item.attachments} showUserImg={false}/></div> : <div>
<div className='commentContent'>
<div className='flexCenter font-14'>
<div>
<Link to={`/${item.user.login}`}>{item.user.name}</Link>
<span className='ml15 timeAgo font-14'>{timeAgo(item.created_at)}</span>
</div>
{login && <div>
{/* 平台管理员/仓库管理员/发布评论者/issue创建者 */}
{(admin || isManager || login === item.user.login || username === author) && <Popconfirm
placement="bottom"
title={`确定要删除此条评论吗?${item.children_journals.length > 0 ? '子评论也将被一起删除。' : ''}`}
okText="是"
cancelText="否"
onConfirm={() => deleteCommentFunc(item.id)}
>
<Button type='link' className='color-grey-89'><i className='iconfont icon-fuzhi-shanchu font-14 mr8'></i>删除</Button>
</Popconfirm>}
{/* 仅评论者可修改 */}
{login === item.user.login && <Button type='link' className='color-grey-89' onClick={()=>{setUpdateId(item.id); setShowEdit(2)}}><i className='iconfont icon-a-bianji12 font-14 mr8'></i>修改</Button>}
<CheckProfile {...props} sureFunc={()=>{setParentId(item.id); setReplyId(item.id); setShowEdit(3)}}><Button type='link' className='color-grey-89'><i className='iconfont icon-a-xiaoxi1 font-14 mr8'></i>回复</Button></CheckProfile>
</div>}
</div>
<div className='contentHtml mb5'>{commentCtx(item.notes)}</div>
{item && item.attachments && item.attachments.length > 0 && <div className='attachmentBox mb5'><Attachment
attachments={item.attachments}
showNotification={showNotification}
canDelete={false}
/></div>}
</div>
</div>}
{showEdit === 3 && replyId === item.id && <div className='contentHtml mr20'><EditComment {...props} cancelMd={cancelMd} parentId={parentId} replyId={replyId} reloadComment={reloadComment}/></div>}
{/* 评论回复部分 */}
{item.children_journals.map(i =>{
return <div className='commentReply' key={i.id}>
{(showEdit === 4 && updateId === i.id) ? <div className='mr20'><EditComment {...props} cancelMd={cancelMd} updateId={updateId} reloadComment={reloadComment} content={i.notes} defaultFileList={i.attachments}/></div> : <div>
<div className='flexCenter'>
<div>
<Link to={`/${i.user.login}`}><img src={getImageUrl(i.user.image_url)} alt="" className='commentUserImg mr8'/></Link>
<Link to={`/${i.user.login}`}>{i.user.name}</Link>
{i.reply_user && <span className='ml5 timeAgo mr3'>回复</span>}
<span>{i.reply_user && i.reply_user.name}</span>
<span className='ml15 timeAgo font-14'>{timeAgo(i.created_at)}</span>
</div>
{login && <div>
{/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */}
{(admin || isManager || login === i.user.login || (i.reply_user && login === i.reply_user.login) || username === author) && <Popconfirm
placement="bottom"
title={"确定要删除当前回复吗?"}
okText="是"
cancelText="否"
onConfirm={() => deleteCommentFunc(i.id)}
>
<Button type='link' className='color-grey-89'><i className='iconfont icon-fuzhi-shanchu font-14 mr8'></i>删除</Button>
</Popconfirm>}
{/* 仅回复评论者可修改 */}
{login === i.user.login && <Button type='link' className='color-grey-89' onClick={()=>{setUpdateId(i.id); setShowEdit(4)}}><i className='iconfont icon-a-bianji12 font-14 mr8'></i>修改</Button>}
<CheckProfile {...props} sureFunc={()=>{setParentId(item.id);setReplyId(i.id); setShowEdit(5)}}>
<Button type='link' className='color-grey-89'><i className='iconfont icon-a-xiaoxi1 font-14 mr8'></i>回复</Button>
</CheckProfile>
</div>}
</div>
<div className='contentHtml mt5 mb10'>{commentCtx(i.notes)}</div>
{i && i.attachments && i.attachments.length > 0 && <div className='attachmentBox'><Attachment
attachments={i.attachments}
showNotification={showNotification}
canDelete={false}
/></div>}
</div>}
{showEdit === 5 && replyId === i.id && <div className='contentHtml mr20'><EditComment {...props} cancelMd={cancelMd} parentId={parentId} replyId={replyId} reloadComment={reloadComment}/></div>}
</div>})}
</div>
</div>}))}
</div>
</Spin>
{totalCount>limit && <div className='mt20 paginationIssueComment mb20'>
<Pagination simple current={page} pageSize={limit} total={totalCount} onChange={(page)=>setPage(page)}/>
</div>}
{/* 添加评论 */}
{category !== 'operate' && <div className="pb30" style={{marginTop: journalsCount ? '-5px' : '30px'}}>
{login ? showEdit === 1 ? <EditComment {...props} cancelMd={cancelMd}/> : <div className="addComments" id='addComments'>
<img src={getImageUrl(image_url)} alt="" />
<div style={{flex:1}}>
<CheckProfile {...props} sureFunc={()=>{setShowEdit(1)}}>
<Input className='addCommentBox' placeholder="添加评论"/>
</CheckProfile>
</div>
</div> : <div className='unLoginComment font-15 pl20'>
{/* 未登录用户 */}
<a className='mr5 loginBtn' onClick={()=>{showLoginDialog()}}>登录</a>并参与评论与回复
</div>}
</div>}
</div>
)
}
export default IssueCommentList;

View File

@ -0,0 +1,217 @@
.typeActionBox{
display: flex;
align-items: center;
font-size: 16px;
.line {
width: 3px;
height: 14px;
background: var(--primary-color);
margin-right: 13px;
}
}
.commentUserImg{
height: 28px;
width: 28px;
border-radius: 50%;
object-fit: cover;
}
.issueCommentsBox{
.operationLog, .commentContentBox{
position: relative;
min-height: 62px;
display: flex;
>.flexCenter, >a{
z-index: 2;
}
&::before, &::after{
content: '';
width: 1px;
height: 50%;
position: absolute;
background: #eee;
left: 12px;
z-index: 1;
}
&::after{
background: #eee;
top: 50%;
}
}
.commentContentBox+.operationLog .operationCommentBor, .operationLog+.commentContentBox .commentOperationBor{
border-top: 1px solid #eee;
width: 98.5%;
position: absolute;
left: 12px;
}
.operationLog+.commentContentBox{
&>a, &>.commentContentRight{
margin-top: 25px;
}
}
.timeAgo{
color:#acb0bf;
}
.operationLog:last-child::after, .operationLog:first-child::before, .commentContentBox:last-child::after, &.justComment .commentContentBox::before, &.justComment .commentContentBox::after{
display: none;
}
.operationLog:first-child, .commentContentBox+.operationLog{
margin-top: -15px;
}
.commentContentBox:last-child::before{
height: 35%;
}
.flexCenter{
display: flex;
align-items: center;
justify-content: space-between;
}
.commentRenderHtml.markdown-body p{
font-size: 14px !important;
}
.commentReply{
padding: 15px 0 0 20px;
background-color: hsla(225, 31%, 95%, 0.41);
&>div{
padding-bottom: 5px;
}
&+.commentReply>div{
margin-top: -15px;
padding-top: 15px;
border-top: 1px dashed #eee;
}
}
.opBox{
justify-content: flex-start;
// flex: 1;
// width: 100%;
}
.commentContentBox{
display: flex;
align-items: flex-start;
}
.commentContentRight{
flex: 1;
background-color:#fafafc;
// border:1px solid var(--light-color-2);
border:1px solid rgba(42, 97, 255, 0.23);
border-radius:6px;
position: relative;
top: -6px;
padding: 10px 15px 16px;
width: 0;
&::before{
content: '';
display: block;
position: absolute;
top: 13px;
left: -14px;
width: 0;
height: 0;
overflow: hidden;
font-size: 0;
line-height: 0;
border: 7px;
border-style: solid;
border-color: transparent rgba(42, 97, 255, 0.23) transparent transparent;
}
&::after{
content: '';
display: block;
width: 0;
height: 0;
overflow: hidden;
font-size: 0;
line-height: 0;
border: 6px;
border-style: solid;
border-color: transparent #fafafc transparent transparent;
position: absolute;
top: 14px;
left: -11px;
}
}
}
.attachmentBox{
margin-top: -8px;
}
.color-grey-89{
color: #898d9d;
// &:hover {
// color: var(--primary-color);
// }
}
// 添加评论样式
.unLoginComment{
height:58px;
line-height: 58px;
background-color:var(--more-light-color);
border-radius:4px;
color: rgba(84, 87, 103, 1);
.loginBtn{
color: var(--primary-color);
}
}
.quillFlagBox{
color: red;
margin-bottom: 5px !important;
height: 28px;
}
.addComments{
display: flex;
align-items: center;
background-color:var(--more-light-color);
border-radius:4px;
padding:7px 10px;
&>img{
height: 28px;
width: 28px;
border-radius: 50%;
margin-right: 13px;
}
}
.addCommentBox{
width: 100%;
height: 30px;
border: none;
&:focus {
border-color: var(--primary-color) !important;
}
}
.paginationIssueComment{
text-align: center;
}
.gotoComment{
// background-color:var(--more-light-color);
background-color:rgba(241, 243, 252, 0.55);
border-radius:4px;
color: rgba(172, 176, 191, 1);
padding: 8px 20px;
margin-top: -10px;
&>a{color: var(--primary-color);}
}
// .commentStyle {
// &:hover {
// border-color: var(--primary-color) !important;
// }
// }
.colorButton {
background-color: var(--primary-color);
border-color: var(--primary-color);
&:hover {
background-color: var(--light-color);
border-color: var(--primary-color);
}
&:focus {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
}
.colorButton2 {
&:hover {
border-color: var(--primary-color);
color: var(--light-color);
}
&:focus {
color: var(--primary-color);
}
}

View File

@ -1,4 +1,4 @@
import React,{ useState , useEffect } from 'react'; import React,{ useState , useEffect, useRef } from 'react';
import { Badge, Breadcrumb , Divider, Spin } from 'antd'; import { Badge, Breadcrumb , Divider, Spin } from 'antd';
import liulan from '../img/liulan.png'; import liulan from '../img/liulan.png';
import RenderHtml from '../../../components/render-html'; import RenderHtml from '../../../components/render-html';
@ -8,6 +8,7 @@ import { IsPC } from 'educoder';
import { tempConfig } from '../tempInfo'; import { tempConfig } from '../tempInfo';
import Acce from '../Component/mobile/accessory'; import Acce from '../Component/mobile/accessory';
import { addMeta, setSeoMeta } from 'educoder'; import { addMeta, setSeoMeta } from 'educoder';
import CommentList from '../Component/comments/list'
function NewsDetail(props){ function NewsDetail(props){
@ -16,6 +17,7 @@ function NewsDetail(props){
const [ cmsDir , setCmsDir ] = useState(undefined); const [ cmsDir , setCmsDir ] = useState(undefined);
const [ content , setContent]=useState(undefined); const [ content , setContent]=useState(undefined);
const [ isSpin , setIsSpin]=useState(false); const [ isSpin , setIsSpin]=useState(false);
const [ commentReload, setCommentReload] = useState(undefined);
const temp = props.temp; const temp = props.temp;
const zonedetail = props.data; const zonedetail = props.data;
@ -76,6 +78,7 @@ function NewsDetail(props){
setIsSpin(false) setIsSpin(false)
}) })
} }
return( return(
<React.Fragment> <React.Fragment>
{ {
@ -120,6 +123,13 @@ function NewsDetail(props){
<span>暂无详情~</span> <span>暂无详情~</span>
} }
</div> </div>
{
//
detail.auditStatus === '1' && <div className="info_text mt30">
<CommentList {...props} docId={ id } reload={commentReload} author={ detail.createBy } reloadComment={()=>{setCommentReload(Math.random())}}/>
</div>
}
</div> </div>
} }
</Spin> </Spin>

View File

@ -83,8 +83,10 @@ function ZoneVIP(props){
<Spin spinning={isSpin}> <Spin spinning={isSpin}>
<div style={{minHeight:400}}> <div style={{minHeight:400}}>
{ {
vipLists && (vipLists.length > 0 ? <MemberList vipLists={vipLists} temp={temp}/> : <div style={{marginTop:30,backgroundColor:"#fff",padding:"20px"}}> vipLists && (vipLists.length > 0 ? <MemberList vipLists={vipLists} temp={temp}/> : <div style={{marginTop:30,padding:"20px"}}>
<Nodata _html={"暂无数据"}/> {
temp === tempEnum.zone1 ? <Nodata _html="暂无数据" img={ nodata }/> : <Nodata _html="暂无数据" />
}
</div>) </div>)
} }
</div> </div>

View File

@ -252,4 +252,40 @@ export function updateMyResource(data) {
method: 'PUT', method: 'PUT',
data: data data: data
}); });
}
// 评论相关
// 评论列表
export function getCommentList(id, params) {
return fetch({
url: `cms/doc/open/${ id }/journalList`,
method: 'GET',
params
})
}
// 新增评论
export function addComment(id, data) {
return fetch({
url: `cms/docComment/${ id }`,
method: 'POST',
data: data
})
}
// 编辑评论
export function editComment(id, data) {
return fetch({
url: `cms/docComment/${ id }/${ data.id }`,
method: 'PUT',
data: data
})
}
// 删除评论
export function deleteComment(docId, id) {
return fetch({
url: `cms/docComment/${ docId }/${ id }`,
method: 'DELETE',
})
} }

View File

@ -1126,10 +1126,12 @@
margin-right: 7px; margin-right: 7px;
} }
} }
.none_panels { .vip_list {
background-color: #FFFFFF; .none_panels {
margin: 25px 25px 25px 0; background-color: #FFFFFF;
border-radius: 12px; margin: 25px 25px 25px 0;
border-radius: 12px;
}
} }
} }
.zone_parter{ .zone_parter{

View File

@ -4,6 +4,8 @@ html[data-theme="zone"] {
--more-light-color: rgba(70, 106, 255, 0.05); --more-light-color: rgba(70, 106, 255, 0.05);
--linear-back-color: linear-gradient(89.9deg,rgba(70, 106, 255, 0) 0%,rgba(70, 106, 255, 0.09) 100%); --linear-back-color: linear-gradient(89.9deg,rgba(70, 106, 255, 0) 0%,rgba(70, 106, 255, 0.09) 100%);
--tag-back: rgba(70, 106, 255, 0.12); --tag-back: rgba(70, 106, 255, 0.12);
--light-color-2: rgba(70,106,255,0.23);
--light-color-3: rgba(70,106,255,0.55);
} }
html[data-theme="zone1"] { html[data-theme="zone1"] {
--primary-color: #089f7f; --primary-color: #089f7f;
@ -11,4 +13,6 @@ html[data-theme="zone1"] {
--light-color: rgba(7, 165, 131, 0.85); --light-color: rgba(7, 165, 131, 0.85);
--linear-back-color: linear-gradient(89.9deg,rgba(7, 165, 131, 0) 0%,rgba(7, 165, 131, 0.09) 100%); --linear-back-color: linear-gradient(89.9deg,rgba(7, 165, 131, 0) 0%,rgba(7, 165, 131, 0.09) 100%);
--tag-back: rgba(142, 147, 161, 0.1); --tag-back: rgba(142, 147, 161, 0.1);
--light-color-2: rgba(7, 165, 131, 0.23);
--light-color-3: rgba(7, 165, 131, 0.55);
} }

View File

@ -198,7 +198,7 @@ function New(props){
}).then(result=>{ }).then(result=>{
if(result && result.data && result.data.project_issues_index){ if(result && result.data && result.data.project_issues_index){
window.scrollTo(0,0); window.scrollTo(0,0);
props.showNotification("任务创建成功!"); props.showNotification("疑修创建成功!");
props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`);
} }
}).catch(error=>{}) }).catch(error=>{})