feat: add sql views support(readonly)

re #135

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2021-12-05 17:00:25 +05:30
parent 5efb2271c4
commit 5dee734e58
15 changed files with 286 additions and 181 deletions

View File

@@ -23,7 +23,7 @@
>
Reload
</x-btn>
<x-btn
<!-- <x-btn
outlined
tooltip="Toggle All"
small
@@ -33,7 +33,7 @@
@click="toggleAll(toggle)"
>
Toggle All {{ toggle ? 'ON' : 'OFF' }}
</x-btn>
</x-btn>-->
<x-btn
outlined
tooltip="Save Changes"
@@ -68,12 +68,22 @@
<template #header>
<thead>
<tr class="text-left caption">
<th>#</th>
<th>Table Name <span class="caption grey--text">({{ selectedCount }})</span></th>
<th>Relation</th>
<th>Parent</th>
<th>Child</th>
<th />
<th class="grey--text">
#
</th>
<th class="grey--text">
Table Name <span class="caption grey--text">({{ selectedCount }})</span>
</th>
<th class="grey--text">
Relation
</th>
<th class="grey--text">
Parent
</th>
<th class="grey--text">
Child
</th>
<!-- <th />-->
</tr>
</thead>
</template>
@@ -85,7 +95,7 @@
<td>{{ item.relationType === 'hm' ? 'HasMany' : 'BelongsTo' }}</td>
<td>{{ item.rtn }}</td>
<td>{{ item.tn }}</td>
<td>
<!-- <td>
<v-checkbox
v-model="item.enabled"
class=""
@@ -93,7 +103,7 @@
hide-details
@change="$set(item,'edited',true)"
/>
</td>
</td>-->
</tr>
</template>
</v-data-table>

View File

@@ -49,14 +49,16 @@
<v-simple-table dense style="min-width: 400px">
<thead>
<tr>
<th>
<th class="grey--text">
Models <span v-show="!isNewOrDeletedModelFound" class="caption ml-1">({{
enableCountText
}})</span>
</th>
<th>APIs</th>
<th>Actions</th>
<th>Comment</th>
<!-- <th>APIs</th>-->
<th class="grey--text">
Actions
</th>
<th />
</tr>
</thead>
<tbody>
@@ -70,14 +72,14 @@
<span class="caption">{{ model.title }}</span>
</v-tooltip>
</td>
<td>
<!-- <td>
<v-checkbox
v-model="model.enabled"
dense
:disabled="model.new || model.deleted"
@change="edited = true"
/>
</td>
</td>-->
<td>
<template v-if="model.new">
<!-- <x-icon small color="success success" tooltip="Add and sync meta information"-->

View File

@@ -49,14 +49,17 @@
<v-simple-table dense style="min-width: 400px">
<thead>
<tr>
<th>
<th class="grey--text">
Models <span v-show="!isNewOrDeletedModelFound" class="caption ml-1">({{
enableCountText
}})</span>
</th>
<th>APIs</th>
<th>Actions</th>
<th>Comment</th>
<!-- <th>APIs</th>-->
<th class="grey--text">
Actions
</th>
<!-- <th>Comment</th>-->
<th />
</tr>
</thead>
<tbody>
@@ -68,14 +71,14 @@
:key="model.title"
>
<td>{{ model.title }}</td>
<td>
<!-- <td>
<v-checkbox
v-model="model.enabled"
dense
:disabled="model.new || model.deleted"
@change="edited = true"
/>
</td>
</td>-->
<td>
<template v-if="model.new">
<!-- <x-icon small color="success success" tooltip="Add and sync meta information"-->
@@ -263,7 +266,7 @@ export default {
this.views = (await this.$store.dispatch('sqlMgr/ActSqlOp', [{
dbAlias: this.db.meta.dbAlias,
env: this.$store.getters['project/GtrEnv']
}, 'viewList'])).data.list
}, 'viewList', { force: true }])).data.list
},
async saveModels() {