Browse Source

fix: 一轮测试修复

wzl 5 months ago
parent
commit
0f7b7043c6

+ 2 - 1
packages/webview/index.html

@@ -4,7 +4,8 @@
     <meta charset="UTF-8">
     <link rel="icon" href="/favicon.ico">
     <!-- <link rel="stylesheet" data-hid="stylesheet" href="https://fonts.googleapis.com/css?family=Courier|Times|Courier:b,i,bi|Times:b,i,bi"> -->
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta name="apple-mobile-web-app-capable" content="yes">
     <title>ComPDFKit Web Viewer</title>
   </head>
   <body>

+ 0 - 4
packages/webview/src/components/Dialogs/CompareSettingDialog.vue

@@ -829,9 +829,5 @@ const setNewCurrentScale = (scale) => {
       bottom: 57px;
     }
   }
-
-  .n-base-select-menu {
-    height: 260px;
-  }
 }
 </style>

+ 1 - 1
packages/webview/src/components/Dialogs/SettingsDialog.vue

@@ -36,7 +36,7 @@
       <p class="title">{{ $t('header.settings.creationInfo') }}</p>
       <div class="version row">
         <span>{{ $t('header.settings.version') }}</span>
-        <span>2.4.7</span>
+        <span>2.4.8</span>
       </div>
 
       <template #footer>

+ 9 - 1
packages/webview/src/components/SearchContainer/SearchHeader.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="findbar" class="findbar">
+  <div id="findbar" class="findbar" :class="{ 'mobile': isMobileDevice }">
     <div id="findbarInputContainer" class="findbar-input-container">
       <div class="input-container">
         <input type="text" autocomplete="off" :placeholder="$t('leftPanel.searchPdf')" v-model="searchValue" name="search">
@@ -35,6 +35,7 @@
   import core from '@/core'
   import { useDocumentStore } from '@/stores/modules/document'
   import { useViewerStore } from '@/stores/modules/viewer'
+  import { isMobileDevice } from '@/helpers/device'
 
   const waitTime = 200
   const isSearching = ref(false)
@@ -152,4 +153,11 @@
       }
     }
   }
+
+  .findbar.mobile {
+    .button:not(.disabled):hover,
+    .button:not(.disabled):active {
+      background-color: unset;
+    }
+  }
 </style>

+ 0 - 81
packages/webview/src/components/Signatures/DigitalKeyboardCreatePanel.vue

@@ -52,70 +52,7 @@ const save = () => {
 <style lang="scss">
 .digital-signature-dialog {
 
-  .dialog-container {
-    padding: 15px 23px;
-    width: 628px;
-    border-radius: 0;
-    position: relative;
-
-    header {
-      
-      p {
-        font-size: 14px;
-        line-height: 16px;
-        font-weight: 400;
-        color: var(--c-right-side-header-text);
-      }
-
-      .close {
-        position: absolute;
-        top: 8px;
-        right: 8px;
-        margin: 0;
-        cursor: pointer;
-      }
-    }
-
-    main {
-      margin-top: 24px;
-      margin-bottom: 20px;
-    }
-
-    footer {
-
-      .rect-button {
-        border-radius: 4px;
-      }
-    }
-  }
-
-  .dialog-container {
-    padding: 16px 24px;
-
-    main {
-      margin-top: 40px;
-      margin-bottom: 12px;
-    }
-
-    footer {
-
-      .rect-button.white {
-        border-radius: 2px;
-      }
-
-      .rect-button:first-child {
-        margin-right: auto;
-      }
-    }
-  }
-
   .paint-container {
-    position: relative;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    height: 240px;
-    background-color: #F2F3F5;
 
     .keyboard-paint {
       flex: 1;
@@ -132,24 +69,6 @@ const save = () => {
         font-family: 'Courier New', Courier, monospace;
       }
     }
-
-    p {
-      position: absolute;
-      font-size: 14px;
-      line-height: 16px;
-      color: #757780;
-      pointer-events: none;
-    }
-  }
-}
-
-@media screen and (max-width: 628px) {
-  .digital-signature-dialog .dialog-container {
-    width: 100%;
-
-    footer {
-      margin-top: 0;
-    }
   }
 }
 </style>

+ 20 - 3
packages/webview/src/components/Signatures/DigitalSignCreatePanel.vue

@@ -4,8 +4,8 @@
       <CloseB class="close" @click="close" />
     </template>
 
-    <div class="paint-container">
-      <canvas id="digitalTrackpadCanvas" width="578" height="240"></canvas>
+    <div class="paint-container" ref="paintContainer">
+      <canvas id="digitalTrackpadCanvas" :width="canvasWidth" :height="canvasHeight"></canvas>
     </div>
 
     <template #footer>
@@ -17,10 +17,11 @@
 </template>
 
 <script setup>
-import { computed, watch, toRaw } from 'vue'
+import { computed, watch, ref, nextTick } from 'vue'
 import { useViewerStore } from '@/stores/modules/viewer'
 import { useDocumentStore } from '@/stores/modules/document'
 import core from '@/core'
+import { isMobileDevice } from '@/helpers/device'
 
 const emits = defineEmits(['modifyImage'])
 const dialogName = 'digitalSignCreatePanel'
@@ -30,6 +31,22 @@ const useDocument = useDocumentStore()
 
 const show = computed(() => useViewer.isElementOpen(dialogName))
 
+const canvasWidth = ref(578)
+const canvasHeight = ref(270)
+const paintContainer = ref()
+
+watch(() => show.value, (newValue, oldValue) => {
+  if (newValue) {
+    if (isMobileDevice) {
+      nextTick(() => {
+        const { clientWidth, clientHeight } = paintContainer.value
+        clientWidth && canvasWidth.value !== clientWidth && (canvasWidth.value = clientWidth)
+        clientHeight && canvasHeight.value !== clientHeight && (canvasHeight.value = clientHeight)
+      })
+    }
+  }
+})
+
 const close = () => {
   useViewer.closeElement(dialogName)
   clear()