mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
试题图片
This commit is contained in:
@@ -26,15 +26,8 @@
|
||||
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
|
||||
<el-button type="primary" @click="addQuestion(1)" style="margin-left: 10px" icon="el-icon-plus"> 添加 </el-button>
|
||||
<div style="display: inline-block;margin-left: 10px;">
|
||||
<file-upload
|
||||
dir="files"
|
||||
text="导入"
|
||||
:loading="true"
|
||||
size="medium"
|
||||
url="/xboe/m/exam/question/import"
|
||||
:isShowTip="false"
|
||||
@success="uploadFile"
|
||||
@remove="removeFile" >
|
||||
<file-upload dir="files" text="导入" :loading="true" size="medium" url="/xboe/m/exam/question/import"
|
||||
:isShowTip="false" @success="uploadFile" @remove="removeFile" >
|
||||
</file-upload>
|
||||
</div>
|
||||
</div>
|
||||
@@ -84,7 +77,7 @@
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-main>
|
||||
<el-dialog :title="isAdd ? '新建试题' : '编辑试题'" :visible.sync="addQuestionDialog" width="700px">
|
||||
<el-dialog :title="isAdd ? '新建试题' : '编辑试题'" :visible.sync="addQuestionDialog" width="750px" top="10vh">
|
||||
<div >
|
||||
<span style="font-weight: 700; font-size: 14px; margin-left: 42px; margin-right: 10px;">类型</span>
|
||||
<el-radio-group v-model="question.type" :disabled="question.id != null">
|
||||
@@ -157,17 +150,22 @@
|
||||
<el-button type="text" @click="addOption">添加选项</el-button>
|
||||
</center>
|
||||
<el-form-item label="难度">
|
||||
<el-select v-model="question.difficulty" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in difficultyOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="默认分" prop="defaultScore">
|
||||
<el-input type="number" v-model="question.defaultScore" placeholder="请输入默认分"></el-input>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="question.difficulty" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in difficultyOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认分" prop="defaultScore">
|
||||
<el-input type="number" v-model="question.defaultScore" placeholder="请输入默认分"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="解析">
|
||||
<el-input v-model="question.analysis" placeholder="请输入解析" type="textarea" maxlength="200" show-word-limit :rows="3"></el-input>
|
||||
</el-form-item>
|
||||
@@ -248,18 +246,27 @@
|
||||
<div v-if="question.type == 1">
|
||||
<div>【单选题】{{question.title}}({{question.defaultScore}}分)</div>
|
||||
<div v-for="(item, i) in question.optionList" :key="i">
|
||||
<el-radio disabled :value="item.isAnswer" :label="true" style="margin-right: 0px;"> </el-radio>
|
||||
<span>{{numberToLetter(i + 1)}}:</span>
|
||||
<span>{{question.optionList[i].content}}</span>
|
||||
<div>
|
||||
<span style="width: 20px;color:green;display: inline-block;">{{item.isAnswer? '√':''}} </span>
|
||||
<span>{{numberToLetter(i + 1)}}:</span>
|
||||
<span>{{item.content}}</span>
|
||||
</div>
|
||||
<div v-if="item.images" style="padding-left: 50px;">
|
||||
<span ><el-image :src="imageBaseUrl+item.images" style="width: 60px;height: 50px;"></el-image> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="question.type == 2">
|
||||
<div>【多选题】{{question.title}}({{question.defaultScore}}分)</div>
|
||||
<div v-for="(item, i) in question.optionList" :key="i">
|
||||
<el-checkbox v-if="item.isAnswer == true" :value="true" disabled> </el-checkbox>
|
||||
<el-checkbox v-else disabled > </el-checkbox>
|
||||
<span>{{numberToLetter(i + 1)}}:</span>
|
||||
<span>{{item.content}}</span>
|
||||
<div>
|
||||
<span style="width: 20px;color:green;display: inline-block;">{{item.isAnswer? '√':''}} </span>
|
||||
<span>{{numberToLetter(i + 1)}}:</span>
|
||||
<span>{{item.content}}</span>
|
||||
</div>
|
||||
<div v-if="item.images" style="padding-left: 50px;">
|
||||
<span ><el-image :src="imageBaseUrl+item.images" style="width: 60px;height: 50px;"></el-image> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="question.type == 3">
|
||||
@@ -394,7 +401,7 @@ export default {
|
||||
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
return this.$confirm(`您确定移除图片吗?`);
|
||||
},
|
||||
downloadTemplate(){
|
||||
let fileName = "试题导入模板.xls";
|
||||
@@ -619,7 +626,7 @@ export default {
|
||||
}else{
|
||||
opt.imgList=[];
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}).catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user