|
|
@ -27,7 +27,7 @@ |
|
|
|
@xcresized="resizingCol = null" |
|
|
|
@xcresized="resizingCol = null" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- :style="columnsWidth[col._cn] ? `min-width:${columnsWidth[col._cn]}; max-width:${columnsWidth[col._cn]}` : ''" |
|
|
|
<!-- :style="columnsWidth[col._cn] ? `min-width:${columnsWidth[col._cn]}; max-width:${columnsWidth[col._cn]}` : ''" |
|
|
|
--> |
|
|
|
--> |
|
|
|
|
|
|
|
|
|
|
|
<virtual-header-cell |
|
|
|
<virtual-header-cell |
|
|
|
v-if="col.virtual" |
|
|
|
v-if="col.virtual" |
|
|
@ -136,13 +136,13 @@ |
|
|
|
:key="row + columnObj.alias" |
|
|
|
:key="row + columnObj.alias" |
|
|
|
class="cell pointer" |
|
|
|
class="cell pointer" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'active' : !isPublicView && selected.col === col && selected.row === row && isEditable , |
|
|
|
'active' :!isPublicView && selected.col === col && selected.row === row && isEditable , |
|
|
|
'primary-column' : primaryValueColumn === columnObj._cn, |
|
|
|
'primary-column' : primaryValueColumn === columnObj._cn, |
|
|
|
'text-center': isCentrallyAligned(columnObj), |
|
|
|
'text-center': isCentrallyAligned(columnObj), |
|
|
|
'required': isRequired(columnObj,rowObj) |
|
|
|
'required': isRequired(columnObj,rowObj) |
|
|
|
}" |
|
|
|
}" |
|
|
|
:data-col="columnObj.alias" |
|
|
|
:data-col="columnObj.alias" |
|
|
|
@dblclick="makeEditable(col,row,columnObj.ai)" |
|
|
|
@dblclick="makeEditable(col,row,columnObj.ai,rowMeta)" |
|
|
|
@click="makeSelected(col,row);" |
|
|
|
@click="makeSelected(col,row);" |
|
|
|
@contextmenu="showRowContextMenu($event,rowObj,rowMeta,row,col, columnObj)" |
|
|
|
@contextmenu="showRowContextMenu($event,rowObj,rowMeta,row,col, columnObj)" |
|
|
|
> |
|
|
|
> |
|
|
@ -162,7 +162,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<editable-cell |
|
|
|
<editable-cell |
|
|
|
v-else-if=" |
|
|
|
v-else-if=" |
|
|
|
!isLocked |
|
|
|
(isPkAvail ||rowMeta.new) && |
|
|
|
|
|
|
|
!isLocked |
|
|
|
&& !isPublicView |
|
|
|
&& !isPublicView |
|
|
|
&& (editEnabled.col === col && editEnabled.row === row) |
|
|
|
&& (editEnabled.col === col && editEnabled.row === row) |
|
|
|
|| enableEditable(columnObj) |
|
|
|
|| enableEditable(columnObj) |
|
|
@ -190,11 +191,11 @@ |
|
|
|
:db-alias="nodes.dbAlias" |
|
|
|
:db-alias="nodes.dbAlias" |
|
|
|
:value="rowObj[columnObj._cn]" |
|
|
|
:value="rowObj[columnObj._cn]" |
|
|
|
:sql-ui="sqlUi" |
|
|
|
:sql-ui="sqlUi" |
|
|
|
@enableedit="makeSelected(col,row);makeEditable(col,row,columnObj.ai)" |
|
|
|
@enableedit="makeSelected(col,row);makeEditable(col,row,columnObj.ai, rowMeta)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr v-if="!isLocked && !isPublicView && isEditable && relationType !== 'bt'"> |
|
|
|
<tr v-if="isPkAvail && !isLocked && !isPublicView && isEditable && relationType !== 'bt'"> |
|
|
|
<td :colspan="visibleColLength + 1" class="text-left pointer" @click="insertNewRow(true)"> |
|
|
|
<td :colspan="visibleColLength + 1" class="text-left pointer" @click="insertNewRow(true)"> |
|
|
|
<v-tooltip top> |
|
|
|
<v-tooltip top> |
|
|
|
<template #activator="{on}"> |
|
|
|
<template #activator="{on}"> |
|
|
@ -214,7 +215,9 @@ |
|
|
|
<!-- <div is="style" v-html="resizeColStyle" />--> |
|
|
|
<!-- <div is="style" v-html="resizeColStyle" />--> |
|
|
|
<dynamic-style> |
|
|
|
<dynamic-style> |
|
|
|
<template v-if="resizingCol"> |
|
|
|
<template v-if="resizingCol"> |
|
|
|
[data-col="{{ resizingCol }}"]{min-width:{{ resizingColWidth }};max-width:{{ resizingColWidth }};width:{{ resizingColWidth }};} |
|
|
|
[data-col="{{ resizingCol }}"]{min-width:{{ resizingColWidth }};max-width:{{ |
|
|
|
|
|
|
|
resizingColWidth |
|
|
|
|
|
|
|
}};width:{{ resizingColWidth }};} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</dynamic-style> |
|
|
|
</dynamic-style> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -261,7 +264,8 @@ export default { |
|
|
|
table: String, |
|
|
|
table: String, |
|
|
|
isVirtual: Boolean, |
|
|
|
isVirtual: Boolean, |
|
|
|
isLocked: Boolean, |
|
|
|
isLocked: Boolean, |
|
|
|
columnsWidth: { type: Object } |
|
|
|
columnsWidth: { type: Object }, |
|
|
|
|
|
|
|
isPkAvail: Boolean |
|
|
|
}, |
|
|
|
}, |
|
|
|
data: () => ({ |
|
|
|
data: () => ({ |
|
|
|
resizingCol: null, |
|
|
|
resizingCol: null, |
|
|
@ -426,6 +430,10 @@ export default { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.key && e.key.length === 1) { |
|
|
|
if (e.key && e.key.length === 1) { |
|
|
|
|
|
|
|
if (!this.isPkAvail && !this.data[this.selected.row].rowMeta.new) { |
|
|
|
|
|
|
|
return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$set(this.data[this.selected.row].row, this.availableColumns[this.selected.col]._cn, '') |
|
|
|
this.$set(this.data[this.selected.row].row, this.availableColumns[this.selected.col]._cn, '') |
|
|
|
this.editEnabled = { ...this.selected } |
|
|
|
this.editEnabled = { ...this.selected } |
|
|
|
} |
|
|
|
} |
|
|
@ -466,10 +474,14 @@ export default { |
|
|
|
this.editEnabled = {} |
|
|
|
this.editEnabled = {} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
makeEditable(col, row) { |
|
|
|
makeEditable(col, row, _, rowMeta) { |
|
|
|
if (this.isPublicView || !this.isEditable) { |
|
|
|
if (this.isPublicView || !this.isEditable) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.isPkAvail && !rowMeta.new) { |
|
|
|
|
|
|
|
return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000) |
|
|
|
|
|
|
|
} |
|
|
|
if (this.availableColumns[col].ai) { |
|
|
|
if (this.availableColumns[col].ai) { |
|
|
|
return this.$toast.info('Auto Increment field is not editable').goAway(3000) |
|
|
|
return this.$toast.info('Auto Increment field is not editable').goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|