1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-11 05:11:59 +08:00

fix: Text Long not only change value to old value. (#303)

This commit is contained in:
EdwinBetanc0urt 2020-02-05 19:10:12 -04:00 committed by GitHub
parent 94788e0e7c
commit cdaf4832cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 33 deletions

View File

@ -464,7 +464,6 @@ export function requestListWorkflows({
* @param {string} pageSize
*/
export function requestListRecordChats({ tableName, recordId, pageToken, pageSize }) {
console.log(tableName, recordId, Instance.call(this).requestListRecordChats({ tableName, recordId, pageToken, pageSize }))
return Instance.call(this).requestListRecordChats({
tableName,
recordId,
@ -479,7 +478,6 @@ export function requestListRecordChats({ tableName, recordId, pageToken, pageSiz
* @param {string} pageSize
*/
export function requestListChatEntries({ uuid, pageToken, pageSize }) {
console.log(uuid, Instance.call(this).requestListChatEntries({ uuid, pageToken, pageSize }))
return Instance.call(this).requestListChatEntries({
uuid,
pageToken,

View File

@ -42,8 +42,8 @@ export default {
},
typeTextBox() {
// String, Url, FileName...
var typeInput = 'text'
if (['Memo', 'Text'].includes(this.metadata.referenceType)) {
let typeInput = 'text'
if (this.metadata.referenceType === 'Text') {
typeInput = 'textarea'
}
if (this.metadata.isEncrypted) {
@ -79,7 +79,7 @@ export default {
methods: {
validateUrl(e) {
// Entry pattern, in this case only accepts numbers and letters
var _Pattern = /^(http[s]?:\/\/(www\.)?|ftp:\/\/(www\.)?|www\.){1}([0-9A-Za-z-\.@:%_\+~#=]+)+((\.[a-zA-Z]{1,5})+)(\/(.)*)?(\?(.)*)?/g
const _Pattern = /^(http[s]?:\/\/(www\.)?|ftp:\/\/(www\.)?|www\.){1}([0-9A-Za-z-\.@:%_\+~#=]+)+((\.[a-zA-Z]{1,5})+)(\/(.)*)?(\?(.)*)?/g
var rex = RegExp(_Pattern)
var value = e.target.value
if (rex.test(value) && value.trim() !== '') {

View File

@ -65,12 +65,6 @@ export default {
value = ''
}
this.value = String(value)
if (this.isDisabled) {
this.editor.setValue(value)
} else {
this.editor.setValue(oldValue)
}
}
},
'metadata.value'(value, oldValue) {
@ -79,21 +73,15 @@ export default {
value = ''
}
this.value = String(value)
if (this.isDisabled) {
this.editor.setValue(value)
} else {
this.editor.setValue(oldValue)
}
}
},
value(newValue, oldValue) {
if (newValue !== this.editor.getValue()) {
if (this.isDisabled) {
this.editor.setValue(newValue)
} else {
this.editor.setValue(oldValue)
}
if (this.isDisabled) {
// not changed value
this.value = oldValue
this.editor.setValue(oldValue)
} else {
this.editor.setValue(newValue)
}
},
language(langValue) {

View File

@ -136,7 +136,7 @@ const REFERENCES = [
},
{
id: 34,
type: 'FieldText',
type: 'FieldTextLong',
support: true,
description: 'Reference List',
alias: ['Memo']

View File

@ -479,7 +479,7 @@ const panel = {
isChangedOldValue = false, withOutColumnNames = []
}) {
const panel = getters.getPanel(containerUuid, isAdvancedQuery)
const fieldList = panel.fieldList
const { fieldList } = panel
// get field
const field = fieldList.find(fieldItem => fieldItem.columnName === columnName)
@ -544,14 +544,16 @@ const panel = {
}
}
// Change Dependents
dispatch('changeDependentFieldsList', {
parentUuid,
containerUuid,
dependentFieldsList: field.dependentFieldsList,
fieldsList: fieldList,
isSendToServer
})
if (!isAdvancedQuery) {
// Change Dependents
dispatch('changeDependentFieldsList', {
parentUuid,
containerUuid,
dependentFieldsList: field.dependentFieldsList,
fieldsList: fieldList,
isSendToServer
})
}
// the field has not changed, then the action is broken
if (newValue === field.value && isEmptyValue(displayColumn) && !isAdvancedQuery) {