|
|
@ -10,6 +10,7 @@ import { |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useMenuCloseOnEsc, |
|
|
|
useMenuCloseOnEsc, |
|
|
|
|
|
|
|
useNuxtApp, |
|
|
|
useSmartsheetStoreOrThrow, |
|
|
|
useSmartsheetStoreOrThrow, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
@ -28,6 +29,8 @@ const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const { gridViewCols, updateGridViewColumn } = useGridViewColumnOrThrow() |
|
|
|
const { gridViewCols, updateGridViewColumn } = useGridViewColumnOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
const _groupBy = ref<{ fk_column_id?: string; sort: string; order: number }[]>([]) |
|
|
|
const _groupBy = ref<{ fk_column_id?: string; sort: string; order: number }[]>([]) |
|
|
|
|
|
|
|
|
|
|
|
const groupBy = computed<{ fk_column_id?: string; sort: string; order: number }[]>(() => { |
|
|
|
const groupBy = computed<{ fk_column_id?: string; sort: string; order: number }[]>(() => { |
|
|
@ -106,6 +109,8 @@ const saveGroupBy = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$e('a:group-by:update', { groupBy: groupBy.value }) |
|
|
|
|
|
|
|
|
|
|
|
eventBus.emit(SmartsheetStoreEvents.GROUP_BY_RELOAD) |
|
|
|
eventBus.emit(SmartsheetStoreEvents.GROUP_BY_RELOAD) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
message.error('There was an error while updating view!') |
|
|
|
message.error('There was an error while updating view!') |
|
|
@ -200,7 +205,13 @@ watch(open, () => { |
|
|
|
</NcSelect> |
|
|
|
</NcSelect> |
|
|
|
|
|
|
|
|
|
|
|
<a-tooltip placement="right" title="Remove"> |
|
|
|
<a-tooltip placement="right" title="Remove"> |
|
|
|
<NcButton class="nc-group-by-item-remove-btn" size="small" type="text" @click.stop="removeFieldFromGroupBy(i)"> |
|
|
|
<NcButton |
|
|
|
|
|
|
|
v-e="['c:group-by:remove']" |
|
|
|
|
|
|
|
class="nc-group-by-item-remove-btn" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click.stop="removeFieldFromGroupBy(i)" |
|
|
|
|
|
|
|
> |
|
|
|
<GeneralIcon icon="delete" class="" /> |
|
|
|
<GeneralIcon icon="delete" class="" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</a-tooltip> |
|
|
|
</a-tooltip> |
|
|
@ -208,6 +219,7 @@ watch(open, () => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-if="fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3" |
|
|
|
v-if="fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3" |
|
|
|
|
|
|
|
v-e="['c:group-by:add']" |
|
|
|
class="nc-add-group-btn" |
|
|
|
class="nc-add-group-btn" |
|
|
|
style="width: fit-content" |
|
|
|
style="width: fit-content" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|