From 286fc11d8789ab443fd5b439058a8c3814cc393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 26 Nov 2019 16:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E9=98=B6=E6=AE=B5-=E5=A2=9E=E5=8A=A0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/paths/PathDetail/Addshixuns.js | 73 ++++++++++++++++++ .../paths/PathDetail/DetailCardsEditAndAdd.js | 72 ++++++++++++++++- .../PathDetail/DetailCardsEditAndEdit.js | 77 ++++++++++++++++--- public/react/src/modules/tpm/NewFooter.js | 4 + public/react/src/modules/tpm/NewHeader.js | 4 +- 5 files changed, 214 insertions(+), 16 deletions(-) create mode 100644 public/react/src/modules/paths/PathDetail/Addshixuns.js diff --git a/public/react/src/modules/paths/PathDetail/Addshixuns.js b/public/react/src/modules/paths/PathDetail/Addshixuns.js new file mode 100644 index 000000000..df6f0751e --- /dev/null +++ b/public/react/src/modules/paths/PathDetail/Addshixuns.js @@ -0,0 +1,73 @@ +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import {Modal,Input} from 'antd'; +class Addshixuns extends Component { + constructor(props) { + super(props); + this.state = { + shixunname:undefined, + } + } + + handleChange=(e)=>{ + this.setState({ + shixunname:e.target.value, + }) + } + + modalCancel=()=>{ + this.setState({ + shixunname:undefined, + }) + this.props.modalCancel() + } + + modalSave=()=>{ + let {shixunname}=this.state; + this.props.Setaddshixuns(shixunname); + this.props.modalCancel(); + } + + render() { + + return( + + {this.props.Addshixunstype===true?:""} + +
+

+ 实训名称: + + +

+
+ 取消 + 确定 +
+ +
+ +
+ ) + } +} + +export default Addshixuns; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 159c40475..595a10cc4 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -3,6 +3,7 @@ import {getImageUrl} from 'educoder'; import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd"; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; +import Addshixuns from './Addshixuns'; import '../ShixunPaths.css'; import axios from 'axios'; import NewShixunModel from '../../courses/coursesPublic/NewShixunModel'; @@ -52,7 +53,8 @@ class DetailCardsEditAndAdd extends Component{ Modalsbottomval:"", ChooseShixunListshixun_list:undefined, stage_nametype:false, - descriptiontype:false + descriptiontype:false, + Addshixunstype:false } this.onDragEnd = this.onDragEnd.bind(this); } @@ -113,9 +115,12 @@ class DetailCardsEditAndAdd extends Component{ for(var z=0; z{ + this.setState({ + Addshixunstype:true, + }) + } + + Getaddshixuns=(value)=>{ + let { + shixuns_listeditlist, + shixuns_listedit, + } = this.state + let newshixuns_listedit=shixuns_listedit; + let list=shixuns_listeditlist + let url='/paths/add_shixun_to_stage.json'; + axios.post(url,{ + name:value + }).then((response) => { + if(response){ + if(response.data){ + newshixuns_listedit.push(response.data); + list.push(response.data.shixun_id); + this.setState({ + shixuns_listedit:newshixuns_listedit, + shixuns_listeditlist:list, + patheditarry:[], + selectShixun:false, + page:1, + }) + } + } + }).catch((error) => { + console.log(error) + }); + } + render(){ let {selectShixun, @@ -340,6 +381,22 @@ class DetailCardsEditAndAdd extends Component{ > + {this.state.Addshixunstype===true?this.Getaddshixuns(value)} + {...this.props} + {...this.state} + />:""} + + { editPanel &&
@@ -371,13 +428,20 @@ class DetailCardsEditAndAdd extends Component{
描述不能超多最大限制300个字符
-

- +

+ this.AddShixunBox()} className="fl defalutGreyBorder color-grey-6 ml37"> 选用实训项目 选择下面实训后,可以通过拖拽进行排序调整

+

+ this.Addshixuns()} className="fl defalutGreyBorder color-grey-6 ml37"> + + 添加实训项目 + 您只需输入实训名称即可完成实训项目的添加,进入实训详情后可进行具体配置操作 +

+ {selectShixun===true? { this.props.idsum===this.props.keys&&this.props.pathCardsedittype===true?
@@ -381,13 +428,21 @@ class DetailCardsEditAndEdit extends Component{ >
描述不能超多最大限制300个字符
-

+ +

选用实训项目 选择下面实训后,可以通过拖拽进行排序调整

+

+ + 添加实训项目 + + 您只需输入实训名称即可完成实训项目的添加,进入实训详情后可进行具体配置操作 +

+ {selectShixun===true? diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 551ab2b0e..32051575b 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1284,7 +1284,9 @@ submittojoinclass=(value)=>{