|  |  |  | 
|---|
|  |  |  | </el-row> | 
|---|
|  |  |  | <el-row :gutter="20"> | 
|---|
|  |  |  | <el-col :span="20"> | 
|---|
|  |  |  | <el-form-item label="问题主旨" prop="questiontitle"> | 
|---|
|  |  |  | <el-form-item label="问题主旨" prop="scriptTopic"> | 
|---|
|  |  |  | <el-input | 
|---|
|  |  |  | v-model="indexform.questiontitle" | 
|---|
|  |  |  | v-model="indexform.scriptTopic" | 
|---|
|  |  |  | placeholder="请输入问题主旨" | 
|---|
|  |  |  | maxlength="80" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-row> | 
|---|
|  |  |  | <el-row> | 
|---|
|  |  |  | <el-col :span="24"> | 
|---|
|  |  |  | <el-form-item label="问题变量" prop="questionText"> | 
|---|
|  |  |  | <el-form-item label="问题变量" prop="scriptContent"> | 
|---|
|  |  |  | <div style="display: flex; margin-bottom: 10px"> | 
|---|
|  |  |  | <div | 
|---|
|  |  |  | v-for="item in variablelist" | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-row> | 
|---|
|  |  |  | <el-col :span="24"> | 
|---|
|  |  |  | <el-form-item label="问题文本" prop="questionText"> | 
|---|
|  |  |  | <el-form-item label="问题文本" prop="scriptContent"> | 
|---|
|  |  |  | <el-input | 
|---|
|  |  |  | :rows="2" | 
|---|
|  |  |  | type="textarea" | 
|---|
|  |  |  | id="questionText" | 
|---|
|  |  |  | id="scriptContent" | 
|---|
|  |  |  | show-word-limit | 
|---|
|  |  |  | placeholder="请输入内容" | 
|---|
|  |  |  | v-model.sync="indexform.questionText" | 
|---|
|  |  |  | @focus="handleInput('questionText')" | 
|---|
|  |  |  | v-model.sync="indexform.scriptContent" | 
|---|
|  |  |  | @focus="handleInput('scriptContent')" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </el-form-item> </el-col | 
|---|
|  |  |  | ></el-row> | 
|---|
|  |  |  | 
|---|
|  |  |  | .confirm('是否添加"' + res.rows[0].targetname + '"指标的选项?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.indexform.valueType = res.rows[0].valueType; | 
|---|
|  |  |  | this.indexform.questiontitle = res.rows[0].targetname; | 
|---|
|  |  |  | this.indexform.scriptTopic = res.rows[0].targetname; | 
|---|
|  |  |  | this.indexform.targetname = res.rows[0].targetname; | 
|---|
|  |  |  | this.indexform.targetdesc = res.rows[0].targetdesc; | 
|---|
|  |  |  | this.indexform.isAvailable = "0"; | 
|---|
|  |  |  | 
|---|
|  |  |  | let inputValueArr = ""; | 
|---|
|  |  |  | let el = document.querySelector("#" + this.currentInputId); | 
|---|
|  |  |  | //el.selectionStart; 这就是当前光标所在的位置(字符串中字符的index) | 
|---|
|  |  |  | if (this.currentInputId == "questionText") { | 
|---|
|  |  |  | inputValueArr = this.indexform.questionText.split(""); | 
|---|
|  |  |  | if (this.currentInputId == "scriptContent") { | 
|---|
|  |  |  | inputValueArr = this.indexform.scriptContent.split(""); | 
|---|
|  |  |  | } else if (this.currentInputId == "noMatchText") { | 
|---|
|  |  |  | inputValueArr = this.indexform.noMatchText.split(""); | 
|---|
|  |  |  | } else if (this.currentInputId == "slienceText") { | 
|---|
|  |  |  | 
|---|
|  |  |  | // 把数组重新转换为字符串并赋值 | 
|---|
|  |  |  | inputValueArr = inputValueArr.join(""); | 
|---|
|  |  |  | console.log(inputValueArr); | 
|---|
|  |  |  | if (this.currentInputId == "questionText") { | 
|---|
|  |  |  | this.indexform.questionText = inputValueArr; | 
|---|
|  |  |  | if (this.currentInputId == "scriptContent") { | 
|---|
|  |  |  | this.indexform.scriptContent = inputValueArr; | 
|---|
|  |  |  | } else if (this.currentInputId == "noMatchText") { | 
|---|
|  |  |  | this.indexform.noMatchText = inputValueArr; | 
|---|
|  |  |  | } else if (this.currentInputId == "slienceText") { | 
|---|