提交 577e9175 authored 作者: lihuihui's avatar lihuihui

update

上级 2e2e967a
......@@ -170,7 +170,6 @@ export default {
},
methods: {
handleSelectionChange(data) {
console.log(data, 'datas')
this.checkedList = data.reduce((a, b) => {
const data = {}
data.question_title = b.question_title
......
......@@ -163,14 +163,8 @@ export default {
},
methods: {
submitForm(formName) {
// if (parseInt(this.ruleForm.question_type) !== 3) {
// const isValue = this.$refs.options.datas.find(item => item.option === '')
// if (!isValue) this.ruleForm.question_options = this.$refs.options.datas
// }
console.log(this.ruleForm.question_options)
this.$refs[formName].validate(valid => {
if (valid) {
// console.log(JSON.stringify(this.ruleForm))
if (this.$route.query.id) {
updateQuestion(this.$route.query.id, this.ruleForm).then(res => {
this.$router.push({
......@@ -239,7 +233,6 @@ export default {
},
// 知识点搜索
remoteMethod(query) {
console.log(query)
searchTag({ title: query }).then(res => {
this.pointOptions = res.data.data
})
......
......@@ -55,7 +55,6 @@ export default {
this.checkboxValue.forEach(item => {
this.option[item].checked = true
})
console.log(this.option)
}
}
}
......
......@@ -240,7 +240,6 @@ export default {
},
// 知识点搜索
remoteMethod(query) {
console.log(query)
searchTag({ title: query }).then(res => {
this.pointOptions = res.data.data
})
......@@ -249,7 +248,6 @@ export default {
questionList(data) {
this.chidrenList.push(data)
this.drawer = false
console.log(this.chidrenList, 'list')
},
haveQuestion(data) {
data.forEach(item => {
......
<template>
<div>
<el-form :disabled="!!($route.query.type === 'view')" :model="data" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<div v-for="(ruleForm, index) in dataList" :key="index">
<div v-for="(ruleForm, index) in chidrenList" :key="index">
<el-divider content-position="center" class="divider">子题目{{ index + 1 }}</el-divider>
<el-form-item style="text-align: right;" v-if="!!!($route.query.type === 'view')">
<el-button type="primary" v-if="!!!($route.query.type === 'edit')" @click="$emit('cacheChidren')">保存子题目</el-button>
......@@ -32,7 +32,7 @@
<el-form-item label="子题目解析" prop="question_analysis">
<v-editor :disabled="!!($route.query.type === 'view')" v-model="ruleForm.question_analysis"></v-editor>
</el-form-item>
<el-form-item style="text-align: center;" v-if="index + 1 == dataList.length">
<el-form-item style="text-align: center;" v-if="index + 1 == chidrenList.length">
<el-button v-if="!!!($route.query.type === 'view')" type="primary" @click="submitForm">保存</el-button>
</el-form-item>
</div>
......@@ -58,7 +58,6 @@ export default {
data() {
return {
ruleForm: {},
dataList: [],
rules: {
child_question_type: [{ required: true, message: ' ', trigger: 'blur' }],
question_difficulty: [{ required: true, message: ' ', trigger: 'blur' }],
......@@ -70,12 +69,10 @@ export default {
}
},
mounted() {
this.dataList = this.chidrenList
console.log(this.chidrenList, 'chi')
},
methods: {
removeChidren(n) {
this.dataList.splice(n, 1)
this.chidrenList.splice(n, 1)
},
submitForm() {
this.$emit('submitForm')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论