From 3ab60f8352497ae56e39cd25af50a2f845f943b1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 3 Sep 2019 11:02:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/ExerciseDisplay.js | 7 ++- .../user/usersInfo/banks/BanksIndex.js | 7 +++ .../user/usersInfo/banks/BanksTabIndex.js | 13 ++++- .../usersInfo/banks/ExerciseBanksDetail.js | 54 +++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js diff --git a/public/react/src/modules/courses/exercise/ExerciseDisplay.js b/public/react/src/modules/courses/exercise/ExerciseDisplay.js index a0296476f..984f96114 100644 --- a/public/react/src/modules/courses/exercise/ExerciseDisplay.js +++ b/public/react/src/modules/courses/exercise/ExerciseDisplay.js @@ -53,11 +53,14 @@ class ExerciseDisplay extends Component{ componentDidMount = () => { const Id = this.props.match.params.Id if (Id) { - const url = `/exercises/${Id}.json` + const url = `/${this.props.urlPath || 'exercises'}/${Id}.json` axios.get(url) .then((response) => { if (response.data.status == 0) { - this.setState({...response.data}) + response.data.exercise_description = response.data.exercise_description || response.data.description + response.data.exercise_name = response.data.exercise_name || response.data.name + response.data.exercise_status = response.data.exercise_status == undefined ? 1 : response.data.exercise_status + this.setState({...response.data}) } }) .catch(function (error) { diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 916601420..6a303f62b 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -149,6 +149,13 @@ class BanksIndex extends Component{ />) } }> + { + return () + } + }> import('./PollBanksContent'), loading: Loading, }) +// 试卷详情 +const ExerciseBanksDetail = Loadable({ + loader: () => import('./ExerciseBanksDetail'), + loading: Loading, +}); class BanksTabIndex extends Component{ constructor(props){ @@ -53,7 +58,13 @@ class BanksTabIndex extends Component{ > } - + { + return () + } + }> { + + } + detailFetchCallback = (result) => { + let Id=this.props.match.params.Id; + + const crumbData={ + title: result.data.exercise && result.data.exercise.name, + is_public: result.data.exercise && result.data.exercise.is_public, + crumbArray:[ + {content:'详情'}, + ] + } + const menuData={ + tab:'0',//tab选中的index + menuArray:[//tab以及tab路由 + {to:`/banks/exercise/${Id}`,content:'内容详情'} + ], + category:'exercise',//毕设选题 + tos: `/banks/exercise/${Id}/edit`, + id: Id, + + } + this.props.initPublic(crumbData,menuData); + } + + render(){ + let { pollDetail } = this.state + + return( +
+ + +
+ ) + } +} +export default ExerciseBanksDetail From 434a34bda555d0fdfbb02a21e32b07040f14c508 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 3 Sep 2019 11:16:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/exercise/ExerciseDisplay.js | 9 +++++---- .../modules/user/usersInfo/banks/ExerciseBanksDetail.js | 2 +- .../react/src/modules/user/usersInfo/banks/banksMenu.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseDisplay.js b/public/react/src/modules/courses/exercise/ExerciseDisplay.js index 984f96114..cbaf38c80 100644 --- a/public/react/src/modules/courses/exercise/ExerciseDisplay.js +++ b/public/react/src/modules/courses/exercise/ExerciseDisplay.js @@ -56,11 +56,12 @@ class ExerciseDisplay extends Component{ const url = `/${this.props.urlPath || 'exercises'}/${Id}.json` axios.get(url) .then((response) => { - if (response.data.status == 0) { - response.data.exercise_description = response.data.exercise_description || response.data.description - response.data.exercise_name = response.data.exercise_name || response.data.name - response.data.exercise_status = response.data.exercise_status == undefined ? 1 : response.data.exercise_status + if (response.data.exercise) { + response.data.exercise.exercise_description = response.data.exercise.exercise_description || response.data.exercise.description + response.data.exercise.exercise_name = response.data.exercise.exercise_name || response.data.exercise.name + response.data.exercise.exercise_status = response.data.exercise.exercise_status == undefined ? 1 : response.data.exercise.exercise_status this.setState({...response.data}) + this.props.detailFetchCallback && this.props.detailFetchCallback(response); } }) .catch(function (error) { diff --git a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js b/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js index 4c14c2a7c..7f261da82 100644 --- a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js +++ b/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js @@ -29,7 +29,7 @@ class ExerciseBanksDetail extends Component{ menuArray:[//tab以及tab路由 {to:`/banks/exercise/${Id}`,content:'内容详情'} ], - category:'exercise',//毕设选题 + category:'exercise',// tos: `/banks/exercise/${Id}/edit`, id: Id, diff --git a/public/react/src/modules/user/usersInfo/banks/banksMenu.js b/public/react/src/modules/user/usersInfo/banks/banksMenu.js index 0d7d1a24a..7680dc748 100644 --- a/public/react/src/modules/user/usersInfo/banks/banksMenu.js +++ b/public/react/src/modules/user/usersInfo/banks/banksMenu.js @@ -126,7 +126,7 @@ class BanksMenu extends Component{ this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除 - 编辑 + 编辑 this.sendTopics()} style="blue" className="ml20 font-16">发送 From 949ee37118ef9cc7a6ad96b452488d091fd3cedb 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, 3 Sep 2019 11:27:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/usersInfo/InfosTopics.js | 24 ++++++++++------- .../src/modules/user/usersInfo/usersInfo.css | 27 +++++++++++++++---- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 2e80608c3..6d9c1838f 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -486,32 +486,36 @@ class InfosTopics extends Component{ {item.is_public===true?公开:""} - {types==="personal"&&item.is_public===false?user_id===targetuserid&&user_type!="学生"?this.openTopics(item.id)}>设为公开:"":""} +

- - {types==="publicly"?{item.creator_name}:""} + + {types==="publicly"?{item.creator_name}:""} {item.quotes_count} 次引用 {item.solve_count} 次答题 {moment(item.updated_at).fromNow()} - {item.course_list_name===null?"":{item.course_list_name}} + {item.course_list_name===null?"": +

{item.course_list_name}
+ }

{types==="personal"?user_id===targetuserid&&user_type!="学生"? 编辑 :"":""} + {types==="personal"&&item.is_public===false?user_id===targetuserid&&user_type!="学生"?this.openTopics(item.id)}>设为公开:"":""} +
diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css index cf1d27019..927b0c70c 100644 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ b/public/react/src/modules/user/usersInfo/usersInfo.css @@ -348,8 +348,8 @@ opacity: 1; border-radius: 2px; } -.topicswidth400{ - width: 400px; +.topicswidth600{ + mac-width: 600px; display: inline-block; } .topicswidth300{ @@ -366,13 +366,13 @@ .topscisright{ right: 0px; - top: 50px; + top: 64px; display: block; position: absolute; } -.topsics100{ - width: 100px; +.topsics135{ + max-width: 135px; display: inline-block; } @@ -405,4 +405,21 @@ .mb45{ margin-bottom: 45px!important; +} + +.topsicsmax550{ + max-width: 550px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + position: absolute; + top: -16px; +} + +.topsicrelative{ + position: relative; +} + +.topsicinline{ + display: inline-block; } \ No newline at end of file