Commit 13f20635 authored by 黄奎's avatar 黄奎

配置修改

parent 56604e40
......@@ -44,7 +44,8 @@
'fontsize', //字号
'bold', 'italic', 'underline',
'forecolor',//字体颜色
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'justifyleft', 'justifycenter', 'justifyright',
'self-image','self-attachment','self-video'
//'music'
//'attachment', //附件
// 'source', '|',
......
......@@ -122,3 +122,15 @@ export function queryDifficultyType() {
data: {}
})
}
/**
* 批量添加问题
* @param {JSON参数} data
*/
export function saveQuestionBeatch(data) {
return request({
url: '/Question/SetQuestionBeatch',
method: 'post',
data
})
}
......@@ -123,12 +123,10 @@
const _this = this;
//上传附件
if (_this.isShowInsertImage) {
UE.registerUI('appinsertimage', (editor, uiName) => {
UE.registerUI('self-image', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: _this.labelIcon,
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position: -381px 0px;',
onclick() {
_this.ue = editor
_this.uploadType = "1"
......@@ -139,12 +137,10 @@
}
//上传附件
if (_this.isShowAttachment) {
UE.registerUI('Attachment', (editor, uiName) => {
UE.registerUI('self-attachment', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: "附件",
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position: -620px -40px;',
onclick() {
_this.ue = editor
_this.uploadType = "2"
......@@ -155,12 +151,10 @@
}
//是否显示音频
if (_this.isShowVoice) {
UE.registerUI('music', (editor, uiName) => {
UE.registerUI('self-video', (editor, uiName) => {
return new UE.ui.Button({
name: uiName,
title: "音频",
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules: 'background-position:-18px -40px;',
onclick() {
_this.ue = editor
_this.uploadType = "3"
......
......@@ -3,54 +3,59 @@
</style>
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
<q-card style="width: 1400px;max-width:900px;">
<q-card style="width: 1400px;max-width:900px;min-height:100px;">
<q-card-section>
<div class="text-h6">{{importType==1?'模板导入(EXCEL)':'智能导入(WORD)'}}</div>
<div class="text-h6">{{importType==1?'模板导入(EXCEL)':'智能导入(WORD)'}}
<a style="color:blue;cursor:pointer;float:right;margin-right:5px;text-decoration:none;" :href="downLoadUrl"
:download="downLoadName">下载模板文件</a>
</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<table>
<thead>
<tr>
<td>
<el-upload class="upload-demo" action="" :accept="accept" :show-file-list="false"
:http-request="UploadAttachment">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</td>
</tr>
</thead>
<tr>
<td>
<template v-for="(item,index) in questionData">
<div style="margin-bottom:20px;">
<span>{{index+1}}. [{{item.QuestionTypeName}}] {{item.Title}}
<a style="cursor:pointer;color:blue;" @click="EditQuestion(item)">修改</a>&nbsp;
<a style="cursor:pointer;color:red;" @click="DeleteQuestion(index)">删除</a>
</span><br />
<!--选择题-->
<template v-if="item.QuestionTypeKey=='single'||item.QuestionTypeName=='multiple'"
v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--判断题-->
<template v-if="item.QuestionTypeKey=='judge'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--填空题-->
<template v-if="item.QuestionTypeKey=='fill-in'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Content}} </span><br />
</template>
<span>答案:{{item.Answer}} </span><br />
<template v-if="item.AnswerParse">
<span>答案解析:{{item.AnswerParse}} </span><br />
</template>
<template v-if="item.DifficultyTypeStr">
<span v-if="item.DifficultyTypeStr">难易程度:{{item.DifficultyTypeStr}} </span><br />
</template>
</div>
</template>
</td>
</tr>
</table>
</q-card-section>
<table>
<tr>
<td>
<el-upload class="avatar-uploader" action="" :accept="accept" :show-file-list="false"
:http-request="UploadAttachment">
<div class="app-upload" flex="main:center cross:center" style="width: 100px; height: 100px;">
<i class="el-icon-upload"></i>
</div>
</el-upload>
</td>
</tr>
</table>
<br />
<table>
<tr>
<td>
<template v-for="(item,index) in questionData">
<div style="margin-bottom:20px;">
<span>{{index+1}}. [{{item.QuestionTypeName}}] {{item.Title}}</span><br />
<!--选择题-->
<template v-if="item.QuestionTypeKey=='single'||item.QuestionTypeName=='multiple'"
v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--判断题-->
<template v-if="item.QuestionTypeKey=='judge'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Name}}.{{subItem.Content}} </span><br />
</template>
<!--填空题-->
<template v-if="item.QuestionTypeKey=='fill-in'" v-for="subItem in item.QuestionContentObj">
<span>{{subItem.Content}} </span><br />
</template>
<span>答案:{{item.Answer}} </span><br />
<template v-if="item.AnswerParse">
<span>答案解析:{{item.AnswerParse}} </span><br />
</template>
<template v-if="item.DifficultyTypeStr">
<span v-if="item.DifficultyTypeStr">难易程度:{{item.DifficultyTypeStr}} </span><br />
</template>
</div>
</template>
</td>
</tr>
</table>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading"
......@@ -63,16 +68,10 @@
<script>
import {
queryQuestionTypeList,
queryDifficultyType,
saveQuestion,
queryQuestionInfo
saveQuestionBeatch,
} from '../../api/question/question'
import {
CreateQuestion, //生成问题
} from '../../api/question/questionconfig'
import {
UploadSelfFile,
UploadLocalSystem
} from '../../api/common/common'
import UeEditor from '../editor/UeEditor'
......@@ -123,30 +122,11 @@
initialFrameHeight: 80,
},
persistent: true,
objOption: {
QuestionId: 0, //问题编号
CourseId: 0, //课程编号
Title: "", //问题名称
DifficultyType: 1, //难易程度
AnswerParse: "", //答案解析JSON
QuestionTypeId: 0, //问题类型
QuestionTypeKey: "", //问题类型Key
Knowledge: "", //知识点编号
IsUpdateJobExam: 0, //是否同步修改引用此题目的作业和考试(1-是)
SortNum: 0, //排序
Answer: "", //问题JSON
IsMutex: 0, //填空题(答案顺序打乱也判正确)
},
AnswerList: [],
optionTitle: "",
questionObj: {}, //题目类型对象
firstTypeList: [], //前5个数组
secondTypeList: [], //后面的题型
questionDifficultyTypeList: [], //问题难易程度列表
saveCourseLoading: false,
isShowPoint: false, //是否显示知识点弹窗
choosePointArray: [], //知识点列表
questionData: [], //导入问题列表
chooseItem: {}, //当前选择的项
ExcelUrl: "http://imgfile.oytour.com/static/EduExcelTemplate.xls",
WordUrl: "http://imgfile.oytour.com/static/EduWordTemplate.doc",
}
},
computed: {
......@@ -161,6 +141,28 @@
return '*/*';
},
},
downLoadUrl: {
get() {
if (this.importType == 1) {
return this.ExcelUrl;
}
if (this.importType == 2) {
return this.WordUrl;
}
return '';
}
},
downLoadName: {
get() {
if (this.importType == 1) {
return "EduExcelTemplate.xls";
}
if (this.importType == 2) {
return "EduWordTemplate.doc";
}
return '';
}
},
},
created() {
......@@ -169,6 +171,15 @@
},
methods: {
//修改问题
EditQuestion(item) {
this.chooseItem = item;
},
//删除问题
DeleteQuestion(index) {
},
//上传文件
UploadAttachment(files) {
var fileParams = {
Analysis: 1,
......@@ -192,8 +203,26 @@
this.$emit('close')
this.persistent = false
},
//保存问题
setQuestion() {
if (this.questionData && this.questionData.length > 0) {
this.questionData.forEach(item => {
item.CourseId = this.CourseId
})
}
this.saveCourseLoading = true;
saveQuestionBeatch(this.questionData).then(res => {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
})
}
},
}
......
......@@ -23,7 +23,7 @@
align-items: center;
}
.clozeTest_question_tit i {
.clozeQuestion .clozeTest_question_tit i {
color: #acbfd9;
cursor: pointer;
}
......@@ -42,7 +42,7 @@
margin-bottom: 20px;
}
.add_LiteBtn:hover {
.clozeQuestion .add_LiteBtn:hover {
opacity: 0.8;
}
......@@ -74,11 +74,10 @@
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
<!-- <el-checkbox v-model="subItem.IsAnswer" @change="ChangeItem(item,subItem)">{{subItem.Name}}</el-checkbox> -->
</td>
<td>
<div class="InpDIV" v-html="subItem.Content" v-if="childIndex!=subIndex"
@click="changeEdit(subIndex)"></div>
<div class="InpDIV" v-html="subItem.Content" v-if="childIndex!=subIndex" @click="changeEdit(subIndex)">
</div>
<UeEditor v-model="subItem.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
......@@ -92,8 +91,6 @@
<a class="addTiMuList" @click="addOption(item)">
<i class="iconfont icon-add"></i>添加选项
</a>
<!-- <a style="cursor:pointer;" @click="addOption(item)">添加选项</a> -->
<!-- <a style="cursor:pointer;" @click="deleteQuestion(index)">删除问题</a> -->
</td>
</tr>
</tfoot>
......@@ -130,12 +127,11 @@
showTag: true,
commonIndex: -1,
childIndex: -1,
isShow:true,
commonIndex2:-2,
isShow: true,
commonIndex2: -2,
};
},
created() {
console.log(this.data,'data');
this.initConfig();
},
methods: {
......@@ -144,12 +140,42 @@
},
//删除小问题
deleteQuestion(index) {
this.data.splice(index, 1);
this.$q.dialog({
title: "删除小题",
message: "确实要删除该小题吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data.splice(index, 1);
});
},
//删除选项
deleteOpion(item, index) {
item.splice(index, 1);
this.calcOptionTitle();
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
item.splice(index, 1);
this.calcOptionTitle();
});
},
//新增选项
addOption(item) {
......@@ -196,22 +222,21 @@
}
subItem.IsAnswer = true;
},
// //点击展开收起
//点击展开收起
showNav(index) {
if(this.commonIndex2==index){
this.commonIndex=index;
this.isShow=!this.isShow;
}else{
this.commonIndex=index;
this.isShow=false;
this.commonIndex2=index;
if (this.commonIndex2 == index) {
this.commonIndex = index;
this.isShow = !this.isShow;
} else {
this.commonIndex = index;
this.isShow = false;
this.commonIndex2 = index;
}
},
//点击切换输入
changeEdit(index) {
this.childIndex = index;
}
},
mounted() {
......
......@@ -197,7 +197,6 @@
}
},
mounted() {
console.log(this.data, 'data');
},
watch: {
data: {
......
......@@ -29,7 +29,7 @@
<template v-slot:body-cell-CoverImg="props">
<q-td :props="props">
<q-avatar square size="100px">
<img :src="props.value" />
<img v-if="props.value" :src="props.value" />
</q-avatar>
</q-td>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment