Parcourir la source

fix: 去除 console

Lee il y a 3 semaines
Parent
commit
39a8cc8860

+ 5 - 0
components.d.ts

@@ -9,6 +9,11 @@ export {}
 declare module 'vue' {
   export interface GlobalComponents {
     CodeViewer: typeof import('./src/components/view_file/vendors/text/CodeViewer.vue')['default']
+    ElButton: typeof import('element-plus/es')['ElButton']
+    ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElOption: typeof import('element-plus/es')['ElOption']
+    ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     ImageViewer: typeof import('./src/components/view_file/vendors/image/ImageViewer.vue')['default']
     Other: typeof import('./src/components/view_file/vendors/other/index.vue')['default']
     PdfView: typeof import('./src/components/view_file/vendors/pdf/PdfView.vue')['default']

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist-lib/huijia-viewfile.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 10
dist-lib/index.cjs


+ 0 - 50
dist-lib/index.d.ts

@@ -1,50 +0,0 @@
-import type { DefineComponent, Plugin } from "vue"
-
-export type ViewFileType =
-  | "docx"
-  | "xlsx"
-  | "pdf"
-  | "pptx"
-  | "gif"
-  | "jpg"
-  | "jpeg"
-  | "bmp"
-  | "tiff"
-  | "tif"
-  | "png"
-  | "svg"
-  | "txt"
-  | "json"
-  | "js"
-  | "css"
-  | "java"
-  | "py"
-  | "html"
-  | "jsx"
-  | "ts"
-  | "tsx"
-  | "xml"
-  | "md"
-  | "log"
-  | string
-
-export interface ViewFileInput {
-  filename?: string
-  type?: ViewFileType
-  fileBuffer?: ArrayBuffer | null
-  size?: number
-  name?: string
-}
-
-export const ViewFile: DefineComponent<{
-  file?: ViewFileInput
-}>
-
-export function getExtend(name: string): string
-export function readBuffer(file: File): Promise<ArrayBuffer>
-export function readDataURL(buffer: ArrayBuffer): Promise<string>
-export function readText(buffer: ArrayBuffer): Promise<string>
-export function render(buffer: ArrayBuffer, type: string, target: HTMLElement): Promise<any>
-
-declare const plugin: Plugin
-export default plugin

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 20899
dist-lib/index.js


+ 63 - 19
package-lock.json

@@ -1,35 +1,39 @@
 {
-    "name": "wisdomcity-office",
-    "version": "0.0.0",
+    "name": "huijia-viewfile",
+    "version": "0.1.2",
     "lockfileVersion": 3,
     "requires": true,
     "packages": {
         "": {
-            "name": "wisdomcity-office",
-            "version": "0.0.0",
+            "name": "huijia-viewfile",
+            "version": "0.1.2",
             "dependencies": {
                 "docx-preview": "0.3.5",
-                "element-plus": "^2.9.8",
                 "exceljs": "4.4.0",
                 "html2canvas": "1.4.1",
+                "huijia-pptxtojson": "^1.0.0",
+                "huijia-viewfile": "^0.1.2",
                 "lodash-es": "^4.17.21",
                 "pdfjs-dist": "^5.1.91",
                 "pptxtojson": "^1.5.0",
                 "tinycolor2": "1.6.0",
-                "vue": "^3.5.13",
-                "vue-router": "4",
-                "wisdom-pptxtojson": "^1.0.0",
                 "x-data-spreadsheet": "^1.1.9"
             },
             "devDependencies": {
                 "@vitejs/plugin-vue": "^5.2.2",
                 "@vue/tsconfig": "^0.7.0",
+                "element-plus": "^2.9.8",
                 "less": "^4.3.0",
                 "typescript": "~5.7.2",
                 "unplugin-auto-import": "^19.1.2",
                 "unplugin-vue-components": "^28.5.0",
                 "vite": "^6.3.1",
+                "vue": "^3.5.13",
+                "vue-router": "4",
                 "vue-tsc": "^2.2.8"
+            },
+            "peerDependencies": {
+                "vue": "^3.5.0"
             }
         },
         "node_modules/@babel/helper-string-parser": {
@@ -82,6 +86,7 @@
             "version": "3.6.1",
             "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
             "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==",
+            "dev": true,
             "license": "MIT",
             "engines": {
                 "node": ">=10"
@@ -91,6 +96,7 @@
             "version": "2.3.2",
             "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.2.tgz",
             "integrity": "sha512-OzIuTaIfC8QXEPmJvB4Y4kw34rSXdCJzxcD1kFStBvr8bK6X1zQAYDo0CNMjojnfTqRQCJ0I7prlErcoRiET2A==",
+            "dev": true,
             "license": "MIT",
             "peerDependencies": {
                 "vue": "^3.2.0"
@@ -583,6 +589,7 @@
             "version": "1.7.3",
             "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz",
             "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@floating-ui/utils": "^0.2.10"
@@ -592,6 +599,7 @@
             "version": "1.7.4",
             "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz",
             "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@floating-ui/core": "^1.7.3",
@@ -602,6 +610,7 @@
             "version": "0.2.10",
             "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz",
             "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/@jridgewell/gen-mapping": {
@@ -908,6 +917,7 @@
             "version": "2.11.7",
             "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
             "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==",
+            "dev": true,
             "license": "MIT",
             "funding": {
                 "type": "opencollective",
@@ -1233,12 +1243,14 @@
             "version": "4.17.21",
             "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.21.tgz",
             "integrity": "sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/@types/lodash-es": {
             "version": "4.17.12",
             "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz",
             "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@types/lodash": "*"
@@ -1260,6 +1272,7 @@
             "version": "0.0.20",
             "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
             "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/@vitejs/plugin-vue": {
@@ -1382,6 +1395,7 @@
             "version": "6.6.4",
             "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
             "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/@vue/language-core": {
@@ -1508,6 +1522,7 @@
             "version": "10.11.1",
             "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.11.1.tgz",
             "integrity": "sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@types/web-bluetooth": "^0.0.20",
@@ -1523,6 +1538,7 @@
             "version": "0.14.10",
             "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz",
             "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==",
+            "dev": true,
             "hasInstallScript": true,
             "license": "MIT",
             "bin": {
@@ -1549,6 +1565,7 @@
             "version": "10.11.1",
             "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.11.1.tgz",
             "integrity": "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==",
+            "dev": true,
             "license": "MIT",
             "funding": {
                 "url": "https://github.com/sponsors/antfu"
@@ -1558,6 +1575,7 @@
             "version": "10.11.1",
             "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.11.1.tgz",
             "integrity": "sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "vue-demi": ">=0.14.8"
@@ -1570,6 +1588,7 @@
             "version": "0.14.10",
             "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz",
             "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==",
+            "dev": true,
             "hasInstallScript": true,
             "license": "MIT",
             "bin": {
@@ -1745,6 +1764,7 @@
             "version": "4.2.5",
             "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz",
             "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/babel-polyfill": {
@@ -2198,6 +2218,7 @@
             "version": "2.13.0",
             "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.13.0.tgz",
             "integrity": "sha512-qjxS+SBChvqCl6lU6ShiliLMN6WqFHiXQENYbAY3GKNflG+FS3jqn8JmQq0CBZq4koFqsi95NT1M6SL4whZfrA==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@ctrl/tinycolor": "^3.4.1",
@@ -2576,6 +2597,36 @@
                 "node": ">=8.0.0"
             }
         },
+        "node_modules/huijia-pptxtojson": {
+            "version": "1.0.0",
+            "resolved": "https://registry.npmjs.org/huijia-pptxtojson/-/huijia-pptxtojson-1.0.0.tgz",
+            "integrity": "sha512-j4F0ueGJNLCY2wieGYBI0cHBu8ulfkDNkJLXLCDmFYX0qhW3HKF9DeVVBBstMo0mONfS8lJpdIAeNjlXAv4tdw==",
+            "license": "MIT",
+            "dependencies": {
+                "jszip": "^3.10.1",
+                "tinycolor2": "1.6.0",
+                "txml": "^5.1.1"
+            }
+        },
+        "node_modules/huijia-viewfile": {
+            "version": "0.1.2",
+            "resolved": "https://registry.npmjs.org/huijia-viewfile/-/huijia-viewfile-0.1.2.tgz",
+            "integrity": "sha512-RPDUAnP7E+iGvohhvcdYh5J5072F9hfCK/fWhIlNDcskeif4W8CKt7H5dkD300GNYJ5e6TDzZ9ESCVqUP3ILAw==",
+            "dependencies": {
+                "docx-preview": "0.3.5",
+                "exceljs": "4.4.0",
+                "html2canvas": "1.4.1",
+                "huijia-pptxtojson": "^1.0.0",
+                "lodash-es": "^4.17.21",
+                "pdfjs-dist": "^5.1.91",
+                "pptxtojson": "^1.5.0",
+                "tinycolor2": "1.6.0",
+                "x-data-spreadsheet": "^1.1.9"
+            },
+            "peerDependencies": {
+                "vue": "^3.5.0"
+            }
+        },
         "node_modules/iconv-lite": {
             "version": "0.6.3",
             "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -2911,6 +2962,7 @@
             "version": "1.0.3",
             "resolved": "https://registry.npmjs.org/lodash-unified/-/lodash-unified-1.0.3.tgz",
             "integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==",
+            "dev": true,
             "license": "MIT",
             "peerDependencies": {
                 "@types/lodash-es": "*",
@@ -3025,6 +3077,7 @@
             "version": "6.0.0",
             "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
             "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/mime": {
@@ -3194,6 +3247,7 @@
             "version": "1.2.0",
             "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
             "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==",
+            "dev": true,
             "license": "BSD-3-Clause"
         },
         "node_modules/object-assign": {
@@ -4245,6 +4299,7 @@
             "version": "4.6.4",
             "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz",
             "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@vue/devtools-api": "^6.6.4"
@@ -4280,17 +4335,6 @@
             "dev": true,
             "license": "MIT"
         },
-        "node_modules/wisdom-pptxtojson": {
-            "version": "1.0.0",
-            "resolved": "https://registry.npmjs.org/wisdom-pptxtojson/-/wisdom-pptxtojson-1.0.0.tgz",
-            "integrity": "sha512-fKtOHCaLASVBTe6Qu8oCjD1cvUjkB+wO/VryRo37xNMa2Ym9Afi7uS/ukbkUEFrNYxRHrSfg/PqUp/XUpLXjGg==",
-            "license": "MIT",
-            "dependencies": {
-                "jszip": "^3.10.1",
-                "tinycolor2": "1.6.0",
-                "txml": "^5.1.1"
-            }
-        },
         "node_modules/wrappy": {
             "version": "1.0.2",
             "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",

+ 3 - 2
package.json

@@ -34,11 +34,12 @@
         "docx-preview": "0.3.5",
         "exceljs": "4.4.0",
         "html2canvas": "1.4.1",
+        "huijia-pptxtojson": "^1.0.0",
+        "huijia-viewfile": "^0.1.2",
         "lodash-es": "^4.17.21",
         "pdfjs-dist": "^5.1.91",
         "pptxtojson": "^1.5.0",
         "tinycolor2": "1.6.0",
-        "huijia-pptxtojson": "^1.0.0",
         "x-data-spreadsheet": "^1.1.9"
     },
     "devDependencies": {
@@ -54,4 +55,4 @@
         "vue-router": "4",
         "vue-tsc": "^2.2.8"
     }
-}
+}

+ 1 - 2
src/components/view_file/vendors/pptx/PPT.vue

@@ -2,7 +2,7 @@
  * @Author: LiZhiWei
  * @Date: 2025-12-26 14:41:26
  * @LastEditors: LiZhiWei
- * @LastEditTime: 2025-12-30 10:22:41
+ * @LastEditTime: 2025-12-30 14:10:48
  * @Description: 
 -->
 <template>
@@ -387,7 +387,6 @@ const slides = computed(() => {
 
 onMounted(() => {
   if (!rootRef.value) return
-  console.log(props.pptxJson)
   const updateWidth = () => {
     if (!rootRef.value) return
     containerWidth.value = rootRef.value.clientWidth

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff