From c9180bba81b105f1932d45223de440f8dd5e3cd0 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期一, 08 七月 2024 17:50:36 +0800 Subject: [PATCH] 阅卷、成绩显示富文本内容 --- public/admin/components/ueditor/ueditor.config.js | 2 +- src/views/exam/exam/components/MarkPaperShow.vue | 9 +++++++-- src/views/answer/components/QuestionAnswerShow.vue | 9 +++++++-- src/views/exam/paper/edit.vue | 1 + src/views/user/student/edit.vue | 13 +++++-------- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/public/admin/components/ueditor/ueditor.config.js b/public/admin/components/ueditor/ueditor.config.js index 55990ec..13d5312 100644 --- a/public/admin/components/ueditor/ueditor.config.js +++ b/public/admin/components/ueditor/ueditor.config.js @@ -1 +1 @@ -!function(){window.UEDITOR_HOME_URL="./admin/components/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,serverUrl:"/api/admin/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"]}},window.UE={getUEBasePath:l}}(); \ No newline at end of file +!function(){window.UEDITOR_HOME_URL="./admin/components/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,serverUrl:"/api/admin/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"]}},window.UE={getUEBasePath:l}}(); diff --git a/src/views/answer/components/QuestionAnswerShow.vue b/src/views/answer/components/QuestionAnswerShow.vue index 613bdf1..57c92db 100644 --- a/src/views/answer/components/QuestionAnswerShow.vue +++ b/src/views/answer/components/QuestionAnswerShow.vue @@ -51,8 +51,8 @@ <!-- 绠�绛斻�佽绠椼�佸垎鏋� --> <div v-else-if="qType == 5 || qType == 7 || qType == 8"> <div class="q-title" v-html="question.title"/> - <div> - <el-input v-model="question.answer" type="textarea" rows="5" ></el-input> + <div class="rich-text-box"> + <div v-html="question.answer"></div> </div> </div> <div class="question-answer-show-item" style="margin-top: 15px"> @@ -185,4 +185,9 @@ color: #606266 } +.rich-text-box { + border: 1px solid #ccc; /* 娣诲姞杈规 */ + padding: 10px ; /* 娣诲姞鍐呰竟璺濅互鎻愪緵绌洪棿 */ + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); +} </style> diff --git a/src/views/exam/exam/components/MarkPaperShow.vue b/src/views/exam/exam/components/MarkPaperShow.vue index 24474e1..d327327 100644 --- a/src/views/exam/exam/components/MarkPaperShow.vue +++ b/src/views/exam/exam/components/MarkPaperShow.vue @@ -51,8 +51,8 @@ <!-- 绠�绛斻�佽绠椼�佸垎鏋� --> <div v-else-if="qType == 5 || qType == 7 || qType == 8"> <div class="q-title" v-html="question.title"/> - <div> - <el-input v-model="question.answer" type="textarea" rows="5" ></el-input> + <div class="rich-text-box"> + <div v-html="question.answer"></div> </div> </div> <div class="question-answer-show-item" style="margin-top: 15px"> @@ -188,4 +188,9 @@ color: #606266 } +.rich-text-box { + border: 1px solid #ccc; /* 娣诲姞杈规 */ + padding: 10px ; /* 娣诲姞鍐呰竟璺濅互鎻愪緵绌洪棿 */ + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); +} </style> diff --git a/src/views/exam/paper/edit.vue b/src/views/exam/paper/edit.vue index a5c7d8e..0d92b76 100644 --- a/src/views/exam/paper/edit.vue +++ b/src/views/exam/paper/edit.vue @@ -383,6 +383,7 @@ addQuestion (titleItem) { this.currentTitleItem = titleItem this.questionPage.queryParam.questionType = [] + this.questionPage.queryParam.status = 1 if (!titleItem.questionType) { this.$message({ message: '璇峰厛閫夋嫨棰樺瀷', diff --git a/src/views/user/student/edit.vue b/src/views/user/student/edit.vue index 5ed5f1b..71c7118 100644 --- a/src/views/user/student/edit.vue +++ b/src/views/user/student/edit.vue @@ -25,11 +25,11 @@ <el-form-item label="鎵嬫満锛�"> <el-input v-model="form.phone"></el-input> </el-form-item> - <el-form-item label="骞寸骇锛�" prop="userLevel" required> - <el-select v-model="form.userLevel" placeholder="骞寸骇"> - <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> - </el-select> - </el-form-item> +<!-- <el-form-item label="骞寸骇锛�" prop="userLevel" required>--> +<!-- <el-select v-model="form.userLevel" placeholder="骞寸骇">--> +<!-- <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>--> +<!-- </el-select>--> +<!-- </el-form-item>--> <el-form-item label="鐘舵�侊細" required> <el-select v-model="form.status" placeholder="鐘舵��"> <el-option v-for="item in statusEnum" :key="item.key" :value="item.key" :label="item.value"></el-option> @@ -70,9 +70,6 @@ ], realName: [ { required: true, message: '璇疯緭鍏ョ湡瀹炲鍚�', trigger: 'blur' } - ], - userLevel: [ - { required: true, message: '璇烽�夋嫨骞寸骇', trigger: 'change' } ] } } -- Gitblit v1.8.0