Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
cxt 5 years ago
commit 4e208baf15

@ -86,7 +86,7 @@ class WorkDetailPageHeader extends Component{
background: #fff; background: #fff;
} }
.workDetailPageHeader .summaryname { .workDetailPageHeader .summaryname {
line-height:30px line-height:28px
} }
`}</style> `}</style>
<CBreadcrumb items={[ <CBreadcrumb items={[

@ -80,7 +80,10 @@ class AddStudentModal extends Component{
} }
setVisible = (visible) => { setVisible = (visible) => {
if (visible) { if (visible) {
this.setState({school_name: this.props.user.user_school},()=>{ this.setState({
school_name: this.props.user.user_school,
name: undefined
},()=>{
this.fetchMemberList(); this.fetchMemberList();
}) })
this.fetchOptions() this.fetchOptions()
@ -88,7 +91,7 @@ class AddStudentModal extends Component{
this.refs.modalWrapper.setVisible(visible) this.refs.modalWrapper.setVisible(visible)
if (visible == false) { if (visible == false) {
this.setState({ this.setState({
checkBoxValues: [] checkBoxValues: [],
}) })
} }
} }

@ -40,8 +40,9 @@ class CodeRepositoryView extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.treeExpanded = false;
this.state = { this.state = {
autoExpandParent: true, autoExpandParent: false,
expandedKeys: [], expandedKeys: [],
addtionalSSHArray: [], addtionalSSHArray: [],
@ -52,24 +53,28 @@ class CodeRepositoryView extends Component {
const { game, challenge, hide_code, tabIndex, } = this.props const { game, challenge, hide_code, tabIndex, } = this.props
if ( // 初始化 或者 game切换 if ( // 初始化 或者 game切换
challenge.path && challenge.path.length && this.state.expandedKeys.length === 0 || !this.treeExpanded && challenge.path && challenge.path.length && this.state.expandedKeys.length === 0 ||
game && (!prevProps.game game && (!prevProps.game
|| prevProps.game.identifier !== this.props.game.identifier) ) { || prevProps.game.identifier !== this.props.game.identifier) ) {
const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
let _ar = []; if (!this.treeExpanded) {
const expandedKeys = []; this.treeExpanded = true
if (_path) { const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
_ar = _path.split('/') let _ar = [];
_ar.length = _ar.length - 1 const expandedKeys = [];
_ar.forEach( (item, index) => { if (_path) {
expandedKeys.push( index === 0 ? item : expandedKeys[index - 1] + '/' + item) _ar = _path.split('/')
_ar.length = _ar.length - 1
_ar.forEach( (item, index) => {
expandedKeys.push( index === 0 ? item : expandedKeys[index - 1] + '/' + item)
})
}
expandedKeys.length = 1 // 没办法做到多级初始化,而且会引起点击其他子目录,加载当前文件目录的问题
// 初始化时无法展开到根节点 https://github.com/fis-components/rc-tree/issues/3
expandedKeys.length && this.setState({
expandedKeys,
}) })
} }
expandedKeys.length = 1 // 没办法做到多级初始化
// 初始化时无法展开到根节点 https://github.com/fis-components/rc-tree/issues/3
expandedKeys.length && this.setState({
expandedKeys,
})
if (game && (!prevProps.game if (game && (!prevProps.game
|| prevProps.game.identifier !== this.props.game.identifier)) { || prevProps.game.identifier !== this.props.game.identifier)) {

@ -191,6 +191,10 @@ class CodeRepositoryViewContainer extends Component {
// withCredentials: true, // withCredentials: true,
}) })
.then((response) => { .then((response) => {
// if (!response) {
// resolve && resolve();
// return;
// }
const repoFilesData = this.map2OldData(response.data.trees) const repoFilesData = this.map2OldData(response.data.trees)
if (!this.state.fileTreeData || this.state.fileTreeData.length === 0) { // 还没树节点,没加载过 if (!this.state.fileTreeData || this.state.fileTreeData.length === 0) { // 还没树节点,没加载过

Loading…
Cancel
Save