<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      純前端實(shí)現(xiàn)Excel模板文件數(shù)據(jù)填充

      exceljs-xlsx-template

      基于 exceljs 庫的 .xlsx 模板文件填充引擎。理論上支持 exceljs 庫的所有 api

      • 普通標(biāo)簽占位符格式:{{xxx}}{{xxx.xxx}}
      • 迭代標(biāo)簽占位符格式:{{@@xxx.xxx}}

      項(xiàng)目地址:GithubGitee

      支持瀏覽器和 node.js 環(huán)境下使用。可參考 test 目錄下的 test.htmltest.js

      <template>
        <button type="button" @click="handleXlsxTemplate">渲染xlsx模板</button>
      </template>
      
      <script setup lang="ts">
      import { renderXlsxTemplate, placeholderRange } from "exceljs-xlsx-template";
      
      function handleXlsxTemplate() {
        const xlsxFile =
          "https://raw.githubusercontent.com/cshaptx4869/exceljs-xlsx-template/refs/heads/main/test/assets/template.xlsx";
        const officialsealFile =
          "https://raw.githubusercontent.com/cshaptx4869/exceljs-xlsx-template/refs/heads/main/test/assets/officialseal.png";
        const imageUrl = "https://s2.loli.net/2025/03/07/ELZY594enrJwF7G.png";
        const data = [
          {
            name: "John",
            items: [
              { no: "No.1", name: "JavaScript" },
              { no: "No.2", name: "CSS" },
              { no: "No.3", name: "HTML" },
              { no: "No.4", name: "Node.js" },
              { no: "No.5", name: "Three.js" },
              { no: "No.6", name: "Vue" },
              { no: "No.7", name: "React" },
              { no: "No.8", name: "Angular" },
              { no: "No.9", name: "UniApp" },
            ],
            projects: [
              { name: "Project 1", description: "Description 1", image: imageUrl },
              { name: "Project 2", description: "Description 2", image: imageUrl },
              { name: "Project 3", description: "Description 3", image: imageUrl },
            ],
          },
          {
            invoice_number: "54548",
            last_name: "John",
            first_name: "Doe",
            phone: "00874****",
            invoice_date: "15/05/2008",
            items: [
              { name: "description", unit_price: 300 },
              { name: "HTML", unit_price: 400 },
            ],
            subtotal: 700,
            tax: 140,
            grand_total: 840,
          },
        ];
      
        try {
          renderXlsxTemplate(xlsxFile, data, `${Date.now()}.xlsx`, {
            parseImage: true,
            async beforeSave(workbook) {
              // 獲取工作表
              const worksheet = workbook.getWorksheet("新報(bào)關(guān)單");
              if (worksheet) {
                // 加載圖片印章
                const officialsealRresponse = await fetch(officialsealFile);
                if (!officialsealRresponse.ok) {
                  console.error(`Failed to download image file, status code: ${officialsealRresponse.status}`);
                  return;
                }
                const officialsealArrayBuffer = await officialsealRresponse.arrayBuffer();
                // 將圖片添加到工作簿
                const imageId = workbook.addImage({
                  buffer: officialsealArrayBuffer,
                  extension: "png",
                });
                // 獲取印章占位符位置信息
                const range = placeholderRange(worksheet, "{{#officialseal}}");
                if (range) {
                  // 插入圖片到表格中
                  worksheet.addImage(imageId, {
                    tl: { col: range.start.col, row: range.start.row - 4 },
                    ext: { width: 200, height: 200 },
                  });
                }
              }
            },
          });
        } catch (error) {
          console.error("Error processing Excel file:", error);
        }
      }
      </script>
      

      input

      output

      posted @ 2025-03-04 09:27  白開水  閱讀(109)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 日韩av一区二区三区不卡| 色www永久免费视频| 日韩有码av中文字幕| 日土县| 亚洲国产精品美日韩久久| 女人被狂躁到高潮视频免费软件| 亚洲老女人区一区二视频| 泰顺县| 国产视频最新| 中文字幕久区久久中文字幕 | 国产性色的免费视频网站| 国产精品视频一区二区噜| 亚洲AV色香蕉一区二区蜜桃小说| 扬中市| 亚洲高潮喷水无码AV电影| 人妻精品动漫H无码中字| 新安县| 国产精品99一区二区三区| 亚洲一区精品视频在线| 久久这里只精品国产2| 不卡视频在线一区二区三区| 国产亚洲无线码一区二区| 久久亚洲人成网站| 91精品国产一二三产区| 躁躁躁日日躁| 久久久久蜜桃精品成人片公司| 老太脱裤子让老头玩xxxxx| 丰满少妇高潮惨叫久久久| 香蕉亚洲欧洲在线一区 | 久久精品网站免费观看| 中文字幕在线日韩| 天天做天天爱夜夜爽导航| 人妻系列无码专区69影院| 一区二区三区四区精品黄| 91精品乱码一区二区三区| 亚洲国产一区二区三区| 亚洲码亚洲码天堂码三区| 西西午夜无码大胆啪啪国模| 日韩精品亚洲精品第一页| 90后极品粉嫩小泬20p| 波多结野衣一区二区三区|