yujialong 4 months ago
parent 891c9b19a1
commit 8203f8578a
  1. 15
      public/index.html
  2. 2
      public/static/ueditor/themes/default/css/ueditor.css
  3. 67
      public/static/ueditor/themes/iframe.css
  4. 2
      public/static/ueditor/ueditor.all.js
  5. 75
      public/static/ueditor/ueditor.config.js
  6. 19
      src/components/ueditor/index.vue
  7. 26
      src/pages/ques/detail/index.vue
  8. 6
      src/pages/testPaper/detail/index.vue
  9. 2
      src/pages/testPaper/list/index.vue
  10. 6
      src/pages/testPaperLibrary/index.vue

@ -13,15 +13,16 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- <script src='./static/ueditor/ueditor.config.js?v=3'></script> <script src='./static/ueditor/ueditor.config.js?v=3'></script>
<script src='./static/ueditor/ueditor.all.js?v=3'></script> <script src='./static/ueditor/ueditor.all.js?v=3'></script>
<script src='./static/ueditor/lang/zh-cn/zh-cn.js'></script> --> <script src='./static/ueditor/lang/zh-cn/zh-cn.js'></script>
<script src='./static/dist/ueditor.config.js?v=3'></script> <!-- <script src='./static/ueditorPlus/ueditor.config.js?v=3'></script>
<script src='./static/dist/ueditor.all.js?v=3'></script> <script src='./static/ueditorPlus/ueditor.all.js?v=3'></script>
<script src='./static/ueditorPlus/lang/zh-cn/zh-cn.js'></script> -->
<!-- <script src='./static/ueditor1/kityformula-plugin/addKityFormulaDialog.js'></script> <script src='./static/ueditor/kityformula-plugin/addKityFormulaDialog.js'></script>
<script src='./static/ueditor1/kityformula-plugin/getKfContent.js'></script> <script src='./static/ueditor/kityformula-plugin/getKfContent.js'></script>
<script src='./static/ueditor1/kityformula-plugin/defaultFilterFix.js'></script> --> <script src='./static/ueditor/kityformula-plugin/defaultFilterFix.js'></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

