生成图片等修复

dev_2022-04-07
yujialong 3 years ago
parent c9c23290c0
commit 1ba8bfdb98
  1. 3
      src/components/TestPanel.vue
  2. 10
      src/components/codemirror.vue
  3. 20
      vue.config.js

@ -301,6 +301,7 @@ export default {
const projectId = Number(pId || this.projectId) const projectId = Number(pId || this.projectId)
const cid = this.courseId const cid = this.courseId
const assessmentId = this.assessmentId const assessmentId = this.assessmentId
const list = this.projectList
let points = [] let points = []
if (pId && cache.judgmentIdList) { if (pId && cache.judgmentIdList) {
cache.judgmentIdList.map(e => { cache.judgmentIdList.map(e => {
@ -313,7 +314,7 @@ export default {
points = JSON.parse(JSON.stringify(this.points)) points = JSON.parse(JSON.stringify(this.points))
} }
// //
if (cache && cache.empty) { if (cache && cache.empty && list.find(e => e.projectId === projectId)) {
this.projectId = projectId this.projectId = projectId
this.closeLoad() this.closeLoad()
localStorage.removeItem('codeCache') localStorage.removeItem('codeCache')

@ -29,7 +29,7 @@
</div> </div>
</div> </div>
<div class="code-right answer"> <div class="code-right answer">
<p class="text-wrapper">{{ runResult }}</p> <p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p>
<div class="pic-wrap" v-if="picSrcList.length"> <div class="pic-wrap" v-if="picSrcList.length">
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i"> <div class="pic-item" v-for="(img, i) in picSrcList" :key="i">
<el-image <el-image
@ -608,9 +608,15 @@ export default {
margin: 10px; margin: 10px;
position: absolute; position: absolute;
width: calc(100% - 14px); width: calc(100% - 14px);
height: calc(100vh - 247px); height: calc(100vh - 340px);
overflow: auto; overflow: auto;
} }
.pic-num0 {
height: calc(100vh - 247px);
}
.pic-num1 {
height: calc(100vh - 520px);
}
} }
.pic-wrap { .pic-wrap {
position: absolute; position: absolute;

@ -1,25 +1,5 @@
// 引入等比适配插件
const px2rem = require('postcss-px2rem')
// 配置基本大小
const postcss = px2rem({
// 基准大小 baseSize,需要和rem.js中相同
remUnit: 16
})
// 使用等比适配插件
module.exports = { module.exports = {
lintOnSave: true, lintOnSave: true,
css: {
loaderOptions: {
postcss: {
plugins: [
postcss
]
}
}
},
publicPath: './', publicPath: './',
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'static' assetsDir: 'static'

Loading…
Cancel
Save