mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: better description in foreign key value select
This commit is contained in:
@ -51,7 +51,8 @@ export default {
|
|||||||
}),
|
}),
|
||||||
isValidDefault () {
|
isValidDefault () {
|
||||||
if (!this.foreignList.length) return true;
|
if (!this.foreignList.length) return true;
|
||||||
return this.value === null || this.foreignList.some(foreign => foreign.foreign_column.toString() === this.value.toString());
|
if (this.value === null) return false;
|
||||||
|
return this.foreignList.some(foreign => foreign.foreign_column.toString() === this.value.toString());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created () {
|
async created () {
|
||||||
@ -65,7 +66,7 @@ export default {
|
|||||||
try { // Field data
|
try { // Field data
|
||||||
const { status, response } = await Tables.getTableColumns(params);
|
const { status, response } = await Tables.getTableColumns(params);
|
||||||
if (status === 'success') {
|
if (status === 'success') {
|
||||||
const textField = response.find(field => [...TEXT, ...LONG_TEXT].includes(field.type));
|
const textField = response.find(field => [...TEXT, ...LONG_TEXT].includes(field.type) && field.name !== this.keyUsage.refField);
|
||||||
foreignDesc = textField ? textField.name : false;
|
foreignDesc = textField ? textField.name : false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -253,7 +253,7 @@ export default {
|
|||||||
fieldDefault = +field.default;
|
fieldDefault = +field.default;
|
||||||
|
|
||||||
if ([...TEXT, ...LONG_TEXT].includes(field.type))
|
if ([...TEXT, ...LONG_TEXT].includes(field.type))
|
||||||
fieldDefault = field.default ? field.default.substring(1, field.default.length - 1) : '';
|
fieldDefault = field.default;
|
||||||
|
|
||||||
if ([...TIME, ...DATE].includes(field.type))
|
if ([...TIME, ...DATE].includes(field.type))
|
||||||
fieldDefault = field.default;
|
fieldDefault = field.default;
|
||||||
|
Reference in New Issue
Block a user