Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
88cceecc
提交
88cceecc
authored
4 年前
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
打印功能易用性修改
上级
1b4d745b
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
52 行增加
和
14 行删除
+52
-14
DragSetting.js
zyd_private/DragAndPrint/DragSetting.js
+33
-12
DetailDom.js
zyd_private/DragAndPrint/ViewPrint/DetailDom.js
+19
-2
没有找到文件。
zyd_private/DragAndPrint/DragSetting.js
浏览文件 @
88cceecc
...
...
@@ -14,7 +14,7 @@ import { imageStyleAll, A4Height, A4Width, styleCount } from './ViewPrint/config
let
domIdTemp
=
''
;
const
HandleDetailFunction
=
({
isDownObj
})
=>
{
const
HandleDetailFunction
=
({
isDownObj
,
updateOnePostion
,
config
})
=>
{
for
(
let
item
in
isDownObj
)
{
if
(
isDownObj
[
item
])
{
domIdTemp
=
item
;
...
...
@@ -23,16 +23,25 @@ const HandleDetailFunction = ({ isDownObj }) => {
if
(
!
domIdTemp
)
{
return
null
;
}
const
id
=
domIdTemp
.
replace
(
'dragKey-'
,
''
);
const
itemConfig
=
config
.
find
((
y
)
=>
{
return
y
.
id
+
''
===
id
;
});
const
dom
=
document
.
getElementById
(
domIdTemp
);
const
x
=
dom
.
style
.
left
;
const
y
=
dom
.
style
.
top
;
return
<
Fragment
>
<
span
dangerouslySetInnerHTML
=
{{
__html
:
dom
.
innerHTML
}}
/
>
const
x
=
itemConfig
.
x
;
const
y
=
itemConfig
.
y
;
return
<
Fragment
>
<
span
dangerouslySetInnerHTML
=
{{
__html
:
dom
.
innerHTML
}}
/
>
<
span
>
偏移量
(
x
,
y
)
<
/span
>
<
InputNumber
precision
=
{
0
}
min
=
{
0
}
onChange
=
{(
value
)
=>
{
updateOnePostion
({
id
,
x
:
value
,
y
});
}}
value
=
{
x
}
/
>
<
InputNumber
precision
=
{
0
}
min
=
{
0
}
onChange
=
{(
value
)
=>
{
updateOnePostion
({
id
,
y
:
value
,
x
});
}}
value
=
{
y
}
/
>
<
/Fragment>
;
};
...
...
@@ -113,7 +122,16 @@ export default class Index extends Component {
}
};
handleOnMouseUp
=
(
e
,
id
)
=>
{
// 鼠标 按钮 收起
updateOnePostion
=
({
id
,
x
,
y
})
=>
{
const
{
updateConfig
}
=
this
.
props
;
updateConfig
({
id
,
x
,
y
,
});
};
handleOnMouseUp
=
(
e
,
id
)
=>
{
// 鼠标 按钮 收起 更新数据到props
const
{
drag
,
isDownObj
}
=
this
.
state
;
let
{
mouseX
,
mouseY
,
objX
,
objY
}
=
drag
;
if
(
isDownObj
[
id
])
{
...
...
@@ -127,7 +145,6 @@ export default class Index extends Component {
mouseX
=
x
;
mouseY
=
y
;
const
{
updateConfig
}
=
this
.
props
;
updateConfig
({
id
:
id
.
replace
(
'dragKey-'
,
''
),
x
:
styleLeft
,
...
...
@@ -157,15 +174,19 @@ export default class Index extends Component {
};
return
(
<
div
className
=
{
styles
.
outSideDiv
}
>
{
/* <div style={{ marginLeft: '45%', height: '100px' }}>
<HandleDetailFunction isDownObj={isDownObj}/>
</div>*/
}
<
div
style
=
{{
marginLeft
:
'45%'
,
height
:
'100px'
}}
>
<
HandleDetailFunction
isDownObj
=
{
isDownObj
}
config
=
{
config
}
updateOnePostion
=
{
this
.
updateOnePostion
}
/
>
<
/div
>
<
div
onMouseMove
=
{(
e
)
=>
{
this
.
handleOnMouseMove
(
e
);
}}
style
=
{{
...
imageStyle
,
position
:
'relative'
,
}}
>
<
img
src
=
{
backgroundUrl
}
...
...
This diff is collapsed.
Click to expand it.
zyd_private/DragAndPrint/ViewPrint/DetailDom.js
浏览文件 @
88cceecc
...
...
@@ -18,11 +18,28 @@ const normalTextRender = (text, config) => {
if
(
!
text
||
text
===
'undefined'
||
typeof
text
===
'undefined'
)
{
return
null
;
}
const
configTextStyle
=
config
.
info
&&
isJSON
(
config
.
info
)
&&
JSON
.
parse
(
config
.
info
).
textStyle
||
{};
const
configInfoJSON
=
(
config
.
info
&&
isJSON
(
config
.
info
)
&&
JSON
.
parse
(
config
.
info
)
)
||
{}
;
const
configTextStyle
=
configInfoJSON
.
textStyle
||
{};
// 文本的样式
const
configTextBreakLength
=
configInfoJSON
.
textBreakLength
||
undefined
;
// 字数过宽换行
const
width
=
config
.
wide
?
config
.
wide
+
'px'
:
'auto'
;
const
height
=
config
.
high
?
config
.
high
+
'px'
:
'auto'
;
if
(
configTextBreakLength
&&
text
.
length
>
configTextBreakLength
)
{
text
=
[
text
.
substr
(
0
,
configTextBreakLength
),
text
.
substr
(
configTextBreakLength
)];
return
text
.
map
((
x
,
index
)
=>
{
return
<
div
key
=
{
x
}
style
=
{{
...
styleCount
(
config
),
marginBottom
:
'0'
,
width
,
textAlign
:
'right'
,
...
configTextStyle
,
}}
>
{
x
}
<
/div>
;
});
}
if
(
config
.
mark
&&
text
.
indexOf
(
config
.
mark
)
>
-
1
)
{
// 换行分隔符
text
=
text
.
split
(
config
.
mark
);
let
length
=
text
.
length
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论