Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
cae64dbb
提交
cae64dbb
authored
4 年前
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
打印功能调整
上级
d574ff5a
master
yaanzhiyuan_2021
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
10 行删除
+39
-10
DragSetting.js
zyd_private/DragAndPrint/DragSetting.js
+38
-7
index2.js
zyd_private/DragAndPrint/ViewPrint/index2.js
+1
-3
没有找到文件。
zyd_private/DragAndPrint/DragSetting.js
浏览文件 @
cae64dbb
...
...
@@ -7,10 +7,37 @@
* 在up 的时候 更新元素dom的新位置到props
* */
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
,
Fragment
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
InputNumber
}
from
'antd'
;
import
{
imageStyleAll
,
A4Height
,
A4Width
,
styleCount
}
from
'./ViewPrint/config'
;
let
domIdTemp
=
''
;
const
HandleDetailFunction
=
({
isDownObj
})
=>
{
for
(
let
item
in
isDownObj
)
{
if
(
isDownObj
[
item
])
{
domIdTemp
=
item
;
}
}
if
(
!
domIdTemp
)
{
return
null
;
}
const
dom
=
document
.
getElementById
(
domIdTemp
);
const
x
=
dom
.
style
.
left
;
const
y
=
dom
.
style
.
top
;
return
<
Fragment
>
<
span
dangerouslySetInnerHTML
=
{{
__html
:
dom
.
innerHTML
}}
/
>
<
InputNumber
precision
=
{
0
}
min
=
{
0
}
value
=
{
x
}
/
>
<
InputNumber
precision
=
{
0
}
min
=
{
0
}
value
=
{
y
}
/
>
<
/Fragment>
;
};
export
default
class
Index
extends
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -26,7 +53,7 @@ export default class Index extends Component {
};
}
handleOnMouseDown
=
(
e
,
id
)
=>
{
handleOnMouseDown
=
(
e
,
id
)
=>
{
// 鼠标按钮 按下
const
div
=
document
.
getElementById
(
id
);
const
{
isDownObj
}
=
this
.
state
;
const
newDrag
=
{
...
...
@@ -46,7 +73,7 @@ export default class Index extends Component {
});
};
handleOnMouseMove
=
(
e
)
=>
{
handleOnMouseMove
=
(
e
)
=>
{
// 鼠标 移动
const
{
drag
,
isDownObj
}
=
this
.
state
;
if
(
new
Date
().
getTime
()
-
this
.
time1
<
17
)
{
this
.
time1
=
new
Date
().
getTime
();
...
...
@@ -86,7 +113,7 @@ export default class Index extends Component {
}
};
handleOnMouseUp
=
(
e
,
id
)
=>
{
handleOnMouseUp
=
(
e
,
id
)
=>
{
// 鼠标 按钮 收起
const
{
drag
,
isDownObj
}
=
this
.
state
;
let
{
mouseX
,
mouseY
,
objX
,
objY
}
=
drag
;
if
(
isDownObj
[
id
])
{
...
...
@@ -121,16 +148,18 @@ export default class Index extends Component {
render
()
{
const
{
backgroundUrl
,
configAll
:
{
config
,
wide
,
high
,
},
configAll
:
{
config
,
wide
,
high
},
}
=
this
.
props
;
const
{
isDownObj
}
=
this
.
state
;
const
imageStyle
=
{
height
:
`
${
high
}
cm`
||
A4Height
,
width
:
`
${
wide
}
cm`
||
A4Width
,
};
console
.
log
(
imageStyle
);
return
(
<
div
className
=
{
styles
.
outSideDiv
}
>
{
/* <div style={{ marginLeft: '45%', height: '100px' }}>
<HandleDetailFunction isDownObj={isDownObj}/>
</div>*/
}
<
div
onMouseMove
=
{(
e
)
=>
{
this
.
handleOnMouseMove
(
e
);
...
...
@@ -155,11 +184,13 @@ export default class Index extends Component {
key
=
{
item
.
id
}
onMouseDown
=
{(
e
)
=>
{
this
.
handleOnMouseDown
(
e
,
domId
);
console
.
log
(
domId
);
}}
onMouseUp
=
{(
e
)
=>
{
this
.
handleOnMouseUp
(
e
,
domId
);
}}
id
=
{
domId
}
style
=
{{
top
:
`
${
item
.
y
||
20
+
index
*
40
}
px`
,
left
:
`
${
item
.
x
||
20
}
px`
,
...
...
This diff is collapsed.
Click to expand it.
zyd_private/DragAndPrint/ViewPrint/index2.js
浏览文件 @
cae64dbb
import
React
,
{
Component
,
Fragment
}
from
'react'
;
import
{
queryConfig
}
from
'../services'
;
import
{
getInfo
}
from
'@/highOrderComponent/Service'
;
import
{
message
,
Button
}
from
'antd'
;
import
{
message
}
from
'antd'
;
import
Shell
from
'@/baseComponent/Shell'
;
import
ButtonDiy
from
'@/baseComponent/ButtonDiy'
;
import
router
from
'umi/router'
;
...
...
@@ -101,9 +101,7 @@ export default class ViewPrint extends Component {
}
else
{
info
=
defaultConfigInfo
;
}
console
.
log
(
info
);
const
{
printMeth
}
=
configAll
;
const
{
wide
,
high
}
=
configAll
;
const
{
LODOP
}
=
window
;
let
dom
=
document
.
getElementById
(
`printDomId-
${
printIndex
}
`
);
if
(
optionType
>=
1
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论