移除material-ui

dev_aliyun2
harry 5 years ago
parent b9b7e68a0e
commit be519f87e1

@ -1188,11 +1188,6 @@
"resolved": "https://registry.npm.taobao.org/@csstools/normalize.css/download/@csstools/normalize.css-10.1.0.tgz", "resolved": "https://registry.npm.taobao.org/@csstools/normalize.css/download/@csstools/normalize.css-10.1.0.tgz",
"integrity": "sha1-8JULuhiBlRLUL3GX5WxRiqSRzxg=" "integrity": "sha1-8JULuhiBlRLUL3GX5WxRiqSRzxg="
}, },
"@emotion/hash": {
"version": "0.7.4",
"resolved": "https://registry.npm.taobao.org/@emotion/hash/download/@emotion/hash-0.7.4.tgz",
"integrity": "sha1-8UkyiHQiyQVrFajSIqkHSn36KDE="
},
"@emotion/is-prop-valid": { "@emotion/is-prop-valid": {
"version": "0.8.6", "version": "0.8.6",
"resolved": "https://registry.npm.taobao.org/@emotion/is-prop-valid/download/@emotion/is-prop-valid-0.8.6.tgz", "resolved": "https://registry.npm.taobao.org/@emotion/is-prop-valid/download/@emotion/is-prop-valid-0.8.6.tgz",
@ -1515,73 +1510,6 @@
"@types/yargs": "^13.0.0" "@types/yargs": "^13.0.0"
} }
}, },
"@material-ui/core": {
"version": "4.9.5",
"resolved": "https://registry.npm.taobao.org/@material-ui/core/download/@material-ui/core-4.9.5.tgz",
"integrity": "sha1-OEhp8oQLJDJB94gakC9f/Eg2CDA=",
"requires": {
"@babel/runtime": "^7.4.4",
"@material-ui/styles": "^4.9.0",
"@material-ui/system": "^4.9.3",
"@material-ui/types": "^5.0.0",
"@material-ui/utils": "^4.7.1",
"@types/react-transition-group": "^4.2.0",
"clsx": "^1.0.2",
"hoist-non-react-statics": "^3.3.2",
"popper.js": "^1.14.1",
"prop-types": "^15.7.2",
"react-is": "^16.8.0",
"react-transition-group": "^4.3.0"
}
},
"@material-ui/styles": {
"version": "4.9.0",
"resolved": "https://registry.npm.taobao.org/@material-ui/styles/download/@material-ui/styles-4.9.0.tgz",
"integrity": "sha1-EMMYWfaGjPqdOt9rbD4yydZ2vHY=",
"requires": {
"@babel/runtime": "^7.4.4",
"@emotion/hash": "^0.7.4",
"@material-ui/types": "^5.0.0",
"@material-ui/utils": "^4.7.1",
"clsx": "^1.0.2",
"csstype": "^2.5.2",
"hoist-non-react-statics": "^3.2.1",
"jss": "^10.0.3",
"jss-plugin-camel-case": "^10.0.3",
"jss-plugin-default-unit": "^10.0.3",
"jss-plugin-global": "^10.0.3",
"jss-plugin-nested": "^10.0.3",
"jss-plugin-props-sort": "^10.0.3",
"jss-plugin-rule-value-function": "^10.0.3",
"jss-plugin-vendor-prefixer": "^10.0.3",
"prop-types": "^15.7.2"
}
},
"@material-ui/system": {
"version": "4.9.3",
"resolved": "https://registry.npm.taobao.org/@material-ui/system/download/@material-ui/system-4.9.3.tgz",
"integrity": "sha1-7kiZDXlBI3/a8ht7OZmB1hS7CHU=",
"requires": {
"@babel/runtime": "^7.4.4",
"@material-ui/utils": "^4.7.1",
"prop-types": "^15.7.2"
}
},
"@material-ui/types": {
"version": "5.0.0",
"resolved": "https://registry.npm.taobao.org/@material-ui/types/download/@material-ui/types-5.0.0.tgz",
"integrity": "sha1-JtYlncazn0wuHprO/3oR4DGUF0E="
},
"@material-ui/utils": {
"version": "4.7.1",
"resolved": "https://registry.npm.taobao.org/@material-ui/utils/download/@material-ui/utils-4.7.1.tgz",
"integrity": "sha1-3BbH8NLNAvvN1c/mAf1oY648xlI=",
"requires": {
"@babel/runtime": "^7.4.4",
"prop-types": "^15.7.2",
"react-is": "^16.8.0"
}
},
"@mrmlnc/readdir-enhanced": { "@mrmlnc/readdir-enhanced": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "http://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz", "resolved": "http://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz",
@ -1855,14 +1783,6 @@
"@types/react": "*" "@types/react": "*"
} }
}, },
"@types/react-transition-group": {
"version": "4.2.4",
"resolved": "https://registry.npm.taobao.org/@types/react-transition-group/download/@types/react-transition-group-4.2.4.tgz",
"integrity": "sha1-x0FiJZh8zbcZJidmwUg9qPgmg40=",
"requires": {
"@types/react": "*"
}
},
"@types/stack-utils": { "@types/stack-utils": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz",
@ -4272,15 +4192,6 @@
"resolved": "http://registry.npm.taobao.org/css-unit-converter/download/css-unit-converter-1.1.1.tgz", "resolved": "http://registry.npm.taobao.org/css-unit-converter/download/css-unit-converter-1.1.1.tgz",
"integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=" "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY="
}, },
"css-vendor": {
"version": "2.0.7",
"resolved": "https://registry.npm.taobao.org/css-vendor/download/css-vendor-2.0.7.tgz",
"integrity": "sha1-Tm1T2VPBh5gVdtalQqzJ+1cXS9o=",
"requires": {
"@babel/runtime": "^7.6.2",
"is-in-browser": "^1.0.2"
}
},
"css-what": { "css-what": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npm.taobao.org/css-what/download/css-what-3.2.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-what%2Fdownload%2Fcss-what-3.2.1.tgz", "resolved": "https://registry.npm.taobao.org/css-what/download/css-what-3.2.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-what%2Fdownload%2Fcss-what-3.2.1.tgz",
@ -4785,15 +4696,6 @@
"utila": "~0.4" "utila": "~0.4"
} }
}, },
"dom-helpers": {
"version": "5.1.3",
"resolved": "https://registry.npm.taobao.org/dom-helpers/download/dom-helpers-5.1.3.tgz",
"integrity": "sha1-cjMkjrOi0fdKr8ox5SxSmcyM6CE=",
"requires": {
"@babel/runtime": "^7.6.3",
"csstype": "^2.6.7"
}
},
"dom-lib": { "dom-lib": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/dom-lib/download/dom-lib-1.2.1.tgz", "resolved": "https://registry.npm.taobao.org/dom-lib/download/dom-lib-1.2.1.tgz",
@ -6992,11 +6894,6 @@
"resolved": "http://registry.npm.taobao.org/https-browserify/download/https-browserify-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/https-browserify/download/https-browserify-1.0.0.tgz",
"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM="
}, },
"hyphenate-style-name": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/hyphenate-style-name/download/hyphenate-style-name-1.0.3.tgz",
"integrity": "sha1-CXu3+guPGpzwvVxzTPlYmZgam0g="
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&sync_timestamp=1579333981154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz", "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&sync_timestamp=1579333981154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz",
@ -7341,11 +7238,6 @@
"is-extglob": "^2.1.1" "is-extglob": "^2.1.1"
} }
}, },
"is-in-browser": {
"version": "1.1.3",
"resolved": "https://registry.npm.taobao.org/is-in-browser/download/is-in-browser-1.1.3.tgz",
"integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU="
},
"is-mobile": { "is-mobile": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/is-mobile/download/is-mobile-2.2.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-mobile%2Fdownload%2Fis-mobile-2.2.1.tgz", "resolved": "https://registry.npm.taobao.org/is-mobile/download/is-mobile-2.2.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-mobile%2Fdownload%2Fis-mobile-2.2.1.tgz",
@ -9017,83 +8909,6 @@
"verror": "1.10.0" "verror": "1.10.0"
} }
}, },
"jss": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss/download/jss-10.0.4.tgz",
"integrity": "sha1-Ruvd4cQMmgedZPMzTLiK4o/ZC/0=",
"requires": {
"@babel/runtime": "^7.3.1",
"csstype": "^2.6.5",
"is-in-browser": "^1.1.3",
"tiny-warning": "^1.0.2"
}
},
"jss-plugin-camel-case": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-camel-case/download/jss-plugin-camel-case-10.0.4.tgz",
"integrity": "sha1-Pe3s7B5bugv2FBwsBeKrEepLRo0=",
"requires": {
"@babel/runtime": "^7.3.1",
"hyphenate-style-name": "^1.0.3",
"jss": "10.0.4"
}
},
"jss-plugin-default-unit": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-default-unit/download/jss-plugin-default-unit-10.0.4.tgz",
"integrity": "sha1-3wOIXeIPIKH8HCG9t8Yuhl7kANk=",
"requires": {
"@babel/runtime": "^7.3.1",
"jss": "10.0.4"
}
},
"jss-plugin-global": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-global/download/jss-plugin-global-10.0.4.tgz",
"integrity": "sha1-QSJFtWEzzIi+xlSnDYLVkiYZ9MU=",
"requires": {
"@babel/runtime": "^7.3.1",
"jss": "10.0.4"
}
},
"jss-plugin-nested": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-nested/download/jss-plugin-nested-10.0.4.tgz",
"integrity": "sha1-TRWtE5lftuQSVhgAZHOgltJHXXU=",
"requires": {
"@babel/runtime": "^7.3.1",
"jss": "10.0.4",
"tiny-warning": "^1.0.2"
}
},
"jss-plugin-props-sort": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-props-sort/download/jss-plugin-props-sort-10.0.4.tgz",
"integrity": "sha1-Q8iA/438+Fj4CfZj7OXmWh2UW1o=",
"requires": {
"@babel/runtime": "^7.3.1",
"jss": "10.0.4"
}
},
"jss-plugin-rule-value-function": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-rule-value-function/download/jss-plugin-rule-value-function-10.0.4.tgz",
"integrity": "sha1-L0z0qGrT66h1u0jLn0p+01yzVOc=",
"requires": {
"@babel/runtime": "^7.3.1",
"jss": "10.0.4"
}
},
"jss-plugin-vendor-prefixer": {
"version": "10.0.4",
"resolved": "https://registry.npm.taobao.org/jss-plugin-vendor-prefixer/download/jss-plugin-vendor-prefixer-10.0.4.tgz",
"integrity": "sha1-FibvYSpFQc/xfPloFeF0AVUhTtI=",
"requires": {
"@babel/runtime": "^7.3.1",
"css-vendor": "^2.0.7",
"jss": "10.0.4"
}
},
"jsx-ast-utils": { "jsx-ast-utils": {
"version": "2.2.3", "version": "2.2.3",
"resolved": "https://registry.npm.taobao.org/jsx-ast-utils/download/jsx-ast-utils-2.2.3.tgz", "resolved": "https://registry.npm.taobao.org/jsx-ast-utils/download/jsx-ast-utils-2.2.3.tgz",
@ -10712,11 +10527,6 @@
"ts-pnp": "^1.1.2" "ts-pnp": "^1.1.2"
} }
}, },
"popper.js": {
"version": "1.16.1",
"resolved": "https://registry.npm.taobao.org/popper.js/download/popper.js-1.16.1.tgz",
"integrity": "sha1-KiI8s9x7YhPXQOQDcr5A3kPmWxs="
},
"portfinder": { "portfinder": {
"version": "1.0.25", "version": "1.0.25",
"resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz?cache=0&sync_timestamp=1571176857935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fportfinder%2Fdownload%2Fportfinder-1.0.25.tgz", "resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz?cache=0&sync_timestamp=1571176857935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fportfinder%2Fdownload%2Fportfinder-1.0.25.tgz",
@ -12953,17 +12763,6 @@
"prop-types": "^15.5.4" "prop-types": "^15.5.4"
} }
}, },
"react-transition-group": {
"version": "4.3.0",
"resolved": "https://registry.npm.taobao.org/react-transition-group/download/react-transition-group-4.3.0.tgz?cache=0&sync_timestamp=1570624821693&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-transition-group%2Fdownload%2Freact-transition-group-4.3.0.tgz",
"integrity": "sha1-/qgy44bPh5bFi2GHSjMZcE9c5oM=",
"requires": {
"@babel/runtime": "^7.5.5",
"dom-helpers": "^5.0.1",
"loose-envify": "^1.4.0",
"prop-types": "^15.6.2"
}
},
"react-url-query": { "react-url-query": {
"version": "1.5.0", "version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/react-url-query/download/react-url-query-1.5.0.tgz", "resolved": "https://registry.npm.taobao.org/react-url-query/download/react-url-query-1.5.0.tgz",

@ -3,7 +3,6 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@material-ui/core": "^4.9.5",
"@novnc/novnc": "^1.1.0", "@novnc/novnc": "^1.1.0",
"antd": "^3.26.12", "antd": "^3.26.12",
"axios": "^0.19.2", "axios": "^0.19.2",

@ -1,19 +1,9 @@
import React, { Component } from 'react'; import React, { Component, Fragment } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import axios from 'axios'; import axios from 'axios';
import Snackbar from '@material-ui/core/Snackbar';
import update from 'immutability-helper' import update from 'immutability-helper'
import { Modal, Button, Alert } from 'antd'
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import Button from '@material-ui/core/Button';
import EvaluateSuccessEffectDisplay from './EvaluateSuccessEffectDisplay' import EvaluateSuccessEffectDisplay from './EvaluateSuccessEffectDisplay'
import _ from 'lodash' import _ from 'lodash'
@ -31,23 +21,8 @@ import _ from 'lodash'
import TPIContext from './TPIContext' import TPIContext from './TPIContext'
import { import {
EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC, getRandomNumber , EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC, getRandomNumber
} from 'educoder' } from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from '@material-ui/core/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
const styles = MUIDialogStyleUtil.getTwoButtonStyle()
// 主题自定义
const theme = createMuiTheme({
palette: {
primary: {
main: '#4CACFF',
contrastText: 'rgba(255, 255, 255, 0.87)'
},
secondary: { main: '#4CACFF' }, // This is just green.A700 as hex.
},
});
const testSetsExpandedArrayInitVal = [false, false, false, false, false, const testSetsExpandedArrayInitVal = [false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false,
@ -912,62 +887,53 @@ pop_box_new(htmlvalue, 480, 182);
match: this.props.match match: this.props.match
}} }}
> >
<Dialog <Modal
id="tpi-dialog" id="tpi-dialog"
open={this.state.gDialogOpen} title='提示'
disableEscapeKeyDown={true} visible={this.state.gDialogOpen}
onClose={() => this.handleGdialogClose()} onCancel={() => this.handleGdialogClose()}
> footer={
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle> <Fragment>
<DialogContent id="dialog-content"> {this.isSingleButton ? <div className="task-popup-submit clearfix"
<DialogContentText id="alert-dialog-description" style={{ textAlign: 'center' }}> style={{ textAlign: 'center', 'margin-bottom': '14px' }}>
{this.state.gDialogContentText} <a className="task-btn task-btn-orange"
</DialogContentText> onClick={this.handleGdialogClose}
</DialogContent> >知道啦</a>
{/* mb20 加了有样式问题 */} </div> :
<DialogActions className={""} id="dialog-actions"> <React.Fragment>
{this.isSingleButton ? <div className="task-popup-submit clearfix" <Button onClick={() => this.handleGdialogClose()} color="primary"
style={{ textAlign: 'center', 'margin-bottom': '14px' }}> className={`${classes.button} ${classes.buttonGray} ${classes.borderRadiusNone}`}>
<a className="task-btn task-btn-orange" 关闭
onClick={this.handleGdialogClose}
>知道啦</a>
</div> :
<React.Fragment>
<Button onClick={() => this.handleGdialogClose()} color="primary"
className={`${classes.button} ${classes.buttonGray} ${classes.borderRadiusNone}`}>
关闭
</Button> </Button>
<Button variant="raised" className={`${classes.button} ${classes.borderRadiusNone}`} <Button variant="raised" className={`${classes.button} ${classes.borderRadiusNone}`}
onClick={() => this.onGdialogOkBtnClick()} color="primary" autoFocus> onClick={() => this.onGdialogOkBtnClick()} color="primary" autoFocus>
{this.okButtonText ? this.okButtonText : '确定'} {this.okButtonText ? this.okButtonText : '确定'}
</Button> </Button>
</React.Fragment>} </React.Fragment>}
{this.moreButtonsRender && this.moreButtonsRender()} {this.moreButtonsRender && this.moreButtonsRender()}
</DialogActions>
</Dialog> </Fragment>
}
<Snackbar >
className={"rootSnackbar"} <div id="alert-dialog-description" style={{ textAlign: 'center' }}>
open={this.state.snackbarOpen} {this.state.gDialogContentText}
autoHideDuration={3000} </div>
anchorOrigin={{ </Modal>
vertical: this.state.snackbarVertical || 'top' {this.state.snackbarOpen ?
, horizontal: this.state.snackbarHorizontal || 'center' <Alert
}} className={"rootSnackbar"}
onClose={() => this.handleSnackbarClose()} onClose={() => this.handleSnackbarClose()}
SnackbarContentProps={{ message={<span id="message-id">{this.state.snackbarText}</span>}
'aria-describedby': 'message-id', /> : null
}} }
resumeHideDuration={2000}
message={<span id="message-id">{this.state.snackbarText}</span>}
/>
{this.props.children} {this.props.children}
</TPIContext.Provider> </TPIContext.Provider>
) )
} }
} }
export default CNotificationHOC()(withStyles(styles)(TPIContextProvider)); export default CNotificationHOC()(TPIContextProvider);

