diff --git a/packages/nc-gui/components/smartsheet/header/Cell.vue b/packages/nc-gui/components/smartsheet/header/Cell.vue index be95ede623..2c48516fe8 100644 --- a/packages/nc-gui/components/smartsheet/header/Cell.vue +++ b/packages/nc-gui/components/smartsheet/header/Cell.vue @@ -17,6 +17,8 @@ const hideMenu = toRef(props, 'hideMenu') const isForm = inject(IsFormInj, ref(false)) +const isLocked = inject(IsLockedInj, ref(false)) + const isSurveyForm = inject(IsSurveyFormInj, ref(false)) const isExpandedForm = inject(IsExpandedFormOpenInj, ref(false)) @@ -46,12 +48,16 @@ const closeAddColumnDropdown = () => { } const openHeaderMenu = () => { + if (isLocked.value) return + if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) { editColumnDropdown.value = true } } const openDropDown = (e: Event) => { + if (isLocked.value) return + if (isForm.value || isExpandedForm.value || (!isUIAllowed('fieldEdit') && !isMobileMode.value)) return e.preventDefault() diff --git a/packages/nc-gui/components/smartsheet/header/VirtualCell.vue b/packages/nc-gui/components/smartsheet/header/VirtualCell.vue index 62d595a52c..9b0c4d390e 100644 --- a/packages/nc-gui/components/smartsheet/header/VirtualCell.vue +++ b/packages/nc-gui/components/smartsheet/header/VirtualCell.vue @@ -36,6 +36,8 @@ const editColumnDropdown = ref(false) const isDropDownOpen = ref(false) +const isLocked = inject(IsLockedInj, ref(false)) + provide(ColumnInj, column) const { metas } = useMetas() @@ -124,12 +126,16 @@ const closeAddColumnDropdown = () => { } const openHeaderMenu = () => { + if (isLocked.value) return + if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) { editColumnDropdown.value = true } } const openDropDown = (e: Event) => { + if (isLocked.value) return + if (isForm.value || isExpandedForm.value || (!isUIAllowed('fieldEdit') && !isMobileMode.value)) return e.preventDefault()