| | |
| | | @blur="onChange" @confirm="onConfirm" @click="onClick" :disabled="data.disabled" :maxlength="-1"></input> |
| | | <input v-else class="oi-input" :class="data.disabled?'input-disabled':''" |
| | | :style="{'padding-left':data.setting.prefix?0 : '8rpx','right':data.setting.suffix?0 : '8rpx'}" |
| | | v-model="data.value" :focus="focus" :placeholder="data.placeholder" @blur="onChange" @confirm="onConfirm" |
| | | v-model="data.value" :focus="focus" :placeholder="data.placeholder" @focus="onFocus" @blur="onChange" @confirm="onConfirm" |
| | | @click="onClick" :disabled="data.disabled"></input> |
| | | <text v-if="data.setting.suffix&& !viewMode" class="form-input-icon" :class="[data.setting.suffix]" |
| | | @click="onSuffixButton"></text> |
| | |
| | | default: false |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | largeMode: getApp().globalData?.largeMode || false, |
| | | } |
| | | }, |
| | | methods: { |
| | | onChange(e) { |
| | | this.$emit("on-change", e) |
| | |
| | | this.$emit("on-click", e) |
| | | }, |
| | | onFocus(e) { |
| | | // getApp().onScan((result) => { |
| | | // if (!this.viewMode && !this.data.disabled) { |
| | | // if (this.model) |
| | | // this.model[data.fieldId] = result |
| | | // else |
| | | // this.data.value = result |
| | | // } |
| | | // }) |
| | | this.$emit("on-focus", e) |
| | | }, |
| | | onPrefixButton() { |
| | |
| | | .oi-form-input:hover { |
| | | border: 1px solid rgb(41, 121, 255); |
| | | } |
| | | |
| | | .large-mode { |
| | | .oi-form-input { |
| | | .oi-input { |
| | | font-size: 24px; |
| | | height: 36px; |
| | | } |
| | | |
| | | .form-input-icon { |
| | | font-size: 30px; |
| | | height: 36px; |
| | | width: 36px; |
| | | } |
| | | } |
| | | } |
| | | </style> |