@ -128,10 +128,6 @@ body {
} }
} }
/* material ui 给body加了个6px padding */
body {
padding-right: 0px !important;
}
.indexHOC { .indexHOC {
position: relative; position: relative;

@ -1,4 +0,0 @@
/* material ui 给body加了个6px padding */
body {
padding-right: 0px !important;
}

@ -1,14 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tooltip, Modal } from 'antd'
import { Dialog } from '@material-ui/core';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import Button from '@material-ui/core/Button';
import { Tooltip } from 'antd'
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import CommentItemKEEditor from './CommentItemKEEditor'; import CommentItemKEEditor from './CommentItemKEEditor';
@ -462,55 +453,29 @@ class Comments extends Component {
modalSave={this.onDialogOkBtnClick} modalSave={this.onDialogOkBtnClick}
> >
</Modals> : </Modals> :
<Dialog <Modal
open={dialogOpen} title="提示"
disableEscapeKeyDown={true} visible={dialogOpen}
onClose={this.handleDialogClose} onOk={this.onDialogOkBtnClick.bind(this)}
onCancel={this.handleDialogClose}
> >
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle> {
<DialogContent> dialogType === 'delete' ? '确定要删除该条回复吗?'
<DialogContentText id="alert-dialog-description" style={{ textAlign: 'center' }}> : dialogType === 'hidden' ? '确定要隐藏该条回复吗?'
{ : dialogType === 'hiddenCancel' ? '确定要取消隐藏该条回复吗?' : ''
dialogType === 'delete' ? '确定要删除该条回复吗?' }
: dialogType === 'hidden' ? '确定要隐藏该条回复吗?' </Modal>
: dialogType === 'hiddenCancel' ? '确定要取消隐藏该条回复吗?' : ''
}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={this.handleDialogClose} color="primary">
取消
</Button>
<Button variant="raised"
onClick={() => this.onDialogOkBtnClick()} color="primary" autoFocus>
确定
</Button>
</DialogActions>
</Dialog>
} }
<Dialog <Modal
open={goldRewardDialogOpen} title="奖励设置"
disableEscapeKeyDown={true} visible={goldRewardDialogOpen}
onClose={this.handleGoldRewardDialogClose} onOk={this.onGoldRewardDialogOkBtnClick.bind(this)}
onCancel={this.handleGoldRewardDialogClose}
> >
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle> <InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
<DialogContent> onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
</Modal>
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
</DialogContent>
<DialogActions>
<Button onClick={this.handleGoldRewardDialogClose} color="primary">
取消
</Button>
<Button variant="raised"
onClick={() => this.onGoldRewardDialogOkBtnClick()} color="primary" autoFocus>
确定
</Button>
</DialogActions>
</Dialog>
<div className="-layout-v -fit"> <div className="-layout-v -fit">

