1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-18 20:50:48 +01:00

fix: improved changes dedection in props tab

This commit is contained in:
Fabio Di Stasio 2020-12-07 19:11:29 +01:00
parent 5712b80022
commit acebe435ff
5 changed files with 22 additions and 14 deletions

View File

@ -177,7 +177,7 @@ export class MySQLClient extends AntaresCore {
return { return {
name: field.COLUMN_NAME, name: field.COLUMN_NAME,
key: field.COLUMN_KEY.toLowerCase(), key: field.COLUMN_KEY.toLowerCase(),
type: field.DATA_TYPE, type: field.DATA_TYPE.toUpperCase(),
schema: field.TABLE_SCHEMA, schema: field.TABLE_SCHEMA,
table: field.TABLE_NAME, table: field.TABLE_NAME,
numPrecision: field.NUMERIC_PRECISION, numPrecision: field.NUMERIC_PRECISION,

View File

@ -36,14 +36,14 @@
> >
</div> </div>
<div <div
class="td text-uppercase text-left" class="td text-uppercase"
tabindex="0" tabindex="0"
:class="`type-${lowerCase(localRow.type)}`"
> >
<span <span
v-if="!isInlineEditor.type" v-if="!isInlineEditor.type"
class="cell-content" class="cell-content text-left"
@dblclick="editON($event, localRow.type.toUpperCase(), 'type')" :class="`type-${lowerCase(localRow.type)}`"
@click="editON($event, localRow.type.toUpperCase(), 'type')"
> >
{{ localRow.type }} {{ localRow.type }}
</span> </span>
@ -51,7 +51,7 @@
v-else v-else
ref="editField" ref="editField"
v-model="editingContent" v-model="editingContent"
class="editable-field px-1 text-uppercase" class="form-select editable-field small-select text-uppercase"
@blur="editOFF" @blur="editOFF"
> >
<optgroup <optgroup
@ -148,7 +148,7 @@
<span <span
v-if="!isInlineEditor.collation" v-if="!isInlineEditor.collation"
class="cell-content" class="cell-content"
@dblclick="editON($event, localRow.collation, 'collation')" @click="editON($event, localRow.collation, 'collation')"
> >
{{ localRow.collation }} {{ localRow.collation }}
</span> </span>
@ -156,7 +156,7 @@
v-else v-else
ref="editField" ref="editField"
v-model="editingContent" v-model="editingContent"
class="editable-field px-1" class="form-select small-select editable-field"
@blur="editOFF" @blur="editOFF"
> >
<option <option
@ -301,6 +301,7 @@ export default {
onUpdate: '' onUpdate: ''
}, },
editingContent: null, editingContent: null,
originalContent: null,
editingField: null editingField: null
}; };
}, },
@ -401,6 +402,7 @@ export default {
this.editingField = field; this.editingField = field;
this.editingContent = content; this.editingContent = content;
this.originalContent = content;
const obj = { [field]: true }; const obj = { [field]: true };
this.isInlineEditor = { ...this.isInlineEditor, ...obj }; this.isInlineEditor = { ...this.isInlineEditor, ...obj };
@ -418,10 +420,10 @@ export default {
editOFF () { editOFF () {
this.localRow[this.editingField] = this.editingContent; this.localRow[this.editingField] = this.editingContent;
if (this.editingField === 'type') { if (this.editingField === 'type' && this.editingContent !== this.originalContent) {
this.localRow.numLength = false; this.localRow.numLength = null;
this.localRow.charLength = false; this.localRow.charLength = null;
this.localRow.datePrecision = false; this.localRow.datePrecision = null;
if (this.fieldType.length) { if (this.fieldType.length) {
if (['integer', 'float', 'binary', 'spatial'].includes(this.fieldType.group)) this.localRow.numLength = 11; if (['integer', 'float', 'binary', 'spatial'].includes(this.fieldType.group)) this.localRow.numLength = 11;
@ -464,6 +466,7 @@ export default {
}); });
this.editingContent = null; this.editingContent = null;
this.originalContent = null;
this.editingField = null; this.editingField = null;
}, },
hideDefaultModal () { hideDefaultModal () {

View File

@ -231,7 +231,6 @@ export default {
return row[primaryFieldName]; return row[primaryFieldName];
}, },
setLocalResults () { setLocalResults () {
// this.resetSort();
this.localResults = this.resultsWithRows[this.resultsetIndex] && this.resultsWithRows[this.resultsetIndex].rows this.localResults = this.resultsWithRows[this.resultsetIndex] && this.resultsWithRows[this.resultsetIndex].rows
? this.resultsWithRows[this.resultsetIndex].rows.map(item => { ? this.resultsWithRows[this.resultsetIndex].rows.map(item => {
return { ...item, _id: uidGen() }; return { ...item, _id: uidGen() };

View File

@ -274,7 +274,7 @@ export default {
if (field) if (field)
type = field.type; type = field.type;
return type; return type.toLowerCase();
}, },
getFieldPrecision (cKey) { getFieldPrecision (cKey) {
let length = 0; let length = 0;

View File

@ -180,6 +180,12 @@ body {
.form-select { .form-select {
cursor: pointer; cursor: pointer;
&.small-select {
height: 1rem;
font-size: 0.7rem;
padding: 1px 0.4rem 0;
}
} }
.form-select, .form-select,