Commit ea091153 authored by 黄奎's avatar 黄奎

页面修改

parent 719ca88b
......@@ -228,3 +228,16 @@ export function RemoveQuestionBank(data) {
data
})
}
/**
* 批量设置问题考级程度
* @param {*} data
*/
export function saveBatchQuestionLevel(data) {
return request({
url: '/Question/SetBatchQuestionLevel',
method: 'post',
data
})
}
......@@ -50,7 +50,7 @@
//初始化表单
initObj() {
GetClassLessPlanList({}).then(res => {
console.log(res, '数据来了');
if (res.Code == 1) {
this.tableData = res.Data;
this.tableData.forEach(x => {
......@@ -60,7 +60,6 @@
})
},
singleElection(row) {
console.log(row, 'row');
this.templateSelection = this.tableData.indexOf(row);
this.checkedRow = row;
},
......
......@@ -54,7 +54,25 @@
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增题目" @click="EditQuestion(null)" />
<!-- <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="批量设置考级程度" @click="SetBatchLevelType" /> -->
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="批量设置" title="批量设置考级程度"
@click="isShowEdit=true">
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="calenderDialog">
<div style="margin:10px 0 15px 0;">设置考级程度</div>
<q-select standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="levelTypeMsg.LevelType" :options="questionLevalTypeList" emit-value map-options
label="考级程度" />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="isShowEdit=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important"
@click="SetBatchLevelType()" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
<q-btn-dropdown color="accent" label="批量导入" size="sm" class="q-mr-md" style="margin-left:5px;">
<q-list>
<q-item clickable v-close-popup>
......@@ -113,7 +131,9 @@
queryDifficultyType,
queryQuestionCategory,
setQuestionSort,
CopyQuestion
CopyQuestion,
queryQuestionLevelType,
saveBatchQuestionLevel
} from '../../api/question/question';
import questionForm from '../question/question-form';
import questionUpload from '../question/question-upload';
......@@ -210,6 +230,11 @@
isShowImportUpload: false, //是否显示导入模板
questionCategoryList: [], //问题分类
selectedQuestion: [], //选中的数组
isShowEdit: false, //是否显示弹窗
questionLevalTypeList: [], //问题考级程度列表
levelTypeMsg: {
LevelType: 0,
}
}
},
created() {
......@@ -222,11 +247,24 @@
this.getQuestionType();
this.getDifficultyType();
this.getQuestionCategory();
this.getQuestionLevelType();
},
mounted() {
this.getQuestionList();
},
methods: {
//获取问题考级程度
getQuestionLevelType() {
queryQuestionLevelType().then(res => {
var tempData = res.Data;
var obj = {
Name: '请选择',
Id: 0
}
tempData.unshift(obj);
this.questionLevalTypeList = tempData;
})
},
//获取问题大类
getQuestionCategory() {
queryQuestionCategory().then(res => {
......@@ -261,9 +299,27 @@
},
//批量设置考级程度
SetBatchLevelType() {
console.log("selectedQuestion", this.selectedQuestion);
if (this.selectedQuestion && this.selectedQuestion.length > 0) {
if (this.selectedQuestion && this.selectedQuestion.length > 0) {
var levelMsg = {
LevelType: this.levelTypeMsg.LevelType,
questionIds: [],
};
this.selectedQuestion.forEach(item => {
levelMsg.questionIds.push(item.QuestionId)
})
saveBatchQuestionLevel(levelMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '设置成功!',
position: 'top'
})
this.getQuestionList();
}
})
} else {
this.$q.notify({
icon: 'iconfont icon-chenggong',
......
......@@ -292,7 +292,6 @@
methods:{
getList() {
getClassLessPlan(this.msg).then(res => {
console.log(res, '数据来了');
if (res.Code == 1) {
this.data = res.Data
}
......
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