From e502aa43e1ec4ee0497156b557fe309340469b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 4 Sep 2019 15:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=95=E4=B8=9A=E9=80=89=E9=A2=98=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comtopicdetails/CompletetopicdePage.js | 175 +++++------------- 1 file changed, 47 insertions(+), 128 deletions(-) diff --git a/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js b/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js index f4291a5df..e9b369b34 100644 --- a/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js +++ b/public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js @@ -1,21 +1,20 @@ import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn} from 'educoder'; +import {BrowserRouter as Router,Route,Switch,Link, NavLin} from 'react-router-dom'; +import {WordsBtn, ActionBtn,getImageUrl} from 'educoder'; import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd"; import axios from 'axios'; -import { - notification -} from "antd"; -import CoursesListType from '../coursesPublic/CoursesListType'; -import Completetopicdetails from './Completetopicdetails'; -import SendTopics from '../../modals/SendTopics'; -import Modals from '../../modals/Modals'; +import BanksMenu from '../../user/usersInfo/banks/banksMenu' +import Loadable from 'react-loadable'; +import Loading from '../../../Loading'; import '../css/members.css'; import "../common/formCommon.css"; import '../css/Courses.css'; import '../css/busyWork.css'; import '../poll/pollStyle.css'; - +const Completetopicdetails = Loadable({ + loader: () => import('./Completetopicdetails'), + loading: Loading, +}) class CompletetopicdePage extends Component { //毕设选题内容详情 constructor(props) { @@ -25,8 +24,8 @@ class CompletetopicdePage extends Component { workid:1, isSpin:false, datas:[], - visible:false - + visible:false, + banksMenu:undefined } } @@ -68,6 +67,18 @@ class CompletetopicdePage extends Component { {content:'详情'} ] } + const menuData={ + tab:'0',//tab选中的index + menuArray:[//tab以及tab路由 + {to:`/banks/gtopic/${workids}/${this.props.match.params.type}/details`,content:'内容详情'}, + ], + category:'gtopic',//毕设选题 + tos:`/banks/gtopic/${workids}/edit/${this.props.match.params.type}`, + id:workids, + } + this.setState({ + banksMenu:menuData + }) this.props.initPublic(crumbData); }catch (e) { @@ -97,127 +108,35 @@ class CompletetopicdePage extends Component { }); } - //发送至相关 - sendTopics=()=>{ - this.setState({ - visible:true - }) - } - - topicscancelmodel=()=>{ - this.setState({ - Modalstype:false, - Loadtype:false, - visible:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - checkBoxValues:[], - checkedtype:false - }) - } - - //删除相关 - - deletecheckBoxValues=()=>{ - - this.setState({ - Modalstype:true, - Modalstopval:"是否确认删除?", - ModalCancel:this.topicscancelmodel, - ModalSave:this.topicssavedelete, - }) - - } - - topicssavedelete=()=>{ - - const url = `/question_banks/multi_delete.json`; - axios.delete(url, { data: { - object_id: [this.props.match.params.workid], - object_type:"gtopic" - }}) - .then((response) => { - if(response.data.status===0){ - this.props.showNotification(response.data.message) - window.location.href=`/users/${this.props.current_user.login}/topics/personal`; - }else{ - this.props.showNotification(response.data.message) - } - }) - .catch(function (error) { - console.log(error); - }); - this.topicscancelmodel() - } - render() { - let{datas,visible}=this.state; - // console.log(119) - let user_id=this.props.current_user&&this.props.current_user.user_id; - let user_type=this.props.current_user&&this.props.current_user.user_identity; - let targetuserid=this.props.data&&this.props.data.id; + let {tab,datas,visible} = this.state; + let{ + banksMenu + }=this.state + // + // const common={ + // initPublic:this.initPublic, + // } return ( -
*/} - {/* {datas&&datas.name}*/} - {/*
*/} - {/*