定时查询状态及自动提交

ui
jialong.yu 3 years ago
parent aa01c8e99a
commit 0a63968750
  1. 0
      src/api/http.js
  2. 2
      src/api/index.js
  3. BIN
      src/assets/img/新建文件夹/left.png
  4. BIN
      src/assets/img/新建文件夹/right.png
  5. BIN
      src/assets/img/新建文件夹/yes.png
  6. 74
      src/components/TestPanel.vue
  7. 4
      src/config/index.js
  8. 4
      src/main.js
  9. 15
      src/views/Home.vue

@ -6,4 +6,6 @@ export default {
queryTestProject: 'occupationlab/projectManage/getProjectBySystemId',
saveCache: 'python/python/saveCache',
getLastCache: 'python/python/getLastCache',
getDetailById: 'occupationlab/assessment/getDetailById',
pageStuAssessment: 'occupationlab/assessment/pageStuAssessment'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -44,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 style="margin-right:7px" @click="confirmSubmit" :disabled="isSubmit">提交</el-button>
</div>
</div>
</el-header>
@ -170,13 +170,14 @@ export default {
curReq: [], //
taskList: [], //
pannelTab: 'first', //
isSelected: false // true
isSelected: false, // true
statusTimer: null //
};
},
mounted() {
this.projectPermissions = this.projectId ? 1 : 0 // /
if(this.projectId){ // projectId)
this.getList()
this.getAssList()
}else{ //
//
this.getList().then(() => {
@ -246,6 +247,36 @@ export default {
})
})
},
//
getAssList(){
this.$post(`${this.api.pageStuAssessment}`, {
pageNum: 1,
pageSize: 10000
}).then(res => {
const list = res.list
const assessmentId = this.assessmentId
let done = false
list.map(e => {
// reportId
if (e.assessmentId == assessmentId && e.reportId) {
done = true
this.isSubmit = true
newmain.$emit('isSubmit', this.isSubmit)
this.$message.error('你已经提交过该考核!')
setTimeout(_ => {
history.back() //
}, 1500)
}
})
if (!done) {
this.getList()
//
this.statusTimer = setInterval(_ => {
this.getStatus()
}, 1000)
}
}).catch(res => {})
},
//
getCache(pId, jId) {
const projectId = pId || this.projectId
@ -287,6 +318,19 @@ export default {
}
}).catch(res => {})
},
//
getStatus() {
this.$get(this.api.getDetailById, {
id: this.assessmentId
}).then(res => {
const done = res.data ? res.data.status === 2 : false // (0 1 2)
//
if (done) {
clearInterval(this.statusTimer)
this.submit()
}
}).catch(res => {})
},
//
selectProject(){
this.isSelected = true
@ -307,6 +351,7 @@ export default {
this.isSubmit = false
newmain.$emit('isSubmit', this.isSubmit)
const points = this.points
// codecodeId,
points.map(e => {
e.code = ''
e.codeId = ''
@ -316,16 +361,22 @@ export default {
this.$emit('recoveryCode')
this.startCount()
},
//
submit() {
//
confirmSubmit() {
const pointList = this.$parent.workbench
if(!pointList.find(e => e.codeId)) return this.$message.error('请先完成实验')
// if(!pointList.find(e => e.codeId)) return this.$message.error('')
this.$confirm("此操作将视为结束考试, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true
}).then(() => {
this.submit()
}).catch(() => {})
},
//
submit() {
const pointList = this.$parent.workbench
const date = new Date()
const entryTime = this.entryTime
const timeSum = Math.ceil((date.getTime() - entryTime.getTime()) / 60000) //
@ -366,20 +417,19 @@ export default {
let list = res.retInfo
let taskList = this.taskList
var score = 0
//
taskList.map(e => {
let item = list.find(n => n.judgmentPointsId === e.judgmentId)
if (item) {
e.score = item.score
e.finishedResult = item.finishedResult
e.finishedResult = item.finishedResult // 12
} else {
e.score = 0
}
score += e.score
})
this.grade = util.handleZero(score)
score += e.score //
})
.catch(err => {})
}).catch(() => {})
this.grade = util.handleZero(score) // 0
}).catch(err => {})
},
//
togglePannel() {

@ -7,11 +7,9 @@ if(isHh) {
host = "http://10.196.131.73/";
} else if(isBeta) {
host = "http://39.108.250.202:9000/";
// host = "http://192.168.31.151:9000/";
host = "http://192.168.31.151:9000/";
} else if(isPro) {
host = "http://www.occupationlab.com/";
} else {
console.log("其它");
}
export default {

@ -4,13 +4,13 @@ import router from "./router";
import store from "./store";
import ElementUI from 'element-ui'
import './assets/element-variables.scss'
import api from './utils/api';
import api from './api';
import {
post,
get,
del,
put
} from './utils/http';
} from './api/http';
import VueCodeMirror from "vue-codemirror";
import "codemirror/lib/codemirror.css";
import vuescroll from "vuescroll"; //引入vuescroll

@ -120,20 +120,7 @@ export default {
},
// 退
back() {
if(this.projectPermissions){
//
if (this.$config.isBeta) { //
location.href = `http://120.78.198.231/#/ass/list`
}
location.href = `${this.$config.host}#/dashboard#2`
}else{
//
if (this.$config.isBeta) {
location.href = `http://120.78.198.231/#/station/list`
}
// location.href = `${this.$config.host}#/dashboard#1`
}
this.$refs.mainindex.getClearTime();
history.back()
},
// id
getQueryIndex(projectId, workbench) {

Loading…
Cancel
Save