From 90136595f2ab16a3e044fff5251bb42182a88693 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sat, 3 Aug 2019 13:42:36 +0800
Subject: [PATCH 1/6] a href
---
public/react/src/common/UrlTool.js | 4 ++-
public/react/src/common/educoder.js | 3 +-
.../shixunHomework/ShixunhomeWorkItem.js | 32 ++++++++++++-------
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js
index 3953f1f34..f224526e6 100644
--- a/public/react/src/common/UrlTool.js
+++ b/public/react/src/common/UrlTool.js
@@ -59,4 +59,6 @@ export function toPath(path) {
}
-// export default queryString
\ No newline at end of file
+export function getTaskUrlById(id) {
+ return `/tasks/${id}`
+}
diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js
index 791b2c6d6..2afbca8d1 100644
--- a/public/react/src/common/educoder.js
+++ b/public/react/src/common/educoder.js
@@ -3,7 +3,8 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
- , getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth } from './UrlTool';
+ , getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
+ , getTaskUrlById as getTaskUrlById } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index d97b58cca..b9aac1e6a 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -1,6 +1,6 @@
import React,{ Component } from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
-import { WordsBtn } from 'educoder';
+import { WordsBtn, getTaskUrlById } from 'educoder';
import {Tooltip,message,Modal} from 'antd';
import {Link} from 'react-router-dom';
import axios from 'axios';
@@ -56,7 +56,7 @@ class ShixunhomeWorkItem extends Component{
startbtn:true,
})
let url= list+".json";
- const w=window.open('about:blank');
+ // const w=window.open('about:blank');
axios.get(url).then((response) => {
if(response.status===200){
@@ -66,7 +66,7 @@ class ShixunhomeWorkItem extends Component{
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
- w.close()
+ // w.close()
}else if(response.data.status===-1){
console.log(response)
}else if(response.data.status===-3){
@@ -75,11 +75,15 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype:true,
startbtn:false
})
- w.close()
+ // w.close()
}else{
- if(response.data.status!=401&&response.data.status!=403){
- w.location.href= "/tasks/"+response.data.game_identifier
- }
+ this.setState({
+ startbtn:false
+ })
+ // if(response.data.status!=401&&response.data.status!=403){
+ // w.location.href= "/tasks/"+response.data.game_identifier
+ // }
+ window.location.href = "/tasks/"+response.data.game_identifier
}
}
@@ -87,7 +91,7 @@ class ShixunhomeWorkItem extends Component{
this.setState({
startbtn:false
})
- w.close()
+ // w.close()
});
@@ -389,9 +393,15 @@ class ShixunhomeWorkItem extends Component{
{this.props.isStudent===true?this.props.course_identity===5?
- + {fileName}{filesize? ` ${filesize}` : ''}
@@ -777,7 +775,7 @@ class MemoDetail extends Component { - { memo.attachment_url && !!memo.attachment_url.length && + { this.props.attachments_list &&
- {item.owner_name}
+ 12 ? item.owner_name : ''} style={{ maxWidth: '198px'}}
+ >{item.owner_name}