|
|
@ -1,10 +1,12 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import { onUnmounted } from '@vue/runtime-core' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import type { Select as AntSelect } from 'ant-design-vue' |
|
|
|
import type { Select as AntSelect } from 'ant-design-vue' |
|
|
|
import type { SelectOptionType, SelectOptionsType } from 'nocodb-sdk' |
|
|
|
import type { SelectOptionType, SelectOptionsType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveCellInj, |
|
|
|
ActiveCellInj, |
|
|
|
|
|
|
|
CellClickHookInj, |
|
|
|
ColumnInj, |
|
|
|
ColumnInj, |
|
|
|
IsKanbanInj, |
|
|
|
IsKanbanInj, |
|
|
|
ReadonlyInj, |
|
|
|
ReadonlyInj, |
|
|
@ -16,7 +18,6 @@ import { |
|
|
|
onMounted, |
|
|
|
onMounted, |
|
|
|
reactive, |
|
|
|
reactive, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useEventListener, |
|
|
|
|
|
|
|
useMetas, |
|
|
|
useMetas, |
|
|
|
useProject, |
|
|
|
useProject, |
|
|
|
useRoles, |
|
|
|
useRoles, |
|
|
@ -144,8 +145,6 @@ onMounted(() => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
useEventListener(document, 'click', handleClose) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => modelValue, |
|
|
|
() => modelValue, |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -273,14 +272,28 @@ const onTagClick = (e: Event, onClose: Function) => { |
|
|
|
onClose() |
|
|
|
onClose() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cellClickHook = inject(CellClickHookInj) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toggleMenu = () => { |
|
|
|
|
|
|
|
if (cellClickHook) return |
|
|
|
|
|
|
|
isOpen.value = editAllowed.value && !isOpen.value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cellClickHookHandler = () => { |
|
|
|
|
|
|
|
isOpen.value = editAllowed.value && !isOpen.value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
cellClickHook?.on(cellClickHookHandler) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
|
|
|
|
cellClickHook?.on(cellClickHookHandler) |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div |
|
|
|
<div class="nc-multi-select h-full w-full flex items-center" :class="{ 'read-only': readOnly }" @click="toggleMenu"> |
|
|
|
class="nc-multi-select h-full w-full flex items-center" |
|
|
|
|
|
|
|
:class="{ 'read-only': readOnly }" |
|
|
|
|
|
|
|
@click="isOpen = editAllowed && !isOpen" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
ref="aselect" |
|
|
|
ref="aselect" |
|
|
|
v-model:value="vModel" |
|
|
|
v-model:value="vModel" |
|
|
|