openf12
yujialong 1 year ago
parent f37c144e46
commit ca1a111524
  1. 23
      src/components/TestPanel.vue
  2. 17
      src/components/codemirror.vue
  3. 5
      src/config/index.js
  4. 6
      src/store/index.js

@ -278,6 +278,7 @@ export default {
resultsDetails: Cookie.get('admin-resultsDetails'), resultsDetails: Cookie.get('admin-resultsDetails'),
resultAnnouncementTime: Cookie.get('admin-resultAnnouncementTime'), resultAnnouncementTime: Cookie.get('admin-resultAnnouncementTime'),
curriculumName: Cookie.get('admin-curriculumName') ? unescape(Cookie.get('admin-curriculumName')) : 'python', // curriculumName: Cookie.get('admin-curriculumName') ? unescape(Cookie.get('admin-curriculumName')) : 'python', //
fromManager: Cookie.get('admin-fromManager'), //
curSystemId: 1, curSystemId: 1,
projectPermissions: 0, // (0 1 2) projectPermissions: 0, // (0 1 2)
isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, // isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, //
@ -381,6 +382,7 @@ export default {
let data = { let data = {
systemId: this.systemId, systemId: this.systemId,
cId: this.courseId, // id cId: this.courseId, // id
mallId: this.mallId,
permissions: this.projectPermissions // // permissions: this.projectPermissions // //
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -444,8 +446,7 @@ export default {
}) })
this.reportPoints = reportPoints this.reportPoints = reportPoints
if (points.length) this.reportTab = reportPoints[0].judgmentId + '' if (points.length) this.reportTab = reportPoints[0].judgmentId + ''
console.log("🚀 ~ file: TestPanel.vue:423 ~ returnnewPromise ~ this.reportTab:", points, this.reportTab) this.taskList = this.isSubmit ? this.$store.state.taskList : points //
this.taskList = points //
this.judgmentId = points[0].judgmentId // this.judgmentId = points[0].judgmentId //
this.experimentTarget = project.experimentTarget this.experimentTarget = project.experimentTarget
this.experimentDescription = project.experimentDescription this.experimentDescription = project.experimentDescription
@ -675,7 +676,20 @@ export default {
// //
toReport () { toReport () {
Cookie.set('doneProjectId', this.projectId) // id,id Cookie.set('doneProjectId', this.projectId) // id,id
this.$router.push(`/report?reportId=${this.$store.state.reportId}`) const { reportId } = this.$store.state
//
if (this.fromManager) {
this.$router.push(`/report?reportId=${reportId}`)
} else {
let href = location.origin
if (!this.$config.isPro && !this.$config.isZxy) href += '/student'
href += `/#/record/show?python=1&reportId=${reportId}`
//
if (this.projectPermissions == 0) {
href += `&curriculumId=${this.courseId}&projectId=${this.projectId}`
}
location.href = href
}
}, },
// //
reload () { reload () {
@ -811,7 +825,7 @@ export default {
clearInterval(this.statusTimer) clearInterval(this.statusTimer)
this.reportVisible = false this.reportVisible = false
let list = retInfo let list = retInfo
let taskList = this.taskList let { taskList } = this
let score = 0 let score = 0
// //
taskList.map(e => { taskList.map(e => {
@ -827,6 +841,7 @@ export default {
this.grade = util.handleZero(score) // 0() this.grade = util.handleZero(score) // 0()
this.reportId = reportId this.reportId = reportId
this.$store.commit('setReportId', reportId) this.$store.commit('setReportId', reportId)
this.$store.commit('setTaskList', taskList)
this.editReport(reportId) this.editReport(reportId)
// //
this.competitionId && this.resultsDetails == 0 && this.$alert('提交成功,成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看', '提示', { this.competitionId && this.resultsDetails == 0 && this.$alert('提交成功,成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看', '提示', {

@ -532,7 +532,6 @@ export default {
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) { } else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) {
/** /**
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来 * 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
* 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可
*/ */
imgList.map((n, i) => { imgList.map((n, i) => {
util.downloadFile(`${i + 1}.jpg`, n) util.downloadFile(`${i + 1}.jpg`, n)
@ -567,9 +566,13 @@ export default {
}, },
// //
exportResult () { exportResult () {
let str = this.runResult
// this.picSrcList.forEach(e => {
// str += `<img src="${e}" alt="">`
// })
var FileSaver = require('file-saver'); var FileSaver = require('file-saver');
var blob = new Blob([this.runResult], { type: "text/plain;charset=utf-8" }); var blob = new Blob([str], { type: "text/plain;charset=utf-8" });
FileSaver.saveAs(blob, 'result.csv') FileSaver.saveAs(blob, 'result.docx')
}, },
// //
getTips () { getTips () {
@ -732,7 +735,7 @@ export default {
margin: 10px; margin: 10px;
position: absolute; position: absolute;
width: calc(100% - 14px); width: calc(100% - 14px);
height: calc(100vh - 340px); height: calc(100vh - 387px);
overflow: auto; overflow: auto;
} }
.pic-num0 { .pic-num0 {
@ -746,7 +749,7 @@ export default {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 5px; bottom: 60px;
display: flex; display: flex;
max-width: calc(100% - 50px); max-width: calc(100% - 50px);
margin: 0 auto; margin: 0 auto;
@ -759,13 +762,15 @@ export default {
margin: 0 5px 5px; margin: 0 5px 5px;
&:only-child { &:only-child {
.pic { .pic {
width: 80%; width: 50%;
max-height: none;
} }
} }
} }
.pic { .pic {
display: block; display: block;
width: 100px; width: 100px;
max-height: 100px;
margin: 0 auto 10px; margin: 0 auto 10px;
} }
} }

@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development' //是否本地
const isHh = url.includes('10.196.131.73') //是否是河海版本 const isHh = url.includes('10.196.131.73') //是否是河海版本
const isPro = url.includes('occupationlab.com') //是否职站生产 const isPro = url.includes('occupationlab.com') //是否职站生产
const isZxy = url.includes('izhixinyun.com') //是否智信云 const isZxy = url.includes('izhixinyun.com') //是否智信云
let vscodeUrl = 'https://vscode.izhixinyun.com' let vscodeUrl = 'http://121.37.12.51:8088/?folder=/home/coder'
let host = location.origin + '/' let host = location.origin + '/'
let bankPath = `${location.origin}/banksystem` // 银行系统 let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
@ -15,11 +15,12 @@ if (isDev) {
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`
vscodeUrl = 'http://121.37.12.51:8088/?folder=/home/coder'
} else if (isPro) { } else if (isPro) {
host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'
bankPath = `https://www.huorantech.cn/banksystem` bankPath = `https://www.huorantech.cn/banksystem`
vscodeUrl = 'https://vscode.occupationlab.com/' vscodeUrl = 'https://vscode.occupationlab.com/'
} else if (isZxy) {
vscodeUrl = 'https://vscode.izhixinyun.com'
} }
const systemId = Cookie.get('admin-systemId') const systemId = Cookie.get('admin-systemId')
export default { export default {

@ -4,7 +4,8 @@ Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
language: 0, language: 0,
reportId: '' reportId: '',
taskList: []
}, },
mutations: { mutations: {
setLanguage: (state, id) => { setLanguage: (state, id) => {
@ -13,6 +14,9 @@ const store = new Vuex.Store({
setReportId: (state, id) => { setReportId: (state, id) => {
state.reportId = id state.reportId = id
}, },
setTaskList: (state, taskList) => {
state.taskList = taskList
},
} }
}); });
export default store; export default store;
Loading…
Cancel
Save