Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
This commit is contained in:
commit
88024ce606
@ -7,10 +7,10 @@
|
||||
|
||||
<script>
|
||||
// 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 { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
|
||||
import { getCompanyList } from '@/api/company';
|
||||
// import { getCompanyList } from '@/api/company';
|
||||
import XLSX from 'xlsx';
|
||||
|
||||
export default {
|
||||
@ -19,7 +19,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
companyList: [],
|
||||
// companyList: [],
|
||||
companyMap: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
@ -29,6 +29,7 @@ export default {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 17,
|
||||
beforeQuery: this.beforeQuery,
|
||||
queryObject: {
|
||||
type: {
|
||||
type: 'select',
|
||||
@ -40,14 +41,15 @@ export default {
|
||||
topic: {
|
||||
type: 'text',
|
||||
label: '题 目'
|
||||
},
|
||||
labels: {
|
||||
type: 'select',
|
||||
label: '标 签',
|
||||
config: {
|
||||
multiple: true,
|
||||
data: []
|
||||
}
|
||||
}
|
||||
// companyId: {
|
||||
// type: 'select',
|
||||
// label: '单位',
|
||||
// config: {
|
||||
// data: []
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
@ -134,15 +136,26 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.companyList = [];
|
||||
// this.companyList = [];
|
||||
// getCompanyList().then(resp => {
|
||||
// resp.data.forEach(item => {
|
||||
// // this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: 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: {
|
||||
beforeQuery(obj) {
|
||||
obj.labels = obj.labels ? obj.labels.join(',') : '';
|
||||
return obj;
|
||||
},
|
||||
doCreate() {
|
||||
// this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
|
||||
this.$router.push({path: '/teaching/questionCreate'});
|
||||
|
@ -73,7 +73,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
isSelect() {
|
||||
return this.remove && this.option.type == 'select';
|
||||
const selectArr = ['select', 'multi'];
|
||||
return this.remove && selectArr.includes(this.option.type);
|
||||
},
|
||||
isProject() {
|
||||
const project = getSessionStorage('project');
|
||||
|
@ -57,13 +57,17 @@ export default {
|
||||
setTimeout(() => {
|
||||
this.formModel = deepAssign({}, this.$store.state.race.preTheoryData[this.questionId]);
|
||||
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);
|
||||
} else {
|
||||
getQuestionInfo(this.questionId).then(resp => {
|
||||
this.formModel = resp.data;
|
||||
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