|
@@ -3,7 +3,7 @@
|
|
|
<div class="signature-title">{{ $t('leftPanel.signatureList') }}</div>
|
|
|
<div v-if="signatures.length" class="signatures">
|
|
|
<template v-for="signature in signatures">
|
|
|
- <div class="signature" :class="{ 'focus': showPopoverName === signature.name }" @click="goToPage(signature.pageIndex)">
|
|
|
+ <div class="signature" :class="{ 'focus': selectedSignature && selectedSignature.name === signature.name }" @click="goToPage(signature.pageIndex)">
|
|
|
<SignatureValid v-if="signature.state === 'valid'" />
|
|
|
<SignatureInvalid v-else-if="signature.state === 'invalid'" />
|
|
|
<SignatureUnknown v-else />
|
|
@@ -16,17 +16,18 @@
|
|
|
:raw="true"
|
|
|
:z-index="96"
|
|
|
class="option-popover"
|
|
|
+ :show="selectedSignature?.name === signature.name && showPopover"
|
|
|
@clickoutside="onOutsidePopover"
|
|
|
>
|
|
|
<template #trigger>
|
|
|
- <Button class="more" @click.stop="showPopoverName = signature.name">
|
|
|
+ <Button class="more" @click.stop="selectSign(signature)">
|
|
|
<MoreB />
|
|
|
</Button>
|
|
|
</template>
|
|
|
<div class="drop-down">
|
|
|
- <div class="drop-item" @click="">{{ $t('leftPanel.signatureDetails') }}</div>
|
|
|
- <div class="drop-item" @click="">{{ $t('leftPanel.certificationDetails') }}</div>
|
|
|
- <div class="drop-item" @click="deleteSignature">{{ $t('delete') }}</div>
|
|
|
+ <div class="drop-item" @click="openDialog('signatureDetailsDialog')">{{ $t('leftPanel.signatureDetails') }}</div>
|
|
|
+ <div class="drop-item" @click="openDialog('certificationDetailsDialog')">{{ $t('leftPanel.certificationDetails') }}</div>
|
|
|
+ <div class="drop-item" @click="openDialog('deleteConfirmDialog')">{{ $t('delete') }}</div>
|
|
|
</div>
|
|
|
</n-popover>
|
|
|
</div>
|
|
@@ -41,14 +42,17 @@
|
|
|
<script setup>
|
|
|
import { computed, ref } from 'vue'
|
|
|
import core from '@/core'
|
|
|
+import { useViewerStore } from '@/stores/modules/viewer'
|
|
|
import { useDocumentStore } from '@/stores/modules/document'
|
|
|
import { NPopover } from 'naive-ui'
|
|
|
|
|
|
+const useViewer = useViewerStore()
|
|
|
const useDocument = useDocumentStore()
|
|
|
|
|
|
const signatures = computed(() => useDocument.getSignatures)
|
|
|
+const selectedSignature = computed(() => useDocument.getSelectedSignature)
|
|
|
|
|
|
-const showPopoverName = ref('')
|
|
|
+const showPopover = ref(false)
|
|
|
|
|
|
const goToPage = (page) => {
|
|
|
core.pageNumberChanged({
|
|
@@ -57,7 +61,18 @@ const goToPage = (page) => {
|
|
|
}
|
|
|
|
|
|
const onOutsidePopover = () => {
|
|
|
- showPopoverName.value = ''
|
|
|
+ showPopover.value = false
|
|
|
+ useDocument.setSelectedSignature(null)
|
|
|
+}
|
|
|
+
|
|
|
+const openDialog = (name) => {
|
|
|
+ showPopover.value = false
|
|
|
+ useViewer.openElement(name)
|
|
|
+}
|
|
|
+
|
|
|
+const selectSign = (data) => {
|
|
|
+ showPopover.value = true
|
|
|
+ useDocument.setSelectedSignature(data)
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -84,7 +99,7 @@ const onOutsidePopover = () => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
padding: 6px 16px;
|
|
|
- height: 32px;
|
|
|
+ // height: 32px;
|
|
|
cursor: default;
|
|
|
|
|
|
&:hover, &.focus {
|