Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev
Showing
4 changed files
with
229 additions
and
164 deletions
src/image/bdcqz/bdczm.jpg
0 → 100644
592 KB
... | @@ -5,7 +5,6 @@ | ... | @@ -5,7 +5,6 @@ |
5 | <el-row> | 5 | <el-row> |
6 | <el-col :span="24" class="btnColRight"> | 6 | <el-col :span="24" class="btnColRight"> |
7 | <el-form-item> | 7 | <el-form-item> |
8 | {{ isRefresh }} | ||
9 | <el-button type="primary" @click="fetchData">查询</el-button> | 8 | <el-button type="primary" @click="fetchData">查询</el-button> |
10 | <el-button type="primary" @click="openAddDialog">新增</el-button> | 9 | <el-button type="primary" @click="openAddDialog">新增</el-button> |
11 | </el-form-item> | 10 | </el-form-item> |
... | @@ -25,150 +24,150 @@ | ... | @@ -25,150 +24,150 @@ |
25 | </div> | 24 | </div> |
26 | </template> | 25 | </template> |
27 | <script> | 26 | <script> |
28 | import { mapGetters } from 'vuex' | 27 | import { mapGetters } from 'vuex' |
29 | import { getLodop } from "@/utils/LodopFuncs" | 28 | import { getLodop } from "@/utils/LodopFuncs" |
30 | import table from "@/utils/mixin/table" | 29 | import table from "@/utils/mixin/table" |
31 | import { datas, sendThis } from "./dymbgl" | 30 | import { datas, sendThis } from "./dymbgl" |
32 | import { selectPrintTemplateList, delPrintTemplate } from "@/api/system.js" | 31 | import { selectPrintTemplateList, delPrintTemplate } from "@/api/system.js" |
33 | export default { | 32 | export default { |
34 | name: "dymbgl", | 33 | name: "dymbgl", |
35 | mixins: [table], | 34 | mixins: [table], |
36 | data () { | 35 | data () { |
37 | return { | 36 | return { |
38 | isDialog: false, | 37 | isDialog: false, |
39 | images: require("../../../image/lodapbg.png"), | 38 | images: require("../../../image/lodapbg.png"), |
40 | tableData: { | 39 | tableData: { |
41 | total: 0, | 40 | total: 0, |
42 | columns: datas.columns(), | 41 | columns: datas.columns(), |
43 | data: [] | 42 | data: [] |
44 | }, | 43 | }, |
45 | printItem: "", | 44 | printItem: "", |
46 | printList: { | 45 | printList: { |
47 | 46 | ||
48 | }, | 47 | }, |
49 | } | ||
50 | }, | ||
51 | mounted () { | ||
52 | sendThis(this); | ||
53 | this.fetchData() | ||
54 | }, | ||
55 | computed: { | ||
56 | ...mapGetters(['isRefresh']) | ||
57 | }, | ||
58 | watch: { | ||
59 | isRefresh: { | ||
60 | handler (newVal, oldVal) { | ||
61 | if (newVal) this.fetchData | ||
62 | } | 48 | } |
63 | } | ||
64 | }, | ||
65 | methods: { | ||
66 | fetchData () { | ||
67 | selectPrintTemplateList({ ...this.pageData }).then(res => { | ||
68 | if (res.code == 200) { | ||
69 | let { total, records } = res.result | ||
70 | this.tableData.total = total ? total : 0 | ||
71 | this.tableData.data = records ? records : [] | ||
72 | } | ||
73 | }) | ||
74 | }, | 49 | }, |
75 | //打开新增弹窗 | 50 | mounted () { |
76 | openAddDialog () { | 51 | sendThis(this); |
77 | this.$popupDialog("新增打印模板", "system/dymbgl/components/editDialog", {}, "35%") | 52 | this.fetchData() |
53 | }, | ||
54 | computed: { | ||
55 | ...mapGetters(['isRefresh']) | ||
78 | }, | 56 | }, |
79 | //打开编辑弹窗 | 57 | watch: { |
80 | openEditDialog (item) { | 58 | isRefresh: { |
81 | this.$popupDialog("编辑打印模板", "system/dymbgl/components/editDialog", item, "35%") | 59 | handler (newVal, oldVal) { |
60 | if (newVal) this.fetchData | ||
61 | } | ||
62 | } | ||
82 | }, | 63 | }, |
83 | //删除数据 | 64 | methods: { |
84 | removeTemplate (item) { | 65 | fetchData () { |
85 | this.$confirm("确定要删除吗, 是否继续?", "提示", { | 66 | selectPrintTemplateList({ ...this.pageData }).then(res => { |
86 | confirmButtonText: "确定", | ||
87 | cancelButtonText: "取消", | ||
88 | type: "warning", | ||
89 | }).then(() => { | ||
90 | delPrintTemplate({ bsmTmp: item.bsmTmp }).then((res) => { | ||
91 | if (res.code == 200) { | 67 | if (res.code == 200) { |
92 | this.$message.success("删除成功"); | 68 | let { total, records } = res.result |
93 | this.fetchData(); | 69 | this.tableData.total = total ? total : 0 |
94 | } else { | 70 | this.tableData.data = records ? records : [] |
95 | this.$message.error(res.message); | ||
96 | } | 71 | } |
97 | }); | 72 | }) |
98 | }) | 73 | }, |
99 | .catch(() => { | 74 | //打开新增弹窗 |
100 | this.$message({ | 75 | openAddDialog () { |
101 | type: "info", | 76 | this.$popupDialog("新增打印模板", "system/dymbgl/components/editDialog", {}, "35%") |
102 | message: "已取消删除", | 77 | }, |
78 | //打开编辑弹窗 | ||
79 | openEditDialog (item) { | ||
80 | this.$popupDialog("编辑打印模板", "system/dymbgl/components/editDialog", item, "35%") | ||
81 | }, | ||
82 | //删除数据 | ||
83 | removeTemplate (item) { | ||
84 | this.$confirm("确定要删除吗, 是否继续?", "提示", { | ||
85 | confirmButtonText: "确定", | ||
86 | cancelButtonText: "取消", | ||
87 | type: "warning", | ||
88 | }).then(() => { | ||
89 | delPrintTemplate({ bsmTmp: item.bsmTmp }).then((res) => { | ||
90 | if (res.code == 200) { | ||
91 | this.$message.success("删除成功"); | ||
92 | this.fetchData(); | ||
93 | } else { | ||
94 | this.$message.error(res.message); | ||
95 | } | ||
103 | }); | 96 | }); |
104 | }); | 97 | }) |
105 | }, | 98 | .catch(() => { |
106 | //设计打印模板 | 99 | this.$message({ |
107 | DesignByPRGData (item) { | 100 | type: "info", |
108 | let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM')); | 101 | message: "已取消删除", |
109 | LODOP.ADD_PRINT_DATA("ProgramData", item.tmpcontent); //装载模板 | 102 | }); |
110 | //窗口关闭后,回调函数中保存的设计代码 | 103 | }); |
111 | if (LODOP.CVERSION) | 104 | }, |
112 | CLODOP.On_Return = function (TaskID, printList) { | 105 | //设计打印模板 |
113 | if (LODOP.CVERSION) | 106 | DesignByPRGData (item) { |
114 | LODOP.On_Return = function (TaskID, Value) { | 107 | let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM')); |
115 | document.getElementById("S1").value = Value; | 108 | LODOP.ADD_PRINT_DATA("ProgramData", item.tmpcontent); //装载模板 |
116 | }; | 109 | //窗口关闭后,回调函数中保存的设计代码 |
117 | document.getElementById("S1").value = LODOP.GET_VALUE( | 110 | if (LODOP.CVERSION) |
118 | "ProgramData", | 111 | CLODOP.On_Return = function (TaskID, printList) { |
119 | 0 | 112 | if (LODOP.CVERSION) |
120 | ); | 113 | LODOP.On_Return = function (TaskID, Value) { |
121 | setTimeout(() => { | 114 | document.getElementById("S1").value = Value; |
122 | item.tmpcontent = document.getElementById("S1").value; | 115 | }; |
123 | }, 1000); | 116 | document.getElementById("S1").value = LODOP.GET_VALUE( |
124 | }; | 117 | "ProgramData", |
125 | LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 | 118 | 0 |
126 | }, | 119 | ); |
127 | editClick () { | 120 | setTimeout(() => { |
128 | let LODOP = getLodop(); | 121 | item.tmpcontent = document.getElementById("S1").value; |
129 | LODOP.SET_PRINT_MODE("PRINT_SETUP_PROGRAM", true); | 122 | }, 1000); |
130 | LODOP.PRINT_INITA(0, 0, 850, 560, "不动产证明"); | 123 | }; |
131 | LODOP.ADD_PRINT_SETUP_BKIMG("<img border='1' src=" + this.images + ">"); | 124 | LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 |
132 | LODOP.ADD_PRINT_TEXT(403, 220, 39, 25, this.printList.year); //year | 125 | }, |
133 | LODOP.ADD_PRINT_TEXT(403, 278, 25, 25, this.printList.month); //month | 126 | editClick () { |
134 | LODOP.ADD_PRINT_TEXT(403, 309, 25, 25, this.printList.day); //day | 127 | let LODOP = getLodop(); |
135 | LODOP.ADD_PRINT_TEXT(493, 205, 160, 25, this.printList.bh); //编号 | 128 | LODOP.SET_PRINT_MODE("PRINT_SETUP_PROGRAM", true); |
136 | // 头部信息 | 129 | LODOP.PRINT_INITA(0, 0, 850, 560, "不动产证明"); |
137 | LODOP.ADD_PRINT_TEXT(78, 419, 39, 25, this.printList.xzq); //陕 | 130 | LODOP.ADD_PRINT_SETUP_BKIMG("<img border='1' src=" + this.images + ">"); |
138 | LODOP.ADD_PRINT_TEXT(78, 466, 39, 25, this.printList.xh); // | 131 | LODOP.ADD_PRINT_TEXT(403, 220, 39, 25, this.printList.year); //year |
139 | LODOP.ADD_PRINT_TEXT(78, 520, 60, 25, this.printList.d); // | 132 | LODOP.ADD_PRINT_TEXT(403, 278, 25, 25, this.printList.month); //month |
140 | LODOP.ADD_PRINT_TEXT(78, 670, 60, 25, this.printList.h); // | 133 | LODOP.ADD_PRINT_TEXT(403, 309, 25, 25, this.printList.day); //day |
134 | LODOP.ADD_PRINT_TEXT(493, 205, 160, 25, this.printList.bh); //编号 | ||
135 | // 头部信息 | ||
136 | LODOP.ADD_PRINT_TEXT(78, 419, 39, 25, this.printList.xzq); //陕 | ||
137 | LODOP.ADD_PRINT_TEXT(78, 466, 39, 25, this.printList.xh); // | ||
138 | LODOP.ADD_PRINT_TEXT(78, 520, 60, 25, this.printList.d); // | ||
139 | LODOP.ADD_PRINT_TEXT(78, 670, 60, 25, this.printList.h); // | ||
141 | 140 | ||
142 | LODOP.ADD_PRINT_TEXT(119, 555, 190, 25, this.printList.zmsx); //然后多个ADD语句及SET语句 | 141 | LODOP.ADD_PRINT_TEXT(119, 555, 190, 25, this.printList.zmsx); //然后多个ADD语句及SET语句 |
143 | LODOP.ADD_PRINT_TEXT(152, 557, 190, 25, this.printList.qlr); //权利人 | 142 | LODOP.ADD_PRINT_TEXT(152, 557, 190, 25, this.printList.qlr); //权利人 |
144 | LODOP.ADD_PRINT_TEXT(186, 557, 190, 25, this.printList.ywr); //义务人 | 143 | LODOP.ADD_PRINT_TEXT(186, 557, 190, 25, this.printList.ywr); //义务人 |
145 | LODOP.ADD_PRINT_TEXT(219, 557, 190, 25, this.printList.zl); //坐落 | 144 | LODOP.ADD_PRINT_TEXT(219, 557, 190, 25, this.printList.zl); //坐落 |
146 | LODOP.ADD_PRINT_TEXT(254, 557, 190, 25, this.printList.bdcdyh); //不动产单元号 | 145 | LODOP.ADD_PRINT_TEXT(254, 557, 190, 25, this.printList.bdcdyh); //不动产单元号 |
147 | LODOP.ADD_PRINT_TEXT(318, 557, 190, 67, this.printList.qt); //其他 | 146 | LODOP.ADD_PRINT_TEXT(318, 557, 190, 67, this.printList.qt); //其他 |
148 | LODOP.ADD_PRINT_TEXT(426, 557, 190, 67, this.printList.fj); //附记 | 147 | LODOP.ADD_PRINT_TEXT(426, 557, 190, 67, this.printList.fj); //附记 |
149 | LODOP.SET_SHOW_MODE("BKIMG_PRINT", 1); | 148 | LODOP.SET_SHOW_MODE("BKIMG_PRINT", 1); |
150 | LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW", 1); | 149 | LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW", 1); |
151 | //窗口关闭后,回调函数中保存的设计代码 | 150 | //窗口关闭后,回调函数中保存的设计代码 |
152 | if (LODOP.CVERSION) | 151 | if (LODOP.CVERSION) |
153 | CLODOP.On_Return = function (TaskID, printList) { | 152 | CLODOP.On_Return = function (TaskID, printList) { |
154 | if (LODOP.CVERSION) | 153 | if (LODOP.CVERSION) |
155 | LODOP.On_Return = function (TaskID, Value) { | 154 | LODOP.On_Return = function (TaskID, Value) { |
156 | document.getElementById("S1").value = Value; | 155 | document.getElementById("S1").value = Value; |
157 | }; | 156 | }; |
158 | document.getElementById("S1").value = LODOP.GET_VALUE( | 157 | document.getElementById("S1").value = LODOP.GET_VALUE( |
159 | "ProgramData", | 158 | "ProgramData", |
160 | 0 | 159 | 0 |
161 | ); | 160 | ); |
162 | setTimeout(() => { | 161 | setTimeout(() => { |
163 | let printValue = document.getElementById("S1").value; | 162 | let printValue = document.getElementById("S1").value; |
164 | console.log("value", printValue); | 163 | console.log("value", printValue); |
165 | }, 1000); | 164 | }, 1000); |
166 | }; | 165 | }; |
167 | LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 | 166 | LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 |
167 | }, | ||
168 | }, | 168 | }, |
169 | }, | 169 | }; |
170 | }; | ||
171 | </script> | 170 | </script> |
172 | <style scoped lang="scss"> | 171 | <style scoped lang="scss"> |
173 | @import "~@/styles/public.scss"; | 172 | @import "~@/styles/public.scss"; |
174 | </style> | 173 | </style> | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-05-31 16:04:44 | 4 | * @LastEditTime: 2023-06-20 16:09:31 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px"> | 7 | <div class="from-clues loadingtext" v-Loading="loading" element-loading-text="拼命加载中..." style="height:720px;text-align: center;"> |
8 | <!-- 表单部分 --> | 8 | <!-- 表单部分 --> |
9 | <el-tabs v-model="activeName" @tab-click="handleClick" v-if="headTabBdcqz.length > 1"> | 9 | <el-tabs v-model="activeName" @tab-click="handleClick" v-if="headTabBdcqz.length >1"> |
10 | <el-tab-pane :label="item.qlr + '(' + item.bdcqzh + ')'" :name="item.bsmBdcqz" | 10 | <el-tab-pane :label="item.qlr + '(' + item.bdcqzh + ')'" :name="item.bdcqzlx" |
11 | v-for="(item, index) in headTabBdcqz" :key="index"></el-tab-pane> | 11 | v-for="(item, index) in headTabBdcqz" :key="index"></el-tab-pane> |
12 | </el-tabs> | 12 | </el-tabs> |
13 | <div class="no-data" v-if="headTabBdcqz.length == 0">暂无数据</div> | 13 | <div class="no-data" v-if="headTabBdcqz.length == 0">暂无数据</div> |
14 | <!-- <img :src="previewImage" class="imgClass"> --> | 14 | <canvas ref="zs" width="1000" v-if="activeName==1" height="700"></canvas> |
15 | <canvas ref="canvas" :width="canvasWidth" :height="canvasHeight"></canvas> | 15 | <canvas ref="zm" width="1180" v-else height="780"></canvas> |
16 | </div> | 16 | </div> |
17 | </template> | 17 | </template> |
18 | 18 | ||
... | @@ -30,9 +30,7 @@ | ... | @@ -30,9 +30,7 @@ |
30 | data () { | 30 | data () { |
31 | return { | 31 | return { |
32 | imgSrc: require('@/image/bdcqz/bdcqzs2.jpg'), | 32 | imgSrc: require('@/image/bdcqz/bdcqzs2.jpg'), |
33 | canvasWidth: 1018, | 33 | bdczmSrc: require('@/image/bdcqz/bdczm.jpg'), |
34 | canvasHeight: 720, | ||
35 | |||
36 | loading: false, | 34 | loading: false, |
37 | //印刷序列号集合 | 35 | //印刷序列号集合 |
38 | ysxlh: [], | 36 | ysxlh: [], |
... | @@ -79,10 +77,14 @@ | ... | @@ -79,10 +77,14 @@ |
79 | getSlsqBdcqzList({ bsmSlsq: this.formData.bsmSlsq }).then(res => { | 77 | getSlsqBdcqzList({ bsmSlsq: this.formData.bsmSlsq }).then(res => { |
80 | if (res.code == 200) { | 78 | if (res.code == 200) { |
81 | if (res.result && res.result.length > 0) { | 79 | if (res.result && res.result.length > 0) { |
82 | this.activeName = res.result[0].bsmBdcqz | 80 | this.activeName = res.result[0].bdcqzlx |
83 | this.bdcqz = res.result[0] | 81 | this.bdcqz = res.result[0] |
84 | this.headTabBdcqz = res.result | 82 | this.headTabBdcqz = res.result |
85 | this.drawTextOnImage(); | 83 | if (this.activeName == 1) { |
84 | this.drawTextOnImage() | ||
85 | } else { | ||
86 | this.drawTextzmImage() | ||
87 | } | ||
86 | } | 88 | } |
87 | } | 89 | } |
88 | this.loading = false | 90 | this.loading = false |
... | @@ -91,26 +93,21 @@ | ... | @@ -91,26 +93,21 @@ |
91 | //tab表头切换方法 | 93 | //tab表头切换方法 |
92 | handleClick (e) { | 94 | handleClick (e) { |
93 | this.bdcqz = this.headTabBdcqz[e.index - 0] | 95 | this.bdcqz = this.headTabBdcqz[e.index - 0] |
94 | this.activeName = this.headTabBdcqz.bsmBdcqz | 96 | this.activeName = this.headTabBdcqz.bdcqzlx |
95 | // this.getBdcqzPreview(); | 97 | if (this.activeName == 1) { |
96 | this.drawTextOnImage() | 98 | this.drawTextOnImage() |
99 | } else { | ||
100 | this.drawTextzmImage() | ||
101 | } | ||
97 | }, | 102 | }, |
98 | // getBdcqzPreview () { | 103 | // 不动产证书 |
99 | // bdcqzPreview(this.bdcqz).then(res => { | ||
100 | // this.loading = false | ||
101 | // let blob = new Blob([res]); | ||
102 | // let url = window.URL.createObjectURL(blob); | ||
103 | // this.previewImage = url; | ||
104 | // this.drawTextOnImage() | ||
105 | // }) | ||
106 | // }, | ||
107 | drawTextOnImage () { | 104 | drawTextOnImage () { |
108 | const canvas = this.$refs.canvas; | 105 | const canvas = this.$refs.zs; |
109 | const context = canvas.getContext('2d'); | 106 | const context = canvas.getContext('2d'); |
110 | const image = new Image(); | 107 | const image = new Image(); |
111 | image.onload = () => { | 108 | image.onload = () => { |
112 | context.drawImage(image, 0, 0); | 109 | context.drawImage(image, 0, 0); |
113 | context.font = '15px 楷体'; | 110 | context.font = '18px 楷体'; |
114 | context.fillStyle = '#000000'; | 111 | context.fillStyle = '#000000'; |
115 | context.fillText(this.bdcqz.sjjc ? this.bdcqz.sjjc : '', 60, 56); | 112 | context.fillText(this.bdcqz.sjjc ? this.bdcqz.sjjc : '', 60, 56); |
116 | context.fillText(this.bdcqz.djnd ? this.bdcqz.djnd : '', 113, 56); | 113 | context.fillText(this.bdcqz.djnd ? this.bdcqz.djnd : '', 113, 56); |
... | @@ -125,10 +122,79 @@ | ... | @@ -125,10 +122,79 @@ |
125 | context.fillText(this.bdcqz.yt ? this.bdcqz.yt : '', 138, 346); | 122 | context.fillText(this.bdcqz.yt ? this.bdcqz.yt : '', 138, 346); |
126 | context.fillText(this.bdcqz.mj ? this.bdcqz.mj : '', 138, 386); | 123 | context.fillText(this.bdcqz.mj ? this.bdcqz.mj : '', 138, 386); |
127 | context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 138, 429); | 124 | context.fillText(this.bdcqz.syqx ? this.bdcqz.syqx : '', 138, 429); |
128 | context.fillText(this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk : '', 138, 469); | 125 | // qlqtzk |
126 | const maxWidth = 280; // 最大宽度限制 | ||
127 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; | ||
128 | lines.forEach((line, index) => { | ||
129 | const y = 469 + (index * 37); // 每行文本的垂直位置 | ||
130 | let currentLine = ''; | ||
131 | let arr = []; | ||
132 | for (let word of line) { | ||
133 | const testLine = currentLine + word; | ||
134 | const lineWidth = context.measureText(testLine).width; | ||
135 | if (lineWidth <= maxWidth) { | ||
136 | currentLine = testLine; | ||
137 | } else { | ||
138 | arr.push(currentLine); | ||
139 | currentLine = word; | ||
140 | } | ||
141 | } | ||
142 | arr.push(currentLine); | ||
143 | arr.forEach((line, index) => { | ||
144 | context.fillText(line, 138, y + (index * 20)); // 调整行高 | ||
145 | }) | ||
146 | }) | ||
129 | context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100); | 147 | context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100); |
130 | } | 148 | } |
131 | image.src = this.imgSrc; | 149 | image.src = this.imgSrc |
150 | }, | ||
151 | // 不动产证明 | ||
152 | drawTextzmImage () { | ||
153 | const canvas = this.$refs.zm; | ||
154 | const context = canvas.getContext('2d'); | ||
155 | const image = new Image(); | ||
156 | image.onload = () => { | ||
157 | context.drawImage(image, 0, 0); | ||
158 | context.font = '18px 楷体'; | ||
159 | context.fillStyle = '#000000'; | ||
160 | context.fillText(this.bdcqz.sjjc ? this.bdcqz.sjjc : '', 620, 125); | ||
161 | context.fillText(this.bdcqz.djnd ? this.bdcqz.djnd : '', 665, 125); | ||
162 | context.fillText(this.bdcqz.sxqc ? this.bdcqz.sxqc : '', 750, 125); | ||
163 | context.fillText(this.bdcqz.sxh ? this.bdcqz.sxh : '', 960, 123); | ||
164 | context.fillText(this.bdcqz.zmqlhsx ? this.bdcqz.zmqlhsx : '', 775, 180); | ||
165 | context.fillText(this.bdcqz.qlr ? this.bdcqz.qlr : '', 775, 228); | ||
166 | // 义务人 | ||
167 | context.fillText(this.bdcqz.ywr ? this.bdcqz.ywr : '', 775, 275); | ||
168 | context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325); | ||
169 | // bdcdyh | ||
170 | context.fillText(this.bdcqz.bdcdyh ? this.bdcqz.bdcdyh : '', 775, 373); | ||
171 | // qlqtzk | ||
172 | const maxWidth = 280; // 最大宽度限制 | ||
173 | let lines = this.bdcqz.qlqtzk ? this.bdcqz.qlqtzk.split('\n') : []; | ||
174 | lines.forEach((line, index) => { | ||
175 | const y = 415 + (index * 37); // 每行文本的垂直位置 | ||
176 | let currentLine = ''; | ||
177 | let arr = []; | ||
178 | for (let word of line) { | ||
179 | const testLine = currentLine + word; | ||
180 | const lineWidth = context.measureText(testLine).width; | ||
181 | if (lineWidth <= maxWidth) { | ||
182 | currentLine = testLine; | ||
183 | } else { | ||
184 | arr.push(currentLine); | ||
185 | currentLine = word; | ||
186 | } | ||
187 | } | ||
188 | arr.push(currentLine); | ||
189 | arr.forEach((line, index) => { | ||
190 | context.fillText(line, 775, y + (index * 20)); // 调整行高 | ||
191 | }); | ||
192 | }); | ||
193 | // fj | ||
194 | context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 775, 650); | ||
195 | }; | ||
196 | |||
197 | image.src = this.bdczmSrc; | ||
132 | } | 198 | } |
133 | } | 199 | } |
134 | } | 200 | } | ... | ... |
1 | /* | 1 | /* |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-05-18 15:01:31 | 4 | * @LastEditTime: 2023-06-20 11:28:09 |
5 | */ | 5 | */ |
6 | import { getWorkFlowImage } from "@/api/workflow/jsydsyqFlow.js"; | 6 | import { getWorkFlowImage } from "@/api/workflow/jsydsyqFlow.js"; |
7 | import { getPrintTemplateByCode } from "@/api/system"; | 7 | import { getPrintTemplateByCode } from "@/api/system"; |
... | @@ -106,7 +106,7 @@ export default { | ... | @@ -106,7 +106,7 @@ export default { |
106 | this.$popupDialog("证书预览", "workflow/components/dialog/zsyl", { | 106 | this.$popupDialog("证书预览", "workflow/components/dialog/zsyl", { |
107 | bsmSlsq: this.bsmSlsq, | 107 | bsmSlsq: this.bsmSlsq, |
108 | entryType: '1' | 108 | entryType: '1' |
109 | }, '65%', true) | 109 | }, '1210px', true) |
110 | break; | 110 | break; |
111 | case "B6": | 111 | case "B6": |
112 | //根据编号获取对应信息 | 112 | //根据编号获取对应信息 | ... | ... |
-
Please register or sign in to post a comment