diff --git a/public/react/src/forge/Main/CoderRootBranch.js b/public/react/src/forge/Main/CoderRootBranch.js index 95e4bb02e..3fc42515b 100644 --- a/public/react/src/forge/Main/CoderRootBranch.js +++ b/public/react/src/forge/Main/CoderRootBranch.js @@ -36,7 +36,7 @@ class CoderRootBranch extends Component { - + diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index ea9a589da..ba6e332a7 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -11,6 +11,12 @@ import RootTable from './RootTable'; import CoderRootFileDetail from './CoderRootFileDetail'; import axios from 'axios'; +/** + * address:http和SSH,http_url(对应git地址) + * branch:当前分支 + * filePath:点击目录时当前目录的路径 + * subfileType:保存当前点击目录的文件类型(显示目录列表时才显示新建文件,如果点击的是文件就不显示新建文件按钮) + */ class CoderRootDirectory extends Component{ constructor(props){ super(props); @@ -19,6 +25,7 @@ class CoderRootDirectory extends Component{ branch:"master", filePath:[], http_url:undefined, + subFileType:"", branchList:undefined, fileDetail:undefined, @@ -56,34 +63,38 @@ class CoderRootDirectory extends Component{ }).catch((error)=>{}) } - ChangeFile=(arr)=>{ - this.renderUrl(arr); + ChangeFile=(arr,index)=>{ + this.renderUrl(arr.name,arr.path,arr.type); this.getFileDetail(arr); + this.setState({ + subFileType:arr.type + }) } - renderUrl=(array)=>{ - if(array && array.path){ - let { path } = array; - let list = []; - let urlList=Object.assign({},array); + renderUrl=(name,path,type)=>{ + let list =[]; + const { filePath } = this.state; + if(path.indexOf("/")){ + const array = path.split("/"); let str = ""; - if(path.indexOf("/")>0){ - const wraps = path.split("/"); - wraps.map((item,key)=>{ - str += '/'+item; - urlList.path = str.substr(1); - urlList.name = item; - list.push({...urlList}); + array.map((i,k)=>{ + str += '/'+i; + return list.push({ + index:k, + name:i, + path:str.substr(1), + type:(filePath && filePath.length>0) ? (filePath[k] ? filePath[k].type : type) : type }) - }else{ - urlList.path = ''; - urlList.name = path; - list.push({...urlList}); - } - this.setState({ - filePath:list + }) + }else{ + list.push({ + index:0, + name,path,type }) } + this.setState({ + filePath:list + }) } // 获取子目录 @@ -91,6 +102,8 @@ class CoderRootDirectory extends Component{ const { current_user } = this.props; const { projectsId } = this.props.match.params; const { branch } = this.state; + + const url =`/${current_user.login}/${projectsId}/sub_entries.json`; axios.get(url,{ @@ -142,9 +155,9 @@ class CoderRootDirectory extends Component{ }) } render(){ - const { rootList , branch ,filePath , fileDetail } = this.state; + const { rootList , branch ,filePath , fileDetail , subFileType } = this.state; - const { branchLastCommit , http_url } = this.props; + const { branchLastCommit , http_url , current_user } = this.props; const { projectsId } = this.props.match.params; const columns = [ @@ -207,7 +220,7 @@ class CoderRootDirectory extends Component{ key === filePath.length-1 ? {item.name} : - this.ChangeFile(item)} className="color-blue subFileName">{item.name} + this.ChangeFile(item,key)} className="color-blue subFileName">{item.name} } ) @@ -218,9 +231,22 @@ class CoderRootDirectory extends Component{ } - { - filePath && filePath.length === 0 && - } +
+ {/* 暂时先放出来,新建和上传文件需要操作权限--current_uesr.admin */} + {/* { + current_user && current_user.admin && 新建文件 + } */} + { + subFileType !== "file" && +

+ 新建文件 + 上传文件 +

+ } + { + filePath && filePath.length === 0 && + } +
{/* 文件夹-子目录列表 */} { diff --git a/public/react/src/forge/Main/CoderRootFileDetail.js b/public/react/src/forge/Main/CoderRootFileDetail.js index 990bd546d..c502396fc 100644 --- a/public/react/src/forge/Main/CoderRootFileDetail.js +++ b/public/react/src/forge/Main/CoderRootFileDetail.js @@ -1,5 +1,5 @@ import React , { Component } from "react"; -import Editor from "@monaco-editor/react"; +import Editor from "react-monaco-editor"; import { Popconfirm } from 'antd'; @@ -46,7 +46,7 @@ class CoderRootFileDetail extends Component{

diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index 54a5ea815..51fbc1a6a 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -8,6 +8,10 @@ import Loadable from 'react-loadable'; import Loading from '../../Loading'; import axios from 'axios'; +const FileNew = Loadable({ + loader: () => import('../Newfile/Index'), + loading: Loading, +}) const OrderIndex = Loadable({ loader: () => import('../Order/order'), loading: Loading, @@ -70,6 +74,11 @@ class Detail extends Component{ + () + } + > () diff --git a/public/react/src/forge/Main/list.css b/public/react/src/forge/Main/list.css index 24e3f1f94..7d0ec873e 100644 --- a/public/react/src/forge/Main/list.css +++ b/public/react/src/forge/Main/list.css @@ -226,6 +226,7 @@ body,#root{ border-radius: 4px; border:1px solid #eee; background: #fff; + margin-left: 20px; } .gitAddressClone > span{ display: flex; @@ -329,6 +330,28 @@ body,#root{ height: 22px; line-height: 22px; } +.addFile{ + display: flex; +} +.addFile a{ + display: block; + background-color: rgb(76, 172, 255,0.8); + color: #fff; + cursor: pointer; + height: 32px; + line-height: 32px; + padding: 0px 10px; +} +.addFile a:first-child{ + border-radius: 4px 0px 0px 4px; +} +.addFile a:last-child{ + border-radius: 0px 4px 4px 0px; + border-left: 1px solid rgba(247, 247, 247, 0.3); +} +.addFile a:active{ + background-color: rgb(76, 172, 255,1); +} @@ -355,6 +378,7 @@ body,#root{ } .gitAddressClone{ width:100%; + margin-left: 0px; } .gitAddressClone > span{ padding:0px; diff --git a/public/react/src/forge/Newfile/Index.js b/public/react/src/forge/Newfile/Index.js new file mode 100644 index 000000000..b7446071e --- /dev/null +++ b/public/react/src/forge/Newfile/Index.js @@ -0,0 +1,52 @@ +import React , { Component } from "react"; +import Editor from "react-monaco-editor"; + +import { Input } from 'antd'; +import './index.css'; + +class Index extends Component{ + constructor(props){ + super(props); + this.state={ + editorValue:"" + } + } + // 取消,弹框询问 + CancelAddFile=()=>{ + + } + + changeEditor=(editorValue)=>{ + this.setState({ + editorValue + }) + } + + render(){ + const { editorValue } = this.state; + const { projectDetail } = this.props; + return( +
+
+
+ +
+ 取消 +
+
+

新建文件

+ +
+
+ +
+
+ ) + } +} +export default Index; \ No newline at end of file diff --git a/public/react/src/forge/Newfile/index.css b/public/react/src/forge/Newfile/index.css new file mode 100644 index 000000000..133602c7f --- /dev/null +++ b/public/react/src/forge/Newfile/index.css @@ -0,0 +1,17 @@ +.setInputAddon{ + width: 350px; + margin-right: 20px; +} +.setInputAddon .ant-input-group-addon{ + height: 30px; + line-height: 30px; + border-left: 1px solid #d9d9d9!important; + border-right: none!important; +} + +@media screen and (max-width: 400px){ + .setInputAddon{ + width: 100%; + margin-right: 0px; + } +} \ No newline at end of file diff --git a/public/react/src/forge/Order/order.css b/public/react/src/forge/Order/order.css index 98c8bff53..41d2584ed 100644 --- a/public/react/src/forge/Order/order.css +++ b/public/react/src/forge/Order/order.css @@ -59,6 +59,9 @@ flex-wrap: wrap; align-items: center; } +.topWrapper .ant-btn.ant-input-search-button{ + height: 30px; +} .topWrapper_select li{ text-align: center; cursor: pointer; diff --git a/public/react/src/forge/Order/order.js b/public/react/src/forge/Order/order.js index 3ead501c5..f19f8f048 100644 --- a/public/react/src/forge/Order/order.js +++ b/public/react/src/forge/Order/order.js @@ -7,12 +7,18 @@ import axios from 'axios'; const Search = Input.Search; -const tagList= ['所有标签','release','test']; -const typeList= ['所有类型','普通','悬赏']; -const categoryList=['所有分类','缺陷','支持','任务','功能','周报']; -const levelList=['优先度','低','正常','高','紧急','立刻']; -const percentList=['完成度','0%','10%','20%','30%','40%','50%','60%','70%','80%','90%','100%']; +const tagList= ['release','test']; +const typeList= ['普通','悬赏']; +const categoryList=['缺陷','支持','任务','功能','周报']; +const levelList=['低','正常','高','紧急','立刻']; +const percentList=['0%','10%','20%','30%','40%','50%','60%','70%','80%','90%','100%']; class order extends Component{ + constructor(props){ + super(props); + this.state={ + issue_chosen:undefined + } + } componentDidMount=()=>{ this.getSelectList(); @@ -25,7 +31,9 @@ class order extends Component{ const url = `/projects/${projectsId}/issues/index_chosen.json`; axios.get(url).then((result)=>{ if(result){ - + this.setState({ + issue_chosen:result.data.issue_chosen + }) } }).catch((error)=>{ console.log(error); @@ -46,20 +54,28 @@ class order extends Component{ console.log(error); }) } - renderMenu =(array)=>{ + + getOption=(e)=>{ + console.log(e); + } + renderMenu =(array,name)=>{ return( - { - array.length > 0 && array.map((item,key)=>{ - return( - {item} - ) - }) - } + {name} + { + array && array.length > 0 && array.map((item,key)=>{ + return( + {item.name} + ) + }) + } ) } render(){ + + const { issue_chosen } = this.state; + return(
@@ -67,7 +83,7 @@ class order extends Component{ 标签 里程

- 创建工单 + 创建工单

@@ -92,37 +108,37 @@ class order extends Component{

  • - + 标签
  • - + 类型
  • - + 分类
  • - + 发布人
  • - + 指派人
  • - + 优先度
  • - + 完成度
  • diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index d4e3518c6..695250c3a 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1189,7 +1189,7 @@ samp { box-shadow: none!important; } /* 这个加了干嘛的?影响到了带addonAfter的input */ -.searchViewAfter,.searchViewAfter:focus,.searchViewAfter .ant-input:hover,.ant-input-group .ant-input:focus{ +.searchViewAfter,.searchViewAfter:focus,.searchViewAfter .ant-input:hover,.searchViewAfter .ant-input-group .ant-input:focus{ border-right: none!important; } .AboutInputForm .ant-form-item-label{