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`,
importCode: `occupationlab/occupationlab/experimentalReport/importCode`,
removeImport: `occupationlab/occupationlab/experimentalReport/removeImport`,
saveStartTime: `python/python/saveStartTime`,
getStartTime: `python/python/getStartTime`,
getProductSystemTheme: `nakadai/mall/getProductSystemTheme`,
}

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

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

@ -14,7 +14,7 @@ let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151
if (isDev) {
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/'
bankPath = `http://${location.hostname}:8093`
} else if (isPro) {

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

Loading…
Cancel
Save