From 70d2790f8dc9de57dd229be5466983c495235d6c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 29 Jul 2019 13:55:32 +0800 Subject: [PATCH 1/2] liink --- .../src/modules/courses/exercise/Testpapersettinghomepage.js | 2 +- public/react/src/modules/courses/exercise/new/JudgeDisplay.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index ddb448cfc..36b319f5a 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -267,7 +267,7 @@ class Testpapersettinghomepage extends Component{

{this.props.coursedata.name} > - 试卷 + 试卷 > 试卷详情

diff --git a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js index 0f8930a8a..a0d5baf2a 100644 --- a/public/react/src/modules/courses/exercise/new/JudgeDisplay.js +++ b/public/react/src/modules/courses/exercise/new/JudgeDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; import QestionDisplayHeader from './QestionDisplayHeader' const { TextArea } = Input; const confirm = Modal.confirm; From 9d808ee583ea6b71620fb06b0fbb443304d93396 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 30 Jul 2019 13:48:21 +0800 Subject: [PATCH 2/2] download --- .../courses/busyWork/CommonWorkDetailIndex.js | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index ff8e3e3a2..4f2283499 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -8,7 +8,7 @@ import { CNotificationHOC } from '../common/CNotificationHOC' import { RouteHOC } from './common' import locale from 'antd/lib/date-picker/locale/zh_CN'; -import { WordsBtn, MarkdownToHtml, trigger, queryString } from 'educoder'; +import { WordsBtn, MarkdownToHtml, trigger, queryString, downloadFile } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; import CoursesListType from '../coursesPublic/CoursesListType'; @@ -18,6 +18,8 @@ import '../css/Courses.css' import CBreadcrumb from '../common/CBreadcrumb' import DownloadMessageysl from "../../modals/DownloadMessageysl"; +import { Spin } from 'antd' + //引入对应跳转的组件 //新建分组/普通作业 @@ -64,6 +66,7 @@ class CommonWorkDetailIndex extends Component{ this.state = { DownloadType:false, DownloadMessageval:undefined, + donwloading: false, } } initWorkDetailCommonState = (data) => { @@ -123,7 +126,20 @@ class CommonWorkDetailIndex extends Component{ } }else { this.props.showNotification(`正在下载中`); - window.open("/api"+url, '_blank'); + + this.setState({ donwloading: true }) + downloadFile({ + url: url, + successCallback: (url) => { + this.setState({ donwloading: false }) + console.log('successCallback') + }, + failCallback: (responseHtml, url) => { + this.setState({ donwloading: false }) + console.log('failCallback') + } + }) + // window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) @@ -244,7 +260,7 @@ class CommonWorkDetailIndex extends Component{ } - { noTab !== true &&
+ { noTab !== true &&
this.setState({moduleName: '作品列表'})} @@ -283,18 +299,30 @@ class CommonWorkDetailIndex extends Component{ padding-top: 10px; padding-bottom: 8px; } + + .floatSpinParent .ant-spin-nested-loading { + float: right; + } `} - {this.props.isAdmin()?
  • + {this.props.isAdmin()? +
  • 导出 -
  • :""} + + :""} {/* {isAdmin && 导出作品附件} {isAdmin && 导出成绩} */}