Browse Source

refactor(gui): Remove lazy load from normal cell

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/341/head
Pranav C 4 years ago
parent
commit
dc43e4193d
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/cell.vue
  2. 4
      packages/nc-gui/components/project/spreadsheet/components/editableCell.vue
  3. 6
      packages/nc-gui/components/project/spreadsheet/components/pagination.vue
  4. 11
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue

2
packages/nc-gui/components/project/spreadsheet/components/cell.vue

@ -1,5 +1,4 @@
<template> <template>
<v-lazy>
<editable-attachment-cell <editable-attachment-cell
:isLocked="isLocked" :isLocked="isLocked"
:db-alias="dbAlias" :db-alias="dbAlias"
@ -8,7 +7,6 @@
<!-- <enum-list-editable-cell @click.stop="$emit('enableedit')" v-else-if="isEnum && selected" :value="value" :column="column"></enum-list-editable-cell>--> <!-- <enum-list-editable-cell @click.stop="$emit('enableedit')" v-else-if="isEnum && selected" :value="value" :column="column"></enum-list-editable-cell>-->
<enum-cell @click.stop="$emit('enableedit')" v-else-if="isEnum" :value="value" :column="column"></enum-cell> <enum-cell @click.stop="$emit('enableedit')" v-else-if="isEnum" :value="value" :column="column"></enum-cell>
<span v-else>{{ value }}</span> <span v-else>{{ value }}</span>
</v-lazy>
</template> </template>
<script> <script>

4
packages/nc-gui/components/project/spreadsheet/components/editableCell.vue

@ -1,5 +1,4 @@
<template> <template>
<v-lazy>
<div <div
@keydown.stop.left @keydown.stop.left
@keydown.stop.right @keydown.stop.right
@ -66,7 +65,6 @@
<text-cell v-else v-model="localState" v-on="$listeners"></text-cell> <text-cell v-else v-model="localState" v-on="$listeners"></text-cell>
</div> </div>
</v-lazy>
</template> </template>
<script> <script>
@ -106,7 +104,7 @@ export default {
}, },
props: { props: {
dbAlias: String, dbAlias: String,
value: [String, Number, Object, Boolean], value: [String, Number, Object, Boolean,Array,Object],
meta: Object, meta: Object,
ignoreFocus: Boolean, ignoreFocus: Boolean,
isForm: Boolean, isForm: Boolean,

6
packages/nc-gui/components/project/spreadsheet/components/pagination.vue

@ -31,9 +31,9 @@
<script> <script>
export default { export default {
props: { props: {
count: Number, count: [Number, String],
value: Number, value: [Number, String],
size: Number, size: [Number, String],
}, },
data: () => ({ data: () => ({
page: 1 page: 1

11
packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue

@ -123,6 +123,9 @@ import listChildItemsModal
from "@/components/project/spreadsheet/components/virtualCell/components/listChildItemsModal"; from "@/components/project/spreadsheet/components/virtualCell/components/listChildItemsModal";
import {parseIfInteger} from "@/helpers"; import {parseIfInteger} from "@/helpers";
// todo: handling add new record for new row
export default { export default {
name: "has-many-cell", name: "has-many-cell",
components: { components: {
@ -276,9 +279,11 @@ export default {
[this.childForeignKey]: parseIfInteger(this.parentId) [this.childForeignKey]: parseIfInteger(this.parentId)
}; };
this.expandFormModal = true; this.expandFormModal = true;
setTimeout(() => { if (!this.isNew) {
this.$refs.expandedForm && this.$refs.expandedForm.$set(this.$refs.expandedForm.changedColumns, this.childForeignKey, true) setTimeout(() => {
}, 500) this.$refs.expandedForm && this.$refs.expandedForm.$set(this.$refs.expandedForm.changedColumns, this.childForeignKey, true)
}, 500)
}
}, },
getCellValue(cellObj) { getCellValue(cellObj) {
if (cellObj) { if (cellObj) {

Loading…
Cancel
Save