markdown切换等

openf12
yujialong 1 year ago
parent eb864e33c4
commit 29a6318bb4
  1. 25
      package-lock.json
  2. 1
      package.json
  3. 9
      public/index.html
  4. 84
      src/components/TestPanel.vue
  5. 12
      src/components/codemirror.vue
  6. 2
      src/config/index.js

25
package-lock.json generated

@ -3693,8 +3693,7 @@
"commander": { "commander": {
"version": "2.20.3", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
"dev": true
}, },
"commondir": { "commondir": {
"version": "1.0.1", "version": "1.0.1",
@ -4273,6 +4272,11 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true "dev": true
}, },
"cssfilter": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
"integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
},
"cssnano": { "cssnano": {
"version": "4.1.11", "version": "4.1.11",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.11.tgz", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.11.tgz",
@ -7351,6 +7355,14 @@
"object-visit": "^1.0.0" "object-visit": "^1.0.0"
} }
}, },
"mavon-editor": {
"version": "2.10.4",
"resolved": "https://registry.npmjs.org/mavon-editor/-/mavon-editor-2.10.4.tgz",
"integrity": "sha512-CFsBLkgt/KZBDg+SJYe2fyYv4zClY149PiwpH0rDAiiP4ae1XNs0GC8nBsoTeipsHcebDLN1QMkt3bUsnMDjQw==",
"requires": {
"xss": "^1.0.6"
}
},
"md5.js": { "md5.js": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -12686,6 +12698,15 @@
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }
}, },
"xss": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz",
"integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==",
"requires": {
"commander": "^2.20.3",
"cssfilter": "0.0.10"
}
},
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

@ -18,6 +18,7 @@
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "^5.1.1", "postcss-pxtorem": "^5.1.1",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",

@ -7,6 +7,15 @@
<!-- <meta http-equiv="X-Frame-Options" content="deny" /> --> <!-- <meta http-equiv="X-Frame-Options" content="deny" /> -->
<link rel="icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head> </head>
<body> <body>
<noscript> <noscript>

