| | |
| | | <el-col :span="8" |
| | | ><el-form-item label="题目标题"> |
| | | <el-input |
| | | v-model="topicobj.script" |
| | | v-model="topicobj.topic" |
| | | placeholder="请输入标题" |
| | | ></el-input> </el-form-item |
| | | ></el-col> |
| | |
| | | <el-input |
| | | style="width: 40vw" |
| | | type="textarea" |
| | | id="scriptContent" |
| | | id="script" |
| | | v-model="topicobj.script" |
| | | @focus="handleInput('script')" |
| | | placeholder="请输入题目内容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="题目说明"> |
| | | <el-input |
| | | style="width: 40vw" |
| | | type="textarea" |
| | | v-model="topicobj.scriptContent" |
| | | @focus="handleInput('scriptContent')" |
| | | placeholder="请输入标题" |
| | | placeholder="请输入说明" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | |
| | | let inputValueArr = ""; |
| | | let el = document.querySelector("#" + this.currentInputId); |
| | | //el.selectionStart; 这就是当前光标所在的位置(字符串中字符的index) |
| | | if (this.currentInputId == "scriptContent") { |
| | | inputValueArr = this.topicobj.scriptContent.split(""); |
| | | if (this.currentInputId == "script") { |
| | | inputValueArr = this.topicobj.script.split(""); |
| | | console.log(123); |
| | | } else if (this.currentInputId == "nomatchtext") { |
| | | inputValueArr = this.topicobj.nomatchtext.split(""); |
| | |
| | | // 把数组重新转换为字符串并赋值 |
| | | inputValueArr = inputValueArr.join(""); |
| | | console.log(inputValueArr); |
| | | if (this.currentInputId == "scriptContent") { |
| | | this.topicobj.scriptContent = inputValueArr; |
| | | if (this.currentInputId == "script") { |
| | | this.topicobj.script = inputValueArr; |
| | | } else if (this.currentInputId == "nomatchtext") { |
| | | this.topicobj.nomatchtext = inputValueArr; |
| | | } else if (this.currentInputId == "sliencetext") { |
| | |
| | | // 执行 |
| | | test() { |
| | | const arrays = [ |
| | | ["2", "3", "4"], |
| | | ["1", "2"], |
| | | ["3", "4", "5"], |
| | | ["3", "2", "5"], |
| | | ["2", "3", "4", "5"], |
| | | ["1", "2", "5", "6"], |
| | | ["3", "4", "5", "3"], |
| | | ["3", "2", "5", "7"], |
| | | ]; |
| | | |
| | | const newMixArray = this.generateCombinations(arrays); |
| | | console.log(newMixArray,'全部路线'); |
| | | console.log(newMixArray, "全部路线"); |
| | | this.screen(newMixArray); |
| | | }, |
| | | // 数组求和 |
| | |
| | | }, |
| | | // 筛选错误路线 |
| | | screen(data) { |
| | | const arraysGreaterThan10 = data.filter((arr) => this.sumArray(arr) > 13); |
| | | const arraysGreaterThan10 = data.filter((arr) => this.sumArray(arr) > 21); |
| | | |
| | | console.log(arraysGreaterThan10,'筛选错误路线大于13分'); |
| | | console.log(arraysGreaterThan10, "筛选错误路线大于13分"); |
| | | }, |
| | | }, |
| | | }; |