1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-11 13:39:48 +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 * @param {string} pageSize
*/ */
export function requestListRecordChats({ tableName, recordId, pageToken, 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({ return Instance.call(this).requestListRecordChats({
tableName, tableName,
recordId, recordId,
@ -479,7 +478,6 @@ export function requestListRecordChats({ tableName, recordId, pageToken, pageSiz
* @param {string} pageSize * @param {string} pageSize
*/ */
export function requestListChatEntries({ uuid, pageToken, pageSize }) { export function requestListChatEntries({ uuid, pageToken, pageSize }) {
console.log(uuid, Instance.call(this).requestListChatEntries({ uuid, pageToken, pageSize }))
return Instance.call(this).requestListChatEntries({ return Instance.call(this).requestListChatEntries({
uuid, uuid,
pageToken, pageToken,

View File

@ -42,8 +42,8 @@ export default {
}, },
typeTextBox() { typeTextBox() {
// String, Url, FileName... // String, Url, FileName...
var typeInput = 'text' let typeInput = 'text'
if (['Memo', 'Text'].includes(this.metadata.referenceType)) { if (this.metadata.referenceType === 'Text') {
typeInput = 'textarea' typeInput = 'textarea'
} }
if (this.metadata.isEncrypted) { if (this.metadata.isEncrypted) {
@ -79,7 +79,7 @@ export default {
methods: { methods: {
validateUrl(e) { validateUrl(e) {
// Entry pattern, in this case only accepts numbers and letters // 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 rex = RegExp(_Pattern)
var value = e.target.value var value = e.target.value
if (rex.test(value) && value.trim() !== '') { if (rex.test(value) && value.trim() !== '') {

View File

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

View File

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

View File

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