HuCheng 2 سال پیش
والد
کامیت
0b3bcd4182
4فایلهای تغییر یافته به همراه15 افزوده شده و 57 حذف شده
  1. 1 0
      package.json
  2. 10 0
      pnpm-lock.yaml
  3. BIN
      src/assets/1.pdf
  4. 4 57
      src/views/report/edit/index.vue

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "highcharts": "^10.3.3",
     "highcharts-vue": "^1.4.0",
     "vue": "^3.2.45",
+    "vue-pdf-embed": "^1.1.5",
     "vue-router": "^4.1.6"
   },
   "devDependencies": {

+ 10 - 0
pnpm-lock.yaml

@@ -17,6 +17,7 @@ specifiers:
   vite: ^4.0.0
   vite-plugin-windicss: ^1.8.10
   vue: ^3.2.45
+  vue-pdf-embed: ^1.1.5
   vue-router: ^4.1.6
   windicss: ^3.5.6
 
@@ -25,6 +26,7 @@ dependencies:
   highcharts: 10.3.3
   highcharts-vue: 1.4.0_x2ttk5sq3pjxzxl7cjqodvt53e
   vue: 3.2.47
+  vue-pdf-embed: 1.1.5_vue@3.2.47
   vue-router: 4.1.6_vue@3.2.47
 
 devDependencies:
@@ -2507,6 +2509,14 @@ packages:
       - supports-color
     dev: true
 
+  /vue-pdf-embed/1.1.5_vue@3.2.47:
+    resolution: {integrity: sha512-aOUKlPFML9abOmFJgCuDujzcXmjN1Ck3X3vt0h2N/EGZYASS9TRXu96s+NzwZDr13iTZ8LGskLOzzXvf7FIpwQ==}
+    peerDependencies:
+      vue: ^2.x || ^3.x
+    dependencies:
+      vue: 3.2.47
+    dev: false
+
   /vue-router/4.1.6_vue@3.2.47:
     resolution: {integrity: sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==}
     peerDependencies:

BIN
src/assets/1.pdf


+ 4 - 57
src/views/report/edit/index.vue

@@ -1,63 +1,10 @@
 <template>
-  <n-data-table
-    :columns="columns"
-    :data="data"
-    :pagination="pagination"
-    :bordered="false"
-  />
+  <vue-pdf-embed :source="pdfSource" />
 </template>
 
 <script setup>
-import { h } from "vue";
-import { NButton } from "naive-ui";
-
-const message = useMessage();
-
-const createColumns = ({ play }) => {
-  return [
-    {
-      title: "No",
-      key: "no",
-    },
-    {
-      title: "Title",
-      key: "title",
-    },
-    {
-      title: "Length",
-      key: "length",
-    },
-    {
-      title: "Action",
-      key: "actions",
-      render(row) {
-        return h(
-          NButton,
-          {
-            strong: true,
-            tertiary: true,
-            size: "small",
-            onClick: () => play(row),
-          },
-          { default: () => "Play" }
-        );
-      },
-    },
-  ];
-};
-
-const data = [
-  { no: 3, title: "Wonderwall", length: "4:18" },
-  { no: 4, title: "Don't Look Back in Anger", length: "4:48" },
-  { no: 12, title: "Champagne Supernova", length: "7:27" },
-];
-
-const columns = createColumns({
-  play(row) {
-    message.info(`Play ${row.title}`);
-  },
-});
-const pagination = ref(false);
+import VuePdfEmbed from "vue-pdf-embed";
+import pdfSource from "@/assets/1.pdf"
 </script>
 
-<style lang="scss" scoped></style>
+<style scoped></style>