openf12
yujialong 1 year ago
parent 2652e3b412
commit eb864e33c4
  1. 20
      src/components/TestPanel.vue
  2. 79
      src/components/codemirror.vue
  3. 29
      src/main.js

@ -100,7 +100,7 @@
<el-aside id="aside"
width="30%">
<div class="aside-header">
<div :class="['p-title color', 'system' + systemId]">
<div :class="['p-title color', 'system' + $themeId]">
<i class="el-icon-s-order"></i>
<p>实验目标</p>
</div>
@ -110,7 +110,7 @@
</div>
</div>
<div class="aside-footer">
<div :class="['p-title color', 'system' + systemId]">
<div :class="['p-title color', 'system' + $themeId]">
<i class="el-icon-s-management"></i>
<p>实验任务</p>
</div>
@ -897,6 +897,12 @@ export default {
togglePannel () {
document.querySelector('#panel').style.left = 0
this.pannelVisible = !this.pannelVisible
// if (this.pannelVisible) {
// document.querySelector('#toggle').onmousedown = null
// document.querySelector('#toggle').onmousedown = togglePannel
// } else {
this.drag()
// }
},
//
timeFormat (param) {
@ -938,6 +944,9 @@ export default {
},
//
drag () {
document.querySelector('.scrollbar').onmousedown = null
document.querySelector('#toggle').onmousedown = null
const el = document.querySelector('#panel')
const drag = e => {
if (this.dragIds.includes(e.target.id)) {
@ -962,7 +971,6 @@ export default {
}
}
}
// document.querySelector('#header').onmousedown = drag
document.querySelector('.scrollbar').onmousedown = drag
@ -992,7 +1000,7 @@ export default {
document.onmouseup = null
}
}
document.querySelector('#toggle').onmousedown = drag1
document.querySelector('#toggle').onmousedown = this.pannelVisible ? this.togglePannel : drag1
}
}
};
@ -1123,7 +1131,6 @@ export default {
&.system4 {
background-size: 100% 58px;
}
&.system5,
&.system7,
&.system9 {
background-size: 100% 40px;
@ -1132,9 +1139,6 @@ export default {
&.system6 {
background-size: 100% 61px;
}
&.system10 {
background-size: 104% 61px;
}
p {
padding-left: 10px;
line-height: 40px;

@ -506,42 +506,49 @@ export default {
projectId,
type: 0
}).then(res => {
const data = res.code
const photo = data.photoUrl
const result = data.runResult || ''
this.$emit('cache') //
this.loadIns.close()
this.picSrcList = []
if (photo) this.picSrcList = photo.split(',')
this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', result) //
this.$emit('update:retResult', data.retResult) //
let imgList = ''
let firtImg = ''
try {
imgList = eval(result)
} catch (error) { }
if (imgList && imgList.length) firtImg = imgList[0]
//
if (photo) {
this.isError = data.retResult //
const text = result.replace(photo, '') //
this.runResult = text
this.picSrcList = photo.split(',')
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length))
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) {
/**
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
*/
imgList.map((n, i) => {
util.downloadFile(`${i + 1}.jpg`, n)
})
this.isError = 0
this.runResult = '下载完成'
} else {
this.isError = data.retResult
this.runResult = result
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length))
//
if (res.code) {
const data = res.code
const photo = data.photoUrl
const result = data.runResult || ''
this.$emit('cache') //
this.loadIns.close()
this.picSrcList = []
if (photo) this.picSrcList = photo.split(',')
this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', result) //
this.$emit('update:retResult', data.retResult) //
let imgList = ''
let firtImg = ''
try {
imgList = eval(result)
} catch (error) { }
if (imgList && imgList.length) firtImg = imgList[0]
//
if (photo) {
this.isError = data.retResult //
const text = result.replace(photo, '') //
this.runResult = text
this.picSrcList = photo.split(',')
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length))
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) {
/**
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
*/
imgList.map((n, i) => {
util.downloadFile(`${i + 1}.jpg`, n)
})
this.isError = 0
this.runResult = '下载完成'
} else {
this.isError = data.retResult
this.runResult = result
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length))
}
} else if (res.data && res.data.current) {
//
this.$message.success(`当前队列有${res.data.current - 1}人在排队,请稍等!`)
this.loadIns.close()
}
}).catch(res => {
this.isError = false

@ -10,17 +10,38 @@ import config from '@/config'
import api from './api';
import Cookie from 'js-cookie'
Vue.prototype.$themeId = 4
Vue.prototype.$themeId = 9
axios.get(config.host + api.detailsOfGoods + '?mallId=' + Cookie.get('admin-mallId'), {
headers: {
token: Cookie.get('admin-token')
},
}).then(({ data }) => {
console.log(33, data.orderDetails.mall.themeId)
const themeId = data.orderDetails.mall.themeId || 4
// const themeId = 14
const themeId = data.orderDetails.mall.themeId || 9
Vue.prototype.$themeId = themeId
require(`@/styles/theme/theme${themeId}.scss`)
// require(`@/styles/theme/theme${themeId}.scss`)
if (themeId == 1) {
import('@/styles/theme/theme1.scss')
} else if (themeId == 2) {
import('@/styles/theme/theme2.scss')
} else if (themeId == 3) {
import('@/styles/theme/theme3.scss')
} else if (themeId == 4) {
import('@/styles/theme/theme4.scss')
} else if (themeId == 5) {
import('@/styles/theme/theme5.scss')
} else if (themeId == 6) {
import('@/styles/theme/theme6.scss')
} else if (themeId == 7) {
import('@/styles/theme/theme7.scss')
} else if (themeId == 8) {
import('@/styles/theme/theme8.scss')
} else if (themeId == 9) {
import('@/styles/theme/theme9.scss')
} else if (themeId == 10) {
import('@/styles/theme/theme10.scss')
}
}).catch(e => {})
import {

Loading…
Cancel
Save