@ -1 +1,66 @@
.gapfilling-span{color:red;padding:0 30px;margin:0 5px;border-bottom:3px double red} body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-size: 14px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
color: #09f;
text-decoration: none;
}
a:hover,
a:focus {
color: #09f;
text-decoration: none;
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 18px;
border-left: 5px solid #EEE;
}
img + br {
display: block;
padding: 4px 0;
content: ' ';
}
body p {
margin-bottom: 1em;
}
iframe {
border: none;
}
img {
max-width: 100%;
}
img[data-word-image] {
cursor: pointer;
}
pre {
margin: .5em 0;
padding: .4em .6em;
border-radius: 8px;
background: #f8f8f8;
line-height: 1.5;
}
/*交互操作*/
img {
cursor: pointer;
}
.edui-quick-operate-active {
background: #E6ECFF;
}
.gapfilling-span{color:#919191;margin:0 5px;}

File diff suppressed because one or more lines are too long

@ -1,78 +1,5 @@
!function () { !function () {
window.UEDITOR_HOME_URL = "./static/ueditor/"; var s = window.UEDITOR_HOME_URL || l(); function l (s, l) { return function (s, l) { var t = l; /^(\/|\\\\)/.test(l) ? t = /^.+?\w(\/|\\\\)/.exec(s)[0] + l.replace(/^(\/|\\\\)/, "") : /^[a-z]+:/i.test(l) || (s = s.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ""), t = s + "" + l); return function (s) { var l = /^[a-z]+:\/\//.exec(s)[0], t = null, e = []; (s = (s = s.replace(l, "").split("?")[0].split("#")[0]).replace(/\\/g, "/").split(/\//))[s.length - 1] = ""; for (; s.length;)".." === (t = s.shift()) ? e.pop() : "." !== t && e.push(t); return l + e.join("/") }(t) }(s || self.document.URL || self.location.href, l || (t = document.getElementsByTagName("script"))[t.length - 1].src); var t } window.UEDITOR_CONFIG = { window.UEDITOR_HOME_URL = "./static/ueditor/"; var s = window.UEDITOR_HOME_URL || l(); function l (s, l) { return function (s, l) { var t = l; /^(\/|\\\\)/.test(l) ? t = /^.+?\w(\/|\\\\)/.exec(s)[0] + l.replace(/^(\/|\\\\)/, "") : /^[a-z]+:/i.test(l) || (s = s.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ""), t = s + "" + l); return function (s) { var l = /^[a-z]+:\/\//.exec(s)[0], t = null, e = []; (s = (s = s.replace(l, "").split("?")[0].split("#")[0]).replace(/\\/g, "/").split(/\//))[s.length - 1] = ""; for (; s.length;)".." === (t = s.shift()) ? e.pop() : "." !== t && e.push(t); return l + e.join("/") }(t) }(s || self.document.URL || self.location.href, l || (t = document.getElementsByTagName("script"))[t.length - 1].src); var t } window.UEDITOR_CONFIG = {
UEDITOR_HOME_URL: s, serverHeaders: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' }, serverUrl: "http://192.168.31.51:9000/exam/exam/upload/configAndUpload", toolbars: [[ UEDITOR_HOME_URL: s, serverHeaders: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS' }, serverUrl: "http://192.168.31.51:9000/exam/exam/upload/configAndUpload", toolbars: [["fullscreen", "source", "|", "bold", "italic", "underline", "forecolor", "fontfamily", "fontsize", "|", "justifyleft", "justifycenter", "justifyright", "justifyjustify", "|", "insertimage", "inserttable", "gapfilling"]], labelMap: { anchor: "", undo: "" }, enableAutoSave: !1, saveInterval: 0, elementPathEnabled: !1, wordCount: !1, maximumWords: 1e5, xssFilterRules: !0, inputXssFilter: !0, outputXssFilter: !0, whitList: { a: ["target", "href", "title", "class", "style"], abbr: ["title", "class", "style"], address: ["class", "style"], area: ["shape", "coords", "href", "alt"], article: [], aside: [], audio: ["autoplay", "controls", "loop", "preload", "src", "class", "style"], b: ["class", "style"], bdi: ["dir"], bdo: ["dir"], big: [], blockquote: ["cite", "class", "style"], br: [], caption: ["class", "style"], center: [], cite: [], code: ["class", "style"], col: ["align", "valign", "span", "width", "class", "style"], colgroup: ["align", "valign", "span", "width", "class", "style"], dd: ["class", "style"], del: ["datetime"], details: ["open"], div: ["class", "style"], dl: ["class", "style"], dt: ["class", "style"], em: ["class", "style"], font: ["color", "size", "face"], footer: [], h1: ["class", "style"], h2: ["class", "style"], h3: ["class", "style"], h4: ["class", "style"], h5: ["class", "style"], h6: ["class", "style"], header: [], hr: [], i: ["class", "style"], img: ["src", "alt", "title", "width", "height", "id", "_src", "loadingclass", "class", "data-latex"], ins: ["datetime"], li: ["class", "style"], mark: [], nav: [], ol: ["class", "style"], p: ["class", "style"], pre: ["class", "style"], s: [], section: [], small: [], span: ["class", "style"], sub: ["class", "style"], sup: ["class", "style"], strong: ["class", "style"], table: ["width", "border", "align", "valign", "class", "style"], tbody: ["align", "valign", "class", "style"], td: ["width", "rowspan", "colspan", "align", "valign", "class", "style"], tfoot: ["align", "valign", "class", "style"], th: ["width", "rowspan", "colspan", "align", "valign", "class", "style"], thead: ["align", "valign", "class", "style"], tr: ["rowspan", "align", "valign", "class", "style"], tt: [], u: [], ul: ["class", "style"], video: ["autoplay", "controls", "loop", "preload", "src", "height", "width", "class", "style"], initialFrameHeight: 400, zIndex: 3000, }
"fullscreen",
"source",
"|",
"undo",
"redo",
"|",
"bold",
"italic",
"underline",
"fontborder",
"strikethrough",
"superscript",
"subscript",
"removeformat",
"formatmatch",
"autotypeset",
"blockquote",
"pasteplain",
"|",
"forecolor",
"backcolor",
"insertorderedlist",
"insertunorderedlist",
"selectall",
"cleardoc",
"|",
"rowspacingtop",
"rowspacingbottom",
"lineheight",
"|",
"customstyle",
"paragraph",
"fontfamily",
"fontsize",
"|",
"directionalityltr",
"directionalityrtl",
"indent",
"|",
"justifyleft",
"justifycenter",
"justifyright",
"justifyjustify",
"|",
"touppercase",
"tolowercase",
"|",
"link",
"unlink",
"anchor",
"|",
"imagenone",
"imageleft",
"imageright",
"imagecenter",
"|",
"insertimage",
"emotion",
"scrawl",
"insertvideo",
"music",
"attachment",
"map",
"gmap",
"insertframe",
"insertcode",
"webapp",
"pagebreak",
"template",
"background",
"|",
"gapfilling",
]], labelMap: { anchor: "", undo: "" }, enableAutoSave: !1, saveInterval: 0, elementPathEnabled: !1, wordCount: !1, maximumWords: 1e5, xssFilterRules: !0, inputXssFilter: !0, outputXssFilter: !0, whitList: { a: ["target", "href", "title", "class", "style"], abbr: ["title", "class", "style"], address: ["class", "style"], area: ["shape", "coords", "href", "alt"], article: [], aside: [], audio: ["autoplay", "controls", "loop", "preload", "src", "class", "style"], b: ["class", "style"], bdi: ["dir"], bdo: ["dir"], big: [], blockquote: ["cite", "class", "style"], br: [], caption: ["class", "style"], center: [], cite: [], code: ["class", "style"], col: ["align", "valign", "span", "width", "class", "style"], colgroup: ["align", "valign", "span", "width", "class", "style"], dd: ["class", "style"], del: ["datetime"], details: ["open"], div: ["class", "style"], dl: ["class", "style"], dt: ["class", "style"], em: ["class", "style"], font: ["color", "size", "face"], footer: [], h1: ["class", "style"], h2: ["class", "style"], h3: ["class", "style"], h4: ["class", "style"], h5: ["class", "style"], h6: ["class", "style"], header: [], hr: [], i: ["class", "style"], img: ["src", "alt", "title", "width", "height", "id", "_src", "loadingclass", "class", "data-latex"], ins: ["datetime"], li: ["class", "style"], mark: [], nav: [], ol: ["class", "style"], p: ["class", "style"], pre: ["class", "style"], s: [], section: [], small: [], span: ["class", "style"], sub: ["class", "style"], sup: ["class", "style"], strong: ["class", "style"], table: ["width", "border", "align", "valign", "class", "style"], tbody: ["align", "valign", "class", "style"], td: ["width", "rowspan", "colspan", "align", "valign", "class", "style"], tfoot: ["align", "valign", "class", "style"], th: ["width", "rowspan", "colspan", "align", "valign", "class", "style"], thead: ["align", "valign", "class", "style"], tr: ["rowspan", "align", "valign", "class", "style"], tt: [], u: [], ul: ["class", "style"], video: ["autoplay", "controls", "loop", "preload", "src", "height", "width", "class", "style"], initialFrameHeight: 400, zIndex: 100, }
}, window.UE = { getUEBasePath: l } }, window.UE = { getUEBasePath: l }
}(); }();