@ -1,27 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import axios from 'axios' import axios from 'axios'
import moment from 'moment' import moment from 'moment'
import Comments from '../comment/Comments' import Comments from '../comment/Comments'
import update from 'immutability-helper' import update from 'immutability-helper'
// import Tooltip from '@material-ui/core/Tooltip';
import RewardDialog from '../common/RewardDialog'; import RewardDialog from '../common/RewardDialog';
import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
import MemoDetailKEEditor from './MemoDetailKEEditor' import MemoDetailKEEditor from './MemoDetailKEEditor'
import MemoDetailMDEditor from './MemoDetailMDEditor' import MemoDetailMDEditor from './MemoDetailMDEditor'
import { CBreadcrumb, htmlEncode } from 'educoder' import { CBreadcrumb, htmlEncode } from 'educoder'
import { Tooltip } from 'antd' import { Tooltip } from 'antd'
// import CBreadcrumb from '../courses/common/CBreadcrumb'
import { typeNameMap2 } from './MemoNew' import { typeNameMap2 } from './MemoNew'
const $ = window.$ const $ = window.$
function urlStringify(params) { function urlStringify(params) {

@ -2,8 +2,6 @@ import React from 'react'
import axios from 'axios' import axios from 'axios'
import PostItem from './PostItem' import PostItem from './PostItem'
import { CircularProgress } from '@material-ui/core';
import { queryString } from 'educoder' import { queryString } from 'educoder'
import { on, off, updatePageParams } from 'educoder' import { on, off, updatePageParams } from 'educoder'
import './Post.css' import './Post.css'
@ -325,12 +323,7 @@ export default function postPaginationHOC(options = {}) {
<span className="color-orange03">{_searchValue}</span>" <span className="color-orange03">{_searchValue}</span>"
</span> </span>
</div>} </div>}
{loadingMemos ? <p>正在加载中...</p> : null}
<CircularProgress size={40} thickness={3}
style={{
marginLeft: 'auto', marginRight: 'auto', paddingTop: '20%'
, display: loadingMemos ? 'block' : 'none'
}} />
{!loadingMemos && {!loadingMemos &&
<WrappedComponent {...this.props} {...this.state} <WrappedComponent {...this.props} {...this.state}

@ -2,11 +2,9 @@ import React, { Component } from 'react';
import ShiXunPostItem from './ShiXunPostItem' import ShiXunPostItem from './ShiXunPostItem'
import ForumsNavTab from '../ForumsNavTab' import ForumsNavTab from '../ForumsNavTab'
import { CircularProgress } from '@material-ui/core';
import { on, off } from 'educoder' import { on, off } from 'educoder'
import './MemoShixun.css' import './MemoShixun.css'
// import queryString from 'query-string'
import { queryString, updatePageParams } from 'educoder' import { queryString, updatePageParams } from 'educoder'
import MemoList from '../MemoList' import MemoList from '../MemoList'
import axios from 'axios' import axios from 'axios'
@ -191,12 +189,7 @@ class MemoShixun extends Component {
<span className="color-orange03">{_searchValue}</span>" <span className="color-orange03">{_searchValue}</span>"
</span> </span>
</div>} </div>}
{loadingMemos ? <p>正在加载中...</p> : null}
<CircularProgress size={40} thickness={3}
style={{
marginLeft: 'auto', marginRight: 'auto', paddingTop: '20%'
, display: loadingMemos ? 'block' : 'none'
}} />
{!loadingMemos && {!loadingMemos &&
<React.Fragment> <React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab> <ForumsNavTab {...this.props}></ForumsNavTab>

@ -1,17 +1,12 @@
import './header.less'; import './header.less';
import React, { Component } from 'react'; import React, { Component } from 'react';
import Button from '@material-ui/core/Button'; import { Tooltip, Drawer } from 'antd'
import { withStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import TaskListContainer from './taskList/TaskListContainer' import TaskListContainer from './taskList/TaskListContainer'
import TaskResultLayer from './layers/TaskResultLayer' import TaskResultLayer from './layers/TaskResultLayer'
import Tooltip from '@material-ui/core/Tooltip';
import moment from 'moment'
function pad(num) { function pad(num) {
return ("0" + num).slice(-2); return ("0" + num).slice(-2);
} }
@ -24,15 +19,6 @@ function hhmmss(secs) {
} }
const styles = theme => ({
button: {
margin: theme.spacing.unit,
background: '#05101A',
color: '#4CACFF',
top: '-6px'
},
});
class Header extends Component { class Header extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -41,11 +27,6 @@ class Header extends Component {
} }
} }
componentDidMount() {
}
goBack() { goBack() {
const { challenge, game, shixun } = this.props const { challenge, game, shixun } = this.props
// myshixuns/pw346iskxh/stages/rw4v6giml5no // myshixuns/pw346iskxh/stages/rw4v6giml5no
@ -69,8 +50,9 @@ class Header extends Component {
<Drawer <Drawer
className="leftNavDrawer" className="leftNavDrawer"
width={500} width={500}
open={challengesDrawerOpen} closable={false}
onClose={() => onChallengesDrawerClose()} onClose={onChallengesDrawerClose}
visible={challengesDrawerOpen}
> >
<TaskListContainer challenges={challenges} taskListLoading={taskListLoading} shixun={shixun} <TaskListContainer challenges={challenges} taskListLoading={taskListLoading} shixun={shixun}
@ -135,4 +117,4 @@ class Header extends Component {
} }
} }
export default withStyles(styles)(Header); export default Header;

@ -1,14 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import Drawer from '@material-ui/core/Drawer';
import PropTypes from 'prop-types';
// import TaskListContainer from '../taskList/TaskListContainer'
import axios from 'axios';
class LeftNav extends Component { class LeftNav extends Component {
constructor(props) { constructor(props) {
@ -24,18 +15,7 @@ class LeftNav extends Component {
const open = this.state.open; const open = this.state.open;
return ( return (
<div> <div>
<Drawer
className="leftNavDrawer"
width={500}
open={open}
onClose={() => this.setState({ open: false })}
>
{/*<TaskListContainer></TaskListContainer>*/}
</Drawer>
<div className="page--leftnav"> <div className="page--leftnav">
<div className="user-info"> <div className="user-info">
<a href="/users/p69243850" alt="用户头像" className="user-info-img"> <a href="/users/p69243850" alt="用户头像" className="user-info-img">
<img alt="0?1442652658" height="50" src="/images/avatars/User/0?1442652658" width="50" /> <img alt="0?1442652658" height="50" src="/images/avatars/User/0?1442652658" width="50" />

@ -11,8 +11,7 @@ import CodeEvaluateView from './main/CodeEvaluateView';
import ChooseRepositoryView from './main/ChooseRepositoryView'; import ChooseRepositoryView from './main/ChooseRepositoryView';
import ChooseEvaluateView from './main/ChooseEvaluateView' import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from '@material-ui/core'; import { Button } from 'antd'
import Button from '@material-ui/core/Button';
import VNCContainer from './VNCContainer' import VNCContainer from './VNCContainer'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
@ -162,8 +161,6 @@ class MainContent extends Component {
? ?
<React.Fragment> <React.Fragment>
<div style={{ display: (codeLoading ? 'block' : 'none'), textAlign: 'center' }}> <div style={{ display: (codeLoading ? 'block' : 'none'), textAlign: 'center' }}>
<CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '18%' }} />
<span style={{ color: '#ddd', display: 'block' }}>正在加载中请稍后...</span> <span style={{ color: '#ddd', display: 'block' }}>正在加载中请稍后...</span>
</div> </div>
<div style={{ display: (codeLoading ? 'none' : 'block') }}> <div style={{ display: (codeLoading ? 'none' : 'block') }}>
@ -181,7 +178,7 @@ class MainContent extends Component {
<div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60" <div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60"
id="games_valuation_contents" style={{ height: '258px', minHeight: '85px' }}> id="games_valuation_contents" style={{ height: '258px', minHeight: '85px' }}>
{/* 测试结果、评测信息区域 */} {/* 测试结果、评测信息区域 */}
{loading ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }} /> {loading ? <p>正在加载中...</p>
: :
st === 0 st === 0
? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output} ? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output}

@ -1,11 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import Dialog from '@material-ui/core/Dialog'; import { Modal } from 'antd'
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import Button from '@material-ui/core/Button';
import MainContent from './MainContent' import MainContent from './MainContent'
import UpdateDrawer from './component/UpdateDrawer' import UpdateDrawer from './component/UpdateDrawer'
@ -14,7 +9,6 @@ import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'
let locationPath = window.location.pathname;
let readingRepoTimes = 0; let readingRepoTimes = 0;
function updateCodeMirror() { function updateCodeMirror() {
@ -211,10 +205,6 @@ class MainContentContainer extends Component {
// } // }
} }
if (newProps.myshixun) { if (newProps.myshixun) {
var stageId = newProps.match.params.stageId;
var shixunId = newProps.myshixun.identifier;
// locationPath = `/myshixuns/${shixunId}/stages/${stageId}`
locationPath = `/api/v1/games/${newProps.game.identifier}`;
next_game = newProps.next_game; next_game = newProps.next_game;
} }
} }
@ -920,65 +910,37 @@ class MainContentContainer extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<Dialog
open={this.state.open} <Modal
disableEscapeKeyDown={true} title="提示"
onClose={this.handleClose} visible={this.state.open}
onCancel={this.handleClose}
> >
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle> <p>
<DialogContent> {msg}
<DialogContentText id="alert-dialog-description" style={{ textAlign: 'center' }}> </p>
{msg} </Modal>
</DialogContentText>
</DialogContent> <Modal
<DialogActions> title='提示'
<Button onClick={this.handleClose} color="primary"> onOk={() => this.doResetCode()}
关闭 visible={this.state.resetCodeDialogOpen}
</Button> onCancel={() => this.handleResetCodeDialogClose()}
</DialogActions>
</Dialog>
<Dialog
open={this.state.resetCodeDialogOpen}
disableEscapeKeyDown={true}
onClose={() => this.handleResetCodeDialogClose()}
> >
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle> <p>
<DialogContent> 你在本文件中修改的内容将丢失<br></br>
<div style={{ textAlign: 'center' }}> </p>
你在本文件中修改的内容将丢失<br></br>
</div> </Modal>
</DialogContent>
<DialogActions> <Modal
<Button onClick={() => this.handleResetCodeDialogClose()} color="primary"> title='提示'
关闭 visible={this.state.resetPassedCodeDialogOpen}
</Button> onCancel={() => this.handleResetPassedCodeDialogClose()}
<Button variant="raised" onClick={() => this.doResetCode()} color="primary"> onOk={() => this.doResetPassedCode()}
确定
</Button>
</DialogActions>
</Dialog>
<Dialog
disableEscapeKeyDown={true}
open={this.state.resetPassedCodeDialogOpen}
onClose={() => this.handleResetPassedCodeDialogClose()}
> >
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle> <p> 你在本关中修改的内容将丢失<br></br>? </p>
<DialogContent> </Modal>
<div style={{ textAlign: 'center' }}>
你在本关中修改的内容将丢失<br></br>?
</div>
</DialogContent>
<DialogActions>
<Button onClick={() => this.handleResetPassedCodeDialogClose()} color="primary">
关闭
</Button>
<Button variant="raised" onClick={() => this.doResetPassedCode()} color="primary">
确定
</Button>
</DialogActions>
</Dialog>
<UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer> <UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer>
<MainContent ref="mainContent" mainContentfun={(ref) => this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state} <MainContent ref="mainContent" mainContentfun={(ref) => this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state}

@ -1,18 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import FormGroup from '@material-ui/core/FormGroup' import { Form, Checkbox } from 'antd'
import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
let defaultItemLabelName = 'label' let defaultItemLabelName = 'label'
let defaultItemValueName = 'value' let defaultItemValueName = 'value'
/*
className={classes.size}
icon={<CheckBoxOutlineBlankIcon className={classes.sizeIcon} />}
checkedIcon={<CheckBoxIcon className={classes.sizeIcon} />}
*/
class CheckBoxGroup extends Component { class CheckBoxGroup extends Component {
constructor(props) { constructor(props) {
@ -37,28 +28,26 @@ class CheckBoxGroup extends Component {
const newItemValueName = itemValueName || defaultItemValueName const newItemValueName = itemValueName || defaultItemValueName
this.options = options; this.options = options;
return ( return (
<FormControl component="fieldset"> <Form.Item>
<FormGroup> <Checkbox.Group>
{options.map((option, index) => {
const val = itemValueFunction ? itemValueFunction(option, index) : option[newItemValueName]; </Checkbox.Group>
return (<FormControlLabel key={index} {options.map((option, index) => {
control={ const val = itemValueFunction ? itemValueFunction(option, index) : option[newItemValueName];
<Checkbox return (<Checkbox key={index}
checked={this.valueMap[index]} checked={this.valueMap[index]}
value={val} value={val}
onChange={this.handleChange(index, val)}
color="primary" onChange={this.handleChange(index, val)}
classes={{ color="primary"
root: this.props.classes.radio, classes={{
checked: this.props.classes.checked root: this.props.classes.radio,
}} checked: this.props.classes.checked
/>} }}
label={itemLabelFunction ? itemLabelFunction(option, index) : option[newItemLabelName]} >itemLabelFunction ? itemLabelFunction(option, index) : option[newItemLabelName]</Checkbox>)
></FormControlLabel>) })
}) }
} </Form.Item>
</FormGroup>
</FormControl>
); );
} }
} }

@ -1,24 +1,6 @@
import React from 'react'; import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { markdownToHTML } from 'educoder' import { markdownToHTML } from 'educoder'
const styles = theme => ({
root: {
width: '100%',
marginTop: theme.spacing.unit * 3 + 'px !important',
overflowX: 'auto',
},
table: {
// minWidth: 300,
width: '200px !important',
margin: '0 auto',
},
});
const ChooseAnswerView = ({ gameAnswer, classes }) => { const ChooseAnswerView = ({ gameAnswer, classes }) => {
if (!gameAnswer) { if (!gameAnswer) {
return '' return ''
@ -37,4 +19,4 @@ const ChooseAnswerView = ({ gameAnswer, classes }) => {
) )
} }
export default withStyles(styles)(ChooseAnswerView); export default ChooseAnswerView;

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import _ from 'lodash' import _ from 'lodash'
import Drawer from '@material-ui/core/Drawer'; import { Drawer } from 'antd';
import TPICodeSetting from './TPICodeSetting' import TPICodeSetting from './TPICodeSetting'
@ -27,8 +27,6 @@ function createCMOptions(mirror_name, theme) {
let cmOptions = { let cmOptions = {
lineNumbers: true, lineNumbers: true,
mode: mode, mode: mode,
// theme: "railscasts",
// theme: "vs-dark",
theme: theme, theme: theme,
indentUnit: 4, indentUnit: 4,
matchBrackets: true, matchBrackets: true,
@ -69,18 +67,6 @@ const mirrorNameModeMap = {
let extend_editor = null; let extend_editor = null;
let notCallCodeMirrorOnChangeFlag = false; let notCallCodeMirrorOnChangeFlag = false;
const $ = window.$;
/*
lint的实现目前只支持javascript\html\css\coffeescript\json的lint支持的语言版本有待考量
底层gutter mark实现使用的还是setGutterMarker接口参见lint.js的189行
红色波浪线实现方式
_cm.markText({line:4, ch:32}, {line:4, ch:40}, {
className: "CodeMirror-lint-mark-error",
__annotation: {message: "Expected an identifier and instead saw ';'.", severity: "error"}
})
*/
class TPICodeMirror extends Component { class TPICodeMirror extends Component {
constructor(props) { constructor(props) {
@ -110,9 +96,6 @@ class TPICodeMirror extends Component {
, cmOptions); , cmOptions);
extend_editor.on('beforeChange', (cm, change) => { extend_editor.on('beforeChange', (cm, change) => {
// if ( ~readOnlyLines.indexOf(change.from.line) ) {
// change.cancel();
// }
if (change.origin === "setValue") { if (change.origin === "setValue") {
return; return;
} }
@ -122,8 +105,6 @@ class TPICodeMirror extends Component {
}); });
extend_editor.on('change', (cMirror) => { extend_editor.on('change', (cMirror) => {
// get value right from instance
// $('#extend-challenge-file-edit').val(cMirror.getValue());
if (notCallCodeMirrorOnChangeFlag === true) { if (notCallCodeMirrorOnChangeFlag === true) {
// 避免死循环 onRepositoryCodeUpdate 和 componentWillReceiveProps // 避免死循环 onRepositoryCodeUpdate 和 componentWillReceiveProps
notCallCodeMirrorOnChangeFlag = false; notCallCodeMirrorOnChangeFlag = false;
@ -245,14 +226,12 @@ class TPICodeMirror extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<Drawer <Drawer
anchor="right"
className="settingDrawer" className="settingDrawer"
width={260} width={260}
open={settingDrawerOpen}
onClose={() => showSettingDrawer(false)} onClose={() => showSettingDrawer(false)}
placement="right"
closable={false}
visible={settingDrawerOpen}
> >
<TPICodeSetting {...this.props} {...this.state} <TPICodeSetting {...this.props} {...this.state}
onFontSizeChange={this.onFontSizeChange} onFontSizeChange={this.onFontSizeChange}
@ -510,12 +489,5 @@ word-spacing
word-wrap word-wrap
z-index`.split('\n') z-index`.split('\n')
// value http://www.siliconbaytraining.com/pages/csspv.html
/* var array =[]; $('.test tr td:nth-child(2) font').each((index, item) => array = array.concat($(item).text().split(', ')))
var mySet = new Set(array)
array = Array.from(mySet)
var array2=array.filter(item=> {return item.indexOf('(') == -1 && item.length < 18 && item != 'Values'})
array2 = array2.map((item) => item.trim().replace('↵',''))
*/
const allCssValueArray = "none,inherit,normal,wider,narrower,ultra-condensed,semi-condensed,semi-expanded,expanded,extra-expanded,ultra-expanded,italic,oblique,small-caps,bold,bolder,lighter,xx-small,x-small,small,medium,large,x-large,xx-large,larger,smaller,1em,left,right,center,justify,underline,overline,line-through,blink,capitalize,uppercase,lowercase,scroll,fixed,transparent,top,bottom,repeat,repeat-x,repeat-y,no-repeat,auto,thin,thick,dotted,dashed,solid,double,groove,ridge,inset,outset,disc,circle,square,decimal,lower-roman,upper-roman,lower-alpha,upper-alpha,upper-latin,hebrew,armenian,georgian,cjk-ideographic,hiragana,katakana,hiragana-iroha,katakana-iroh,outside,inside,pre,nowrap,crosshair,default,pointer,move,e-resize,ne-resize,nw-resize,n-resize,se-resize,sw-resize,s-resize,w-resize,text,wait,help,invert,visible,hidden,open-quote,close-quote,no-open-quote,no-close-quote,inherit,none,both,ltr,rtl,inline,block,list-item,run-in,compact,marker,table,inline-table,table-row-group,table-row,table-caption,static,absolute,relative,embed,bidi-override,baseline,sub,super,text-top,middle,text-bottom,collapse,separate,show,hide,once,always,number,percentage,silent,x-soft,soft,loud,x-loud,spell-out,time,percentage,uri,mix,angle,left-side,far-left,center-left,center-right,far-right,right-side,behind,leftwards,rightwards,below,level,above,higher,lower,x-slow,slow,fast,x-fast,faster,slower,frequency,x-low,low,high,x-high,code,digits,continuous".split(',') const allCssValueArray = "none,inherit,normal,wider,narrower,ultra-condensed,semi-condensed,semi-expanded,expanded,extra-expanded,ultra-expanded,italic,oblique,small-caps,bold,bolder,lighter,xx-small,x-small,small,medium,large,x-large,xx-large,larger,smaller,1em,left,right,center,justify,underline,overline,line-through,blink,capitalize,uppercase,lowercase,scroll,fixed,transparent,top,bottom,repeat,repeat-x,repeat-y,no-repeat,auto,thin,thick,dotted,dashed,solid,double,groove,ridge,inset,outset,disc,circle,square,decimal,lower-roman,upper-roman,lower-alpha,upper-alpha,upper-latin,hebrew,armenian,georgian,cjk-ideographic,hiragana,katakana,hiragana-iroha,katakana-iroh,outside,inside,pre,nowrap,crosshair,default,pointer,move,e-resize,ne-resize,nw-resize,n-resize,se-resize,sw-resize,s-resize,w-resize,text,wait,help,invert,visible,hidden,open-quote,close-quote,no-open-quote,no-close-quote,inherit,none,both,ltr,rtl,inline,block,list-item,run-in,compact,marker,table,inline-table,table-row-group,table-row,table-caption,static,absolute,relative,embed,bidi-override,baseline,sub,super,text-top,middle,text-bottom,collapse,separate,show,hide,once,always,number,percentage,silent,x-soft,soft,loud,x-loud,spell-out,time,percentage,uri,mix,angle,left-side,far-left,center-left,center-right,far-right,right-side,behind,leftwards,rightwards,below,level,above,higher,lower,x-slow,slow,fast,x-fast,faster,slower,frequency,x-low,low,high,x-high,code,digits,continuous".split(',')
const allCssPropValueArray = allCssPropertiesArray.concat(allCssValueArray) const allCssPropValueArray = allCssPropertiesArray.concat(allCssValueArray)

@ -1,18 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import Tooltip from '@material-ui/core/Tooltip'; import { Select, Tooltip } from 'antd';
import { Select } from 'antd';
const Option = Select.Option; const Option = Select.Option;
class TPICodeSetting extends Component { class TPICodeSetting extends Component {
render() { render() {
const { autoCompleteSwitch, onAutoCompleteSwitchChange, onFontSizeChange const { onFontSizeChange, cmFontSize, cmCodeMode, onCodeModeChange, shixun } = this.props;
, cmFontSize, cmCodeMode,
onCodeModeChange,
shixun } = this.props;
const task_pass = shixun.task_pass const task_pass = shixun.task_pass
const forbid_copy = shixun.forbid_copy const forbid_copy = shixun.forbid_copy
const test_set_permission = shixun.test_set_permission const test_set_permission = shixun.test_set_permission
@ -30,22 +24,7 @@ class TPICodeSetting extends Component {
<h3 className="ide-settings--section -light "> <h3 className="ide-settings--section -light ">
代码格式 代码格式
</h3> </h3>
{/* 去掉 -space-v-24 class */}
<div className="-padding-24 "> <div className="-padding-24 ">
{/*<div className="-layout-h -center -justify-between">
<div className="ide-settings--item-key">Tab Size</div>
<div className="ide-settings--item-value">
<div className="select -view-flat -value">
<div className="-layout-v -start">
<div className="select--wrapper -layout-h -center -justify" >
<div className="select--content -layout-h -center -space-h-4">
1
</div>
</div>
</div>
</div>
</div>
</div>*/}
<div className="-layout-h -center -justify-between"> <div className="-layout-h -center -justify-between">
<div className="ide-settings--item-key">显示模式</div> <div className="ide-settings--item-key">显示模式</div>
<div className="ide-settings--item-value"> <div className="ide-settings--item-value">
@ -185,19 +164,6 @@ class TPICodeSetting extends Component {
</Tooltip> </Tooltip>
</div> </div>
{/* <a href="https://github.com/Microsoft/monaco-editor/wiki/Monaco-Editor-Accessibility-Guide"></a> */}
{/* <h3 className="ide-settings--section -light ">
说明
</h3>
<div className="-padding-24 " style={{ marginBottom: '75px' }}>
<div className="-layout-h -center -justify-between">
<div className="ide-settings--item-key">
本编辑器和Visual Studio Code的快捷键一致使用F1或Alt+F1 (Internet Explorer)可以唤出快捷键列表
</div>
</div>
</div> */}
</div> </div>
); );
} }

@ -1,52 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './UpdateDrawer.css' import './UpdateDrawer.css'
import { withStyles } from '@material-ui/core/styles'; import { Modal, Button } from 'antd'
import { CircularProgress } from '@material-ui/core';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import Button from '@material-ui/core/Button';
import axios from 'axios'; import axios from 'axios';
import MUIDialogStyleUtil from './MUIDialogStyleUtil'
const styles = MUIDialogStyleUtil.getTwoButtonStyle()
/*
(@tpm_modified || @tpm_script_modified) && @game_challenge.st == 0
关卡任务的代码文件有更新啦~<br/>更新操作将保留已完成的评测记录和成绩<br/>还未完成评测的任务代码请自行保存
sync_hide_tip_content(this) 立即更新 next_update(this) 稍后再说
tpm_cases_modified
本关<%= @game_challenge.st == 0 ? "测试集" : "答案" %>已更新您可以重新评测<br/>本次更新不影响已获得的经验值
sync_hide($(this).parents('.tip-panel-animate-left'))
<%= link_to "知道啦", sync_modify_time_myshixun_game_path(@game, :myshixun_id => @myshixun.id), :remote => true,:class => "fl color-orange03",:style => "width:100%;text-align: center;border:none" %>
myshixuns/9egrt8q5ju/stages/2pjt9wlbzov7
myshixun.identifier game.identifier
稍后再说
$.ajax({
url:"/myshixuns/9egrt8q5ju/stages/2pjt9wlbzov7/system_update"
});
立即更新
$.ajax({
url: "/myshixuns/9egrt8q5ju/stages/2pjt9wlbzov7/sync_codes",
dataType: "script",
success: function(data){
}
});
// :status => 1, :message :path
// 拿到path后重新调用rep_content即可
测试集更新 sync_modify_time 提醒状态设置接口
*/
class UpdateDrawer extends Component { class UpdateDrawer extends Component {
constructor(props) { constructor(props) {
@ -59,7 +15,6 @@ class UpdateDrawer extends Component {
onCasesModified(updateTogether) { onCasesModified(updateTogether) {
const { game, myshixun, showSnackbar, updateDialogClose } = this.props; const { game, myshixun, showSnackbar, updateDialogClose } = this.props;
// const url = `/api/v1/games/${game.identifier}/sync_modify_time`
const url = `/tasks/${game.identifier}/sync_modify_time` const url = `/tasks/${game.identifier}/sync_modify_time`
axios.get(url, { axios.get(url, {
// withCredentials: true, // withCredentials: true,
@ -152,49 +107,22 @@ class UpdateDrawer extends Component {
const { updateDialogClose } = this.props; const { updateDialogClose } = this.props;
updateDialogClose(); updateDialogClose();
} }
// fetchRepositoryCode
render() { render() {
const { myshixun, showUpdateDialog, classes } = this.props; const { showUpdateDialog, classes } = this.props;
const { loading } = this.state; const { loading } = this.state;
// system_tip 为true时只有点击消息通知按钮时才弹框
// !myshixun || myshixun.system_tip === true ||
// if ( showUpdateDialog === false) {
// return ''
// }
const { tpm_cases_modified, tpm_modified, tpm_script_modified, challenge } = this.props; const { tpm_cases_modified, tpm_modified, tpm_script_modified, challenge } = this.props;
let needUpdateScript = (tpm_modified || tpm_script_modified) && challenge.st === 0; let needUpdateScript = (tpm_modified || tpm_script_modified) && challenge.st === 0;
// 立即更新 稍后再说 // 立即更新 稍后再说
return ( return (
<Modal
<Dialog title='更新通知'
disableBackdropClick={true}
className="updateDialog" className="updateDialog"
open={showUpdateDialog && (tpm_cases_modified || needUpdateScript)} visible={showUpdateDialog && (tpm_cases_modified || needUpdateScript)}
onClose={() => this.handleDialogClose()} onCancel={() => this.handleDialogClose()}
> footer={
<DialogTitle id="alert-dialog-title">{"更新通知"}</DialogTitle> needUpdateScript ?
<DialogContent id="dialog-content"> <React.Fragment >
<div style={{ textAlign: 'center' }}>
{tpm_cases_modified && needUpdateScript ?
<div>
关卡任务的代码文件和测试集有更新啦~<br></br><br></br>
</div>
:
tpm_cases_modified ?
<div>
本关{challenge.st === 0 ? '测试集' : '答案'}已更新您可以重新评测<br></br>
</div> :
<div>
关卡任务的代码文件有更新啦~<br></br><br></br>
</div>
}
</div>
</DialogContent>
<DialogActions id="dialog-actions" >
{needUpdateScript ?
<React.Fragment>
<Button <Button
disabled={loading} disabled={loading}
className={"nextUpdate " + classes.button + ' ' + classes.buttonGray} onClick={() => this.onNextUpdate(tpm_cases_modified)} color="primary" > className={"nextUpdate " + classes.button + ' ' + classes.buttonGray} onClick={() => this.onNextUpdate(tpm_cases_modified)} color="primary" >
@ -205,17 +133,32 @@ class UpdateDrawer extends Component {
variant="raised" onClick={() => this.onUpdateNow(tpm_cases_modified)} color="primary" className={"updateNow " + classes.button}> variant="raised" onClick={() => this.onUpdateNow(tpm_cases_modified)} color="primary" className={"updateNow " + classes.button}>
立即更新 立即更新
</Button> </Button>
{loading && <CircularProgress size={24} className={classes.buttonProgress} />} {loading && <p>正在加载中...</p>}
</React.Fragment> : </ React.Fragment> :
<Button onClick={() => this.onCasesModified()} color="primary" className={"nextUpdate " + classes.button}> <Button onClick={() => this.onCasesModified()} color="primary" className={"nextUpdate " + classes.button}>
知道啦 知道啦
</Button> </Button>
}
>
<div style={{ textAlign: 'center' }}>
{tpm_cases_modified && needUpdateScript ?
<div>
关卡任务的代码文件和测试集有更新啦~<br></br><br></br>
</div>
:
tpm_cases_modified ?
<div>
本关{challenge.st === 0 ? '测试集' : '答案'}已更新您可以重新评测<br></br>
</div> :
<div>
关卡任务的代码文件有更新啦~<br></br><br></br>
</div>
} }
</DialogActions> </div>
</Dialog> </Modal>
); );
} }
} }
export default UpdateDrawer
export default withStyles(styles)(UpdateDrawer);

@ -1,29 +1,9 @@
// WebSSHTimer.js
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tooltip, Modal, Popconfirm, Button } from 'antd'
import { withStyles } from '@material-ui/core/styles';
import Tooltip from '@material-ui/core/Tooltip';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import Button from '@material-ui/core/Button';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import MUIDialogStyleUtil from './MUIDialogStyleUtil'
import './WebSSHTimer.css' import './WebSSHTimer.css'
import Popconfirm from 'antd/lib/popconfirm';
import 'antd/lib/popconfirm/style/css';
const styles = MUIDialogStyleUtil.getTwoButtonStyle()
const $ = window.$; const $ = window.$;
const five_min = 5 * 60 * 1000; const five_min = 5 * 60 * 1000;
/* /*
@ -55,7 +35,6 @@ class WebSSHTimer extends Component {
} }
init() { init() {
console.log('调用定时器开始: =========>>>>>>>>>>>>');
// 20分钟倒计时 // 20分钟倒计时
this.timeRemain = 20 * 60 * 1000; this.timeRemain = 20 * 60 * 1000;
this.startTimeRemain = 0 this.startTimeRemain = 0
@ -176,38 +155,12 @@ class WebSSHTimer extends Component {
if (e.data.tp === "setSSHConnectStatus") { if (e.data.tp === "setSSHConnectStatus") {
this.props.reInitSsh(window.$, null, true) this.props.reInitSsh(window.$, null, true)
// let windows = this.getWebsshWindows();
// for (let i = 0; i < windows.length; i++) {
// let _w = windows[i].contentWindow
// _w && _w.postMessage({tp: 'reload'}, "*");
// }
} else if (e.data.tp === "sshWorking") { } else if (e.data.tp === "sshWorking") {
// this.startTimeRemain = 60;
// this.forceUpdate();
} }
}); });
// } else {
// // 非iframe时使用的消息机制
// on('setSSHConnectStatus', () => {
// // 需要reload
// this.props.reInitSsh(window.$, null, true)
// })
// on('sshWorking', () => {
// this.startTimeRemain = 60;
// this.forceUpdate()
// })
// }
} }
getWebsshWindows = () => { getWebsshWindows = () => {
return $('.game_webssh') return $('.game_webssh')
// var i = $('#game_webssh')[0]
// var _w;
// if (i) {
// _w = i.contentWindow
// }
// return _w;
} }
componentWillUnmount() { componentWillUnmount() {
this.intervalHandler && clearInterval(this.intervalHandler); this.intervalHandler && clearInterval(this.intervalHandler);
@ -258,42 +211,32 @@ class WebSSHTimer extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<Dialog <Modal
disableBackdropClick={true} title='命令行连接时长提醒'
className="updateDialog" className="updateDialog"
open={dialogOpen && this.isUserChoseNotConcern === false} visible={dialogOpen && this.isUserChoseNotConcern === false}
onClose={() => this.handleDialogClose()} onCancel={() => this.handleDialogClose()}
>
<DialogTitle id="alert-dialog-title">{"命令行连接时长提醒"}</DialogTitle> footer={[
<DialogContent id="dialog-content"> <Button
<div style={{ textAlign: 'center' }}> disabled={loading}
命令行将于 {moment(this.timeRemain).format('m')} 分钟后中断需要延长使用时间吗 className={"nextUpdate " + classes.button + ' ' + classes.buttonGray} onClick={() => this.onNope()} color="primary" >
</div> 不需要
</DialogContent>
<DialogActions id="dialog-actions">
<React.Fragment>
<Button
disabled={loading}
className={"nextUpdate " + classes.button + ' ' + classes.buttonGray} onClick={() => this.onNope()} color="primary" >
不需要
</Button> </Button>
<Button , <Button
disabled={loading} disabled={loading}
variant="raised" onClick={() => this.onOK()} color="primary" className={"updateNow " + classes.button}> variant="raised" onClick={() => this.onOK()} color="primary" className={"updateNow " + classes.button}>
立即延长 立即延长
</Button> </Button>
{/* loading && <CircularProgress size={24} className={classes.buttonProgress} /> */}
</React.Fragment> ]}
} >
</DialogActions> <div style={{ textAlign: 'center' }}>
</Dialog> 命令行将于 {moment(this.timeRemain).format('m')} 分钟后中断需要延长使用时间吗
</div>
</Modal>
<Tooltip title="中断命令行连接的倒计时"> <Tooltip title="中断命令行连接的倒计时">
{/* <span className="webSSHTimer"
style={{ display: (showTimer && this.props.showTimerProp === true &&
this.startTimeRemain <= 0 ? 'inline-block' : 'none')}}>
</span> */}
<a href="javascript:void(0)" className="iconButton" <a href="javascript:void(0)" className="iconButton"
style={{ style={{
display: (showTimer && this.props.showTimerProp === true && display: (showTimer && this.props.showTimerProp === true &&
@ -321,9 +264,6 @@ class WebSSHTimer extends Component {
</a> </a>
</Popconfirm> </Popconfirm>
} }
{/* <Tooltip title={ ""} disableFocusListener={true}>
</Tooltip> */}
{showTimer === false && this.props.showTimerProp === true && {showTimer === false && this.props.showTimerProp === true &&
<a href="javascript:void(0)" className="iconButton" onClick={this.reInitSsh} > <a href="javascript:void(0)" className="iconButton" onClick={this.reInitSsh} >
<i className="iconfont icon-congshulianjie font-16 "></i> <i className="iconfont icon-congshulianjie font-16 "></i>
@ -334,11 +274,10 @@ class WebSSHTimer extends Component {
重连命令行</span> 重连命令行</span>
</a> </a>
} }
{/* <Tooltip title={ "命令行重连"} disableFocusListener={true}></Tooltip> */}
</React.Fragment> </React.Fragment>
); );
} }
} }
export default withStyles(styles)(WebSSHTimer); export default WebSSHTimer;

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import _ from 'lodash' import _ from 'lodash'
import Drawer from '@material-ui/core/Drawer'; import { Drawer } from 'antd';
import './TPIMonaco.css' import './TPIMonaco.css'
import TPICodeSetting from '../TPICodeSetting' import TPICodeSetting from '../TPICodeSetting'
@ -22,32 +22,14 @@ monaco.editor.defineTheme('myCoolTheme', {
{ background: '#121c23' }, { background: '#121c23' },
// { foreground: 'FFFFFF' } // { foreground: 'FFFFFF' }
], ],
// editor_monaco._themeService._knownThemes.get('myCoolTheme')
colors: { colors: {
// 'editor.foreground': '#FFFFFF',
'editor.background': '#121c23', 'editor.background': '#121c23',
// 'editor.selectionHighlightBorder': '#ffffff',
// 'input.border': '#ffffff',
'editor.lineHighlightBorder': '#222c34', // .current-line 'editor.lineHighlightBorder': '#222c34', // .current-line
// 'editor.selectionBackground': '#FFFF0030',
// 'editor.selectionHighlightBackground' :'#0000FFFF',
} }
}); });
const $ = window.$; const $ = window.$;
function loadMonacoResouce(callback) { function loadMonacoResouce(callback) {
let _url_origin = ``;
let prefix = 'react/build'
if (window.location.port == 3007) {
prefix = ''
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = 'http://pre-newweb.educoder.net';
}
const $ = window.$;
if (!window['monaco']) { if (!window['monaco']) {
callback && callback() callback && callback()
var editor = monaco.editor.create(document.getElementById('container'), { var editor = monaco.editor.create(document.getElementById('container'), {
@ -316,14 +298,12 @@ class TPIMonaco extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<Drawer <Drawer
anchor="right"
className="settingDrawer" className="settingDrawer"
width={260} width={260}
open={settingDrawerOpen} placement="right"
closable={false}
onClose={() => showSettingDrawer(false)} onClose={() => showSettingDrawer(false)}
visible={settingDrawerOpen}
> >
<TPICodeSetting {...this.props} {...this.state} <TPICodeSetting {...this.props} {...this.state}
onFontSizeChange={this.onFontSizeChange} onFontSizeChange={this.onFontSizeChange}

@ -1,20 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import { Rate } from 'antd'
import PropTypes from 'prop-types';
import Rate from 'rc-rate';
import Tooltip from '@material-ui/core/Tooltip';
import './TaskResultLayer.css' import './TaskResultLayer.css'
import moment from 'moment';
import passallImg from '../../../images/tpi/passall.png' import passallImg from '../../../images/tpi/passall.png'
import passpartImg from '../../../images/tpi/passpart.png' import passpartImg from '../../../images/tpi/passpart.png'
import empiricgreenImg from '../../../images/tpi/empiricgreen.png' import empiricgreenImg from '../../../images/tpi/empiricgreen.png'
import { trigger } from 'educoder'; import { trigger } from 'educoder';
import SecondTab from "../../paths/SchoolStatistics/SecondTab";
class TaskResultLayer extends Component { class TaskResultLayer extends Component {
@ -199,7 +191,6 @@ class TaskResultLayer extends Component {
</React.Fragment> </React.Fragment>
: ''} : ''}
<p> <p>
{/*<a href="javascript:void(0)" className="passNext">下一关</a>*/}
<a href="javascript:void(0)" className={`passed ${stared || game.star ? 'stared' : ''}`} <a href="javascript:void(0)" className={`passed ${stared || game.star ? 'stared' : ''}`}
{...titleObj} onClick={() => this.onFinish(true)}>{next_game ? '下一关' : '完成'}</a> {...titleObj} onClick={() => this.onFinish(true)}>{next_game ? '下一关' : '完成'}</a>
@ -208,30 +199,10 @@ class TaskResultLayer extends Component {
<a href="javascript:void(0)" className={`passed ${stared || game.star ? 'stared' : ''}`} <a href="javascript:void(0)" className={`passed ${stared || game.star ? 'stared' : ''}`}
{...titleObj} onClick={() => this.onFinish()}> {...titleObj} onClick={() => this.onFinish()}>
{`查看效果`} {`查看效果`}
{/* ${ moment(this.state.timeRemain * 1000).format('mm:ss') } */}
</a> </a>
} }
{/*
(this.state.timeRemain ?
<Tooltip title={"注意效果查看服务只会保留5分钟"} disableFocusListener={true}>
</Tooltip>
:
<Tooltip title={"效果查看服务已被终止运行,需要重新评测后才能查看"} disableFocusListener={true}>
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>{}} style={{ backgroundColor: 'gray'}}>
{ `查看效果` }
</a>
</Tooltip>
)
*/}
{/*
注意效果查看服务只会保留5分钟
效果查看服务已被终止运行需要重新评测后才能查看
*/}
</p> </p>
</div> </div>
</div> </div>

@ -1,72 +1,14 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { Button, Tooltip } from 'antd'
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Tooltip from '@material-ui/core/Tooltip';
import './ActionView.css' import './ActionView.css'
/*
color: #1B4061 !important;
background-color: transparent;
border: 1px solid #1B4061 !important;
*/
const styles = theme => ({
button: {
margin: theme.spacing.unit,
border: '1px solid #1B4061',
color: '#1B4061',
height: '30px',
padding: '0 16px',
'&:hover': {
color: '#4CACFF',
border: '1px solid #4CACFF'
}
},
hoverButton: {
margin: theme.spacing.unit,
height: '30px',
padding: '0 16px',
color: '#4CACFF',
border: '1px solid #4CACFF'
},
buttonText: {
color: '#1B4061 !important',
'&:hover': {
color: '#1B4061',
}
}
});
class ActionView extends Component { class ActionView extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentDidMount() {
// request
window._tpiWidthResize = () => {
const _w = window.$('#actionView').width();
// if (_w < 446) {
// window.$('#time-consuming').hide()
// // window.$('#time-consuming').hide()
// } else if (_w < 746) {
// // 文字放出来之前是 580
// window.$('#time-consuming').show()
// window.$('.time_limit').hide()
// } else {
// window.$('#time-consuming').show()
// window.$('.time_limit').show()
// }
}
}
showWebDisplay(challenge) { showWebDisplay(challenge) {
window.open(challenge.webDisplayUrl, '_blank'); window.open(challenge.webDisplayUrl, '_blank');
} }
@ -180,28 +122,7 @@ class ActionView extends Component {
</div>} </div>}
</div> </div>
); );
/*
<a href="/shixuns/8arufxzl" id="exit_shixun" className="shixun-task-btn task-newbtn-grey mt8 mr15">离开</a>
<a href="javascript:void(0)" className="shixun-task-btn task-btn-blue mr15 mt8" id="prev_step"
onClick={onShowNextStage}>下一关 </a>
onclick="training_task_submmit();"
{game && !!game.prev_game ?
<div id="prev_step_area">
<Link to={`/tasks/${game.prev_game}`} className="shixun-task-btn task-btn-blue mr15 mt8">上一关</Link>
</div>
: ''}
{game && !!game.next_game ?
<div id="next_step_area">
<Link to={`/tasks/${game.next_game}`} className="shixun-task-btn task-btn-blue mr15 mt8">下一关</Link>
</div>
: ''}
*/
} }
} }
export default withStyles(styles)(ActionView); export default ActionView

@ -1,9 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tooltip } from 'antd';
import Tooltip from '@material-ui/core/Tooltip';
import { CircularProgress } from '@material-ui/core';
import './ChooseEvaluateViewnew.css'; import './ChooseEvaluateViewnew.css';
class ChooseEvaluateView extends Component { class ChooseEvaluateView extends Component {
@ -17,11 +13,6 @@ class ChooseEvaluateView extends Component {
} }
} }
componentDidMount() {
// request
}
renderTestSets() { renderTestSets() {
const { choose_test_cases, testSetsExpandedArray } = this.props; const { choose_test_cases, testSetsExpandedArray } = this.props;
const { test_sets, had_submmit } = choose_test_cases; const { test_sets, had_submmit } = choose_test_cases;
@ -86,15 +77,11 @@ class ChooseEvaluateView extends Component {
render() { render() {
const { evaluateViewExpanded } = this.state; const { evaluateViewExpanded } = this.state;
const { choose_test_cases, latest_output, record, loading, gameBuilding } = this.props; const { choose_test_cases, gameBuilding } = this.props;
const { choose_correct_num, challenge_chooses_count, had_submmit } = choose_test_cases; const { choose_correct_num, challenge_chooses_count, had_submmit } = choose_test_cases;
/*
<IconButton iconClassName={ evaluateViewExpanded ? "fa font-16 color-grey fa-compress" : "fa fa-expand font-16 color-grey"} onClick={this.onEvaluateViewExpand}
className="fr mt10 mr15" tooltip={ evaluateViewExpanded ? "收起" : "展开"}/>
*/
return ( return (
<React.Fragment> <React.Fragment>
<ul id="blacktab_nav"> <ul id="blacktab_nav">
@ -120,21 +107,16 @@ class ChooseEvaluateView extends Component {
<div id="game_test_set_results" className="-flex -relative blacktab-inner"> <div id="game_test_set_results" className="-flex -relative blacktab-inner">
{gameBuilding ? {gameBuilding ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }} /> <p>正在加载中...</p>
: :
<React.Fragment> <React.Fragment>
<div id="blacktab_con_1" className=""> <div id="blacktab_con_1" className="">
</div> </div>
<div id="blacktab_con_2" className=" "> <div id="blacktab_con_2" className=" ">
<div className="fit -scroll"> <div className="fit -scroll">
<div className="-layout-v -fit paddingbottom60tpm"> <div className="-layout-v -fit paddingbottom60tpm">
<div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div> <div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div>
<div className="-flex -scroll task-padding16" id="evaluating_contents"> <div className="-flex -scroll task-padding16" id="evaluating_contents">
{/*
record ? <span className="fr mr5 tab_color">本次评测耗时{ record } </span> : ""
*/}
{ {
challenge_chooses_count === choose_correct_num ? challenge_chooses_count === choose_correct_num ?
<div></div> <div></div>

@ -1,66 +1,22 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Radio } from 'antd' import { Radio, Form } from 'antd'
const RadioGroup = Radio.Group const RadioGroup = Radio.Group
import FormControlLabel from '@material-ui/core/FormControlLabel';
import { createForm } from 'rc-form'; import { createForm } from 'rc-form';
import CheckBoxGroup from '../component/CheckBoxGroup' import CheckBoxGroup from '../component/CheckBoxGroup'
import { withStyles } from '@material-ui/core/styles';
import './ChooseRepositoryView.css' import './ChooseRepositoryView.css'
import './ChooseView.css'; import './ChooseView.css';
const myStyles = theme => ({
// root: {
// color: 'inherit',
// textDecoration: 'inherit',
// '&:hover': {
// textDecoration: 'underline',
// },
// },
// 使用主题的主色
primary: {
color: theme.palette.primary.main,
},
radio: {
// '&$checked': {
// color: '#4B8DF8'
// }
color: 'rgb(139, 147, 153)'
},
checked: {}
});
const styles = {
block: {
maxWidth: 250
},
radioButton: {
// marginBottom: 16,
},
};
const iconStyle = {
marginRight: 5
}
const groupStyle = {
fontSize: '16px',
fontWeight: 'bold'
}
const selectedOptionValueStyle = {
// color:'rgb(0, 188, 212)',
fontSize: 18
}
const optionValueArray = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] const optionValueArray = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
class ChooseRepositoryView extends Component { class ChooseRepositoryView extends Component {
/* /*
category:1 category:1
challenge_question:[{positon: 0, option_name: "所有计算机上都应使用的软件"}, {positon: 1, option_name: "能被各用户共同使用的软件"},] challenge_question:[{positon: 0, option_name: "所有计算机上都应使用的软件"}, {positon: 1, option_name: "能被各用户共同使用的软件"},]
@ -154,7 +110,7 @@ class ChooseRepositoryView extends Component {
<textarea value={optionItem.option_name}></textarea> <textarea value={optionItem.option_name}></textarea>
*/ */
ar.push( ar.push(
<FormControlLabel key={`${optionItem.option_name + optionIndex}`} value="male" control={ <Form.Item key={`${optionItem.option_name + optionIndex}`} value="male" control={
<Radio <Radio
// color="primary" // color="primary"
classes={{ classes={{
@ -176,11 +132,9 @@ class ChooseRepositoryView extends Component {
</div> </div>
</div>} ></FormControlLabel> </div>} ></Form.Item>
) )
}) })
//
// <span style={ isSelected ? { fontSize: 16} : {}}> {optionItem.option_name}</span>
return ar return ar
} }
@ -190,7 +144,6 @@ class ChooseRepositoryView extends Component {
{...this.props} {...this.props}
options={item.challenge_question} initialValueArray={initialValueArray} options={item.challenge_question} initialValueArray={initialValueArray}
itemLabelFunction={(option, index) => { itemLabelFunction={(option, index) => {
// option.option_name = '1\r\n2\r\n3\r\n'
const showText = this._toHtml(option.option_name) const showText = this._toHtml(option.option_name)
return ( return (
<div className="break-word" style={{ lineHeight: "24px" }}> <div className="break-word" style={{ lineHeight: "24px" }}>
@ -249,4 +202,4 @@ class ChooseRepositoryView extends Component {
} }
} }
export default createForm()(withStyles(myStyles)(ChooseRepositoryView)); export default createForm()(ChooseRepositoryView);

@ -1,11 +1,8 @@
import '../VNC.css'; import '../VNC.css';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tooltip } from 'antd'
import Tooltip from '@material-ui/core/Tooltip';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import './CodeEvaluateView.css'; import './CodeEvaluateView.css';
import { CircularProgress } from '@material-ui/core';
import { on, off } from 'educoder' import { on, off } from 'educoder'
import actions from '../../../redux/actions'; import actions from '../../../redux/actions';
const testSetsExpandedArrayInitVal = [false, false, false, false, false, const testSetsExpandedArrayInitVal = [false, false, false, false, false,
@ -362,10 +359,9 @@ class CodeEvaluateView extends Component {
<div className="cl"></div> <div className="cl"></div>
</ul> </ul>
{gameBuilding ? <p>正在加载中...</p> : null}
<CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: gameBuilding ? 'block' : 'none' }} />
<div id="evaluateMiddleStatusText" style={{ <div id="evaluateMiddleStatusText" style={{
marginTop: "4px", marginTop: "4px",
textAlign: "center", textAlign: "center",

@ -1,71 +1,19 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import ContentLoader from 'react-content-loader' import { Modal, Tooltip, Button } from 'antd'
import Tooltip from '@material-ui/core/Tooltip';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import { CircularProgress } from '@material-ui/core';
import Button from '@material-ui/core/Button';
import IconButton from '@material-ui/core/IconButton';
import CommentContainer from '../../comment/CommentContainer' import CommentContainer from '../../comment/CommentContainer'
import CommentInput from '../../comment/CommentInput' import CommentInput from '../../comment/CommentInput'
import ChooseAnswerView from '../component/ChooseAnswerView' import ChooseAnswerView from '../component/ChooseAnswerView'
import { withStyles } from '@material-ui/core/styles';
import { markdownToHTML } from 'educoder' import { markdownToHTML } from 'educoder'
import AnswerListContainer from './answer/AnswerListContainer' import AnswerListContainer from './answer/AnswerListContainer'
import './leftView.css' import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock' import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
import moment from 'moment'; import moment from 'moment';
// http://danilowoz.com/create-react-content-loader/ // http://danilowoz.com/create-react-content-loader/
const MyLoader = () => (
<ContentLoader
height={600}
width={400}
speed={2}
primaryColor={"#000000"}
secondaryColor={"#ecebeb"}
>
<rect x="0" y="10" rx="3" ry="3" width="320" height="6.4" />
<rect x="0" y="35" rx="3" ry="3" width="85" height="10" />
<rect x="0" y="60" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="80" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="100" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="120" rx="3" ry="3" width="101" height="6.4" />
<rect x="0" y="145" rx="3" ry="3" width="65" height="10" />
<rect x="0" y="170" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="190" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="210" rx="3" ry="3" width="201" height="6.4" />
</ContentLoader>
)
const styles = MUIDialogStyleUtil.getTwoButtonStyle(
(theme) => {
return {
iconButton: {
margin: theme.spacing.unit,
// background: '#05101A',
color: '#4CACFF',
top: '-7px',
width: '36px',
height: '36px',
}
}
}
)
// const styles = theme => ();
class LeftView extends Component { class LeftView extends Component {
goToCertification() { goToCertification() {
@ -79,23 +27,6 @@ class LeftView extends Component {
let propaedeutics = shixun ? shixun.propaedeutics : null; let propaedeutics = shixun ? shixun.propaedeutics : null;
let _hasAnswer = challenge.hasAnswer // st === 1 || let _hasAnswer = challenge.hasAnswer // st === 1 ||
// const actions = [
// <Button
// label="取消"
// primary={true}
// onClick={handleDialogClose}
// style={{marginRight: '6px'}}
// />,
// <Button
// variant="raised"
// label="确定"
// primary={true}
// onClick={handleDialogReadAnswer}
// />,
// ];
// TODO TEST
// isMultiLevelAnswer = true
const is_teacher = user.is_teacher const is_teacher = user.is_teacher
let contentText = is_teacher ? let contentText = is_teacher ?
@ -137,43 +68,28 @@ class LeftView extends Component {
</React.Fragment>; </React.Fragment>;
} }
/**
{ is_teacher ? <Button size="small" variant="raised" style={{ marginRight: '20px'}}
onClick={()=>this.goToCertification()} color="primary">
{ '立即认证' }
</Button> : ''}
*/
return ( return (
<React.Fragment> <React.Fragment>
<Dialog <Modal
open={dialogOpen} title='提示'
disableEscapeKeyDown={true} visible={dialogOpen}
onClose={handleDialogClose} onCancel={handleDialogClose}
> footer={[
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>
<DialogContent id="dialog-content" >
<DialogContentText id="alert-dialog-description" style={{ textAlign: 'center' }}>
{contentText}
</DialogContentText>
</DialogContent>
{/* http://localhost:3000/account/professional_certification */}
<DialogActions id="dialog-actions">
<Button onClick={handleDialogClose} color="primary" className={`${classes.button} ${classes.buttonGray}`}> <Button onClick={handleDialogClose} color="primary" className={`${classes.button} ${classes.buttonGray}`}>
取消 取消
</Button> </Button>,
{/* variant={ is_teacher ? "flat" : "raised"} */}
<Button size="medium" variant={"raised"} <Button size="medium" variant={"raised"}
className={`${classes.button} `} className={`${classes.button} `}
onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')} onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')}
color="primary" autoFocus> color="primary" autoFocus>
{is_teacher ? '继续查看' : '确定'} {is_teacher ? '继续查看' : '确定'}
</Button> </Button>
</DialogActions> ]}
>
</Dialog> {contentText}
</Modal>
<div className="-fit -layout-v"> <div className="-fit -layout-v">
@ -185,10 +101,10 @@ class LeftView extends Component {
{loading ? "" : {loading ? "" :
<React.Fragment> <React.Fragment>
<Tooltip title={"点击查看全部任务"} disableFocusListener={true}> <Tooltip title={"点击查看全部任务"} disableFocusListener={true}>
<IconButton color="default" mini={''} aria-label="edit" className={classes.iconButton} <Button color="default" mini={''} aria-label="edit" className={classes.iconButton}
onClick={onDrawerButtonClick}> onClick={onDrawerButtonClick}>
<i className={"fa font-18 fa-list-ul"}></i> <i className={"fa font-18 fa-list-ul"}></i>
</IconButton> </Button>
</Tooltip> </Tooltip>
<h3 className="subject">{challenge.position}{challenge.subject}</h3> <h3 className="subject">{challenge.position}{challenge.subject}</h3>
<span className="btn-cir-big fr mt8 mr15">{challenge.score}</span> <span className="btn-cir-big fr mt8 mr15">{challenge.score}</span>
@ -227,8 +143,7 @@ class LeftView extends Component {
{loading ? {loading ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview" <div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on"> unselectable="on">
<CircularProgress size={40} thickness={3} className="circularProgress" <p>正在加载...</p>
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40% !important', display: 'block' }} />
</div> : "" </div> : ""
} }
@ -346,7 +261,7 @@ class LeftView extends Component {
</div> </div>
<div id="tab_con_4" className="commentTab tab-info commentsDelegateParent" style={tabIndex === 3 ? { display: 'block' } : { display: 'none' }}> <div id="tab_con_4" className="commentTab tab-info commentsDelegateParent" style={tabIndex === 3 ? { display: 'block' } : { display: 'none' }}>
{loadingComments ? {loadingComments ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }} /> : <p>正在加载中...</p> :
<CommentContainer {...this.props}></CommentContainer> <CommentContainer {...this.props}></CommentContainer>
} }
</div> </div>
@ -360,9 +275,7 @@ class LeftView extends Component {
</div> </div>
</React.Fragment> </React.Fragment>
); )
} }
} }
// <textarea style={{display:'none'}} value={challenge.task_pass ? `${challenge.task_pass}` : ''}></textarea> export default LeftView
// {/*<textarea style={{display:'none'}} value={propaedeutics ? `${propaedeutics}` : ''}></textarea>*/}
export default withStyles(styles)(LeftView);

Loading…
Cancel
Save