From fa5fd9d4f9c1ba33f26a343942a7941003cc601c Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期一, 28 十一月 2022 17:40:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/operate/writManager/components/inquest_record/edit.vue | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/src/views/operate/writManager/components/inquest_record/edit.vue b/src/views/operate/writManager/components/inquest_record/edit.vue
index 72869e7..9ba26c4 100644
--- a/src/views/operate/writManager/components/inquest_record/edit.vue
+++ b/src/views/operate/writManager/components/inquest_record/edit.vue
@@ -260,6 +260,13 @@
});
},
handlePrint(e) {},
+ judgeLength(word, length, char) {
+ let wordLength = word.length;
+ for (let index = 0; wordLength + index < length; index++) {
+ word += char ? " " : " ";
+ }
+ return word;
+ },
handleExport(e) {
let that = this;
loadFile(
@@ -267,7 +274,7 @@
"/inquest_record.docx", //"https://docxtemplater.com/tag-example.docx"
function (error, content) {
// eslint-disable-next-line no-debugger
- debugger;
+
if (error) {
throw error;
}
@@ -276,8 +283,29 @@
paragraphLoop: true,
linebreaks: true,
});
- debugger;
- doc.setData(that.form);
+ var data = that.form;
+ data.jc_address = that.judgeLength(data.jc_address, 20, true);
+ data.jc_user1 = that.judgeLength(data.jc_user1, 9, true);
+ data.jc_user2 = that.judgeLength(data.jc_user2, 9, true);
+ data.jc_card1 = that.judgeLength(data.jc_card1, 13, false);
+ data.jc_card2 = that.judgeLength(data.jc_card2, 12, false);
+ data.recorder = that.judgeLength(data.recorder, 9, true);
+ data.weather = that.judgeLength(data.weather, 7, true);
+ data.bjc_name = that.judgeLength(data.bjc_name, 16, true);
+ data.bjc_code = that.judgeLength(data.bjc_code, 36, false);
+ data.bjc_address = that.judgeLength(data.bjc_address, 11, true);
+ data.bjc_phone = that.judgeLength(data.bjc_phone, 12, false);
+ data.current_person = that.judgeLength(data.current_person, 12, true);
+ data.position = that.judgeLength(data.position, 9, true);
+ data.current_person_phone = that.judgeLength(
+ data.current_person_phone,
+ 24,
+ false
+ );
+ data.relation = that.judgeLength(data.relation, 6, true);
+ data.eyewitness = that.judgeLength(data.eyewitness, 25, true);
+
+ doc.setData(data);
/*鍚戞枃妗d腑鍐欏叆鏁版嵁*/
doc.render();
@@ -299,7 +327,7 @@
<style scoped>
.content {
- width: 90%;
+ width: 805px;
margin: auto;
line-height: 2 !important;
}
--
Gitblit v1.8.0