Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_tpm_ui
daiao 5 years ago
commit 3822c37ff7

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

@ -8,6 +8,8 @@ import { notification } from 'antd';
import './index.css';
const $ = window.$;
const opens ="79e33abd4b6588941ab7622aed1e67e8";
let timestamp;
let checkSubmitFlg = false;
broadcastChannelOnmessage('refreshPage', () => {
window.location.reload()
})
@ -19,7 +21,7 @@ function locationurl(list){
window.location.href=list
}
}
let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
@ -39,7 +41,29 @@ if (isDev) {
//ebugType="teacher";
// 学生
//debugType="student";
function railsgettimes(proxy) {
if(timestamp&&checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.message;
}
}})
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 3500);
}else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.message;
}
}})
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 3500);
}
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
initOnlineOfflineListener()
@ -62,17 +86,10 @@ export function initAxiosInterceptors(props) {
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {};
window.railsgettimes = function(proxy) {
$.ajax({url:`${proxy}/api/main/first_stamp.json`,async:false,success:function(data,status){
if(data.status===0){
return data.message;
}
}});
}
window.setfalseInRequestMap = function(keyName) {
requestMap[keyName] = false;
}
axios.interceptors.request.use(
config => {
@ -102,8 +119,7 @@ export function initAxiosInterceptors(props) {
}
if(`${config[0]}`!=`true`){
if (window.location.port === "3007") {
let timestamp=railsgettimes(proxy);
console.log(timestamp)
railsgettimes(`${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) {
@ -113,6 +129,8 @@ export function initAxiosInterceptors(props) {
}
} else {
// 加api前缀
railsgettimes(`/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = url;
if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?&randomcode=${timestamp}&client_key=${newopens}`;

@ -0,0 +1,62 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import '../modules/user/account/common.css';
import './gotoqqgroup.css'
class GotoQQgroup extends Component {
constructor(props) {
super(props);
this.state={
}
}
modalCancel=()=>{
try {
this.props.setgoshowqqgtounp(false);
}catch (e) {
}
}
setDownload=()=>{
//立即联系
try {
this.props.setgoshowqqgtounp(false);
}catch (e) {
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.goshowqqgtounp===undefined?false:this.props.goshowqqgtounp}
width="530px"
>
<div className="educouddiv intermediatecenter verticallayout">
<div className="tabeltext-alignleft mt10"><p>您可以在QQ服务群向管理员申请获得继续操作的权限</p></div>
<img className="mt10" src={getImageUrl("images/educoder/qqqun20191230.png")}/>
<div className="tabeltext-alignleft mt10"><p>群号612934990</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即联系</a>
</div>
</div>
</Modal>
)
}
}
export default GotoQQgroup;

@ -0,0 +1,61 @@
/* 中间居中 */
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* 简单居中 */
.intermediatecenterysls{
display: flex;
align-items: center;
}
.spacearound{
display: flex;
justify-content: space-around;
}
.spacebetween{
display: flex;
justify-content: space-between;
}
/* 头顶部居中 */
.topcenter{
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
/* x轴正方向排序 */
/* 一 二 三 四 五 六 七 八 */
.sortinxdirection{
display: flex;
flex-direction:row;
}
/* x轴反方向排序 */
/* 八 七 六 五 四 三 二 一 */
.xaxisreverseorder{
display: flex;
flex-direction:row-reverse;
}
/* 垂直布局 正方向*/
/*
*/
.verticallayout{
display: flex;
flex-direction:column;
}
/* 垂直布局 反方向*/
.reversedirection{
display: flex;
flex-direction:column-reverse;
}

@ -31,13 +31,15 @@ class ShixunsHome extends Component {
}
}
componentDidMount(){
configShareForIndex()
configShareForIndex()
const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{
let updata=response.data;
this.setState({
updata:updata
})
if(response.data){
let updata=response.data;
this.setState({
updata:updata
})
}
}).catch((error)=>{
console.log(error);
})
@ -50,7 +52,7 @@ class ShixunsHome extends Component {
})
}
}).catch((error)=>{
console.log(error)
// console.log(error)
});
}

@ -19,7 +19,9 @@ import Addcourses from '../courses/coursesPublic/Addcourses';
import LoginDialog from '../login/LoginDialog';
import Trialapplication from '../login/Trialapplication'
import Trialapplication from '../login/Trialapplication';
import GotoQQgroup from '../../modal/GotoQQgroup'
import 'antd/lib/modal/style/index.css';
@ -31,6 +33,8 @@ import 'antd/lib/input/style/index.css';
import './TPMIndex.css';
const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用
@ -69,6 +73,7 @@ class NewHeader extends Component {
headtypesonClickbool:false,
headtypess:"/",
mygetHelmetapi2: null,
goshowqqgtounp:false,
}
console.log("176")
// console.log(props);
@ -649,6 +654,18 @@ submittojoinclass=(value)=>{
return;
}
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===true){
this.setgoshowqqgtounp(true);
return;
}
if(url !== undefined || url!==""){
window.location.href = url;
}
@ -790,6 +807,14 @@ submittojoinclass=(value)=>{
return false
}
}
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match} = this.props;
@ -808,6 +833,7 @@ submittojoinclass=(value)=>{
headtypesonClickbool,
headtypess,
mygetHelmetapi2,
goshowqqgtounp,
}=this.state;
/*
用户名称 用户头像url
@ -898,7 +924,9 @@ submittojoinclass=(value)=>{
})
}
console.log("newHeadersnewHeaders");
console.log(this.props);
// this.props.current_user.is_shixun_marker
return (
<div className="newHeaders" id="nHeader" >
@ -914,6 +942,14 @@ submittojoinclass=(value)=>{
{...this.props}
{...this.state}
/>:""}
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
<a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}>
{
mygetHelmetapi2 === null ?
@ -1100,9 +1136,6 @@ submittojoinclass=(value)=>{
{/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/}
<Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>
</li>
{}
{console.log(activeShixuns)}
<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
<Link to="/shixuns">实训项目</Link>
{/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
@ -1287,7 +1320,9 @@ submittojoinclass=(value)=>{
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===false?
<li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}</a></li>:""
}
{shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>}
{shixuntype===true?"":
<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>
}
{this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>}
{this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:""

@ -1,118 +1,119 @@
.basicForm {
background: #fff;
padding: 30px;
margin-bottom: 10px;
box-sizing: border-box;
width: 100%;
min-height: 390px;
}
.basicForm .title {
font-size: 16px;
padding-left: 30px;
margin-bottom: 10px;
}
.flexTable {
display: flex;
flex-direction: column;
}
.flexRow {
display: flex;
}
.mb15{margin-bottom: 15px!important;}
/* BUTTOn */
.ant-btn {
border-radius: 2px;
}
button.ant-btn.ant-btn-primary.grayBtn {
background: #CBCBCB;
border-color: #CBCBCB;
}
.borderBottom {
border-bottom: 1px solid #4CACFF;
}
/* form ---------------- START */
.formItemInline {
display: flex;
}
.formItemInline .ant-form-item-control-wrapper {
display: inline-block;
}
.hideRequireTag .ant-form-item-required:before{
display: none;
}
/* .basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.basicForm .ant-form-item-label label {
color: #979797
} */
.courseNormalForm .ant-select-show-search {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
.courseNormalForm .ant-select-search__field__mirror {
height: 40px;
}
.courseNormalForm .ant-input-lg {
height: 40px;
}
.courseNormalForm .ant-select-selection--single {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single {
height: 40px
}
.courseNormalForm .ant-input-affix-wrapper {
height: 40px;
}
/* 职业 */
.courseNormalForm .ant-select-selection-selected-value {
line-height: 38px
}
.courseNormalForm input {
height: 40px;
}
.autoModal .ant-modal-body{
height: auto;
overflow-y: auto;
}
@media screen and (max-height: 765px) {
.autoModal .ant-modal-body {
height: 670px;
overflow-y: auto;
}
}
@media screen and (max-height: 735px) {
.autoModal .ant-modal-body {
height: 600px;
overflow-y: auto;
}
}
@media screen and (max-height: 635px) {
.autoModal .ant-modal-body {
height: 500px;
overflow-y: auto;
}
}
@media screen and (max-height: 566px) {
.autoModal .ant-modal-body {
height: 465px;
overflow-y: auto;
}
}
@media screen and (max-height: 472px) {
.autoModal .ant-modal-body {
height: 360px;
overflow-y: auto;
}
}
.basicForm {
background: #fff;
padding: 30px;
margin-bottom: 10px;
box-sizing: border-box;
width: 100%;
min-height: 390px;
}
.basicForm .title {
font-size: 16px;
padding-left: 30px;
margin-bottom: 10px;
}
.flexTable {
display: flex;
flex-direction: column;
}
.flexRow {
display: flex;
}
.mb15{margin-bottom: 15px!important;}
/* BUTTOn */
.ant-btn {
border-radius: 2px;
}
button.ant-btn.ant-btn-primary.grayBtn {
background: #CBCBCB;
border-color: #CBCBCB;
}
.borderBottom {
border-bottom: 1px solid #4CACFF;
}
/* form ---------------- START */
.formItemInline {
display: flex;
}
.formItemInline .ant-form-item-control-wrapper {
display: inline-block;
}
.hideRequireTag .ant-form-item-required:before{
display: none;
}
/* .basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
}
.basicForm .ant-form-item-label label {
color: #979797
} */
.courseNormalForm .ant-select-show-search {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
.courseNormalForm .ant-select-search__field__mirror {
height: 40px;
}
.courseNormalForm .ant-input-lg {
height: 40px;
}
.courseNormalForm .ant-select-selection--single {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single {
height: 40px
}
.courseNormalForm .ant-input-affix-wrapper {
height: 40px;
}
/* 职业 */
.courseNormalForm .ant-select-selection-selected-value {
line-height: 38px
}
.courseNormalForm input {
height: 40px;
}
.autoModal .ant-modal-body{
height: auto;
overflow-y: auto;
}
@media screen and (max-height: 765px) {
.autoModal .ant-modal-body {
height: 670px;
overflow-y: auto;
}
}
@media screen and (max-height: 735px) {
.autoModal .ant-modal-body {
height: 600px;
overflow-y: auto;
}
}
@media screen and (max-height: 635px) {
.autoModal .ant-modal-body {
height: 500px;
overflow-y: auto;
}
}
@media screen and (max-height: 566px) {
.autoModal .ant-modal-body {
height: 465px;
overflow-y: auto;
}
}
@media screen and (max-height: 472px) {
.autoModal .ant-modal-body {
height: 360px;
overflow-y: auto;
}
}

Loading…
Cancel
Save