yujialong 10 months ago
parent 5342a2809a
commit fba27010ad
  1. 2
      src/api/index.js
  2. 40
      src/components/TestPanel.vue
  3. 4
      src/components/codemirror.vue
  4. 2
      src/config/index.js
  5. 3
      src/main.js

@ -41,6 +41,6 @@ export default {
detailsOfGoods: `nakadai/mall/detailsOfGoods`, detailsOfGoods: `nakadai/mall/detailsOfGoods`,
importCode: `occupationlab/occupationlab/experimentalReport/importCode`, importCode: `occupationlab/occupationlab/experimentalReport/importCode`,
removeImport: `occupationlab/occupationlab/experimentalReport/removeImport`, removeImport: `occupationlab/occupationlab/experimentalReport/removeImport`,
saveStartTime: `python/python/saveStartTime`, getStartTime: `python/python/getStartTime`,
getProductSystemTheme: `nakadai/mall/getProductSystemTheme`, getProductSystemTheme: `nakadai/mall/getProductSystemTheme`,
} }

@ -417,15 +417,8 @@ export default {
2 : 2 :
0 0
let now await this.getEntryTime()
if (!this.projectPermissions) {
now = await this.getNow()
} else {
now = await this.getSumTime() //
if (!now) now = await this.getNow()
}
this.entryTime = now
if (this.assessmentId) { // assessmentIdcompetitionId) if (this.assessmentId) { // assessmentIdcompetitionId)
this.getAssList() this.getAssList()
} else { // } else { //
@ -458,10 +451,13 @@ export default {
permissions: this.projectPermissions // // permissions: this.projectPermissions // //
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$get(`${this.api.queryTestProject}`, data).then(res => { this.$get(`${this.api.queryTestProject}`, data).then(async res => {
const list = res.projects const list = res.projects
this.projectList = list this.projectList = list
if (!this.projectPermissions && !this.projectId) this.projectId = list ? list[0].projectId : 0 // if (!this.projectPermissions && !this.projectId) {
this.projectId = list ? list[0].projectId : 0 //
await this.getEntryTime()
}
this.getProDetail().then(() => { this.getProDetail().then(() => {
resolve() resolve()
}).catch(res => { }).catch(res => {
@ -526,13 +522,12 @@ export default {
this.experimentHint = project.experimentHint this.experimentHint = project.experimentHint
this.hintOpen = project.founder ? !project.hintOpenBySchool : !project.hintOpen // 01 this.hintOpen = project.founder ? !project.hintOpenBySchool : !project.hintOpen // 01
this.$emit('tell', projectId, systemId, this.points) this.$emit('tell', projectId, systemId, this.points)
// this.getSumTime()
const isPrac = this.projectPermissions == 0 // const isPrac = this.projectPermissions == 0 //
this.text = isPrac ? '已用' : '剩余' this.text = isPrac ? '已用' : '剩余'
// //
if (!this.competitionId) { if (!this.competitionId) {
const now = await this.getNow() const now = await this.getNow()
this.countVal = isPrac ? 0 : (new Date(this.endTime) - now) / 1000 // 0 this.countVal = (isPrac ? now - this.entryTime : (new Date(this.endTime) - now)) / 1000 //
this.startCount() this.startCount()
} }
resolve() resolve()
@ -558,6 +553,16 @@ export default {
resolve(new Date(res.currentTime)) resolve(new Date(res.currentTime))
}) })
}, },
//
getEntryTime () {
return new Promise(async (resolve, reject) => {
let now
if (this.projectId) now = await this.getSumTime() //
if (!now) now = await this.getNow()
this.entryTime = now
resolve()
})
},
// loadingtrue // loadingtrue
closeLoad () { closeLoad () {
this.$parent.loadIns.close() this.$parent.loadIns.close()
@ -599,7 +604,7 @@ export default {
}).catch(res => { }) }).catch(res => { })
}, },
// //
getCache (cache) { async getCache (cache) {
const pId = cache ? cache.projectId : '' const pId = cache ? cache.projectId : ''
const projectId = Number(pId || this.projectId) const projectId = Number(pId || this.projectId)
const cid = this.courseId const cid = this.courseId
@ -743,13 +748,14 @@ export default {
}).catch(res => { }) }).catch(res => { })
}, },
// //
selectProject () { async selectProject () {
this.isSelected = true this.isSelected = true
await this.getEntryTime()
this.countVal = this.entryTime
this.getProDetail().then(() => { this.getProDetail().then(() => {
this.getCache() this.getCache()
}).catch(res => { }) }).catch(res => { })
this.setSubmit(false) this.setSubmit(false)
this.countVal = 0
this.grade = '00' this.grade = '00'
this.pannelTab = 'first' this.pannelTab = 'first'
this.clearReport() this.clearReport()
@ -889,7 +895,7 @@ export default {
if (this.isSubmit) return false if (this.isSubmit) return false
const pointList = this.$parent.workbench const pointList = this.$parent.workbench
const date = await this.getNow() const date = await this.getNow()
const entryTime = this.entryTime const { entryTime } = this
const timeSum = Math.ceil((date - entryTime) / 60000) // const timeSum = Math.ceil((date - entryTime) / 60000) //
const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date) const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date)
const projectId = this.projectId const projectId = this.projectId
@ -913,7 +919,7 @@ export default {
classId: this.classId ? this.classId : '', classId: this.classId ? this.classId : '',
className: this.className ? this.className : '', className: this.className ? this.className : '',
curriculumId: this.courseId, curriculumId: this.courseId,
startTime: this.projectPermissions ? this.startTime : util.formatDate('yyyy-MM-dd hh:mm:ss', entryTime), // startTime: util.formatDate('yyyy-MM-dd hh:mm:ss', entryTime), //
endTime: this.projectPermissions ? this.endTime : submitTime, // endTime: this.projectPermissions ? this.endTime : submitTime, //
submitTime, // 3 submitTime, // 3
timeSum, timeSum,

@ -834,7 +834,7 @@ export default {
}, },
// //
importCode (row) { importCode (row) {
this.codeVal = row.runCode this.codeVal += (this.codeVal ? '\n' : '') + row.runCode //
this.$nextTick(() => { this.$nextTick(() => {
const codemirror = this.$refs.codemirror.codemirror const codemirror = this.$refs.codemirror.codemirror
codemirror.focus() codemirror.focus()
@ -844,7 +844,7 @@ export default {
}, },
// //
showSubmit () { showSubmit () {
this.codeVal = this.curCode this.codeVal += (this.codeVal ? '\n' : '') + this.curCode //
this.$nextTick(() => { this.$nextTick(() => {
const codemirror = this.$refs.codemirror.codemirror const codemirror = this.$refs.codemirror.codemirror
codemirror.focus() codemirror.focus()

@ -14,7 +14,7 @@ let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (isDev) { if (isDev) {
host = 'http://192.168.31.51:9000/' host = 'http://192.168.31.51:9000/'
// host = 'http://121.37.12.51:9000/' host = 'http://121.37.12.51:9000/'
// host = 'https://occupationlab.com/' // host = 'https://occupationlab.com/'
bankPath = `http://${location.hostname}:8093` bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {

@ -3,7 +3,6 @@ import App from "./App.vue";
import router from "./router"; import router from "./router";
import store from "./store"; import store from "./store";
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import util from '@/util'
import '@/styles/index.scss'; import '@/styles/index.scss';
import axios from 'axios' import axios from 'axios'
import config from '@/config' import config from '@/config'
@ -75,7 +74,7 @@ Vue.prototype.$put = put
Vue.prototype.$config = config Vue.prototype.$config = config
Vue.config.productionTip = false; Vue.config.productionTip = false;
const curriculumName = util.getCookie('curriculumName') const curriculumName = Cookie.get('admin-curriculumName')
document.title = curriculumName ? decodeURIComponent(curriculumName) : 'python' document.title = curriculumName ? decodeURIComponent(curriculumName) : 'python'
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
next() next()

Loading…
Cancel
Save