|
@@ -0,0 +1,132 @@
|
|
|
+<template>
|
|
|
+ <div class="signature-container">
|
|
|
+ <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)">
|
|
|
+ <SignatureValid v-if="signature.state === 'valid'" />
|
|
|
+ <SignatureInvalid v-else-if="signature.state === 'invalid'" />
|
|
|
+ <SignatureUnknown v-else />
|
|
|
+ <span :title="signature.name">{{ signature.type }}</span>
|
|
|
+ <n-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ trigger="click"
|
|
|
+ :show-arrow="false"
|
|
|
+ to="#outerContainer"
|
|
|
+ :raw="true"
|
|
|
+ :z-index="96"
|
|
|
+ class="option-popover"
|
|
|
+ @clickoutside="onOutsidePopover"
|
|
|
+ >
|
|
|
+ <template #trigger>
|
|
|
+ <Button class="more" @click.stop="showPopoverName = signature.name">
|
|
|
+ <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>
|
|
|
+ </n-popover>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div v-else class="no-signatures">
|
|
|
+ {{ $t('leftPanel.noSignatures') }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { computed, ref } from 'vue'
|
|
|
+import core from '@/core'
|
|
|
+import { useDocumentStore } from '@/stores/modules/document'
|
|
|
+import { NPopover } from 'naive-ui'
|
|
|
+
|
|
|
+const useDocument = useDocumentStore()
|
|
|
+
|
|
|
+const signatures = computed(() => useDocument.getSignatures)
|
|
|
+
|
|
|
+const showPopoverName = ref('')
|
|
|
+
|
|
|
+const goToPage = (page) => {
|
|
|
+ core.pageNumberChanged({
|
|
|
+ value: (page * 1 + 1).toString()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const onOutsidePopover = () => {
|
|
|
+ showPopoverName.value = ''
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.signature-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .signature-title {
|
|
|
+ margin: 0;
|
|
|
+ padding: 9px 16px;
|
|
|
+ line-height: 17px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: var(--c-side-title);
|
|
|
+ }
|
|
|
+
|
|
|
+ .signatures {
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .signature {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 6px 16px;
|
|
|
+ height: 32px;
|
|
|
+ cursor: default;
|
|
|
+
|
|
|
+ &:hover, &.focus {
|
|
|
+ background-color: var(--c-side-header-active);
|
|
|
+ }
|
|
|
+
|
|
|
+ span {
|
|
|
+ margin-left: 8px;
|
|
|
+ text-wrap: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 16px;
|
|
|
+ color: var(--c-right-side-header-text);
|
|
|
+ }
|
|
|
+
|
|
|
+ svg {
|
|
|
+ min-width: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .more {
|
|
|
+ margin-left: auto;
|
|
|
+ padding: 0;
|
|
|
+ margin-right: 0;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .no-signatures {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, 50%);
|
|
|
+ text-align: center;
|
|
|
+ font-weight: 700;
|
|
|
+ color: var(--c-side-text);
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.option-popover .drop-down .drop-item {
|
|
|
+ padding: 6px 8px;
|
|
|
+}
|
|
|
+</style>
|