fix: 中文输入法回车键直接保存

This commit is contained in:
fit2cloud-chenyw 2021-07-12 15:15:19 +08:00
parent d02f249b8b
commit 7b993b609a
8 changed files with 15 additions and 16 deletions

View File

@ -5,7 +5,7 @@
v-model="values" v-model="values"
resize="vertical" resize="vertical"
:placeholder="options.attrs.placeholder" :placeholder="options.attrs.placeholder"
@keyup.enter.native="search" @keypress.enter.native="search"
@dblclick="setEdit" @dblclick="setEdit"
> >

View File

@ -6,8 +6,7 @@
<span class="title-text"> <span class="title-text">
{{ $t('chart.datalist') }} {{ $t('chart.datalist') }}
</span> </span>
<el-button icon="el-icon-plus" type="text" size="mini" style="float: right;" @click="add('group')"> <el-button icon="el-icon-plus" type="text" size="mini" style="float: right;" @click="add('group')" />
</el-button>
</el-row> </el-row>
<el-divider /> <el-divider />
<el-row> <el-row>
@ -127,7 +126,7 @@
<!--group add/edit--> <!--group add/edit-->
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%"> <el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keyup.enter.native="saveGroup(groupForm)"> <el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keypress.enter.native="saveGroup(groupForm)">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name" /> <el-input v-model="groupForm.name" />
</el-form-item> </el-form-item>
@ -247,7 +246,7 @@
<!--rename chart--> <!--rename chart-->
<el-dialog v-dialogDrag :title="$t('chart.chart')" :visible="editTable" :show-close="false" width="30%"> <el-dialog v-dialogDrag :title="$t('chart.chart')" :visible="editTable" :show-close="false" width="30%">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keyup.enter.native="saveTable(tableForm)"> <el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keypress.enter.native="saveTable(tableForm)">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name" /> <el-input v-model="tableForm.name" />
</el-form-item> </el-form-item>
@ -275,7 +274,7 @@
<el-input v-model="chartName" style="height: 34px" size="mini" /> <el-input v-model="chartName" style="height: 34px" size="mini" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="optFrom==='panel'"> <el-col v-if="optFrom==='panel'" :span="12">
<el-form-item :label="$t('chart.belong_group')"> <el-form-item :label="$t('chart.belong_group')">
<treeselect <treeselect
v-model="currGroup.id" v-model="currGroup.id"

View File

@ -184,7 +184,7 @@
</el-col> </el-col>
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%"> <el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keyup.enter.native="saveGroup(groupForm)"> <el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keypress.enter.native="saveGroup(groupForm)">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name" /> <el-input v-model="groupForm.name" />
</el-form-item> </el-form-item>
@ -304,7 +304,7 @@
<!-- </el-col>--> <!-- </el-col>-->
<el-dialog v-dialogDrag :title="$t('dataset.table')" :visible="editTable" :show-close="false" width="30%"> <el-dialog v-dialogDrag :title="$t('dataset.table')" :visible="editTable" :show-close="false" width="30%">
<el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keyup.enter.native="saveTable(tableForm)"> <el-form ref="tableForm" :model="tableForm" :rules="tableFormRules" @keypress.enter.native="saveTable(tableForm)">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name" /> <el-input v-model="tableForm.name" />
</el-form-item> </el-form-item>

View File

@ -26,7 +26,7 @@
maxlength="30" maxlength="30"
show-word-limit show-word-limit
autocomplete="new-password" autocomplete="new-password"
@keyup.enter.native="handleLogin" @keypress.enter.native="handleLogin"
/> />
</el-form-item> </el-form-item>
</div> </div>
@ -34,7 +34,7 @@
<el-button type="primary" class="submit" size="default" @click.native.prevent="handleLogin"> <el-button type="primary" class="submit" size="default" @click.native.prevent="handleLogin">
{{ $t('commons.login') }} {{ $t('commons.login') }}
</el-button> </el-button>
<div v-if="uiInfo && uiInfo['ui.demo.tips'] && uiInfo['ui.demo.tips'].paramValue" class="demo-tips"> <div v-if="uiInfo && uiInfo['ui.demo.tips'] && uiInfo['ui.demo.tips'].paramValue" class="demo-tips">
{{ uiInfo['ui.demo.tips'].paramValue }} {{ uiInfo['ui.demo.tips'].paramValue }}
</div> </div>
</div> </div>

View File

@ -102,10 +102,10 @@ export default {
} }
}, },
bindKey() { bindKey() {
document.addEventListener('keyup', this.entryKey) document.addEventListener('keypress', this.entryKey)
}, },
unBindKey() { unBindKey() {
document.removeEventListener('keyup', this.entryKey) document.removeEventListener('keypress', this.entryKey)
}, },
showCurrentTemplateInfo(data) { showCurrentTemplateInfo(data) {
this.editPanel.panelInfo.name = data.name this.editPanel.panelInfo.name = data.name

View File

@ -131,7 +131,7 @@
</el-col> </el-col>
<el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="500px"> <el-dialog v-dialogDrag :title="dialogTitle" :visible="editGroup" :show-close="false" width="500px">
<el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keyup.enter.native="saveGroup(groupForm)"> <el-form ref="groupForm" :model="groupForm" :rules="groupFormRules" @keypress.enter.native="saveGroup(groupForm)">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name" /> <el-input v-model="groupForm.name" />
</el-form-item> </el-form-item>

View File

@ -186,10 +186,10 @@ export default {
} }
}, },
bindKey() { bindKey() {
document.addEventListener('keyup', this.entryKey) document.addEventListener('keypress', this.entryKey)
}, },
unBindKey() { unBindKey() {
document.removeEventListener('keyup', this.entryKey) document.removeEventListener('keypress', this.entryKey)
}, },
repeatValidator(rule, value, callback) { repeatValidator(rule, value, callback) {
if (value !== this.form.password) { if (value !== this.form.password) {

View File

@ -142,7 +142,7 @@
label-width="120px" label-width="120px"
:rules="rule" :rules="rule"
class="demo-ruleForm" class="demo-ruleForm"
@keyup.enter.native="editUserPassword('editPasswordForm')" @keypress.enter.native="editUserPassword('editPasswordForm')"
> >
<el-form-item :label="$t('member.new_password')" prop="newPassword"> <el-form-item :label="$t('member.new_password')" prop="newPassword">
<el-input v-model="ruleForm.newPassword" type="password" autocomplete="off" show-password /> <el-input v-model="ruleForm.newPassword" type="password" autocomplete="off" show-password />