| | |
| | | </button> |
| | | <input v-if="(tableData.length < formData.checkQyt) && formData.fupAllow && formData.fdownAllow" |
| | | ref="numberInput" |
| | | :focus="isFocus" |
| | | @input="onNumberInput" |
| | | @confirm="onEnterSave" |
| | | @blur="isFocus = false" |
| | | v-model="formData.fcheckResu" |
| | | type="text" |
| | | class="result-input" |
| | |
| | | placeholder-class="placeholder" /> |
| | | <input v-else |
| | | ref="textInput" |
| | | :focus="isFocus" |
| | | @input="search($event)" |
| | | @confirm="onEnterSave" |
| | | @blur="isFocus = false" |
| | | v-model="inputTxt" |
| | | type="text" |
| | | class="result-input" |
| | |
| | | showMeom:false, |
| | | meom: '', |
| | | autoSaveTimer: null, // 自动保存定时器 |
| | | isFocus: false, // 新增,控制输入框聚焦 |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.$showMessage("保存成功"); |
| | | this.refreshResult(); |
| | | this.inputTxt = ''; |
| | | |
| | | // 设置焦点回到对应的输入框 |
| | | // 使用 isFocus 控制聚焦,兼容多端 |
| | | this.isFocus = false; |
| | | this.$nextTick(() => { |
| | | if (this.formData.fupAllow && this.formData.fdownAllow) { |
| | | // 有上下限时,焦点回到数字输入框 |
| | | if (this.$refs.numberInput) { |
| | | this.$refs.numberInput.focus(); |
| | | } |
| | | } else { |
| | | // 无上下限时,焦点回到文本输入框 |
| | | if (this.$refs.textInput) { |
| | | this.$refs.textInput.focus(); |
| | | } else if (this.$refs.textInput2) { |
| | | this.$refs.textInput2.focus(); |
| | | } |
| | | } |
| | | this.isFocus = true; |
| | | }); |
| | | }) |
| | | |