|
|
|
@ -5,6 +5,10 @@ import { ref } from 'vue'
|
|
|
|
|
import type { Ref } from 'vue' |
|
|
|
|
import { ActiveCellInj, CellValueInj, ColumnInj, IsUnderLookupInj, inject, useSelectedCellKeyupListener } from '#imports' |
|
|
|
|
|
|
|
|
|
const props = defineProps<{ |
|
|
|
|
readonly: boolean |
|
|
|
|
}>() |
|
|
|
|
|
|
|
|
|
const value = inject(CellValueInj, ref(0)) |
|
|
|
|
|
|
|
|
|
const column = inject(ColumnInj)! |
|
|
|
@ -15,7 +19,9 @@ const reloadRowTrigger = inject(ReloadRowDataHookInj, createEventHook())
|
|
|
|
|
|
|
|
|
|
const isForm = inject(IsFormInj) |
|
|
|
|
|
|
|
|
|
const readOnly = inject(ReadonlyInj, ref(false)) |
|
|
|
|
const _readOnly = inject(ReadonlyInj, ref(false)) |
|
|
|
|
|
|
|
|
|
const readOnly = computed(() => props.readonly || _readOnly.value) |
|
|
|
|
|
|
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
|
|
|
|
|
@ -77,6 +83,8 @@ const onAttachRecord = () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const openChildList = () => { |
|
|
|
|
if (readOnly.value) return |
|
|
|
|
|
|
|
|
|
if (!isLocked.value) { |
|
|
|
|
childListDlg.value = true |
|
|
|
|
} |
|
|
|
@ -98,6 +106,11 @@ const localCellValue = computed<any[]>(() => {
|
|
|
|
|
} |
|
|
|
|
return [] |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const openListDlg = () => { |
|
|
|
|
if (readOnly.value) return |
|
|
|
|
listItemsDlg.value = true |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
@ -120,7 +133,7 @@ const localCellValue = computed<any[]>(() => {
|
|
|
|
|
<MdiPlus |
|
|
|
|
v-if="(!readOnly && isUIAllowed('dataEdit')) || isForm" |
|
|
|
|
class="select-none !text-md text-gray-700 nc-action-icon nc-plus" |
|
|
|
|
@click.stop="listItemsDlg = true" |
|
|
|
|
@click.stop="openListDlg" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|