|
|
@ -297,7 +297,7 @@ export default { |
|
|
|
showExpandModal: false, |
|
|
|
showExpandModal: false, |
|
|
|
selectedExpandRowIndex: null, |
|
|
|
selectedExpandRowIndex: null, |
|
|
|
selectedExpandRowMeta: null, |
|
|
|
selectedExpandRowMeta: null, |
|
|
|
meta: null, |
|
|
|
// meta: null, |
|
|
|
navDrawer: true, |
|
|
|
navDrawer: true, |
|
|
|
selected: { |
|
|
|
selected: { |
|
|
|
row: null, |
|
|
|
row: null, |
|
|
@ -343,12 +343,19 @@ export default { |
|
|
|
modelName: null |
|
|
|
modelName: null |
|
|
|
}), |
|
|
|
}), |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
|
|
|
|
meta() { |
|
|
|
|
|
|
|
return this.$store.state.meta.metas[this.table] |
|
|
|
|
|
|
|
}, |
|
|
|
sqlUi() { |
|
|
|
sqlUi() { |
|
|
|
// todo: replace with correct client |
|
|
|
// todo: replace with correct client |
|
|
|
return SqlUI.create(this.nodes.dbConnection) |
|
|
|
return SqlUI.create(this.nodes.dbConnection) |
|
|
|
}, |
|
|
|
}, |
|
|
|
api() { |
|
|
|
api() { |
|
|
|
return ApiFactory.create(this.$store.getters['project/GtrProjectType'], (this.meta && this.meta._tn) || this.table, this.meta && this.meta.columns, this, this.meta) |
|
|
|
return this.meta && this.$ncApis.get({ |
|
|
|
|
|
|
|
env: this.nodes.env, |
|
|
|
|
|
|
|
dbAlias: this.nodes.dbAlias, |
|
|
|
|
|
|
|
table: this.meta.tn |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
edited() { |
|
|
|
edited() { |
|
|
|
return this.data && this.data.some(r => r.rowMeta && (r.rowMeta.new || r.rowMeta.changed)) |
|
|
|
return this.data && this.data.some(r => r.rowMeta && (r.rowMeta.new || r.rowMeta.changed)) |
|
|
@ -532,13 +539,21 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
async loadMeta() { |
|
|
|
async loadMeta() { |
|
|
|
this.loadingMeta = true |
|
|
|
this.loadingMeta = true |
|
|
|
const tableMeta = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ |
|
|
|
|
|
|
|
|
|
|
|
await this.$store.dispatch('meta/ActLoadMeta', { |
|
|
|
env: this.nodes.env, |
|
|
|
env: this.nodes.env, |
|
|
|
dbAlias: this.nodes.dbAlias |
|
|
|
dbAlias: this.nodes.dbAlias, |
|
|
|
}, 'tableXcModelGet', { |
|
|
|
tn: this.table, |
|
|
|
tn: this.table |
|
|
|
force: true |
|
|
|
}]) |
|
|
|
}) |
|
|
|
this.meta = JSON.parse(tableMeta.meta) |
|
|
|
|
|
|
|
|
|
|
|
// const tableMeta = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ |
|
|
|
|
|
|
|
// env: this.nodes.env, |
|
|
|
|
|
|
|
// dbAlias: this.nodes.dbAlias |
|
|
|
|
|
|
|
// }, 'tableXcModelGet', { |
|
|
|
|
|
|
|
// tn: this.table |
|
|
|
|
|
|
|
// }]) |
|
|
|
|
|
|
|
// this.meta = JSON.parse(tableMeta.meta) |
|
|
|
this.loadingMeta = false |
|
|
|
this.loadingMeta = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
async loadTableData() { |
|
|
|
async loadTableData() { |
|
|
|