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

update

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