整体修改

master
yujialong 4 years ago
parent 5d872fb19d
commit 9f3d59df04
  1. 19
      README.md
  2. 4
      src/assets/element-variables.scss
  3. BIN
      src/assets/img/bg1.png
  4. BIN
      src/assets/img/bg2.png
  5. BIN
      src/assets/img/btn.png
  6. BIN
      src/assets/img/header.png
  7. BIN
      src/assets/img/left.png
  8. BIN
      src/assets/img/right.png
  9. BIN
      src/assets/img/yes.png
  10. 1
      src/assets/styles/var.scss
  11. 161
      src/components/TestPanel.vue
  12. 147
      src/components/codemirror.vue
  13. 16
      src/config/index.js
  14. 3
      src/main.js
  15. 11
      src/utils/api.js
  16. 123
      src/views/Home.vue
  17. 3
      vue.config.js

@ -1,19 +0,0 @@
# python_demo
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -1,6 +1,6 @@
/* 改变主题色变量 */
$--color-primary: #239685;
@import 'styles/var.scss';
$--color-primary: $main-color;
/* 改变 icon 字体路径变量,必需 */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -0,0 +1 @@
$main-color: #8549f7;

@ -3,7 +3,7 @@
<el-container class="scrollbar" v-if="ishow">
<el-header>
<div class="flex between">
<div class="flex">
<div class="flex" style="width: 28%">
<p>实训项目</p>
<el-select
v-model="value1"
@ -11,6 +11,7 @@
class="select"
:disabled="projectPermissions != 0"
@change="selectProject"
style="flex: 1"
>
<el-option
v-for="item in value"
@ -43,7 +44,7 @@
v-show="projectPermissions == 0"
@click="reload"
>重新开始</el-button>
<el-button style="margin-right:7px" @click="Submit()" :disabled="isSubmit">提交</el-button>
<el-button class="submit-btn" style="margin-right:7px" @click="Submit()" :disabled="isSubmit">提交</el-button>
</div>
</div>
</el-header>
@ -55,7 +56,9 @@
<p>实验目标</p>
</div>
<div class="font_css">
<p class="experimentalGoal">{{experimentalGoal}}</p>
<div class="experimentalGoal">
<div class="break-all" v-html="experimentalGoal"></div>
</div>
</div>
</div>
<div class="aside-footer">
@ -94,7 +97,9 @@
</el-aside>
<el-main>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="案例" name="first">{{caseDescription}}</el-tab-pane>
<el-tab-pane label="案例" name="first">
<div class="break-all" v-html="caseDescription"></div>
</el-tab-pane>
<el-tab-pane label="实验要求" name="second">
<el-collapse v-model="activeNames">
<el-collapse-item v-for="(loop, index) in points" :key="index">
@ -102,11 +107,13 @@
<i class="el-icon-s-ticket"></i>
<span style="font-size:16px">{{loop.judgmentPointsName}}</span>
</template>
<div>{{loop.experimentalRequirements}}</div>
<div class="break-all" v-html="loop.experimentalRequirements"></div>
</el-collapse-item>
</el-collapse>
</el-tab-pane>
<el-tab-pane label="实验提示" name="fifth" >{{experimentSuggests}}</el-tab-pane>
<el-tab-pane label="实验提示" name="fifth" >
<div class="break-all" v-html="experimentSuggests"></div>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
@ -154,6 +161,7 @@ function formatDate(fmt,date) {
export default {
data() {
return {
systemId: this.$config.systemId,
test: [],
ishow: false,
grade: "00",
@ -195,6 +203,8 @@ export default {
stopTime: '',
isSelected: false,
userId: '',
workbenchCus: this.workbench,
isRecovery: false
};
},
watch: {
@ -233,6 +243,10 @@ export default {
codeId: {
type: Number,
default: 0
},
workbench: {
type: Array,
default: []
}
},
computed: {
@ -262,6 +276,29 @@ export default {
this.getQueryProject();
}else{
this.getProjects();
let codeCache = localStorage.getItem('codeCache')
if(codeCache){
codeCache = JSON.parse(codeCache)
if(codeCache.systemId && codeCache.systemId == this.$config.systemId){
this.$confirm('是否要继续上次的实验?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'success'
}).then(() => {
this.value1 = codeCache.projectId
this.workbenchCus = codeCache.workbench
this.isRecovery = true
this.selectProject()
let codeIds = []
codeCache.workbench.map(n => codeIds.push(n.code.codeId))
codeIds = codeIds.filter(n => n)
this.codeIds = codeIds
this.$emit('recoveryCode',codeCache.workbench1)
}).catch(() => {
localStorage.removeItem('codeCache')
})
}
}
}
this.assessmentId && this.projectId && this.checkVer()
this.codeId && this.codeIds.push(this.codeId)
@ -271,6 +308,14 @@ export default {
let codeId = this.codeid;
this.codeIds.push(codeId);
});
// tableData
newmain.$on("updateJud", item => {
let list = this.tableData
list.map(n => {
if(n.judgmentPointsId == item.id) n.isError = item.isError
})
this.tableData = list
});
},
methods: {
checkVer() {
@ -288,12 +333,30 @@ export default {
//
reload() {
this.$post(this.api.DeleteCodes, this.codeIds).then(res => {
this.getClearTime();
this.$router.go(0);
this.startCountFn();
this.getClearTime()
localStorage.removeItem('codeCache')
this.codeIds = []
this.isSubmit = false
newmain.$emit("isSubmit", this.isSubmit)
let workbench = this.workbench
workbench.map(n => {
n.code = {
code: '',
codeId: ''
}
})
this.$emit('recoveryCode',workbench)
let tableData = this.tableData
tableData.map(n => {
delete n.score
delete n.right
})
this.tableData = JSON.parse(JSON.stringify(tableData))
this.startCountFn()
});
},
Submit() {
if(!this.codeIds.length) return this.$message.error('请先完成实验')
this.$confirm("此操作将视为结束考试, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -326,9 +389,23 @@ export default {
}
})
.then(res => {
this.assessmentId && (this.isSubmit = true);
localStorage.removeItem('codeCache')
this.isSubmit = true
newmain.$emit("isSubmit", this.isSubmit);
this.tableData = res.message;
let list = res.message
let workbench = this.workbenchCus.length ? this.workbenchCus : this.workbench
let result = []
workbench.map(n => {
result.push(list.find(e => e.judgmentPointsId == n.judgmentPointsId))
})
let tableData = this.tableData
result.map(n => {
if(tableData.find(e => e.judgmentPointsId == n.judgmentPointsId).isError){
n.score = 0
n.right = -1
}
})
this.tableData = result
//
var s = 0;
this.tableData.forEach(element => {
@ -381,11 +458,12 @@ export default {
this.projectId = type == 2 ? project[0].projectId : this.projectId
if(type == 2) this.getQueryProject(0,1)
this.projectPermissions = type == 1 ? project[0].projectPermissions : this.projectPermissions
this.$emit("tell", this.value1, this.projectPermissions);
this.$emit("tell", this.value1, this.projectPermissions,this.isRecovery ? this.workbenchCus : []);
this.experimentalGoal = project[0].experimentalGoal;
this.caseDescription = project[0].caseDescription;
this.experimentSuggests = project[0].experimentSuggests;
this.actEndTime = project[0].endTime;
this.isRecovery = false
},
getQueryProject(projectId,type) {
//++++
@ -457,8 +535,9 @@ export default {
},
getProjects(){
let data = {
systemId: 5,
schoolId: this.schoolId
systemId: this.systemId,
// schoolId: this.schoolId
schoolId: ''
}
this.$get(`${this.api.queryTestProject}`,data).then(res => {
this.handleData(res.message,2)
@ -467,7 +546,12 @@ export default {
selectProject(){
this.isSelected = true
this.assessmentId = ''
this.judgmentPointsIds = []
this.codeIds = []
this.getQueryProject(this.value1)
this.isSubmit = false
this.countVal = 0
newmain.$emit("isSubmit", this.isSubmit)
},
counterFn(counterTime) {
let leave1 = counterTime % (24 * 3600 * 1); //
@ -523,6 +607,9 @@ export default {
</script>
<style lang="scss" scoped>
.break-all{
word-break: break-all;
}
.m_step {
height: 150px;
width: 35px;
@ -544,6 +631,7 @@ export default {
font-size: 16px;
margin: 0px 20px 10px 10px;
white-space: pre-wrap;
background: #fff url(../assets/img/bg1.png) top right no-repeat,url(../assets/img/bg2.png) bottom right no-repeat;
}
::v-deep .el-collapse-item__wrap {
@ -558,7 +646,7 @@ export default {
::v-deep .el-icon-s-ticket:before {
font-size: 16px;
padding: 5px;
color: #239685;
color: $main-color;
}
::v-deep .el-collapse-item__arrow {
margin: 0 5px 0 0;
@ -568,7 +656,7 @@ export default {
font-size: 12px;
padding: 1px;
margin-left: 10px;
background-color: #239685;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}
@ -593,7 +681,7 @@ export default {
}
::v-deep .el-tabs__item.is-active {
color: #fff;
background-color: #239685;
background-color: $main-color;
}
::v-deep .el-tabs__header {
padding: 5px 20px;
@ -618,8 +706,8 @@ export default {
background-color: #fff;
}
.header_h {
height: 40px;
background-color: #239685;
height: 50px;
background: url(../assets/img/header.png) 0 0/100% 100% no-repeat;
justify-content: center;
}
.header_h i {
@ -631,13 +719,17 @@ export default {
color: #fff;
padding-left: 10px;
}
/deep/.el-card{
border: 0;
border-radius: 0;
}
//
::v-deep .el-card__body {
padding: 0;
}
::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
background: #fff9e6;
background: #ffebf9;
}
::v-deep .el-table td,
.el-table th.is-leaf {
@ -649,20 +741,28 @@ export default {
::v-deep .el-table thead {
color: #ffffff;
font-size: 10px;
th{
padding: 5px 0;
}
}
::v-deep .el-table th,
.el-table tr {
background-color: #202020;
background-color: #d695ff;
}
::v-deep .el-table {
font-size: 12px;
color: #202020;
}
/deep/.el-collapse-item__content{
padding-left: 10px;
padding-right: 10px;
}
//.el-header
.el-header {
color: #333;
padding: 0 12px;
padding: 0 12px 0 20px;
}
.between {
justify-content: space-between;
@ -693,12 +793,11 @@ export default {
content: "\e78f";
font-size: 16px;
padding: 3px;
background-color: #239685;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}
.select ::v-deep .el-input--suffix .el-input__inner {
width: 90%;
color: #333;
font-size: 14px;
border-radius: 30px;
@ -712,7 +811,6 @@ export default {
}
.select ::v-deep .el-input {
width: 80%;
padding: 10px 0;
}
//
@ -734,22 +832,27 @@ export default {
color: #ffffff;
padding: 10px;
font-size: 14px;
background: #000000;
background: #d0e7fb;
border-radius: 6px;
text-align: center;
}
//
.el-header ::v-deep .el-button {
background-color: #239685;
background-color: $main-color;
color: #fff;
border: none;
margin: 5px 0px 5px 5px;
font-size: 16px;
}
.el-header .submit-btn{
padding-left: 30px;
padding-right: 30px;
background: url(../assets/img/btn.png) 0 0/100% 100% no-repeat;
}
.el-header ::v-deep .el-button:hover,
.el-button:focus,
.el-button:active {
background-color: #239685;
background-color: $main-color;
color: #fff;
}
@ -779,7 +882,7 @@ export default {
}
//
.scrollbar ::-webkit-scrollbar-thumb {
background-color: #239685;
background-color: $main-color;
border-radius: 3px;
box-shadow: inset 0 0 5px #dddddd;
}

@ -11,12 +11,13 @@
@input="onCmCodeChange"
ref="myCmGenerate"
></codemirror>
<div v-if="isSubmit" class="code-mask"></div>
<el-button
class="func-btn"
type="warning"
@click="AnswerTips()"
:disabled="isAnswerTips"
style="width:100px;position:absolute;z-index:99;background:#239685;color:#fff;right: 50px;bottom:15px;border-color: #239685"
>运行</el-button>
</div>
<div class="code-right answer">
@ -25,7 +26,7 @@
<div style="margin-bottom: 5px;text-align: center">
<img class="pic" :src="picSrc" alt="">
</div>
<el-button type="primary" size="mini" @click="$refs.picLink.click()" style="background:#239685;color:#fff;border-color: #239685">下载图片</el-button>
<el-button class="download-btn" type="primary" size="mini" @click="$refs.picLink.click()">下载图片</el-button>
<a ref="picLink" style="display: none;" download="运行结果.png" :href="picSrc">下载图片</a>
</div>
<div class="code_yes" v-show="this.isError == 0">
@ -40,7 +41,9 @@
<el-button class="tips-btn" @click="getQueryAnswer()" v-show="ShowAssessmentId">提示</el-button>
<el-dialog title="答案提示" center :visible.sync="error">
<el-tabs>
<el-tab-pane label="参考答案">{{answer}}</el-tab-pane>
<el-tab-pane label="参考答案">
<div class="answer-wrap" v-html="answer"></div>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
@ -114,6 +117,7 @@ export default {
picVisible: false,
picSrc: '',
loadIns: null,
submiting: false,
cmOption: {
scrollbarStyle: "native",
tabSize: 2, // tab
@ -172,7 +176,7 @@ export default {
methods: {
onCmReady3() {
this.$refs.myCmGenerate.codemirror.setSize("auto", "750px");
this.$refs.myCmGenerate.codemirror.setSize("auto", "calc(100vh - 167px)");
},
onCmFocus(instance, event) {},
getCookie(cookie_name) {
@ -195,32 +199,50 @@ export default {
},
onCmCodeChange(instance, obj) {
this.submit = 0;
this.projectId = this.projectId;
this.studentId = this.getCookie("studentId");
//
if (this.codeId == "") {
this.$post(this.api.AddCode, {
code: this.exampleData,
projectId: this.projectId,
// projectId: 305,
judgmentPointsId: this.workbench1,
studentId: this.studentId,
// studentId: 54,
submit: this.submit
})
.then(res => {
this.codeId = res.message;
newmain.$emit("codeid", this.codeId);
})
.catch(err => {});
} else {
//
// this.timer = setTimeout(this.UpdateCode, 300000);
if(!this.submiting){
this.submiting = true
this.submit = 0;
this.projectId = this.projectId;
this.userId = this.getCookie("userId");
this.studentId = this.getCookie("studentId");
//
if (this.codeId == "") {
this.$post(this.api.AddCode, {
code: this.exampleData,
projectId: this.projectId,
// projectId: 305,
judgmentPointsId: this.workbench1,
userId: parseInt(this.userId),
studentId: this.studentId,
// studentId: 54,
submit: this.submit
})
.then(res => {
this.codeId = res.message;
this.submiting = false
newmain.$emit("codeid", this.codeId);
})
.catch(err => {});
} else {
//
// this.timer = setTimeout(this.UpdateCode, 300000);
this.submit = 0;
}
}
},
downloadFile(fileName,url) {
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = 'blob'
x.onload=function(e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement('a')
a.href = url
a.download = fileName
a.click()
}
x.send()
},
AnswerTips() {
// this.$post(this.api.AddCode, {
// // headers: {code: "#-*-coding:utf-8-*-"},
@ -242,8 +264,8 @@ export default {
type: "warning"
});
} else {
// return console.log(11,/^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)(,|\(|\)|\[|\]|\{|\}|\s)?/m.test(this.exampleData))
if (/^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)(,|\(|\)|\[|\]|\{|\}|\s)?/m.test(this.exampleData)) {
// if (/^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)(,|\(|\)|\[|\]|\{|\}|\s)?/m.test(this.exampleData)) {
if (false) {
this.$prompt("请输入...", "提示", {
confirmButtonText: "确定"
}).then(({ value }) => {
@ -261,7 +283,9 @@ export default {
});
}).catch(err => {})
} else {
this.loadIns = Loading.service()
this.loadIns = Loading.service({
background: 'transparent'
})
//()
this.$post(this.api.UpdateCode, {
code: this.exampleData,
@ -272,16 +296,32 @@ export default {
this.loadIns.close()
this.picSrc = ''
if(typeof res.message == 'string'){
this.picSrc = res.message
this.isError = res.message.isError;
this.modifys = ''
this.picSrc = `${res.message}?id=${new Date().getTime()}`
newmain.$emit("updateJud",{
id: res.data.judgmentPointsId,
isError: res.data.isError
})
}else{
this.isError = res.message.isError;
newmain.$emit("updateJud",{
id: res.data.judgmentPointsId,
isError: res.data.isError
})
var modify = res.message.result;
this.modifys = modify;
this.after = modify.substring(
modify.indexOf("line") + 4,
modify.length
modify.length
);
this.num = parseInt(this.after);
if(this.projectId == 593){
let str = /\d+\.\d+/.exec(modify)
if(str.length){
this.modifys = str[0]
}
}
}
})
.catch(err => {
@ -369,12 +409,6 @@ export default {
color: #fff !important;
background-color: #333 !important;
}
// .answer ::v-deep .el-tabs__item.is-active:hover,
// .el-tabs__item.is-active:focus,
// .el-tabs__item.is-active:active {
// color: #333 !important;
// background-color: #239685 !important;
// }
::v-deep .CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {
@ -415,7 +449,7 @@ export default {
margin-right: 10px;
}
.code_yes {
color: #239685;
color: $main-color;
background-color: rgba(43, 40, 22, 1);
}
.code_error {
@ -430,13 +464,14 @@ export default {
left: 20px;
right: 20px;
padding: 0 10px;
// padding-right: 20px;
box-sizing: border-box;
}
.code-right p {
font-size: 18px;
margin: 10px;
position: absolute;
height: calc(100vh - 230px);
overflow: auto;
}
.code-right {
width: 500px;
@ -448,7 +483,7 @@ export default {
.button ::v-deep .el-button--warning:hover,
.el-button--warning:focus,
.el-button--warning:active {
background: #239685;
background: $main-color;
color: #333;
}
.flex {
@ -461,7 +496,7 @@ export default {
}
//
.scrollbar ::-webkit-scrollbar-thumb {
background-color: #239685;
background-color: $main-color;
border-radius: 3px;
box-shadow: inset 0 0 5px #dddddd;
}
@ -482,4 +517,32 @@ export default {
vertical-align: middle;
}
}
.code-mask{
z-index: 2;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.func-btn{
width:100px;
position:absolute;
z-index:99;
background:$main-color;
color:#fff !important;
right: 50px;
bottom:15px;
border-color: $main-color;
}
.download-btn{
background:$main-color;
color:#fff;
border-color: $main-color
}
/deep/.answer-wrap{
img{
max-width: 100%;
}
}
</style>

@ -0,0 +1,16 @@
export default {
/**
* @description 配置显示在浏览器标签的title
*/
title: '量化投资策略建模实验教学系统',
/**
* @description 是否使用国际化默认为false
* 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
locale: 'zh',
/**
* @description 跳转子系统链接
*/
systemId: 7
}

@ -16,6 +16,7 @@ import "codemirror/lib/codemirror.css";
import vuescroll from "vuescroll"; //引入vuescroll
import "vuescroll/dist/vuescroll.css"; //引入vuescroll样式
import VueDraggableResizable from 'vue-draggable-resizable'
import config from '@/config'
// optionally import default styles
import 'vue-draggable-resizable/dist/VueDraggableResizable.css'
@ -32,6 +33,8 @@ Vue.prototype.$post = post;
Vue.prototype.$del = del;
Vue.prototype.$put = put;
Vue.prototype.$config = config
Vue.config.productionTip = false;
router.beforeEach((to, from, next) => {

@ -1,6 +1,11 @@
// let host = 'http://192.168.0.113'
// let host = 'http://192.168.31.125:8081/python'
let host = 'http://www.liuwanr.cn/python'
// let host = 'http://192.168.31.125:8081/python'//林
// let host = 'http://192.168.31.152:8081/python'//榕
let host = ''
if(location.host.includes('liuwanr.cn')){
host = 'http://www.liuwanr.cn/python'
}else{
host = 'http://www.occupationlab.com/python'
}
export default {
QueryProject: `${host}/python/queryProject`, //项目选择下拉框+项目信息+判分点信息展示

@ -1,7 +1,7 @@
<template>
<template>
<div>
<div class="flex header">
<p>python可视化</p>
<p>{{$config.title}}</p>
<div class="bt">
<el-button type="primary" @click="back()">退出实验</el-button>
</div>
@ -21,6 +21,7 @@
:value="item.judgmentPointsId"
>
<codemirror
:key="codeKey"
:projectId.sync="projectId"
:code.sync="item.code.code"
:workbench1="item.judgmentPointsId"
@ -33,12 +34,14 @@
<div class="menu">
<testPanel
@tell="getQueryIndex"
@recoveryCode="recoveryCode"
ref="mainindex"
:autoStart="autoStart"
:sendSync="sendSync"
:defaultVal="defaultVal"
@getDataFromChild="getDataFromChild"
:codeId="codeId"
:workbench="workbench"
:key="codeId"
></testPanel>
</div>
@ -76,6 +79,7 @@ export default {
return {
//
isShow: false,
projectPermissions: 0, //(0 1 2)
ops: {
vuescroll: {},
scrollPanel: {},
@ -94,7 +98,7 @@ export default {
codeId: 0,
value: "Python",
workbench1: "", //
workbench: {},
workbench: [],
editableTabs: [],
tabIndex: 2,
name: "",
@ -105,16 +109,27 @@ export default {
assessmentId: '',
defaultVal: sessionStorage.getItem("timer")
? parseInt(sessionStorage.getItem("timer"))
: 0
: 0,
codeKey: 1,
host: location.host.includes('liuwanr.cn') ? 'http://www.liuwanr.cn/' : 'http://www.occupationlab.com/'
};
},
components: {
codemirror,
testPanel
},
beforeDestroy(){
let data = {
studentId: this.studentId,
startTime: this.entryTime,
endTime: formatDate('yyyy-MM-dd hh:mm:ss'),
projectId: this.projectId
}
this.$post(this.api.saveEvaluation,data).then(res => {})
this.leavePage()
},
mounted() {
this.assessmentId = this.getCookie("assessmentId");
this.addLeaveEvent()
if (window.history && window.history.pushState) {
//
history.pushState(null, null, document.URL);
@ -125,34 +140,46 @@ export default {
window.removeEventListener("popstate", this.goBack, false);
},
methods: {
leavePage(){
if(!this.$refs.mainindex.isSubmit && !this.assessmentId && this.workbench.length){
let workbench = this.workbench
if(workbench.some(n => n.code.code)){
let codeCache = {
systemId: this.$config.systemId,
projectId: this.projectId,
workbench1: this.workbench1,
workbench
}
localStorage.setItem('codeCache',JSON.stringify(codeCache))
}
}
},
goBack() {
console.log("点击了浏览器的返回按钮");
this.$router.replace({ path: "/" });
this.leavePage()
history.back()
},
getDataFromChild(data) {
sessionStorage.setItem("timer", parseInt(data));
},
addLeaveEvent(){
this.$once('hook:beforeDestroy', function () {
let data = {
studentId: this.studentId,
startTime: this.entryTime,
endTime: formatDate('yyyy-MM-dd hh:mm:ss'),
projectId: this.projectId
}
this.$post(this.api.saveEvaluation,data).then(res => {});
})
recoveryCode(workbench){
this.workbench = workbench
this.codeKey++
this.workbench1 = '0'
},
reload(){
this.$refs.mainindex.reload()
},
back() {
// window.location = "http://www.liuwanr.cn:8080/client/#/student";
// window.location = "http://www.occupationlab.com/client/#/student";
// history.back()
location.href = 'http://www.liuwanr.cn/hrClient/#/dashboard#1'
this.leavePage()
if(this.projectPermissions){
location.href = `${this.host}hrClient/#/dashboard#2`
}else{
location.href = `${this.host}hrClient/#/dashboard#1`
}
this.$refs.mainindex.getClearTime();
},
//
getQueryIndex(value1, projectPermissions) {
getQueryIndex(value1, projectPermissions,workBench) {
//
this.projectId = value1;
this.projectPermissions = projectPermissions;
@ -163,16 +190,20 @@ export default {
// studentId: 54
})
.then(res => {
this.workbench = res.message;
this.workbench.map(item => {
if (item.code.codeId == 0) {
item.code.codeId = "";
}
// if (this.projectPermissions == "0") {
// item.code.codeId = "";
// item.code.code = "";
// }
});
if(workBench.length){
this.workbench = workBench
}else{
this.workbench = res.message;
this.workbench.map(item => {
if (item.code.codeId == 0) {
item.code.codeId = "";
}
if (this.projectPermissions == "0") {
item.code.codeId = "";
item.code.code = "";
}
});
}
this.assessmentId && (this.codeId = this.workbench[0].code.codeId)
})
.catch(err => {
@ -222,7 +253,7 @@ export default {
}
::v-deep .el-dialog__headerbtn .el-icon-close:before {
padding: 3px;
background-color: #239685;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}
@ -239,7 +270,7 @@ export default {
}
.tab ::v-deep .el-tabs__item.is-active {
color: #fff;
background-color: #239685;
background-color: $main-color;
}
.tab ::v-deep .el-icon-circle-plus-outline:before {
font-size: 16px;
@ -275,7 +306,7 @@ export default {
width: 10%;
}
.center ::v-deep .el-input.is-disabled .el-input__inner {
// border-color: #239685;
// border-color: $main-color;
border-radius: 30px;
}
//
@ -287,24 +318,28 @@ export default {
.el-button--primary:hover,
.el-button--primary:active {
border: none;
background-color: #239685;
background-color: $main-color;
}
.bt ::v-deep .el-button {
padding: 23px 50px;
border-radius: 0;
border: none;
}
.bt .restart{
color: #868686;
background-color: #e0e0e0;
}
.header p {
font-size: 16px;
font-weight: 700;
color: rgba(51, 51, 51, 1);
font-size: 20px;
color: #333;
margin-left: 18px;
}
.header {
background-color: #f8f8f8;
justify-content: space-between;
height: 40px;
line-height: 40px;
height: 58px;
line-height: 58px;
}
//
p {
@ -320,7 +355,7 @@ p {
}
//
::v-deep ::-webkit-scrollbar-thumb {
background-color: #239685;
background-color: $main-color;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 5px #dddddd;
}
@ -349,7 +384,7 @@ p {
content: "\e78f";
font-size: 16px;
padding: 3px;
background-color: #239685;
background-color: $main-color;
border-radius: 50%;
color: #ffffff;
}

@ -12,6 +12,9 @@ module.exports = {
lintOnSave: true,
css: {
loaderOptions: {
sass: {
prependData: `@import "@/assets/styles/var.scss";`
},
postcss: {
plugins: [
postcss

Loading…
Cancel
Save