From 552f23fa3964990c456e86541d57eaf770bde647 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:18:08 +0800 Subject: [PATCH 1/8] https://www.trustie.net/issues/22475 --- .../src/modules/user/account/AccountBasicEdit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 82f7d60d8..e79ffa16b 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -106,6 +106,8 @@ class AccountBasic extends Component { this.setState({ school_id, school: selectedName + }, () => { + this.filterList(name) }) } else if(basicInfo && basicInfo.school_name){ this.setState({ @@ -199,7 +201,7 @@ class AccountBasic extends Component { } // 过滤学校 - filterList=(e)=>{ + filterList =(e)=>{ const inputVal = e.trim() let arr=[]; if(inputVal){ @@ -211,7 +213,7 @@ class AccountBasic extends Component { }) this.setState({ school: inputVal, - filterSchoolList:arr + filterSchoolList: arr }) } else { this.setState({ @@ -254,6 +256,7 @@ class AccountBasic extends Component { this.setState({ department_id: '', departmentsName: e, + filterDepartments: [], }) this.this_department_id = '' return; @@ -261,7 +264,7 @@ class AccountBasic extends Component { this.this_department_id = arr[0].id this.setState({ departmentsName:e, - department_id: arr[0].id + department_id: arr[0].id, }) } @@ -365,7 +368,6 @@ class AccountBasic extends Component { // this.setState({ schoolList }) this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ name: name }) @@ -716,10 +718,10 @@ class AccountBasic extends Component { { - !filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName && + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) &&
- 未找到包含“{departmentsName}”的院系/部门, + {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, 申请新增
From 14de4e317d669a1b49892eef03930273b151fd48 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:24:07 +0800 Subject: [PATCH 2/8] mg --- public/react/src/modules/user/account/AccountBasicEdit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index e79ffa16b..3b12e0456 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -678,7 +678,7 @@ class AccountBasic extends Component { {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && -
+
未找到包含“{school}”的高校, 申请新增 @@ -719,7 +719,7 @@ class AccountBasic extends Component { { (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && -
+
{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, 申请新增 From 05b741652d5bb4bd68dd1d08c71b85d71f8f6a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 15:27:16 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 4 + .../courses/coursesPublic/Addcourses.js | 1 - .../react/src/modules/courses/css/Courses.css | 23 +++++- .../paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- .../PathDetail/DetailCardsEditAndEdit.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 32 +++++++- public/react/src/modules/tpm/TPMBanner.js | 25 ++++++- .../tpm/shixunchild/Challenges/Challenges.js | 26 ++++++- .../react/src/modules/user/AccountProfile.js | 74 +++++++++++++++++++ 9 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 public/react/src/modules/user/AccountProfile.js diff --git a/public/react/src/App.js b/public/react/src/App.js index 191b0f0c8..49dac07cd 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -18,6 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl'; import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; +import AccountProfile from"./modules/user/AccountProfile"; + + import Trialapplication from './modules/login/Trialapplication' import NotFoundPage from './NotFoundPage' @@ -278,6 +281,7 @@ class App extends Component { + {/*{*/} {/* isRender === true?*/} {/* : ""*/} diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 922c68650..8225907b8 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -38,7 +38,6 @@ class Addcourses extends Component{ } return response; }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 }); diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index e214bd81d..f8d0ec76c 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1560,9 +1560,28 @@ input.ant-input-number-input:focus { border-radius: 5px; } -.ant-modal-wrap{ - overflow: hidden; +@media screen and (min-width: 1400px) { + .ant-modal-wrap{ + overflow: hidden; + } +} +/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度 */ + +@media screen and (max-width: 1400px) { + +} +/* 设置了浏览器宽度不大于1200px时 abc 显示900px宽度 */ + +@media screen and (max-width: 900px) { + +} +/* 设置了浏览器宽度不大于900px时 abc 显示200px宽度 */ + +@media screen and (max-width: 500px) { + } +/* 设置了浏览器宽度不大于500px时 abc 显示100px宽度 */ + /* 试卷答题 */ .stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{ diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 912302cb8..2d7bcc0e0 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -466,7 +466,7 @@ class DetailCardsEditAndAdd extends Component{ {ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
+
{ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
+
{ } //头部获取是否已经登录了 getUser=(url)=>{ - console.log("点击了503") - console.log(url); + // console.log("点击了503") + // console.log(url); let{user} =this.state; + if(user===undefined){ this.setState({ isRender:true }) return } + if(user&&user.login===""){ this.setState({ isRender:true }) return; } + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + if(url !== undefined || url!==""){ window.location.href = url; } + + } //修改登录方法 @@ -554,6 +566,12 @@ submittojoinclass=(value)=>{ }) } + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const {match ,} = this.props; @@ -568,7 +586,7 @@ submittojoinclass=(value)=>{ Checkboxteachingtype, code_notice, checked_notice, - RadioGroupvalue, + AccountProfiletype, submitapplications, submitapplicationsvalue, user, @@ -610,6 +628,12 @@ submittojoinclass=(value)=>{ {...this.props} />:""} + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} +
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 5efadc1d1..33dc7fc5b 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -8,6 +8,8 @@ import PropTypes from 'prop-types'; import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; +import AccountProfile from"../user/AccountProfile"; + import 'antd/lib/pagination/style/index.css'; import axios from 'axios' @@ -381,6 +383,14 @@ class TPMBanner extends Component { //开始实战按钮 startshixunCombat=(id, reset)=>{ + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + let {shixunsDetails} = this.props if( shixunsDetails.shixun_status>1){ this.setState({ @@ -455,7 +465,11 @@ class TPMBanner extends Component { }) } - + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } render() { let { @@ -480,7 +494,7 @@ class TPMBanner extends Component { shixunsreplace, hidestartshixunsreplacevalue, Forkvisibletype, - Senttothevcaluetype, + AccountProfiletype, isIE} = this.state; let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let challengeBtnTipText = ''; @@ -555,6 +569,13 @@ class TPMBanner extends Component {
+ {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + {this.state.Modalstype===true? { - + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + + debugger let { ChallengesDataList } = this.state; // let id = this.props.match.params.shixunId; this.setState({ @@ -271,8 +280,15 @@ class Challenges extends Component { startshixunCombattype:false }) } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue} = this.state; + let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; let { loadingContent } = this.props; if (ChallengesDataList != undefined) { this.updatamakedown("ReactMarkdown") @@ -281,6 +297,12 @@ class Challenges extends Component { const antIcon = ; return ( + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + {loadingContent ? { + if (response != undefined) + if (response && response.data.status === 402) { + this.setState({ + AccountProfiletype: true + }) + + } + return response; + }, (error) => { + + }); + + } + + gotoback=()=>{ + if(this.props.AccountProfiletype!=undefined){ + this.setState({ + AccountProfiletype:false + }) + this.props.hideAccountProfile() + }else{ + window.location.href="/"; + this.setState({ + AccountProfiletype:false + }) + } + } + + + +render() { + return( + + + + ) + } +} + +export default AccountProfile; \ No newline at end of file From 65800e57df02150a8e578b3fd6d5650a1c8cd1ad Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:35:03 +0800 Subject: [PATCH 4/8] cursor --- public/react/src/modules/user/usersInfo/Infos.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 42a713a88..3b58681da 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -239,14 +239,14 @@ class Infos extends Component{
{is_current ? "我":"TA"}的经验值 - {data && data.experience}
{is_current ? "我":"TA"}的金币 - {data && data.grade}
@@ -255,14 +255,14 @@ class Infos extends Component{
{is_current ? "我":"TA"}的粉丝 - {data && data.fan_count}
{is_current ? "我":"TA"}的关注 - {data && data.follow_count}
From aa0c889f8f89d15ff78b39d6dccffc380de1b0df Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:35:14 +0800 Subject: [PATCH 5/8] cur --- public/react/src/modules/page/Header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/page/Header.js b/public/react/src/modules/page/Header.js index 05cb62743..1c24b6a52 100644 --- a/public/react/src/modules/page/Header.js +++ b/public/react/src/modules/page/Header.js @@ -100,7 +100,8 @@ class Header extends Component { {/**/} - { grade === 0 ? grade : (grade || '')} + {/* href={`${user.user_url}/user_grade`} target="_blank" */} + { grade === 0 ? grade : (grade || '')}
} From 72e53f97b48fd0fce072d6a1c8bee176d484fcc3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:38:05 +0800 Subject: [PATCH 6/8] selectedName --- public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 3b12e0456..4a2fd97f1 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -107,7 +107,7 @@ class AccountBasic extends Component { school_id, school: selectedName }, () => { - this.filterList(name) + this.filterList(selectedName) }) } else if(basicInfo && basicInfo.school_name){ this.setState({ From 7a7c2c85d8be2df97a51c4fd059b1e9b66194ff1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:48:23 +0800 Subject: [PATCH 7/8] cate --- public/react/src/modules/user/usersInfo/InfosProject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index d308e0fd3..6c1f4a666 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -125,7 +125,7 @@ class InfosProject extends Component{ :"" } { - (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.projects && data.projects.map((item,key)=>{ From 2d2d92e022bdcbc7b9f6f6e750c1927ed5cc5778 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:49:46 +0800 Subject: [PATCH 8/8] cate --- public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +- public/react/src/modules/user/usersInfo/InfosPath.js | 2 +- public/react/src/modules/user/usersInfo/InfosShixun.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 1623e9097..ff5321a9f 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -130,7 +130,7 @@ class InfosCourse extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? : "" } { - (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.courses && data.courses.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index a7b0b95f6..759527a6e 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -152,7 +152,7 @@ class InfosPath extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? :"" } { - (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.subjects && data.subjects.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index 7e911202e..bac60fe6f 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -161,7 +161,7 @@ class InfosShixun extends Component{ :"" } { - (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.shixuns && data.shixuns.map((item,key)=>{