From 56509b2ad5b4a6bccfa29aa21dcb1911d7a60235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 1 Jul 2019 10:47:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/Loading.js | 11 +- .../src/modules/courses/busyWork/UseBank.js | 2 +- .../courses/coursesPublic/PathModal.js | 15 +- .../courses/coursesPublic/SelectResource.js | 19 +- .../courses/coursesPublic/Showoldfiles.js | 432 +++++++++--------- .../coursesPublic/modal/ShixunModal2.js | 5 +- public/react/src/modules/home/shixunsHome.js | 11 +- .../paths/PathDetail/DetailCardsEditAndAdd.js | 8 +- .../PathDetail/DetailCardsEditAndEdit.js | 10 +- .../src/modules/tpm/TPMFork/TPMForklist.js | 385 ++++++++-------- .../src/modules/tpm/component/TPMright.css | 4 +- .../src/modules/tpm/shixuns/ShixunCard.js | 12 +- .../src/modules/tpm/shixuns/ShixunsIndex.js | 10 +- 13 files changed, 450 insertions(+), 474 deletions(-) diff --git a/public/react/src/Loading.js b/public/react/src/Loading.js index 07ab19a4a..2bca2a482 100644 --- a/public/react/src/Loading.js +++ b/public/react/src/Loading.js @@ -9,7 +9,16 @@ class Loading extends Component { // Loading return (
- + +
); } diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 3a60b23b0..ea31cf4fa 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -252,7 +252,7 @@ class UseBank extends Component{

通过职业认证的教师才能访问公共题库

- 立即认证 + 立即认证
: diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 787c70d3e..0b69fa15d 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -1,11 +1,7 @@ import React,{ Component } from "react"; -import { Modal,Checkbox,Select,Input,Tooltip } from "antd"; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon } from "antd"; import axios from'axios'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; import Modals from '../../modals/Modals'; - -const Option = Select.Option; const Search = Input.Search; class PathModal extends Component{ constructor(props){ @@ -126,7 +122,7 @@ class PathModal extends Component{ render(){ let {Searchvalue,type,Modalstype}=this.state; let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props; - + const antIcon = ; return(
@@ -148,8 +144,7 @@ class PathModal extends Component{ width="840px" destroyOnClose={true} > - - +
{ shixunmodallist && shixunmodallist.tags.length===0?"":
@@ -203,7 +198,6 @@ class PathModal extends Component{
- { newshixunmodallist&&newshixunmodallist.map((item,key)=>{ @@ -229,7 +223,6 @@ class PathModal extends Component{ }) } -
{ this.state.patheditarrytype===true?{this.state.patheditarryvalue}:""}
@@ -237,7 +230,7 @@ class PathModal extends Component{ 确定
- +
) diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index 878395144..ef36a2ab4 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -1,9 +1,7 @@ import React,{ Component } from "react"; -import { Modal,Checkbox,Select,Input} from "antd"; +import { Modal,Checkbox,Select,Input,Spin,Icon} from "antd"; import axios from'axios'; import NoneData from "../coursesPublic/NoneData"; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; import Modals from '../../modals/Modals'; const Option = Select.Option; @@ -244,7 +242,7 @@ class Selectresource extends Component{ render(){ let {Searchvalue,type,category_id,Resourcelist,hometypepvisible,patheditarry}=this.state; let {visible,shixunmodallist}=this.props; - + const antIcon = ; return(
{/*提示*/} @@ -275,8 +273,8 @@ class Selectresource extends Component{ ` } - + - - - - -
-
- -
- - 注:该文件有历史版本,请选择您需要的文件,点击文件名 下载。 - -
-
- - - -
    -
  • 资源名称
  • -
  • 版本
  • -
- - - -
- - - - - { - allfiles === undefined ? "": -
- -
- -
  • - {allfiles.title} - 当前版本 -
  • - -
  • - {formatDate(allfiles.created_on)} -
  • - -
    - { - allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{ - return( - -
    - -
  • - {item.title} -
  • - -
  • - {formatDate(item.created_on)} -
  • - -
    - ) - }) - } -
    - } -
    - -
    -
    - :""} -
    - ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Select,Input} from "antd"; +import axios from'axios'; + +import Modals from '../../modals/Modals'; + +const Option = Select.Option; +const Search = Input.Search; + +function formatDate(date) { + var dateee = new Date(date).toJSON(); + return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') +} + +class Showoldfiles extends Component{ + constructor(props){ + super(props); + this.state={ + Searchvalue:undefined, + type:'all', + category_id:0, + page:1, + Resourcelist:undefined, + + getallfiles:false, + searchtype:'getallfiles' + } + } + componentDidMount() { + + } + + componentDidUpdate = (prevProps) => { + + if ( prevProps.visible != this.props.visible ) { + + } + + } + + cloasshanchudiao=()=>{ + this.props.closaoldfilesprops() + } + + render(){ + let {visible,allfiles}=this.props; + + return( +
    + {/*提示*/} + + {visible===true? + + + + + + +
    +
    + +
    + + 注:该文件有历史版本,请选择您需要的文件,点击文件名 下载。 + +
    +
    + + + +
      +
    • 资源名称
    • +
    • 版本
    • +
    + + + +
    + + + + + { + allfiles === undefined ? "": +
    + +
    + +
  • + {allfiles.title} + 当前版本 +
  • + +
  • + {formatDate(allfiles.created_on)} +
  • + +
    + { + allfiles.attachment_histories.length===0?"":allfiles.attachment_histories.map((item,key)=>{ + return( + +
    + +
  • + {item.title} +
  • + +
  • + {formatDate(item.created_on)} +
  • + +
    + ) + }) + } +
    + } +
    + +
    + +
    :""} +
    + ) + } +} export default Showoldfiles; \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js index d01c8d986..9148845e9 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js +++ b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js @@ -1,8 +1,6 @@ import React,{ Component } from "react"; import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd"; import axios from'axios'; -// import Loading from '@icedesign/base/lib/loading'; -// import '@icedesign/base/lib/loading/style.js'; const Option = Select.Option; const Search = Input.Search; @@ -276,7 +274,7 @@ class ShixunModal extends Component{ ` } - {/**/} + { newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{ @@ -303,7 +301,6 @@ class ShixunModal extends Component{ }) } - {/**/}
    diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 07920e2d9..9ef26f7a8 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -10,8 +10,6 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import SiderBar from '../tpm/SiderBar'; -import Loading from '@icedesign/base/lib/loading'; - import { SnackbarHOC , getImageUrl} from 'educoder'; import Slider from '@icedesign/base/lib/slider'; @@ -24,9 +22,7 @@ import '@icedesign/base/lib/rating/style.js'; import './home.css'; -import '@icedesign/base/lib/loading/style.js'; - -import {Tooltip} from 'antd'; +import {Tooltip,Spin} from 'antd'; const $ = window.$; @@ -110,7 +106,7 @@ class ShixunsHome extends Component { return (
    - + {/*懒加载*/} @@ -498,8 +494,7 @@ class ShixunsHome extends Component {
    - - + ); } diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 393c28c9f..6e2ca0883 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -1,10 +1,8 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; -import {Modal,Input,Checkbox,Tooltip} from "antd"; +import {Modal,Input,Checkbox,Tooltip,Spin} from "antd"; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; import '../ShixunPaths.css'; import axios from 'axios'; const $ = window.$; @@ -437,7 +435,7 @@ class DetailCardsEditAndAdd extends Component{ width="840px" destroyOnClose={true} > - +
    -
    + diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index 63263dfc1..f822b0de1 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -1,10 +1,8 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; -import {Modal,Input,Checkbox,Tooltip} from "antd"; +import {Modal,Input,Checkbox,Tooltip,Spin} from "antd"; import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; import '../ShixunPaths.css'; import axios from 'axios'; const $ = window.$; @@ -478,8 +476,8 @@ class DetailCardsEditAndEdit extends Component{ footer={null} width="840px" destroyOnClose={true} - > - + >Z +
    -
    + diff --git a/public/react/src/modules/tpm/TPMFork/TPMForklist.js b/public/react/src/modules/tpm/TPMFork/TPMForklist.js index a9c9efd6f..b76683837 100644 --- a/public/react/src/modules/tpm/TPMFork/TPMForklist.js +++ b/public/react/src/modules/tpm/TPMFork/TPMForklist.js @@ -1,193 +1,192 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -// import "antd/dist/antd.css"; - -import Rating from '@icedesign/base/lib/rating'; - -import Loading from '@icedesign/base/lib/loading'; - -import axios from 'axios'; - -import {getImageUrl, toPath, getUrl} from 'educoder' - -import './shixunCss/fork.css'; - -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -let timeout; - -let currentValue; - - - -export default class TPMFork_listComponent extends Component { - constructor(props) { - super(props) - this.state = { - shixuns:undefined, - total_count:0, - shixunsID:undefined, - Forkvisible: true, - Forkcurrent: 1 - } - } - - - componentDidMount() { - let id = this.props.match.params.shixunId; - - let Url="/shixuns/"+id+"/fork_list.json"; - axios.get(Url, { - params: { - page:1, - limit:8 - } - }).then((response)=> { - this.setState({ - shixunsID:id, - shixuns:response.data.shixuns, - total_count:response.data.total_count, - Forkvisible:false - }) - }).catch((error)=>{ - console.log(error) - }); - } - - - TPMForkonChange=(pageNumber)=>{ - let id = this.props.match.params.shixunId; - this.setState({ - Forkvisible:true - }) - let Url="/shixuns/"+id+"/fork_list.json"; - axios.get(Url, { - params: { - page:pageNumber, - limit:8 - } - }).then((response)=> { - this.setState({ - shixunsID:id, - shixuns:response.data.shixuns, - total_count:response.data.total_count, - Forkvisible: false, - Forkcurrent: pageNumber - }) - }).catch((error)=>{ - console.log(error) - }); - } - render() { - - let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state; - - - return ( - -
    - -
    - Fork实训列表 - 返回 -
    - -
    - - { shixuns===undefined?" ":shixuns.map((item,key)=>{ - return( -
    - -
    - {item.tag_name} - -
    - -
    - -

    非试用内容,需要授权

    -
    - - - - - -
    -

    - - {item.name} - -

    - -

    - - - - {item.score_info===null?"5分":item.score_info+"分"} -

    - -

    - - - - {item.challenges_count} - - - - {/**/} - {/**/} - {/*{item.exp}*/} - {/**/} - {/**/} - - - - {item.stu_num} - - - - - {item.level} -

    - -
    -
    - ) - }) - } -
    - - {/*
    {total_count}
    */} -
    8 ? "block" : "none"}}> - {/*
    */} - -
    - - -
    - - ) - } -} - - +import React, {Component} from 'react'; + +import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip,Spin} from 'antd'; + +import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; + +// import "antd/dist/antd.css"; + +import Rating from '@icedesign/base/lib/rating'; + +import axios from 'axios'; + +import {getImageUrl, toPath, getUrl} from 'educoder' + +import './shixunCss/fork.css'; + +let origin = getUrl(); + +let path = getUrl("/editormd/lib/") + +const $ = window.$; + +let timeout; + +let currentValue; + + + +export default class TPMFork_listComponent extends Component { + constructor(props) { + super(props) + this.state = { + shixuns:undefined, + total_count:0, + shixunsID:undefined, + Forkvisible: true, + Forkcurrent: 1 + } + } + + + componentDidMount() { + let id = this.props.match.params.shixunId; + + let Url="/shixuns/"+id+"/fork_list.json"; + axios.get(Url, { + params: { + page:1, + limit:8 + } + }).then((response)=> { + this.setState({ + shixunsID:id, + shixuns:response.data.shixuns, + total_count:response.data.total_count, + Forkvisible:false + }) + }).catch((error)=>{ + console.log(error) + }); + } + + + TPMForkonChange=(pageNumber)=>{ + let id = this.props.match.params.shixunId; + this.setState({ + Forkvisible:true + }) + let Url="/shixuns/"+id+"/fork_list.json"; + axios.get(Url, { + params: { + page:pageNumber, + limit:8 + } + }).then((response)=> { + this.setState({ + shixunsID:id, + shixuns:response.data.shixuns, + total_count:response.data.total_count, + Forkvisible: false, + Forkcurrent: pageNumber + }) + }).catch((error)=>{ + console.log(error) + }); + } + render() { + + let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state; + + + return ( + +
    + +
    + Fork实训列表 + 返回 +
    + {/**/} + +
    + + { shixuns===undefined?" ":shixuns.map((item,key)=>{ + return( +
    + +
    + {item.tag_name} + +
    + +
    + +

    非试用内容,需要授权

    +
    + + + + + +
    +

    + + {item.name} + +

    + +

    + + + + {item.score_info===null?"5分":item.score_info+"分"} +

    + +

    + + + + {item.challenges_count} + + + + {/**/} + {/**/} + {/*{item.exp}*/} + {/**/} + {/**/} + + + + {item.stu_num} + + + + + {item.level} +

    + +
    +
    + ) + }) + } +
    + + {/*
    {total_count}
    */} +
    8 ? "block" : "none"}}> + {/*
    */} + +
    + + {/**/} +
    + + ) + } +} + + diff --git a/public/react/src/modules/tpm/component/TPMright.css b/public/react/src/modules/tpm/component/TPMright.css index 9f2622eda..b0f8315e6 100644 --- a/public/react/src/modules/tpm/component/TPMright.css +++ b/public/react/src/modules/tpm/component/TPMright.css @@ -15,14 +15,14 @@ /*flex-wrap: wrap;*/ /*display: -webkit-flex; !* Safari *!*/ /*display: flex;*/ - width: 340px; + width: 360px; position:relative; overflow: hidden; } .newsubscript{ position: absolute; right: 23px; - bottom: 38px; + bottom: 16px; cursor: pointer; } .newsubscript:hover{ diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index e0850143c..18e261bb5 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -7,11 +7,9 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; -// import { Rating,Loading} from '@icedesign/base'; - import {getImageUrl,setImagesUrl, toPath} from 'educoder'; -// import { Pagination,Row,Col } from 'antd'; +import { Spin,Icon } from 'antd'; import 'antd/lib/pagination/style/index.css'; @@ -21,8 +19,6 @@ import Rating from '@icedesign/base/lib/rating'; import Pagination from '@icedesign/base/lib/pagination'; -// import Loading from '@icedesign/base/lib/loading'; - // 引入业务组件样式 import '@icedesign/base/lib/pagination/style.js'; @@ -30,8 +26,6 @@ import '@icedesign/base/lib/rating/style.js'; import { Tooltip } from 'antd'; -// import '@icedesign/base/lib/loading/style.js'; - import axios from 'axios'; const $ = window.$; @@ -63,8 +57,8 @@ class ShixunCard extends Component { let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props; return (
    - {/**/} +
    @@ -168,7 +162,7 @@ class ShixunCard extends Component {
    - {/*
    */} +
    ) } diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js index ddb6a22b9..3f1f7e9e8 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js +++ b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js @@ -6,6 +6,8 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import axios from 'axios'; +import { Spin } from 'antd'; + import { TPMIndexHOC } from '../TPMIndexHOC'; import { SnackbarHOC } from 'educoder'; @@ -16,10 +18,6 @@ import ShixunSearchBar from './ShixunSearchBar'; import ShixunCard from './ShixunCard'; -import Loading from '@icedesign/base/lib/loading'; - -import '@icedesign/base/lib/loading/style.js'; - const queryString = require('query-string'); const $ = window.$; @@ -362,7 +360,7 @@ class ShixunsIndex extends Component { return (
    - + {/*懒加载*/} - +
    ); } From 5496df9e5edd5e448df0d59c29d5eab46aef4efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 1 Jul 2019 13:47:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/educoder/edu_application.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 10 +++++----- public/react/src/modules/tpm/SiderBar.js | 2 +- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index feacff0dd..612a5a44b 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -125,7 +125,7 @@ $(window).resize(function() { rightSlider(); }); function rightSlider() { - var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 34; + var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 81; // console.log(parseInt($(window).width())+" "+poi); if (poi > 0) { $(".-task-sidebar").css("right", poi); diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index ff0ece9f9..691f8bb1e 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -638,7 +638,7 @@ submittojoinclass=(value)=>{ {/*
  • 实训路径
  • */}
  • - 实训课程
  • + 实践课程 {/*
  • 课堂
  • */}
  • @@ -671,13 +671,13 @@ submittojoinclass=(value)=>{
  • -
  • 教学案例
  • -
  • 竞赛
  • + {/*
  • 教学案例
  • */} +
  • 在线竞赛
  • -
  • 问答
  • +
  • 交流问答
  • 认证
  • + >工程认证 diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index bc1a80ed4..bc5800153 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -23,7 +23,7 @@ $(window).scroll(function(){ }); function rightSlider(){ - var poi=parseInt((parseInt($(window).width())- 1200 )/2)-34; + var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81; // console.log(parseInt($(window).width())+" "+poi); if(poi>0){ $(".-task-sidebar").css("right",poi); diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 68f3c2e56..f03d59751 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -131,7 +131,7 @@ export function TPMIndexHOC(WrappedComponent) { }else if(this.props.match.path==="/shixuns"){ document.title="开发社区"; }else if(this.props.match.path==="/paths"){ - document.title="实训课程"; + document.title="实践课程"; }else if(this.props.match.path==="/courses"){ document.title="翻转课堂"; }