From ad70f145e8bea957b41043b4a1e37ce37cc5ed1e Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期二, 16 一月 2024 18:39:24 +0800 Subject: [PATCH] 指标完成 --- src/views/knowledge/questionbank/particulars/index.vue | 80 +++++++++++++++++++++++++++++++--------- 1 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/views/knowledge/questionbank/particulars/index.vue b/src/views/knowledge/questionbank/particulars/index.vue index ef1020e..63cc423 100644 --- a/src/views/knowledge/questionbank/particulars/index.vue +++ b/src/views/knowledge/questionbank/particulars/index.vue @@ -12,6 +12,28 @@ > </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="棰樼洰鏍囬"> @@ -116,9 +138,9 @@ <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> @@ -323,10 +345,10 @@ </el-card> </div> <el-drawer - title="娣诲姞棰樼洰" + title="娣诲姞閫夐」" :visible.sync="drawer" custom-class="demo-drawer" - width="50%" + width="66%" > <div class="preview-left"> <el-form @@ -415,6 +437,7 @@ compileissue, delissueinfo, Followupinfo, + getissueclassify, deltargetillness, addtargetillness, getillnesslist, @@ -467,7 +490,7 @@ optionsillness: [], illnesslistapi: [], illnesslist: [], - + classifylist: [], optionstag: [], xjxsoptions: [], usable: [], @@ -487,10 +510,26 @@ }, 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; @@ -512,6 +551,10 @@ }); getillness({ outid: this.id, type: 4 }).then((res) => { this.illnesslist = res.rows; + }); + // 鍒嗙被 + getissueclassify({}).then((res) => { + this.classifylist = res.rows; }); }, gettargetInfo() { @@ -720,16 +763,17 @@ 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; } @@ -742,16 +786,16 @@ // 鎶婃暟缁勯噸鏂拌浆鎹负瀛楃涓插苟璧嬪�� 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; } -- Gitblit v1.9.3