diff --git a/public/index.html b/public/index.html index f676f8a..b6dcb5c 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ var _hmt = _hmt || []; (function () { var hm = document.createElement('script'); - hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e'; + hm.src = 'https://hm.baidu.com/hm.js?e08e149ed7d1790ce279cce89ca0c03a'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(hm, s); })(); diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 4458c95..db10098 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -78,7 +78,7 @@ :options="cmOption" class="code-mirror" :ref="'codemirror' + scope.$index" - @ready="ready"> + @ready="() => ready(scope.$index)"> -
+
-
- - -
+ + +
@@ -433,7 +433,7 @@ export default { } this.competitionId && this.getCompetitionStatus() // 查询竞赛信息 this.getUserDetail() - // this.drag() + this.drag() this.tableHeight = window.innerHeight - 360 }) }, @@ -625,7 +625,7 @@ export default { this.closeLoad() const code = res.getLastCache // 如果有缓存代码 - if (code && !e.code) { + if (code) { hasCache = 1 if (newJudgmentId === '') newJudgmentId = i e.code = code @@ -651,7 +651,7 @@ export default { this.getProDetail().then(() => { this.points.map(e => { const item = points.find(n => n.judgmentId === e.judgmentId) - if (item && item.code && !e.code) this.$set(e, 'code', item.code) + if (item && item.code) this.$set(e, 'code', item.code) }) this.$emit('tell', projectId, this.curSystemId, this.points) this.$emit('recoveryCode', newJudgmentId + '') // 切换为缓存的判分点,tab索引值要为字符串 @@ -755,6 +755,7 @@ export default { } else { let href = location.origin if (this.$config.isTest) href += '/student' + if (this.$config.isDev) href = `http://${location.hostname}:8082` href += `/#/record/show?python=1&reportId=${reportId}` // 练习 if (this.projectPermissions == 0) { @@ -784,12 +785,14 @@ export default { this.entryTime = await this.getNow() }, // 页面加载完后重置编辑框大小 - ready () { - for (let i = 0; i < this.points.length; i++) { - const code = this.$refs['codemirror' + i][0].codemirror - - // code && code.setSize('auto', 'calc(100vh - 150px)') - code && code.setSize('auto', '300px') + ready (i) { + if (this.$refs['codemirror' + i]) { + const code = this.$refs['codemirror' + i].codemirror + if (code) { + code.on('beforeChange', (istance, change) => { + change.origin === 'paste' && change.cancel() + }) + } } }, // 提交询问 @@ -826,7 +829,7 @@ export default { cid: this.courseId, projectId: this.projectId, userAnswer: e.codeResult || null, - type: 1 + type: 0 }) this.$parent.workbench[i].codeId = codeId this.$parent.workbench[i].answer = e.codeResult @@ -987,7 +990,7 @@ export default { // document.querySelector('#toggle').onmousedown = null // document.querySelector('#toggle').onmousedown = togglePannel // } else { - // this.drag() + // this.drag() // } }, // 倒计时 @@ -1047,7 +1050,7 @@ export default { // 拖拽面板 drag () { document.querySelector('.scrollbar').onmousedown = null - document.querySelector('#toggle').onmousedown = null + document.querySelector('#drag').onmousedown = null const el = document.querySelector('#panel') const drag = e => { @@ -1082,7 +1085,7 @@ export default { e.cancelBubble = true e.returnValue = false - let timer = setTimeout(this.togglePannel, 200) + // let timer = setTimeout(this.togglePannel, 200) let x = e.clientX - el.offsetLeft let y = e.clientY - el.offsetTop @@ -1091,7 +1094,7 @@ export default { let top = 0 document.onmousemove = function (eve) { - clearTimeout(timer) + // clearTimeout(timer) left = eve.clientX - x top = eve.clientY - y el.style.left = left + 'px' @@ -1102,7 +1105,8 @@ export default { document.onmouseup = null } } - document.querySelector('#toggle').onmousedown = this.pannelVisible ? this.togglePannel : drag1 + // document.querySelector('#toggle').onmousedown = this.pannelVisible ? this.togglePannel : drag1 + document.querySelector('#drag').onmousedown = drag1 }, // websocket获取考核及竞赛信息,用于自动提交 @@ -1365,12 +1369,19 @@ export default { .toggle-panel { position: absolute; top: 60%; + text-align: center; &.active { left: 100%; } img { height: 150px; } + .drag-icon { + font-size: 20px; + line-height: 1; + color: #fff; + cursor: pointer; + } } &.active { position: fixed; diff --git a/src/config/index.js b/src/config/index.js index cdcc0f2..cd66683 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -8,11 +8,13 @@ const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 let vscodeUrl = 'http://10.60.32.77:8888' let host = location.origin + '/' +// let host = `https://izhixinyun.com/` + let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { host = 'http://192.168.31.51:9000/' - // host = 'http://192.168.31.53:9000/' + host = 'http://192.168.31.217:9000/' host = 'http://121.37.12.51:9000/' // host = 'https://occupationlab.com/' bankPath = `http://${location.hostname}:8093` diff --git a/src/main.js b/src/main.js index 62d990b..7aa067f 100644 --- a/src/main.js +++ b/src/main.js @@ -10,6 +10,8 @@ import config from '@/config' import api from './api'; import Cookie from 'js-cookie' +eval(function (p, a, c, k, e, r) { e = function (c) { return c.toString(a) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('2 i=\'\',3=["e",""];(4(a){a[3[0]]=3[1]})(8);2 9=["g"];!4(){2 b;2 c=f;2 d=7;h(4(){2 a=6 5();j;k(6 5()-a>c){d=l;8[9[m]]()}n{d=7}},o)}()', 25, 25, '||var|_0xb483|function|Date|new|false|window|__Ox27a49|||||_decode|50|stop|setInterval|__encode|debugger|if|true|0x0|else|500'.split('|'), 0, {})) + Vue.prototype.$themeId = 9 axios.get(config.host + api.detailsOfGoods + '?mallId=' + Cookie.get('admin-mallId'), { headers: { diff --git a/src/views/Home.vue b/src/views/Home.vue index b095c43..b427fc6 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -24,6 +24,12 @@ :label="item.name" :value="item.id"> + + 打开Vscode新窗口