From be103ef10b4e85bd6d4a8e60d827e3d601298bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 28 Aug 2019 14:42:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectPackages/packageconcnet.css | 4 +- .../react/src/modules/user/usersInfo/Infos.js | 12 +- .../src/modules/user/usersInfo/InfosBanner.js | 2 +- .../src/modules/user/usersInfo/InfosTopics.js | 242 +++++++++++++----- .../src/modules/user/usersInfo/usersInfo.css | 47 +++- 5 files changed, 230 insertions(+), 77 deletions(-) diff --git a/public/react/src/modules/projectPackages/packageconcnet.css b/public/react/src/modules/projectPackages/packageconcnet.css index f7ee4cc06..22dd4ebc8 100644 --- a/public/react/src/modules/projectPackages/packageconcnet.css +++ b/public/react/src/modules/projectPackages/packageconcnet.css @@ -295,11 +295,11 @@ .topsj{ position: absolute; - top: -6px; + top: -3px; } .bottomsj{ position: absolute; - bottom: -6px; + bottom: -5px; } .touchSelect .ant-spin-dot-spin{ margin-top: 30% !important; diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index cf40e5b29..3a2632061 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -261,6 +261,12 @@ class Infos extends Component{ {/* --------------------------------------------------------------------- */} + {/* 题库 */} + () + } + > {/* 课堂 */} {/* http://localhost:3007/courses/1309/homework/9300/setting */} @@ -306,12 +312,6 @@ class Infos extends Component{ } > - {/* 题库 */} - () - } - > this.setState({moduleName: 'topics'})} - to={`/users/${username}/topics`}>题库 + to={`/users/${username}/topics/personal`}>题库 :""} diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index a462ccbe7..eef665b8b 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -9,30 +9,124 @@ import NoneData from '../../courses/coursesPublic/NoneData'; import "./usersInfo.css" import moment from 'moment'; + class InfosTopics extends Component{ constructor(props){ super(props); this.state={ - isSpin:false + isSpin:false, + category:"common", + course_list_id:undefined, + sort_by:"updated_at", + sort_direction:"desc", + page:1, + data:undefined } } componentDidMount=()=>{ + let types=this.props.match.params.topicstype; + let { category, + course_list_id, + sort_by, + sort_direction, + page + }=this.state; + this.searchAlldata( + types, + category, + course_list_id, + sort_by, + sort_direction, + page + ) + + } + + searchAlldata=(type,category,course_list_id,sort_by,sort_direction,page)=>{ + let user_id=this.props.current_user&&this.props.current_user.user_id; + + + let url=`/users/${user_id}/question_banks.json`; + + axios.get(url,{params:{ + type, + category, + course_list_id, + sort_by, + sort_direction, + page + } + }).then((response) => { + this.setState({ + data:response.data + }) + }).catch((error) => { + + + }); + } + + searchCategory=(type)=>{ + this.setState({ + category:type + }) + + let types=this.props.match.params.topicstype; + let { category, + course_list_id, + sort_by, + sort_direction, + page + }=this.state; + this.searchAlldata( + types, + type, + course_list_id, + sort_by, + sort_direction, + page + ) + } + searchCourselistid=(id)=>{ + this.setState({ + course_list_id:id + }) + + let types=this.props.match.params.topicstype; + let { category, + course_list_id, + sort_by, + sort_direction, + page + }=this.state; + this.searchAlldata( + types, + category, + id, + sort_by, + sort_direction, + page + ) } render(){ let{ category, - status, - page, - data, - totalCount, - isSpin + course_list_id, + isSpin, + data } = this.state; - let is_current=this.props.is_current; - // console.log(data) + let categorylist=[ + {val:"普通作业",type:"common"}, + {val:"分组作业",type:"group"}, + {val:"毕设选题",type:"gtopic"}, + {val:"毕设任务",type:"gtask"}, + {val:"试卷",type:"exercise"}, + {val:"问卷",type:"poll"}, + ] return(
{/*提示*/} @@ -45,48 +139,82 @@ class InfosTopics extends Component{
- 我的题库 + 我的题库 公共题库
-
+
+ {categorylist.map((item,key)=>{ + return( + this.searchCategory(item.type)}>{item.val} + ) + })} -

- 共个 - 发布时间 -

+
+ +
+
+
  • this.searchCourselistid(undefined)}>全部
  • + {data===undefined?"":data.course_list===undefined||data.course_list.length===0?"":data.course_list.map((item,key)=>{ + return( +
  • this.searchCourselistid(item.id)}>{item.name}
  • + ) + })} +
    +
    +
    - {/*{data===undefined?:data.project_packages.length===0?:data.project_packages.map((item,key)=>{*/} - {/*return(*/} - {/*
    */} - {/*
    */} +
    +

    + {data&&data.count} + 已选择 {data&&data.count} +

    +

    + 最近更新 + 发送 + 删除 +

    +
    - {/*
    */} - {/*图片*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
    */} - {/*{item.title}*/} - {/*
    */} + {data===undefined?:data.question_banks===undefined||data.question_banks.length===0?:data.question_banks.map((item,key)=>{ + return( +
    +
    + {/*course_list_name: "IP视频监控技术"*/} + {/*creator_name: "实践教学"*/} + {/*id: 4269*/} + {/*is_public: false*/} + {/*name: "第四次训练"*/} + {/*quotes_count: 4*/} + {/*solve_count: 0*/} + {/*updated_at: "2018-11-16T09:30:11.000+08:00"*/} - {/*
    */} - {/*{item.bidden_status==="pending"?竞标中:""}*/} - {/*{item.bidden_status==="bidding_won"?已中标:""}*/} - {/*{item.bidden_status==="bidding_lost"?未中标:""}*/} - {/*
    */} +
    +
    + +
    - {/*
    */} - {/*
    */} - {/*{item.min_price===null?"":¥{item.min_price}}*/} - {/*{item.max_price===null||item.min_price===null?"":~}*/} - {/*{item.max_price===null?"":¥{item.max_price}}*/} - {/*{item.min_price===null&&item.max_price===null?可议价:""}*/} - {/*
    */} - {/*
    */} {/*
    */} {/*
    {item.category_name}
    */} {/*
    */} @@ -108,39 +236,23 @@ class InfosTopics extends Component{ {/*发布于:{moment(item.published_at).format("YYYY-MM-DD HH:mm")} }*/} {/*
    */} {/*
    */} - {/*
    */} - - {/*{category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===true?*/} - {/*
    */} +
    - {/**/} - {/**/} - {/**/} - {/*this.delectprojectModal(item.id)} data-id="10" title="删除">*/} - {/**/} - {/**/} - {/*
    :"":""}*/} - {/*{category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===false?*/} - {/*
    */} - {/**/} - {/**/} - {/**/} - {/*
    :"":""}*/} - {/*
    */} - {/*
    */} - {/*)})}*/} + + + )})} - {/*{*/} - {/*totalCount >20 &&*/} - {/*
    */} - {/**/} - {/*
    */} - {/*}*/} + { + data&&data.count >15 && +
    + +
    + } diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index 5b1ab3036..67951957b 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -229,7 +229,7 @@ } .topicsbox{ width: 1200px; - height: 216px; + /*min-height: 216px;*/ background: rgba(255,255,255,1); padding: 0px 40px; } @@ -241,11 +241,52 @@ font-family:PingFangSC; font-weight:400; color:rgba(51,51,51,1); + cursor: pointer; } .topcschild{ width:1128px; - height:49px; - line-height: 35px; + height:55px; + line-height: 54px; border-bottom:1px solid rgba(235,235,235,1); +} + +.topcsmid{ + width:1128px; + height:55px; + line-height: 55px; +} + +.topcsactive{ + color: #4CACFF; +} + +.topicsmidfont{ + max-width: 56px; + height: 55px; + font-size: 14px; + font-family: PingFangSC; + font-weight: 400; + cursor: pointer; + line-height: 55px; +} + +.alltopisc{ + width:141px; + height:20px; + font-size:14px; + font-family:PingFangSC; + font-weight:400; + color:rgba(153,153,153,1); + line-height:20px; +} + +.alltopiscright{ + /* width: 141px; */ + height: 20px; + font-size: 14px; + font-family: PingFangSC; + font-weight: 400; + color: rgba(153,153,153,1); + line-height: 20px; } \ No newline at end of file