diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index d543d592c7..9fae66cc85 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -12,7 +12,7 @@ const emit = defineEmits(['update:modelValue']) const columnMeta = inject(ColumnInj, null)! -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) let isDateInvalid = $ref(false) diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index fb192cfc8c..d444494c8c 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -12,7 +12,7 @@ const emit = defineEmits(['update:modelValue']) const { isMysql } = useProject() -const readOnly = inject(ReadonlyInj, false) +const readOnly = inject(ReadonlyInj, ref(false)) let isDateInvalid = $ref(false) diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 832ddb7ff4..53e7aa02b1 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -1,6 +1,6 @@ + + diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index 3dbb20469f..a3acbd571b 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -9,6 +9,8 @@ import { MetaInj, ReloadRowDataHookInj, computedInject, + createEventHook, + inject, message, provide, ref, diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue index db6aad701d..392fa50c43 100644 --- a/packages/nc-gui/components/tabs/Smartsheet.vue +++ b/packages/nc-gui/components/tabs/Smartsheet.vue @@ -7,6 +7,7 @@ import { IsLockedInj, MetaInj, OpenNewRecordFormHookInj, + ReadonlyInj, ReloadViewDataHookInj, ReloadViewMetaHookInj, TabMetaInj, @@ -18,6 +19,7 @@ import { useMetas, useProvideKanbanViewStore, useProvideSmartsheetStore, + useUIPermission, } from '#imports' import type { TabItem } from '~/lib' @@ -25,6 +27,8 @@ const props = defineProps<{ activeTab: TabItem }>() +const { isUIAllowed } = useUIPermission() + const { metas } = useMetas() const activeTab = toRef(props, 'activeTab') @@ -55,6 +59,10 @@ provide(OpenNewRecordFormHookInj, openNewRecordFormHook) provide(FieldsInj, fields) provide(IsFormInj, isForm) provide(TabMetaInj, activeTab) +provide( + ReadonlyInj, + computed(() => !isUIAllowed('xcDatatableEditable')), +)