|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="h-100"> |
|
|
|
<div class="h-100"> |
|
|
|
<v-toolbar v-if="!viewMode" class="elevation-0"> |
|
|
|
<v-toolbar v-if="!viewMode" class="elevation-0"> |
|
|
|
<slot name="toolbar"> |
|
|
|
<slot name="toolbar" :valid="valid"> |
|
|
|
<!-- <v-text-field |
|
|
|
<!-- <v-text-field |
|
|
|
v-model="url" |
|
|
|
v-model="url" |
|
|
|
clearable |
|
|
|
clearable |
|
|
@ -87,7 +87,7 @@ |
|
|
|
</slot> |
|
|
|
</slot> |
|
|
|
</v-toolbar> |
|
|
|
</v-toolbar> |
|
|
|
<v-container class="text-center" style="height:calc(100% - 64px);overflow-y: auto"> |
|
|
|
<v-container class="text-center" style="height:calc(100% - 64px);overflow-y: auto"> |
|
|
|
<v-form ref="form"> |
|
|
|
<v-form ref="form" v-model="valid"> |
|
|
|
<v-row fluid class="justify-center"> |
|
|
|
<v-row fluid class="justify-center"> |
|
|
|
<v-col cols="12"> |
|
|
|
<v-col cols="12"> |
|
|
|
<v-card> |
|
|
|
<v-card> |
|
|
@ -130,7 +130,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<v-spacer /> |
|
|
|
<v-spacer /> |
|
|
|
<v-icon v-if="!viewMode" class="flex-grow-0 mr-2" small color="grey" @click.stop="deleteTable(i)"> |
|
|
|
<v-icon v-if="!viewMode" class="flex-grow-0 mr-2" small color="grey" @click.stop="deleteTable(i)"> |
|
|
|
mdi-delete |
|
|
|
mdi-delete-outline |
|
|
|
</v-icon> |
|
|
|
</v-icon> |
|
|
|
</v-expansion-panel-header> |
|
|
|
</v-expansion-panel-header> |
|
|
|
<v-expansion-panel-content> |
|
|
|
<v-expansion-panel-content> |
|
|
@ -144,10 +144,10 @@ |
|
|
|
<v-simple-table v-if="table.columns.length" dense class="my-4"> |
|
|
|
<v-simple-table v-if="table.columns.length" dense class="my-4"> |
|
|
|
<thead> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th class="caption text-left pa-3"> |
|
|
|
<th class="caption text-left pa-1"> |
|
|
|
Column Name |
|
|
|
Column Name |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th class="caption text-left pa-3" colspan="4"> |
|
|
|
<th class="caption text-left pa-1" colspan="4"> |
|
|
|
Column Type |
|
|
|
Column Type |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th /> |
|
|
|
<th /> |
|
|
@ -157,7 +157,7 @@ |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
<tr v-for="(col,j) in table.columns" :key="j" :data-exp="i"> |
|
|
|
<tr v-for="(col,j) in table.columns" :key="j" :data-exp="i"> |
|
|
|
<td class="pa-3 text-left" :style="{width:viewMode ? '33%' : ''}"> |
|
|
|
<td class="pa-1 text-left" :style="{width:viewMode ? '33%' : '15%'}"> |
|
|
|
<span v-if="viewMode" class="body-1 "> |
|
|
|
<span v-if="viewMode" class="body-1 "> |
|
|
|
{{ col.cn }} |
|
|
|
{{ col.cn }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -225,12 +225,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<td |
|
|
|
<td |
|
|
|
class="pa-3 text-left" |
|
|
|
class="pa-1 text-left" |
|
|
|
:colspan="isLookupOrRollup(col) || isRelation(col) || isSelect(col) ? (isRollup(col)? |
|
|
|
style="width:200px;max-width:200px" |
|
|
|
1 :2) : 4" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<v-autocomplete |
|
|
|
<v-autocomplete |
|
|
|
:ref="`uidt_${table.tn}_${j}`" |
|
|
|
:ref="`uidt_${table.tn}_${j}`" |
|
|
|
|
|
|
|
style="max-width: 200px" |
|
|
|
:value="col.uidt" |
|
|
|
:value="col.uidt" |
|
|
|
placeholder="Column Datatype" |
|
|
|
placeholder="Column Datatype" |
|
|
|
outlined |
|
|
|
outlined |
|
|
@ -254,7 +254,7 @@ |
|
|
|
<span v-else class="caption">{{ name }}</span> |
|
|
|
<span v-else class="caption">{{ name }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #selection="{item:{name}} "> |
|
|
|
<template #selection="{item:{name}} "> |
|
|
|
<v-chip v-if="colors[name]" :color="colors[name]" small> |
|
|
|
<v-chip v-if="colors[name]" :color="colors[name]" small style="max-width: 100px"> |
|
|
|
{{ name }} |
|
|
|
{{ name }} |
|
|
|
</v-chip> |
|
|
|
</v-chip> |
|
|
|
<span v-else class="caption">{{ name }}</span> |
|
|
|
<span v-else class="caption">{{ name }}</span> |
|
|
@ -265,7 +265,7 @@ |
|
|
|
<template |
|
|
|
<template |
|
|
|
v-if="isRelation(col) || isLookupOrRollup(col)" |
|
|
|
v-if="isRelation(col) || isLookupOrRollup(col)" |
|
|
|
> |
|
|
|
> |
|
|
|
<td class="pa-3 text-left"> |
|
|
|
<td class="pa-1 text-left"> |
|
|
|
<v-autocomplete |
|
|
|
<v-autocomplete |
|
|
|
:value="col.rtn" |
|
|
|
:value="col.rtn" |
|
|
|
placeholder="Related table" |
|
|
|
placeholder="Related table" |
|
|
@ -282,7 +282,7 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
|
|
|
|
|
|
|
|
<td v-if="isRelation(col)" class="pa-3"> |
|
|
|
<td v-if="isRelation(col)" class="pa-1"> |
|
|
|
<template v-if="col.uidt !== 'ForeignKey'"> |
|
|
|
<template v-if="col.uidt !== 'ForeignKey'"> |
|
|
|
<span |
|
|
|
<span |
|
|
|
v-if="viewMode" |
|
|
|
v-if="viewMode" |
|
|
@ -304,7 +304,7 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<td v-if="isLookupOrRollup(col)" class="pa-3"> |
|
|
|
<td v-if="isLookupOrRollup(col)" class="pa-1"> |
|
|
|
<span |
|
|
|
<span |
|
|
|
v-if="viewMode" |
|
|
|
v-if="viewMode" |
|
|
|
class="caption" |
|
|
|
class="caption" |
|
|
@ -326,7 +326,7 @@ |
|
|
|
item-value="cn" |
|
|
|
item-value="cn" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<td v-if="isRollup(col)" class="pa-3"> |
|
|
|
<td v-if="isRollup(col)" class="pa-1"> |
|
|
|
<span |
|
|
|
<span |
|
|
|
v-if="viewMode" |
|
|
|
v-if="viewMode" |
|
|
|
class="caption" |
|
|
|
class="caption" |
|
|
@ -350,7 +350,7 @@ |
|
|
|
<template |
|
|
|
<template |
|
|
|
v-if="isSelect(col)" |
|
|
|
v-if="isSelect(col)" |
|
|
|
> |
|
|
|
> |
|
|
|
<td class="pa-3 text-left" colspan="2"> |
|
|
|
<td class="pa-1 text-left" colspan="2"> |
|
|
|
<span |
|
|
|
<span |
|
|
|
v-if="viewMode" |
|
|
|
v-if="viewMode" |
|
|
|
class="caption" |
|
|
|
class="caption" |
|
|
@ -367,7 +367,12 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<td> |
|
|
|
<td |
|
|
|
|
|
|
|
v-if="!isRollup(col) " |
|
|
|
|
|
|
|
:colspan="isLookupOrRollup(col) || isRelation(col) || isSelect(col) ? (isRollup(col)? |
|
|
|
|
|
|
|
0 :1) : 3" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<td style="max-width: 50px;width: 50px"> |
|
|
|
<v-icon |
|
|
|
<v-icon |
|
|
|
v-if="!viewMode" |
|
|
|
v-if="!viewMode" |
|
|
|
class="flex-grow-0" |
|
|
|
class="flex-grow-0" |
|
|
@ -375,7 +380,7 @@ |
|
|
|
color="grey" |
|
|
|
color="grey" |
|
|
|
@click.stop="deleteTableColumn(i,j, col, table)" |
|
|
|
@click.stop="deleteTableColumn(i,j, col, table)" |
|
|
|
> |
|
|
|
> |
|
|
|
mdi-delete |
|
|
|
mdi-delete-outline |
|
|
|
</v-icon> |
|
|
|
</v-icon> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -439,7 +444,7 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
Click to change gradient |
|
|
|
Click to change gradient |
|
|
|
</div>--> |
|
|
|
</div>--> |
|
|
|
|
|
|
|
<template v-if="!excelImport"> |
|
|
|
<gradient-generator v-model="project.image_url" class=" d-100" /> |
|
|
|
<gradient-generator v-model="project.image_url" class=" d-100" /> |
|
|
|
|
|
|
|
|
|
|
|
<v-row> |
|
|
|
<v-row> |
|
|
@ -473,6 +478,7 @@ |
|
|
|
@click="counter++" |
|
|
|
@click="counter++" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</v-card-text> |
|
|
|
</v-card-text> |
|
|
|
</v-card> |
|
|
|
</v-card> |
|
|
@ -571,7 +577,8 @@ export default { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
id: [Number, String], |
|
|
|
id: [Number, String], |
|
|
|
viewMode: Boolean, |
|
|
|
viewMode: Boolean, |
|
|
|
projectTemplate: Object |
|
|
|
projectTemplate: Object, |
|
|
|
|
|
|
|
excelImport: Boolean |
|
|
|
}, |
|
|
|
}, |
|
|
|
data: () => ({ |
|
|
|
data: () => ({ |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
@ -1277,14 +1284,16 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
if (oldVal === UITypes.LinkToAnotherRecord) { |
|
|
|
if (oldVal === UITypes.LinkToAnotherRecord) { |
|
|
|
rTable = this.project.tables.find(t => t.tn === col.rtn) |
|
|
|
rTable = this.project.tables.find(t => t.tn === col.rtn) |
|
|
|
|
|
|
|
if (rTable) { |
|
|
|
if (col.type === 'hm') { |
|
|
|
if (col.type === 'hm') { |
|
|
|
index = rTable.columns.findIndex(c => c.uidt === UITypes.ForeignKey && c.rtn === table.tn) |
|
|
|
index = rTable.columns.findIndex(c => c.uidt === UITypes.ForeignKey && c.rtn === table.tn) |
|
|
|
} else if (col.type === 'mm') { |
|
|
|
} else if (col.type === 'mm') { |
|
|
|
index = rTable.columns.findIndex(c => c.uidt === UITypes.LinkToAnotherRecord && c.rtn === table.tn && c.type === 'mm') |
|
|
|
index = rTable.columns.findIndex(c => c.uidt === UITypes.LinkToAnotherRecord && c.rtn === table.tn && c.type === 'mm') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (oldVal === UITypes.ForeignKey) { |
|
|
|
} else if (oldVal === UITypes.ForeignKey) { |
|
|
|
rTable = this.project.tables.find(t => t.tn === col.rtn) |
|
|
|
rTable = this.project.tables.find(t => t.tn === col.rtn) |
|
|
|
index = rTable.columns.findIndex(c => c.uidt === UITypes.LinkToAnotherRecord && c.rtn === table.tn && c.type === 'hm') |
|
|
|
if (rTable) { index = rTable.columns.findIndex(c => c.uidt === UITypes.LinkToAnotherRecord && c.rtn === table.tn && c.type === 'hm') } |
|
|
|
} |
|
|
|
} |
|
|
|
if (rTable && index > -1) { |
|
|
|
if (rTable && index > -1) { |
|
|
|
rTable.columns.splice(index, 1) |
|
|
|
rTable.columns.splice(index, 1) |
|
|
@ -1303,4 +1312,7 @@ export default { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
|
|
|
|
|
/deep/ .v-select__selections{ |
|
|
|
|
|
|
|
flex-wrap: nowrap; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|