缓存后编辑器聚焦

dev_2022-03-03
jialong.yu 3 years ago
parent ab9cf4b77e
commit 89aa5a0645
  1. BIN
      src/assets/images/system/5/right.png
  2. 5
      src/components/TestPanel.vue
  3. 4
      src/components/codemirror.vue
  4. 8
      src/views/Home.vue

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@ -283,7 +283,7 @@ export default {
const cid = this.courseId
const assessmentId = this.assessmentId
let points = []
if (pId) {
if (pId && cache.judgmentIdList) {
cache.judgmentIdList.map(e => {
points.push({
judgmentId: e
@ -310,7 +310,7 @@ export default {
//
if (code) {
hasCache = 1
if (!newJudgmentId) newJudgmentId = i
if (newJudgmentId === '') newJudgmentId = i
e.code = code
}
resolve()
@ -329,7 +329,6 @@ export default {
}).then(() => {
localStorage.removeItem('codeCache') //
this.projectId = projectId
// this.judgmentId = newJudgmentId
// id
if (pId) {
this.getProDetail().then(() => {

@ -308,16 +308,18 @@ export default {
this.$emit('update:codeId', res.codeId) // coddeId
this.$emit('update:answer', result) //
let imgList = ''
let firtImg = ''
try {
imgList = eval(result)
} catch (error) {}
if (imgList.length) firtImg = imgList[0]
//
if (photo) {
this.isError = '' //
const text = result.replace(photo, '') //
this.runResult = text
this.picSrc = photo
} else if (imgList instanceof Array && imgList.length && (imgList[0].includes('.jpg') || imgList[0].includes('.png') || imgList[0].includes('img'))) {
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) {
/**
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
* 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可

@ -122,9 +122,11 @@ export default {
},
//
judChange() {
const code = this.$refs['code' + this.curTab][0].$refs.codemirror.codemirror
code.focus()
code.setCursor(code.lineCount(), 0)
this.$nextTick(_ => {
const code = this.$refs['code' + this.curTab][0].$refs.codemirror.codemirror // codemirror
code.focus() //
code.setCursor(code.lineCount(), 0) //
})
},
//
recoveryCode(curTab = '0'){

Loading…
Cancel
Save