|
|
@ -8,7 +8,7 @@ const { loadCommentsAndLogs, commentsAndLogs, saveComment: _saveComment, comment |
|
|
|
|
|
|
|
|
|
|
|
const commentsWrapperEl = ref<HTMLDivElement>() |
|
|
|
const commentsWrapperEl = ref<HTMLDivElement>() |
|
|
|
|
|
|
|
|
|
|
|
const { user } = useGlobal() |
|
|
|
const { user, appInfo } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const tab = ref<'comments' | 'audits'>('comments') |
|
|
|
const tab = ref<'comments' | 'audits'>('comments') |
|
|
|
|
|
|
|
|
|
|
@ -98,6 +98,12 @@ const saveComment = async () => { |
|
|
|
watch(commentsWrapperEl, () => { |
|
|
|
watch(commentsWrapperEl, () => { |
|
|
|
scrollComments() |
|
|
|
scrollComments() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onClickAudit = () => { |
|
|
|
|
|
|
|
if (appInfo.value.ee) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tab.value = 'audits' |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -108,7 +114,7 @@ watch(commentsWrapperEl, () => { |
|
|
|
v-e="['c:row-expand:comment']" |
|
|
|
v-e="['c:row-expand:comment']" |
|
|
|
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" |
|
|
|
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'comments', |
|
|
|
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'comments' || appInfo.ee, |
|
|
|
}" |
|
|
|
}" |
|
|
|
@click="tab = 'comments'" |
|
|
|
@click="tab = 'comments'" |
|
|
|
> |
|
|
|
> |
|
|
@ -117,13 +123,29 @@ watch(commentsWrapperEl, () => { |
|
|
|
Comments |
|
|
|
Comments |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<NcTooltip v-if="appInfo.ee" class="tab flex-1"> |
|
|
|
|
|
|
|
<template #title> |
|
|
|
|
|
|
|
<span class="!text-base"> Coming soon </span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-e="['c:row-expand:audit']" |
|
|
|
|
|
|
|
class="flex-1 px-4 py-2 transition-all text-gray-400 cursor-not-allowed bg-gray-50 rounded-lg" |
|
|
|
|
|
|
|
@click="onClickAudit" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div class="tab-title nc-tab select-none"> |
|
|
|
|
|
|
|
<MdiFileDocumentOutline class="h-4 w-4" /> |
|
|
|
|
|
|
|
Audits |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
<div |
|
|
|
<div |
|
|
|
|
|
|
|
v-else |
|
|
|
v-e="['c:row-expand:audit']" |
|
|
|
v-e="['c:row-expand:audit']" |
|
|
|
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" |
|
|
|
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'audits', |
|
|
|
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'audits', |
|
|
|
}" |
|
|
|
}" |
|
|
|
@click="tab = 'audits'" |
|
|
|
@click="onClickAudit" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="tab-title nc-tab"> |
|
|
|
<div class="tab-title nc-tab"> |
|
|
|
<MdiFileDocumentOutline class="h-4 w-4" /> |
|
|
|
<MdiFileDocumentOutline class="h-4 w-4" /> |
|
|
@ -135,7 +157,7 @@ watch(commentsWrapperEl, () => { |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="h-[calc(100%-4rem)]" |
|
|
|
class="h-[calc(100%-4rem)]" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'pb-2': tab !== 'comments', |
|
|
|
'pb-2': tab !== 'comments' && !appInfo.ee, |
|
|
|
}" |
|
|
|
}" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-if="tab === 'comments'" class="flex flex-col h-full"> |
|
|
|
<div v-if="tab === 'comments'" class="flex flex-col h-full"> |
|
|
@ -251,6 +273,9 @@ watch(commentsWrapperEl, () => { |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
|
|
|
|
|
.tab { |
|
|
|
|
|
|
|
@apply max-w-1/2; |
|
|
|
|
|
|
|
} |
|
|
|
.tab .tab-title { |
|
|
|
.tab .tab-title { |
|
|
|
@apply min-w-0 flex justify-center gap-2 font-semibold items-center; |
|
|
|
@apply min-w-0 flex justify-center gap-2 font-semibold items-center; |
|
|
|
word-break: 'keep-all'; |
|
|
|
word-break: 'keep-all'; |
|
|
|