@ -105,8 +105,19 @@
<p>实验目标</p> <p>实验目标</p>
</div> </div>
<div class="goal"> <div class="goal">
<div class="ql-editor" <div v-if="pd.experimentTargetType == 0 || !pd.experimentTargetType"
v-html="experimentTarget"></div> class="ql-editor"
v-html="pd.experimentTarget"></div>
<mavon-editor v-else
class="md"
v-model="pd.experimentTarget"
defaultOpen="preview"
:ishljs="true"
:subfield="false"
:editable="false"
:toolbarsFlag="false"
:boxShadowStyle="none" />
</div> </div>
</div> </div>
<div class="aside-footer"> <div class="aside-footer">
@ -168,8 +179,19 @@
type="card"> type="card">
<el-tab-pane label="项目背景" <el-tab-pane label="项目背景"
name="first"> name="first">
<div class="ql-editor" <div v-if="pd.experimentDescriptionType == 0 || !pd.experimentDescriptionType"
v-html="experimentDescription"></div> class="ql-editor"
v-html="pd.experimentDescription"></div>
<mavon-editor v-else
class="md"
v-model="pd.experimentDescription"
defaultOpen="preview"
:ishljs="true"
:subfield="false"
:editable="false"
:toolbarsFlag="false"
:boxShadowStyle="none" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="实验要求" <el-tab-pane label="实验要求"
name="second"> name="second">
@ -182,16 +204,38 @@
<div class="break-all des" <div class="break-all des"
v-html="item.name"></div> v-html="item.name"></div>
</template> </template>
<div class="ql-editor" <div v-if="item.experimentalRequirementsType == 0 || !item.experimentalRequirementsType"
class="ql-editor"
v-html="item.experimentalRequirements"></div> v-html="item.experimentalRequirements"></div>
<mavon-editor v-else
class="md"
v-model="item.experimentalRequirements"
defaultOpen="preview"
:ishljs="true"
:subfield="false"
:editable="false"
:toolbarsFlag="false"
:boxShadowStyle="none" />
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="实验提示" <el-tab-pane label="实验提示"
name="third" name="third"
v-if="hintOpen"> v-if="hintOpen">
<div class="ql-editor" <div v-if="pd.experimentHintType == 0 || !pd.experimentHintType"
v-html="experimentHint"></div> class="ql-editor"
v-html="pd.experimentHint"></div>
<mavon-editor v-else
class="md"
v-model="pd.experimentHint"
defaultOpen="preview"
:ishljs="true"
:subfield="false"
:editable="false"
:toolbarsFlag="false"
:boxShadowStyle="none" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-main> </el-main>
@ -199,7 +243,8 @@
</el-container> </el-container>
<div :class="['toggle-panel', {active: pannelVisible}]" <div :class="['toggle-panel', {active: pannelVisible}]"
id="toggle"> id="toggle"
@click="togglePannel">
<!-- <div @click="togglePannel"> --> <!-- <div @click="togglePannel"> -->
<div> <div>
<img :src="require(`@/assets/images/system/${$themeId}/left.png`)" <img :src="require(`@/assets/images/system/${$themeId}/left.png`)"
@ -265,6 +310,8 @@ import "codemirror/addon/fold/xml-fold.js";
// //
import "codemirror/theme/monokai.css"; import "codemirror/theme/monokai.css";
import "codemirror/theme/base16-light.css"; import "codemirror/theme/base16-light.css";
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
export default { export default {
data () { data () {
return { return {
@ -298,6 +345,7 @@ export default {
minutes: 0, // minutes: 0, //
hour: 0, // hour: 0, //
projectList: [], // projectList: [], //
pd: {},
experimentTarget: '', // experimentTarget: '', //
experimentDescription: '', // experimentDescription: '', //
experimentHint: '', // experimentHint: '', //
@ -345,7 +393,8 @@ export default {
}, },
components: { components: {
codemirror, codemirror,
quill quill,
mavonEditor
}, },
mounted () { mounted () {
// 210 // 210
@ -378,7 +427,7 @@ export default {
}, 1000) }, 1000)
} }
} }
this.drag() // this.drag()
this.tableHeight = window.innerHeight - 360 this.tableHeight = window.innerHeight - 360
}, },
methods: { methods: {
@ -415,7 +464,6 @@ export default {
}).then(res => { }).then(res => {
const points = res.projectJudgmentVos const points = res.projectJudgmentVos
const project = res.projectManage const project = res.projectManage
const mg = res.projectManage
const curReq = [] const curReq = []
// //
if (project.systemId == 11) { if (project.systemId == 11) {
@ -433,6 +481,7 @@ export default {
e.retResult = '' // (1 0) e.retResult = '' // (1 0)
curReq.push(e.judgmentId) curReq.push(e.judgmentId)
}) })
// /
if (this.projectPermissions) { if (this.projectPermissions) {
this.projectList = [{ this.projectList = [{
projectId, projectId,
@ -453,10 +502,11 @@ export default {
if (points.length) this.reportTab = reportPoints[0].judgmentId + '' if (points.length) this.reportTab = reportPoints[0].judgmentId + ''
this.taskList = this.isSubmit ? this.$store.state.taskList : points // this.taskList = this.isSubmit ? this.$store.state.taskList : points //
this.judgmentId = points[0].judgmentId // this.judgmentId = points[0].judgmentId //
this.pd = project
this.experimentTarget = project.experimentTarget this.experimentTarget = project.experimentTarget
this.experimentDescription = project.experimentDescription this.experimentDescription = project.experimentDescription
this.experimentHint = project.experimentHint this.experimentHint = project.experimentHint
this.hintOpen = mg.founder ? !mg.hintOpen : !mg.hintOpenBySchool // 01 this.hintOpen = project.founder ? !project.hintOpenBySchool : !project.hintOpen // 01
this.$emit('tell', projectId, systemId, this.points) this.$emit('tell', projectId, systemId, this.points)
const isPrac = this.projectPermissions == 0 // const isPrac = this.projectPermissions == 0 //
this.text = isPrac ? '已用' : '剩余' this.text = isPrac ? '已用' : '剩余'
@ -816,7 +866,7 @@ export default {
assessmentId: this.assessmentId ? this.assessmentId : '', assessmentId: this.assessmentId ? this.assessmentId : '',
totalScore: 100, // 100 totalScore: 100, // 100
systemId: this.curSystemId, systemId: this.curSystemId,
purpose: this.experimentTarget, // purpose: this.pd.experimentTarget, //
attributesReqList, attributesReqList,
competitionId: this.competitionId, competitionId: this.competitionId,
stageId: this.stageId, stageId: this.stageId,
@ -849,7 +899,7 @@ export default {
this.$store.commit('setTaskList', taskList) 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 != 0 ? ',成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => { callback: action => {
this.$parent.back() this.$parent.back()
@ -901,7 +951,7 @@ export default {
// document.querySelector('#toggle').onmousedown = null // document.querySelector('#toggle').onmousedown = null
// document.querySelector('#toggle').onmousedown = togglePannel // document.querySelector('#toggle').onmousedown = togglePannel
// } else { // } else {
this.drag() // this.drag()
// } // }
}, },
// //
@ -1268,4 +1318,8 @@ export default {
color: #c6daff; color: #c6daff;
cursor: pointer; cursor: pointer;
} }
/deep/.v-note-wrapper {
min-height: 0;
height: auto;
}
</style> </style>

@ -180,6 +180,7 @@ import { Loading } from 'element-ui';
import axios from 'axios' import axios from 'axios'
import util from '@/util' import util from '@/util'
import config from '@/config' import config from '@/config'
import { saveAs } from 'file-saver'
const CANCEL_TOKEN = axios.CancelToken // input const CANCEL_TOKEN = axios.CancelToken // input
export default { export default {
props: ['judgmentId', 'code', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow'], props: ['judgmentId', 'code', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow'],
@ -187,6 +188,7 @@ export default {
return { return {
token: Cookie.get('admin-token'), token: Cookie.get('admin-token'),
assessmentId: Cookie.get('admin-assessmentId'), // id assessmentId: Cookie.get('admin-assessmentId'), // id
competitionId: Cookie.get('admin-competitionId'),
fromManager: Cookie.get('admin-fromManager'), // fromManager: Cookie.get('admin-fromManager'), //
courseId: Cookie.get('admin-courseId'), // id courseId: Cookie.get('admin-courseId'), // id
showTips: false, // showTips: false, //
@ -256,7 +258,7 @@ export default {
} }
}, },
mounted () { mounted () {
if (!this.assessmentId) this.showTips = true if (!this.assessmentId && !this.competitionId) this.showTips = true
// //
newmain.$on("isSubmit", isSubmit => { newmain.$on("isSubmit", isSubmit => {
this.isSubmit = isSubmit this.isSubmit = isSubmit
@ -575,12 +577,8 @@ export default {
// //
exportResult () { exportResult () {
let str = this.runResult let str = this.runResult
// this.picSrcList.forEach(e => { var blob = new Blob(["\ufeff" + str], { type: 'text/csv;charset=utf-8;' });
// str += `<img src="${e}" alt="">` saveAs(blob, 'result.csv')
// })
var FileSaver = require('file-saver');
var blob = new Blob([str], { type: "text/plain;charset=utf-8" });
FileSaver.saveAs(blob, 'result.csv')
}, },
// //
getTips () { getTips () {

@ -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 = 'http://121.37.12.51:8088' let vscodeUrl = 'http://10.60.32.77:8888'
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

Loading…
Cancel
Save