mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: cell update soft reload doesn't apply changes
This commit is contained in:
@ -257,10 +257,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
applyUpdate (params) {
|
applyUpdate (params) {
|
||||||
const { primary, id, field, content } = params;
|
const { primary, id, field, table, content } = params;
|
||||||
|
|
||||||
this.localResults = this.localResults.map(row => {
|
this.localResults = this.localResults.map(row => {
|
||||||
if (row[primary] === id)
|
if (row[primary] === id)// only fieldName
|
||||||
row[field] = content;
|
row[field] = content;
|
||||||
|
else if (row[`${table}.${primary}`] === id)// table.fieldName
|
||||||
|
row[`${table}.${field}`] = content;
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
});
|
});
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
v-if="results"
|
v-if="results"
|
||||||
v-show="!isQuering"
|
v-show="!isQuering"
|
||||||
ref="queryTable"
|
ref="queryTable"
|
||||||
:results="[results]"
|
:results="results"
|
||||||
:tab-uid="tabUid"
|
:tab-uid="tabUid"
|
||||||
@update-field="updateField"
|
@update-field="updateField"
|
||||||
@delete-selected="deleteSelected"
|
@delete-selected="deleteSelected"
|
||||||
@ -72,7 +72,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
tabUid: 'data',
|
tabUid: 'data',
|
||||||
isQuering: false,
|
isQuering: false,
|
||||||
results: {},
|
results: [],
|
||||||
fields: [],
|
fields: [],
|
||||||
keyUsage: [],
|
keyUsage: [],
|
||||||
lastTable: null,
|
lastTable: null,
|
||||||
@ -116,7 +116,7 @@ export default {
|
|||||||
async getTableData () {
|
async getTableData () {
|
||||||
if (!this.table) return;
|
if (!this.table) return;
|
||||||
this.isQuering = true;
|
this.isQuering = true;
|
||||||
this.results = {};
|
this.results = [];
|
||||||
const fieldsArr = [];
|
const fieldsArr = [];
|
||||||
const keysArr = [];
|
const keysArr = [];
|
||||||
this.setTabFields({ cUid: this.connection.uid, tUid: this.tabUid, fields: [] });
|
this.setTabFields({ cUid: this.connection.uid, tUid: this.tabUid, fields: [] });
|
||||||
@ -144,7 +144,7 @@ export default {
|
|||||||
const { status, response } = await Tables.getTableData(params);
|
const { status, response } = await Tables.getTableData(params);
|
||||||
|
|
||||||
if (status === 'success')
|
if (status === 'success')
|
||||||
this.results = response;
|
this.results = [response];
|
||||||
else
|
else
|
||||||
this.addNotification({ status: 'error', message: response });
|
this.addNotification({ status: 'error', message: response });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user