| | |
| | | > |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="问题文本" prop="questiontext"> |
| | | <el-form-item label="问题文本" prop="questionText"> |
| | | <el-input |
| | | :rows="2" |
| | | type="textarea" |
| | | :rows="2" |
| | | id="questionText" |
| | | maxlength="66" |
| | | show-word-limit |
| | | placeholder="请输入内容" |
| | | id="questiontext" |
| | | v-model.sync="indexform.questionText" |
| | | @focus="handleInput('questiontext')" |
| | | maxlength="30" |
| | | @focus="handleInput('questionText')" |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | |
| | | > |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | </el-upload> |
| | | <!-- <el-input v-model="indexform.userName" maxlength="30" /> --> |
| | | <!-- <el-input v-model="indexform.userName" maxlength="66" |
| | | show-word-limit /> --> |
| | | </el-form-item> |
| | | </el-col></el-row |
| | | > |
| | |
| | | placeholder="请输入内容" |
| | | v-model.sync="indexform.nomatchtext" |
| | | @focus="handleInput('nomatchtext')" |
| | | maxlength="30" |
| | | maxlength="66" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | |
| | | placeholder="请输入内容" |
| | | v-model.sync="indexform.sliencetext" |
| | | @focus="handleInput('sliencetext')" |
| | | maxlength="30" |
| | | maxlength="66" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | |
| | | placeholder="请输入内容" |
| | | v-model.sync="indexform.submoduletext" |
| | | @focus="handleInput('submoduletext')" |
| | | maxlength="30" |
| | | maxlength="66" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | |
| | | placeholder="请输入内容" |
| | | @focus="handleInput('noclearlytext')" |
| | | v-model.sync="indexform.noclearlytext" |
| | | maxlength="30" |
| | | maxlength="66" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | |
| | | let inputValueArr = ""; |
| | | let el = document.querySelector("#" + this.currentInputId); |
| | | //el.selectionStart; 这就是当前光标所在的位置(字符串中字符的index) |
| | | if (this.currentInputId == "questiontext") { |
| | | inputValueArr = this.indexform.questiontext.split(""); |
| | | if (this.currentInputId == "questionText") { |
| | | inputValueArr = this.indexform.questionText.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") { |
| | | if (this.currentInputId == "questionText") { |
| | | this.indexform.questionText = inputValueArr; |
| | | } else if (this.currentInputId == "nomatchtext") { |
| | | this.indexform.nomatchtext = inputValueArr; |