fix: extended fix for gql & improved ui part

Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
mertmit
2022-03-30 13:22:42 +03:00
parent f16cd2e909
commit ea5a936a11
5 changed files with 12 additions and 11 deletions

View File

@@ -1079,11 +1079,12 @@ export default {
// onCellValueChange(col, row, column) {
// this.onCellValueChangeFn(col, row, column)
// },
async onCellValueChange(col, row, column, saved = false) {
async onCellValueChange(col, row, column, saved = true) {
if (!this.data[row]) {
return
}
const { row: rowObj, rowMeta, oldRow, saving } = this.data[row]
const { row: rowObj, rowMeta, oldRow, saving, lastSave } = this.data[row]
if(!lastSave) this.$set(this.data[row], 'lastSave', rowObj[column._cn]);
if (rowMeta.new) {
// return if there is no change
if (oldRow[column._cn] === rowObj[column._cn] || saving) {
@@ -1096,9 +1097,10 @@ export default {
return
}
// return if there is no change
if (oldRow[column._cn] === rowObj[column._cn] && !saved) {
if (oldRow[column._cn] === rowObj[column._cn] && ((lastSave || null) === rowObj[column._cn])) {
return
}
if(saved) this.$set(this.data[row], 'lastSave', oldRow[column._cn]);
const id = this.meta.columns.filter(c => c.pk).map(c => rowObj[c._cn]).join('___')
if (!id) {