理论题目管理调整
This commit is contained in:
parent
22205736f9
commit
0f09744cc4
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { UrlConfig } from '@/scripts/ConstDic';
|
// import { UrlConfig } from '@/scripts/ConstDic';
|
||||||
import { listQuestionPage, deleteQuestion } from '@/api/questionBank.js';
|
import { listQuestionPage, deleteQuestion, getLableList } from '@/api/questionBank.js';
|
||||||
import DialogDetail from './dialog-detail';
|
import DialogDetail from './dialog-detail';
|
||||||
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
|
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
|
||||||
import { getCompanyList } from '@/api/company';
|
// import { getCompanyList } from '@/api/company';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -19,7 +19,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
companyList: [],
|
// companyList: [],
|
||||||
companyMap: {},
|
companyMap: {},
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
@ -29,6 +29,7 @@ export default {
|
|||||||
reset: true,
|
reset: true,
|
||||||
labelWidth: '80px',
|
labelWidth: '80px',
|
||||||
leftSpan: 17,
|
leftSpan: 17,
|
||||||
|
beforeQuery: this.beforeQuery,
|
||||||
queryObject: {
|
queryObject: {
|
||||||
type: {
|
type: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@ -40,14 +41,15 @@ export default {
|
|||||||
topic: {
|
topic: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: '题 目'
|
label: '题 目'
|
||||||
|
},
|
||||||
|
labels: {
|
||||||
|
type: 'select',
|
||||||
|
label: '标 签',
|
||||||
|
config: {
|
||||||
|
multiple: true,
|
||||||
|
data: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// companyId: {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '单位',
|
|
||||||
// config: {
|
|
||||||
// data: []
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
@ -134,15 +136,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.companyList = [];
|
// this.companyList = [];
|
||||||
// getCompanyList().then(resp => {
|
// getCompanyList().then(resp => {
|
||||||
// resp.data.forEach(item => {
|
// resp.data.forEach(item => {
|
||||||
// // this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name });
|
// // this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name });
|
||||||
// this.companyMap[item.id] = item.name;
|
// this.companyMap[item.id] = item.name;
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
getLableList().then(res => {
|
||||||
|
res.data.forEach(item => {
|
||||||
|
this.queryForm.queryObject.labels.config.data.push({ value: item, label: item });
|
||||||
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
beforeQuery(obj) {
|
||||||
|
obj.labels = obj.labels ? obj.labels.join(',') : '';
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
doCreate() {
|
doCreate() {
|
||||||
// this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
|
// this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
|
||||||
this.$router.push({path: '/teaching/questionCreate'});
|
this.$router.push({path: '/teaching/questionCreate'});
|
||||||
|
@ -73,7 +73,8 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isSelect() {
|
isSelect() {
|
||||||
return this.remove && this.option.type == 'select';
|
const selectArr = ['select', 'multi'];
|
||||||
|
return this.remove && selectArr.includes(this.option.type);
|
||||||
},
|
},
|
||||||
isProject() {
|
isProject() {
|
||||||
const project = getSessionStorage('project');
|
const project = getSessionStorage('project');
|
||||||
|
@ -57,13 +57,17 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.formModel = deepAssign({}, this.$store.state.race.preTheoryData[this.questionId]);
|
this.formModel = deepAssign({}, this.$store.state.race.preTheoryData[this.questionId]);
|
||||||
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
|
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
|
||||||
this.$refs.info.tagsArr = this.formModel.tags.split(',');
|
const tagVal = this.formModel.tags ? this.formModel.tags.split(',') : '';
|
||||||
|
this.$refs.info.tagsArr = tagVal;
|
||||||
|
this.tagsArr = tagVal;
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
getQuestionInfo(this.questionId).then(resp => {
|
getQuestionInfo(this.questionId).then(resp => {
|
||||||
this.formModel = resp.data;
|
this.formModel = resp.data;
|
||||||
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
|
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
|
||||||
this.$refs.info.tagsArr = this.formModel.tags.split(',');
|
const tagVal = this.formModel.tags ? this.formModel.tags.split(',') : '';
|
||||||
|
this.$refs.info.tagsArr = tagVal;
|
||||||
|
this.tagsArr = tagVal;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user