zhanghua
2022-11-22 03eadfd663e99ff619d4ab48761fc5c8b1b643b8
src/views/operate/writManager/components/inquest_record/edit.vue
@@ -260,6 +260,12 @@
      });
    },
    handlePrint(e) {},
    judgeLength(word, length) {
      for (let index = 0; word.length < length; index++) {
        word += " ";
      }
      return word;
    },
    handleExport(e) {
      let that = this;
      loadFile(
@@ -267,7 +273,7 @@
        "/inquest_record.docx", //"https://docxtemplater.com/tag-example.docx"
        function (error, content) {
          // eslint-disable-next-line no-debugger
          if (error) {
            throw error;
          }
@@ -276,8 +282,10 @@
            paragraphLoop: true,
            linebreaks: true,
          });
          doc.setData(that.form);
          var data = that.form;
          data.jc_address = that.judgeLength(data.jc_address, 33);
          debugger;
          doc.setData(data);
          /*向文档中写入数据*/
          doc.render();