@ -1,10 +1,12 @@
<template> <template>
<div> <div>
<!-- <vue-ueditor-wrap :id="randomId" v-model="content" :editor-id="randomId" style="height: 200px;" /> -->
<script :id="randomId" type="text/plain" style="height: 200px;"></script> <script :id="randomId" type="text/plain" style="height: 200px;"></script>
</div> </div>
</template> </template>
<script> <script>
import VueUeditorWrap from 'vue-ueditor-wrap'
export default { export default {
name: 'UE', name: 'UE',
@ -15,6 +17,9 @@ export default {
} }
} }
}, },
components: {
VueUeditorWrap
},
data () { data () {
return { return {
randomId: 'editor_' + Math.random() * 100000000000000000, randomId: 'editor_' + Math.random() * 100000000000000000,
@ -25,6 +30,7 @@ export default {
}, },
watch: { watch: {
value: function (val, oldVal) { value: function (val, oldVal) {
console.log("🚀 ~ val:", val)
if (val != null && this.ready) { if (val != null && this.ready) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
this.instance = UE.getEditor(this.randomId) this.instance = UE.getEditor(this.randomId)
@ -49,9 +55,20 @@ export default {
this.instance.addListener('ready', () => { this.instance.addListener('ready', () => {
this.ready = true this.ready = true
this.$emit('ready', this.instance) this.$emit('ready', this.instance)
// this.instance.on('contentchange', function () {
// console.log('contentchange', this.instance.getContent());
// })
this.instance.addListener('contentchange', this.onContentChange)
console.log("🚀 ~ this.instance.addListener ~ ready:", this.instance.addListener, this.onContentChange)
}) })
}) })
}, },
onContentChange () {
// Vue
console.log(333)
},
getUEContent () { getUEContent () {
return this.instance.getContent() return this.instance.getContent()
}, },
@ -63,7 +80,7 @@ export default {
} }
} }
</script> </script>
<style> <style lang="scss">
.edui-default { .edui-default {
line-height: normal; line-height: normal;
} }

