Merge branch 'dev_aliyun' into dev_cxt

dev_ec
cxt 5 years ago
commit 673427229f

@ -9,8 +9,10 @@ json.results do
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '')
# 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '')
json.content highlights
end

@ -7,11 +7,13 @@ json.shixun_list do
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '')
# 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '')
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300].sub!(atta_reg, '')
json.content highlights
json.level level_to_s(obj.trainee)

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

@ -80,7 +80,10 @@ class AddStudentModal extends Component{
}
setVisible = (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.fetchOptions()
@ -88,7 +91,7 @@ class AddStudentModal extends Component{
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
checkBoxValues: [],
})
}
}

@ -40,8 +40,9 @@ class CodeRepositoryView extends Component {
constructor(props) {
super(props);
this.treeExpanded = false;
this.state = {
autoExpandParent: true,
autoExpandParent: false,
expandedKeys: [],
addtionalSSHArray: [],
@ -52,24 +53,28 @@ class CodeRepositoryView extends Component {
const { game, challenge, hide_code, tabIndex, } = this.props
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
|| prevProps.game.identifier !== this.props.game.identifier) ) {
const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
let _ar = [];
const expandedKeys = [];
if (_path) {
_ar = _path.split('/')
_ar.length = _ar.length - 1
_ar.forEach( (item, index) => {
expandedKeys.push( index === 0 ? item : expandedKeys[index - 1] + '/' + item)
if (!this.treeExpanded) {
this.treeExpanded = true
const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
let _ar = [];
const expandedKeys = [];
if (_path) {
_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
|| prevProps.game.identifier !== this.props.game.identifier)) {

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

Loading…
Cancel
Save