mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 07:04:21 +08:00
* Change definition for v-model of fields using reactive store * change custom validateValue to custom and overwrite parsedValue. * Delete unused parameters. * Add queue for persistence * fix: Create entity. * Add return value as array for persistence * Add multiple commit for panel * remove commnets * Change context session to preference. * fix: Load window. * Add support to seekrecord for panel * Set default value to isActive columnName. * set default values. * Separate template mobile and panel desktop with mixin. * set values into panel with first load of records. * fix lookups value and display value. * change `DisplayColumn_${columnName}` to `displayColumnName` property. * fix create entity with default values. * Set default values and fix browser search. * fix context values from SmartBrowser. * fix: Associated process. * set context values to process associated. * fix set values. * fix style field components. * fix send values to server. Co-authored-by: Yamel Senih <ysenih@erpya.com>
80 lines
1.8 KiB
Vue
80 lines
1.8 KiB
Vue
<template>
|
|
<el-input
|
|
:ref="metadata.columnName"
|
|
v-model="value"
|
|
:pattern="pattern"
|
|
:rows="rows"
|
|
:class="cssClassStyle"
|
|
:type="typeTextBox"
|
|
:placeholder="metadata.help"
|
|
:readonly="Boolean(metadata.readonly)"
|
|
:disabled="isDisabled"
|
|
:maxlength="maxLength"
|
|
:show-password="Boolean(metadata.isEncrypted)"
|
|
:autofocus="metadata.inTable"
|
|
@change="preHandleChange"
|
|
@blur="focusLost"
|
|
@focus="focusGained"
|
|
@keydown.native="keyPressed"
|
|
@keyup.native="keyReleased"
|
|
@keyup.native.enter="actionKeyPerformed"
|
|
/>
|
|
</template>
|
|
|
|
<script>
|
|
import fieldMixin from '@/components/ADempiere/Field/mixin/mixinField.js'
|
|
import fieldMixinText from '@/components/ADempiere/Field/mixin/mixinFieldText.js'
|
|
import { TEXT } from '@/utils/ADempiere/references'
|
|
|
|
export default {
|
|
name: 'FieldText',
|
|
mixins: [
|
|
fieldMixin,
|
|
fieldMixinText
|
|
],
|
|
props: {
|
|
inTable: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
pattern: {
|
|
type: String,
|
|
default: undefined
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
patternFileName: '[A-Za-zñÑ0-9-_]{1,}',
|
|
patternFilePath: '[A-Za-zñÑ0-9-_/.]{1,}'
|
|
}
|
|
},
|
|
computed: {
|
|
// Only used when input type='TextArea'
|
|
rows() {
|
|
if (this.metadata.inTable) {
|
|
return 1
|
|
}
|
|
return 4
|
|
},
|
|
typeTextBox() {
|
|
// String, Url, FileName...
|
|
let typeInput = 'text'
|
|
// Display Type 'Text' (14)
|
|
if (this.metadata.displayType === TEXT.id) {
|
|
typeInput = 'textarea'
|
|
}
|
|
if (this.metadata.isEncrypted) {
|
|
typeInput = 'password'
|
|
}
|
|
return typeInput
|
|
},
|
|
maxLength() {
|
|
if (!this.isEmptyValue(this.metadata.fieldLength) && this.metadata.fieldLength > 0) {
|
|
return Number(this.metadata.fieldLength)
|
|
}
|
|
return undefined
|
|
}
|
|
}
|
|
}
|
|
</script>
|