@ -1,7 +1,8 @@
<template> <template>
<div> <div>
<el-dialog :title="(detailType ? detailTypes[detailType] : '新增') + '试题'" :visible.sync="quesVisible" width="1000px" <el-dialog :title="(detailType ? detailTypes[detailType] : '新增') + '试题'" :visible.sync="quesVisible"
:close-on-click-modal="false" @closed="closeDia"> :modal-append-to-body="false" width="1000px" :close-on-click-modal="false" custom-class="ques-dia"
@closed="closeDia">
<el-form :model="form" :rules="rules" ref="form" label-width="110px" :disabled="detailType === 2"> <el-form :model="form" :rules="rules" ref="form" label-width="110px" :disabled="detailType === 2">
<el-form-item label="题库分类"> <el-form-item label="题库分类">
<el-input v-model="questionBankCategory" disabled /> <el-input v-model="questionBankCategory" disabled />
@ -34,6 +35,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item class="is-required" prop="stem" label="题干"> <el-form-item class="is-required" prop="stem" label="题干">
{{ form.stem }}
<Ueditor ref="stem" @ready="stemReady" v-model="form.stem" /> <Ueditor ref="stem" @ready="stemReady" v-model="form.stem" />
<Upload v-if="form.questionType === 'essay'" class="m-t-10" <Upload v-if="form.questionType === 'essay'" class="m-t-10"
@ -53,9 +55,7 @@
<div class="opts"> <div class="opts">
<div v-for="(item, i) in form.questionAnswerVersions" :key="i" class="line"> <div v-for="(item, i) in form.questionAnswerVersions" :key="i" class="line">
<el-checkbox v-if="form.questionType === 'multiple_choice'" class="correct-check" <el-checkbox v-if="form.questionType === 'multiple_choice'" class="correct-check"
v-model="item.answerIsCorrect" :true-label="1">选项{{ v-model="item.answerIsCorrect" :true-label="1">选项{{ numToLetter(i) }}</el-checkbox>
numToLetter(i)
}}</el-checkbox>
<el-radio v-else v-model="item.answerIsCorrect" :true-label="1" :label="1" @change="correctChange(i)">选项{{ <el-radio v-else v-model="item.answerIsCorrect" :true-label="1" :label="1" @change="correctChange(i)">选项{{
numToLetter(i) numToLetter(i)
}}</el-radio> }}</el-radio>
@ -422,6 +422,17 @@ export default {
}, },
// //
stemReady (editor) { stemReady (editor) {
// editor.on('blur', () => {
// console.log(11, editor.getContent())
// })
// editor.addListener('contentChange', () => {
// console.log(22, editor)
// })
// editor.on('change', () => {
// console.log(22, editor.getContent())
// })
this.form.stem && editor.setContent(this.form.stem) this.form.stem && editor.setContent(this.form.stem)
}, },
// //
@ -456,7 +467,6 @@ export default {
editorReady (instance) { editorReady (instance) {
console.log("🚀 ~ editorReady ~ instance:", instance) console.log("🚀 ~ editorReady ~ instance:", instance)
// this.richEditor.instance = instance // this.richEditor.instance = instance
// let currentContent = this.richEditor.object[this.richEditor.parameterName] // let currentContent = this.richEditor.object[this.richEditor.parameterName]
// this.richEditor.instance.setContent(currentContent) // this.richEditor.instance.setContent(currentContent)
@ -640,4 +650,8 @@ export default {
/deep/.correct-check { /deep/.correct-check {
margin-right: 15px; margin-right: 15px;
} }
/deep/.ques-dia {
z-index: 500;
}
</style> </style>

@ -44,7 +44,9 @@
</el-form-item> </el-form-item>
</div> </div>
<el-form-item prop="remarks" label="试卷说明"> <el-form-item prop="remarks" label="试卷说明">
<Ueditor ref="remarks" @ready="remarksReady" /> <!-- <Ueditor ref="remarks" @ready="remarksReady" /> -->
<Ueditor ref="remarks" :initial-content="form.remarks" />
re:{{ form.remarks }}
</el-form-item> </el-form-item>
<div class="line"></div> <div class="line"></div>
@ -169,7 +171,7 @@
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import Ueditor from '@/components/ueditor' import Ueditor from '@/components/u'
import Breadcrumb from '@/components/breadcrumb' import Breadcrumb from '@/components/breadcrumb'
import Template from './template' import Template from './template'
import Manual from './manual' import Manual from './manual'

@ -119,7 +119,7 @@
<el-table-column prop="name" label="试卷名称" align="center" min-width="100"></el-table-column> <el-table-column prop="name" label="试卷名称" align="center" min-width="100"></el-table-column>
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column> <el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column> <el-table-column prop="score" label="总分" align="center" width="60"></el-table-column>
<el-table-column prop="name" label="中分位数" align="center" width="70"></el-table-column> <el-table-column prop="medianScore" label="中分位数" align="center" width="70"></el-table-column>
<el-table-column prop="name" label="题型" align="center" min-width="90"> <el-table-column prop="name" label="题型" align="center" min-width="90">
</el-table-column> </el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom"> <el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom">

@ -26,7 +26,7 @@
<div class="right"> <div class="right">
<h6 class="page-name">筛选</h6> <h6 class="page-name">筛选</h6>
<UeditorPlus /> <!-- <UeditorPlus /> -->
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
@ -104,10 +104,10 @@
<script> <script>
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import UeditorPlus from '@/components/ueditorPlus' // import UeditorPlus from '@/components/ueditorPlus'
import _ from 'lodash' import _ from 'lodash'
export default { export default {
components: { UeditorPlus }, // components: { UeditorPlus },
data () { data () {
return { return {
loading: false, loading: false,

Loading…
Cancel
Save