Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
9934afe4
提交
9934afe4
authored
6月 11, 2020
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
打印效果修改
上级
c8378d7f
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
29 行增加
和
18 行删除
+29
-18
index2.js
zyd_private/DragAndPrint/ViewPrint/index2.js
+29
-18
没有找到文件。
zyd_private/DragAndPrint/ViewPrint/index2.js
浏览文件 @
9934afe4
...
@@ -23,6 +23,7 @@ export default class ViewPrint extends Component {
...
@@ -23,6 +23,7 @@ export default class ViewPrint extends Component {
loading
:
true
,
loading
:
true
,
printIndex
:
0
,
printIndex
:
0
,
showWindowPrint
:
false
,
showWindowPrint
:
false
,
preaparePrint
:
false
,
};
};
this
.
getConfigInfo
=
queryConfig
.
bind
(
this
);
this
.
getConfigInfo
=
queryConfig
.
bind
(
this
);
}
}
...
@@ -95,11 +96,12 @@ export default class ViewPrint extends Component {
...
@@ -95,11 +96,12 @@ export default class ViewPrint extends Component {
printOne
=
(
optionType
=
0
)
=>
{
printOne
=
(
optionType
=
0
)
=>
{
const
{
printIndex
,
configAll
,
viewData
}
=
this
.
state
;
const
{
printIndex
,
configAll
,
viewData
}
=
this
.
state
;
let
{
info
}
=
configAll
;
let
{
info
}
=
configAll
;
if
(
isJSON
(
info
))
{
if
(
isJSON
(
info
))
{
info
=
JSON
.
parse
(
info
);
info
=
JSON
.
parse
(
info
);
}
else
{
}
else
{
info
=
defaultConfigInfo
;
info
=
defaultConfigInfo
;
}
}
console
.
log
(
info
);
const
{
printMeth
}
=
configAll
;
const
{
printMeth
}
=
configAll
;
const
{
wide
,
high
}
=
configAll
;
const
{
wide
,
high
}
=
configAll
;
const
{
LODOP
}
=
window
;
const
{
LODOP
}
=
window
;
...
@@ -111,11 +113,12 @@ export default class ViewPrint extends Component {
...
@@ -111,11 +113,12 @@ export default class ViewPrint extends Component {
console
.
error
(
'dom节点没找到'
);
console
.
error
(
'dom节点没找到'
);
return
false
;
return
false
;
}
}
console
.
log
(
wide
,
high
);
const
strHTML
=
dom
.
innerHTML
;
const
strHTML
=
dom
.
innerHTML
;
LODOP
.
SET_SHOW_MODE
(
'LANGUAGE'
,
0
);
LODOP
.
SET_SHOW_MODE
(
'LANGUAGE'
,
0
);
LODOP
.
SET_LICENSES
(
'成都市知用科技有限公司'
,
'649677881727389907689190562356'
,
''
,
''
);
LODOP
.
SET_LICENSES
(
'成都市知用科技有限公司'
,
'649677881727389907689190562356'
,
''
,
''
);
LODOP
.
PRINT_INITA
(
0
,
0
,
`
${
wide
}
cm`
,
`
${
high
}
cm`
,
`printDomId
${
printIndex
}
`
);
// LODOP.PRINT_INITA(0, 0, `${wide}cm`, `${high}cm`, `printDomId${printIndex}`);
LODOP
.
PRINT_INIT
(
`
${
Math
.
random
()
*
10000
+
'test'
}
`
);
LODOP
.
SET_PRINT_MODE
(
'RESELECT_PAGESIZE'
,
true
);
LODOP
.
SET_PRINT_PAGESIZE
(
printMeth
,
info
.
paperWidth
,
info
.
paperHeight
,
'CreateCustomPage'
);
// 打印方向 纸张大小.
LODOP
.
SET_PRINT_PAGESIZE
(
printMeth
,
info
.
paperWidth
,
info
.
paperHeight
,
'CreateCustomPage'
);
// 打印方向 纸张大小.
LODOP
.
ADD_PRINT_HTML
(
0
,
0
,
'100%'
,
'100%'
,
strHTML
);
// HTML 打印
LODOP
.
ADD_PRINT_HTML
(
0
,
0
,
'100%'
,
'100%'
,
strHTML
);
// HTML 打印
switch
(
optionType
)
{
switch
(
optionType
)
{
...
@@ -207,7 +210,7 @@ export default class ViewPrint extends Component {
...
@@ -207,7 +210,7 @@ export default class ViewPrint extends Component {
};
};
render
()
{
render
()
{
const
{
configAll
,
viewData
,
showWindowPrint
,
loading
}
=
this
.
state
;
const
{
configAll
,
viewData
,
showWindowPrint
,
loading
,
preaparePrint
}
=
this
.
state
;
if
(
!
viewData
)
{
if
(
!
viewData
)
{
return
(
return
(
<
Shell
styleShell
=
{{
marginTop
:
'0'
,
marginBottom
:
'20px'
}}
>
<
Shell
styleShell
=
{{
marginTop
:
'0'
,
marginBottom
:
'20px'
}}
>
...
@@ -247,42 +250,50 @@ export default class ViewPrint extends Component {
...
@@ -247,42 +250,50 @@ export default class ViewPrint extends Component {
name
=
{
'打印设备选择'
}
name
=
{
'打印设备选择'
}
handleClick
=
{()
=>
{
handleClick
=
{()
=>
{
window
.
LODOP
.
SELECT_PRINTER
();
window
.
LODOP
.
SELECT_PRINTER
();
this
.
setState
({
preaparePrint
:
true
,
});
}}
}}
loading
=
{
loading
}
loading
=
{
loading
}
/
>
/
>
<
ButtonDiy
<
ButtonDiy
name
=
{
'打印
'
}
name
=
{
'打印预览
'
}
handleClick
=
{()
=>
{
handleClick
=
{()
=>
{
this
.
printByLodop
();
if
(
!
preaparePrint
)
{
message
.
warning
(
'请先选择打印设备'
);
return
false
;
}
this
.
printPreview
();
}}
}}
loading
=
{
loading
}
loading
=
{
loading
}
/
>
/
>
<
ButtonDiy
<
ButtonDiy
name
=
{
'返回
'
}
name
=
{
'打印
'
}
handleClick
=
{()
=>
{
handleClick
=
{()
=>
{
router
.
goBack
();
if
(
!
preaparePrint
)
{
message
.
warning
(
'请先选择打印设备'
);
return
false
;
}
this
.
printByLodop
();
}}
}}
loading
=
{
loading
}
/
>
/
>
<
Authorized
authority
=
{
'/jc/setting/PrintPositionSetting'
}
>
<
span
style
=
{{
float
:
'right'
}}
>
<
span
style
=
{{
float
:
'right'
}}
>
<
ButtonDiy
<
ButtonDiy
name
=
{
'打印调试模式(实施)
'
}
name
=
{
'返回
'
}
handleClick
=
{()
=>
{
handleClick
=
{()
=>
{
this
.
printSetUp
();
router
.
goBack
();
}}
}}
loading
=
{
loading
}
/
>
/
>
<
/span
>
<
/span
>
<
/Authorized
>
<
Authorized
authority
=
{
'/jc/setting/PrintPositionSetting'
}
>
<
Authorized
authority
=
{
'/jc/setting/PrintPositionSetting'
}
>
<
span
style
=
{{
float
:
'right'
}}
>
<
span
style
=
{{
float
:
'right'
}}
>
<
ButtonDiy
<
ButtonDiy
name
=
{
'打印预览
(实施)'
}
name
=
{
'打印调试模式
(实施)'
}
handleClick
=
{()
=>
{
handleClick
=
{()
=>
{
this
.
printPreview
();
this
.
printSetUp
();
}}
}}
loading
=
{
loading
}
loading
=
{
loading
}
/
>
/
>
...
@@ -331,7 +342,7 @@ export default class ViewPrint extends Component {
...
@@ -331,7 +342,7 @@ export default class ViewPrint extends Component {
<
div
<
div
style
=
{{
style
=
{{
position
:
'relative'
,
position
:
'relative'
,
// pageBreakAfter: 'always
',
pageBreakAfter
:
'avoid
'
,
...
imageStyle
,
...
imageStyle
,
backgroundColor
:
'#fff'
,
backgroundColor
:
'#fff'
,
}}
>
}}
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论