| | |
| | | > |
| | | </div> |
| | | <div style="margin-left: 8%"> |
| | | <el-form-item label="问题分类"> |
| | | <el-select |
| | | v-model="topicobj.assortid" |
| | | size="medium" |
| | | filterable |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option-group |
| | | v-for="group in classifylist" |
| | | :key="group.id" |
| | | :label="group.name" |
| | | > |
| | | <el-option |
| | | v-for="item in group.svyLibTopicCategoryList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-option-group> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-row :gutter="10"> |
| | | <el-col :span="6" |
| | | ><el-form-item label="题目标题"> |
| | |
| | | <el-input |
| | | style="width: 40vw" |
| | | type="textarea" |
| | | id="questiontext" |
| | | id="topicContent" |
| | | v-model="topicobj.topicContent" |
| | | @focus="handleInput('questiontext')" |
| | | @focus="handleInput('topicContent')" |
| | | placeholder="请输入标题" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-card> |
| | | </div> |
| | | <el-drawer |
| | | title="添加题目" |
| | | title="添加选项" |
| | | :visible.sync="drawer" |
| | | custom-class="demo-drawer" |
| | | width="50%" |
| | | width="66%" |
| | | > |
| | | <div class="preview-left"> |
| | | <el-form |
| | |
| | | compileissue, |
| | | delissueinfo, |
| | | Followupinfo, |
| | | getissueclassify, |
| | | deltargetillness, |
| | | addtargetillness, |
| | | getillnesslist, |
| | |
| | | optionsillness: [], |
| | | illnesslistapi: [], |
| | | illnesslist: [], |
| | | |
| | | classifylist: [], |
| | | optionstag: [], |
| | | xjxsoptions: [], |
| | | usable: [], |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // 公共方法--------------- |
| | | getIndexInArray(arr, obj) { |
| | | return arr.indexOf(obj); |
| | | }, |
| | | |
| | | // 递归扁平化 |
| | | flattenArray(arr) { |
| | | let result = []; |
| | | arr.forEach((item) => { |
| | | result.push(item); |
| | | if (item.svyLibTopicCategoryList) { |
| | | console.log(2); |
| | | result = result.concat( |
| | | this.flattenArray(item.svyLibTopicCategoryList) |
| | | ); |
| | | delete item.svyLibTopicCategoryList; |
| | | } |
| | | }); |
| | | return result; |
| | | }, |
| | | // ----------------------------- |
| | | // 获取数据 |
| | | getissueinfo() { |
| | | this.id = this.$route.query.id; |
| | |
| | | }); |
| | | getillness({ outid: this.id, type: 4 }).then((res) => { |
| | | this.illnesslist = res.rows; |
| | | }); |
| | | // 分类 |
| | | getissueclassify({}).then((res) => { |
| | | this.classifylist = res.rows; |
| | | }); |
| | | }, |
| | | gettargetInfo() { |
| | |
| | | let inputValueArr = ""; |
| | | let el = document.querySelector("#" + this.currentInputId); |
| | | //el.selectionStart; 这就是当前光标所在的位置(字符串中字符的index) |
| | | if (this.currentInputId == "questiontext") { |
| | | inputValueArr = this.indexform.questiontext.split(""); |
| | | if (this.currentInputId == "topicContent") { |
| | | inputValueArr = this.topicobj.topicContent.split(""); |
| | | console.log(123); |
| | | } else if (this.currentInputId == "nomatchtext") { |
| | | inputValueArr = this.indexform.nomatchtext.split(""); |
| | | inputValueArr = this.topicobj.nomatchtext.split(""); |
| | | } else if (this.currentInputId == "sliencetext") { |
| | | inputValueArr = this.indexform.sliencetext.split(""); |
| | | inputValueArr = this.topicobj.sliencetext.split(""); |
| | | } else if (this.currentInputId == "noclearlytext") { |
| | | inputValueArr = this.indexform.noclearlytext.split(""); |
| | | inputValueArr = this.topicobj.noclearlytext.split(""); |
| | | } else if (this.currentInputId == "submoduletext") { |
| | | inputValueArr = this.indexform.submoduletext.split(""); |
| | | inputValueArr = this.topicobj.submoduletext.split(""); |
| | | } else { |
| | | return; |
| | | } |
| | |
| | | // 把数组重新转换为字符串并赋值 |
| | | inputValueArr = inputValueArr.join(""); |
| | | console.log(inputValueArr); |
| | | if (this.currentInputId == "questiontext") { |
| | | this.indexform.questiontext = inputValueArr; |
| | | if (this.currentInputId == "topicContent") { |
| | | this.topicobj.topicContent = inputValueArr; |
| | | } else if (this.currentInputId == "nomatchtext") { |
| | | this.indexform.nomatchtext = inputValueArr; |
| | | this.topicobj.nomatchtext = inputValueArr; |
| | | } else if (this.currentInputId == "sliencetext") { |
| | | this.indexform.sliencetext = inputValueArr; |
| | | this.topicobj.sliencetext = inputValueArr; |
| | | } else if (this.currentInputId == "noclearlytext") { |
| | | this.indexform.noclearlytext = inputValueArr; |
| | | this.topicobj.noclearlytext = inputValueArr; |
| | | } else if (this.currentInputId == "submoduletext") { |
| | | this.indexform.submoduletext = inputValueArr; |
| | | this.topicobj.submoduletext = inputValueArr; |
| | | } else { |
| | | return; |
| | | } |