Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
45e47118
authored
2023-08-23 15:36:47 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:证书打印
1 parent
7fed6620
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
src/views/workflow/components/dialog/zsdy.vue
src/views/workflow/components/dialog/zsdy.vue
View file @
45e4711
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-08-
10 15:20:52
* @LastEditTime: 2023-08-
23 15:36:24
-->
<
template
>
<div>
...
...
@@ -117,7 +117,7 @@
const
image
=
new
Image
();
image
.
onload
=
()
=>
{
context
.
drawImage
(
image
,
0
,
0
);
context
.
font
=
'1
8
px 楷体'
;
context
.
font
=
'1
6
px 楷体'
;
context
.
fillStyle
=
'#000000'
;
context
.
fillText
(
this
.
bdcqz
.
sjjc
?
this
.
bdcqz
.
sjjc
:
''
,
60
,
56
);
context
.
fillText
(
this
.
bdcqz
.
djnd
?
this
.
bdcqz
.
djnd
:
''
,
113
,
56
);
...
...
@@ -131,7 +131,32 @@
context
.
fillText
(
this
.
bdcqz
.
qlxz
?
this
.
bdcqz
.
qlxz
:
''
,
138
,
303
);
context
.
fillText
(
this
.
bdcqz
.
yt
?
this
.
bdcqz
.
yt
:
''
,
138
,
346
);
context
.
fillText
(
this
.
bdcqz
.
mj
?
this
.
bdcqz
.
mj
:
''
,
138
,
386
);
// 使用期限
if
(
this
.
bdcqz
.
syqx
&&
this
.
bdcqz
.
syqx
.
length
>
28
)
{
let
lines3
=
this
.
bdcqz
.
syqx
?
this
.
bdcqz
.
syqx
.
split
(
' '
)
:
[];
lines3
.
forEach
((
line
,
index
)
=>
{
const
y
=
427
+
(
index
*
27
);
// 每行文本的垂直位置
let
currentLine
=
''
;
let
arr
=
[];
for
(
let
word
of
line
)
{
const
testLine
=
currentLine
+
word
;
const
lineWidth
=
context
.
measureText
(
testLine
).
width
;
if
(
lineWidth
<=
315
)
{
currentLine
=
testLine
;
}
else
{
arr
.
push
(
currentLine
);
currentLine
=
word
;
}
}
arr
.
push
(
currentLine
);
arr
.
forEach
((
line
,
index
)
=>
{
context
.
fillText
(
line
,
138
,
y
+
(
index
*
20
));
// 调整行高
})
})
}
else
{
context
.
fillText
(
this
.
bdcqz
.
syqx
?
this
.
bdcqz
.
syqx
:
''
,
138
,
429
);
}
// qlqtzk
const
maxWidth
=
280
;
// 最大宽度限制
let
lines
=
this
.
bdcqz
.
qlqtzk
?
this
.
bdcqz
.
qlqtzk
.
split
(
'\n'
)
:
[];
...
...
@@ -155,7 +180,7 @@
})
})
let
lines1
=
this
.
bdcqz
.
fj
?
this
.
bdcqz
.
fj
.
split
(
'
'
)
:
[];
let
lines1
=
this
.
bdcqz
.
fj
?
this
.
bdcqz
.
fj
.
split
(
'
\n
'
)
:
[];
lines1
.
forEach
((
line
,
index
)
=>
{
const
y
=
100
+
(
index
*
37
);
// 每行文本的垂直位置
let
currentLine
=
''
;
...
...
Please
register
or
sign in
to post a comment