Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
cd4a4b30
提交
cd4a4b30
authored
12月 22, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加签章组件
上级
4102219b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
275 行增加
和
121 行删除
+275
-121
DetailTest.js
FormInsertDiy/AffairPage/DetailTest.js
+66
-0
index.jsx
one_stop_public/AffairButton/AuditButton/Modal/index.jsx
+67
-60
index.jsx
one_stop_public/filePreview/index.jsx
+7
-2
PictureSignature.js
one_stop_public/libs/PictureSignature/PictureSignature.js
+118
-47
styles.less
one_stop_public/libs/PictureSignature/styles.less
+5
-1
index.jsx
one_stop_public/tableCompon/index.jsx
+7
-6
utils.js
one_stop_public/utils/utils.js
+5
-5
没有找到文件。
FormInsertDiy/AffairPage/DetailTest.js
0 → 100644
浏览文件 @
cd4a4b30
import
React
,
{
Fragment
,
Component
}
from
'react'
;
const
getUrlInfo
=
param
=>
{
let
url
=
window
.
document
.
location
.
href
.
toString
();
let
u
=
url
.
split
(
'?'
);
if
(
typeof
u
[
1
]
==
'string'
)
{
u
=
u
[
1
].
split
(
'&'
);
let
get
=
{};
for
(
let
i
in
u
)
{
let
j
=
u
[
i
].
split
(
'='
);
get
[
j
[
0
]]
=
decodeURIComponent
(
j
[
1
]);
}
return
get
;
}
else
{
return
{};
}
};
export
default
class
Detail
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
componentDidMount
()
{
window
.
addEventListener
(
'message'
,
event
=>
{
if
(
event
.
data
&&
event
.
data
.
indexOf
&&
event
.
data
.
indexOf
(
'iframeDetailHeight'
)
>
-
1
)
{
const
height
=
Number
(
event
.
data
.
split
(
'-'
)[
1
]);
document
.
getElementById
(
'detailIframeId'
).
height
=
height
+
50
;
setTimeout
(()
=>
{
//document.getElementsByClassName('ant-layout-content')[0].scrollTo(0, height);
// 23627 签约审核/另行签约审核,审核框优化,自动显示到当前页面,不要一直拉
// 需求存在争议 暂时这样解决
},
500
);
}
},
false
,
);
}
render
()
{
let
iframeUrl
=
`http://localhost:8000/onestop/IframeForDetail?id=1471409591622303744&token=2055c709-a144-4897-b8b8-0e907f9e9221`
;
return
(
<
div
>
<
iframe
src
=
{
iframeUrl
}
frameBorder
=
{
0
}
id
=
"detailIframeId"
name
=
"applyIframe"
marginWidth
=
"0"
marginHeight
=
"0"
onLoad
=
{
this
.
showAll
}
allowtransparency
=
"yes"
seamless
scrolling
=
{
'no'
}
style
=
{{
width
:
'100%'
,
overflowY
:
'hidden'
,
minHeight
:
'800px'
,
}}
/
>
<
/div
>
);
}
}
one_stop_public/AffairButton/AuditButton/Modal/index.jsx
浏览文件 @
cd4a4b30
...
...
@@ -3,68 +3,75 @@
* 2019年9月16日
* Modal定制样式
*/
import
React
,
{
Component
}
from
'react'
;
import
{
Modal
,
Button
}
from
'antd'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Modal
,
Button
}
from
'antd'
;
import
styles
from
'./index.less'
;
import
{
getContainer
}
from
"@/webPublic/one_stop_public/utils/utils"
;
export
default
class
WebModal
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
top
:
0
,
};
}
/**
* 钟是志
* 2020年4月22日 17:07:53
* 修改Iframe打开弹窗的时候 弹窗定位错误的bug
* */
componentDidMount
()
{
setTimeout
(()
=>
{
let
dom
=
document
.
getElementById
(
'detailInfoDiv'
);
if
(
dom
&&
dom
.
offsetHeight
)
{
let
height
=
dom
.
offsetHeight
;
if
(
height
>
700
)
{
this
.
setState
({
top
:
height
-
700
,
});
}
// console.log(height, 'Iframe页面的高度');
}
},
1500
);
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
top
:
0
,
};
}
/**
* 钟是志
* 2020年4月22日 17:07:53
* 修改Iframe打开弹窗的时候 弹窗定位错误的bug
* */
componentDidMount
()
{
setTimeout
(()
=>
{
let
dom
=
document
.
getElementById
(
'detailInfoDiv'
);
if
(
dom
&&
dom
.
offsetHeight
)
{
let
height
=
dom
.
offsetHeight
;
if
(
height
>
700
)
{
this
.
setState
({
top
:
height
-
700
,
});
}
// console.log(height, 'Iframe页面的高度');
}
},
1500
);
}
render
()
{
let
{
visible
,
handleCancel
,
title
,
width
}
=
this
.
props
;
const
{
top
}
=
this
.
state
;
const
style
=
{
borderRadius
:
4
,
};
if
(
top
)
{
style
.
top
=
top
;
}
return
(
<
div
>
<
Modal
closable=
{
false
}
visible=
{
visible
}
footer=
{
null
}
getContainer=
{
getContainer
}
destroyOnClose=
{
true
}
width=
{
!!
width
?
width
:
800
}
handleCancel=
{
handleCancel
}
style=
{
style
}
>
<
div
className=
{
styles
.
content_div
}
>
<
div
className=
{
styles
.
title
}
>
{
title
}
<
Button
className=
{
styles
.
button
}
onClick=
{
handleCancel
}
>
X
</
Button
>
</
div
>
{
this
.
props
.
children
}
</
div
>
</
Modal
>
</
div
>
);
}
render
()
{
let
{
visible
,
handleCancel
,
title
,
width
}
=
this
.
props
;
const
{
top
}
=
this
.
state
;
const
style
=
{
borderRadius
:
4
,
};
if
(
top
)
{
style
.
top
=
top
;
}
let
dom
=
document
.
getElementsByClassName
(
'antd-pro-web-public-one_stop_public-affair-button-audit-button-user-table-styles-btn_page'
);
if
(
dom
&&
dom
.
length
){
dom
=
dom
[
0
];
}
return
(
<
Modal
closable=
{
false
}
visible=
{
visible
}
footer=
{
null
}
getContainer=
{
()
=>
{
return
getContainer
(
dom
);
}
}
destroyOnClose=
{
true
}
width=
{
!!
width
?
width
:
800
}
handleCancel=
{
handleCancel
}
style=
{
style
}
>
<
div
className=
{
styles
.
content_div
}
>
<
div
className=
{
styles
.
title
}
>
{
title
}
<
Button
className=
{
styles
.
button
}
onClick=
{
handleCancel
}
>
X
</
Button
>
</
div
>
{
this
.
props
.
children
}
</
div
>
</
Modal
>
);
}
}
one_stop_public/filePreview/index.jsx
浏览文件 @
cd4a4b30
...
...
@@ -90,13 +90,16 @@ export default class index extends Component {
{
pathName
}
</
a
>
)
}
{
visible
&&
<
Modal
title=
{
pathName
}
visible=
{
visible
}
width=
{
1200
}
destroyOnClose
getContainer=
{
getContainer
}
getContainer=
{
()
=>
{
return
getContainer
(
this
.
imageDom
.
parentNode
.
parentNode
.
parentNode
);
}
}
centered=
{
true
}
onOk=
{
this
.
handleOk
}
onCancel=
{
this
.
handleCancel
}
>
...
...
@@ -128,6 +131,8 @@ export default class index extends Component {
</
div
>
)
}
</
Modal
>
}
</>
);
}
...
...
one_stop_public/libs/PictureSignature/PictureSignature.js
浏览文件 @
cd4a4b30
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./styles.less'
;
import
{
Modal
,
Button
,
Icon
}
from
'antd'
;
import
ShowItem
,
{
dragEventList
}
from
'./ShowItem'
;
import
{
apiRequest
}
from
"../../utils/request"
;
import
{
Modal
,
Button
,
Icon
,
message
}
from
'antd'
;
import
ShowItem
,
{
dragEventList
}
from
'./ShowItem'
;
import
{
apiRequest
}
from
"../../utils/request"
;
import
{
getContainer
}
from
"../../utils/utils"
;
let
fakeFileInfo
=
{
path
:
'/u/202112/
09145847wsz2.jp
g'
,
path
:
'/u/202112/
22111913hyia.pn
g'
,
name
:
'摇摇后摇'
,
};
export
default
function
PictureSignature
({
json
,
// fileInfo,
basicUrl
,
openEdit
=
true
,
})
{
let
fileInfo
=
fakeFileInfo
;
json
,
disabled
,
basicUrl
,
onChangeFile
,
// fileInfo,
...
others
})
{
let
imageRef
=
useRef
();
const
[
fileInfo
,
setFileInfo
]
=
useState
(
others
?.
fileInfo
);
const
[
openEdit
,
setOpenEdit
]
=
useState
(
false
);
const
[
showModal
,
setShowModal
]
=
useState
(
false
);
const
[
otherProps
,
setOtherProps
]
=
useState
({});
const
[
imageInfo
,
setImageInfo
]
=
useState
({
...
...
@@ -29,6 +31,7 @@ export default function PictureSignature({
const
changeShowModal
=
()
=>
{
setShowModal
(
!
showModal
);
};
console
.
log
(
json
);
useEffect
(()
=>
{
if
(
json
.
otherProps
)
{
...
...
@@ -53,22 +56,40 @@ export default function PictureSignature({
}
},
[
json
.
otherProps
]);
const
{
ModalProps
,
signConfig
,
footerButtons
}
=
otherProps
;
const
{
ModalProps
,
signConfig
,
footerButtons
,
originButtons
}
=
otherProps
;
const
handleClickButton
=
(
clickType
)
=>
{
switch
(
clickType
){
switch
(
clickType
)
{
case
'startEdit'
:
setOpenEdit
(
true
);
break
;
case
'confirm'
:
onChangeFile
({...
fileInfo
});
changeShowModal
();
break
;
case
'save'
:
apiRequest
(
'/ImageLibApi/merge'
,
{
background
:
fileInfo
?.
path
,
content
:
JSON
.
stringify
({
objs
:
otherProps
.
signConfig
,
}),
}).
then
((
res
)
=>
{
if
(
res
&&
res
.
path
)
{
message
.
success
(
'操作成功'
);
let
newPath
=
res
.
path
;
fileInfo
.
originPath
=
fileInfo
.
path
;
fileInfo
.
path
=
newPath
;
setFileInfo
({...
fileInfo
});
setOpenEdit
(
false
);
}
})
break
;
case
'restore'
:
let
func
=
new
Function
(
json
.
otherProps
);
let
otherPropsX
=
func
();
setOtherProps
(
otherPropsX
);
if
(
fileInfo
.
originPath
)
{
fileInfo
.
path
=
fileInfo
.
originPath
;
setFileInfo
({...
fileInfo
});
setOpenEdit
(
false
);
}
break
;
default
:
return
true
;
...
...
@@ -76,27 +97,47 @@ export default function PictureSignature({
}
const
Footer
=
()
=>
{
if
(
disabled
)
{
return
null
;
}
if
(
openEdit
)
{
return
footerButtons
.
map
(
g
=>
{
return
(
<
Button
type
=
{
g
.
type
}
key
=
{
g
.
key
}
onClick
=
{()
=>
{
handleClickButton
(
g
.
clickType
)}}
onClick
=
{()
=>
{
handleClickButton
(
g
.
clickType
)
}}
>
{
g
.
name
}
<
/Button
>
);
});
}
else
{
return
originButtons
.
map
(
g
=>
{
return
(
<
Button
type
=
{
g
.
type
}
key
=
{
g
.
key
}
onClick
=
{()
=>
{
handleClickButton
(
g
.
clickType
)
}}
>
{
g
.
name
}
<
/Button
>
);
});
}
else
{
return
null
;
}
};
if
(
!
fileInfo
)
{
return
null
;
}
return
(
<
div
className
=
{
styles
.
outSideDiv
}
>
<
div
className
=
{
styles
.
outSideDiv
}
ref
=
{
imageRef
}
>
{
fileInfo
&&
fileInfo
?.
path
&&
(
<
img
className
=
{
styles
.
onePic
}
ref
=
{
imageRef
}
src
=
{
basicUrl
+
fileInfo
?.
path
}
alt
=
{
fileInfo
.
name
}
onClick
=
{
changeShowModal
}
...
...
@@ -108,14 +149,18 @@ export default function PictureSignature({
destroyOnClose
=
{
true
}
maskClosable
=
{
false
}
onCancel
=
{
changeShowModal
}
getContainer
=
{
getContainer
}
// getContainer={() => {getContainer(imageRef.current)}}
getContainer
=
{
false
}
className
=
{
styles
.
ModalClass
}
footer
=
{
<
Footer
/>
}
footer
=
{
<
Footer
/>
}
title
=
{
'图片签章'
}
width
=
{
'90vw'
}
bodyStyle
=
{{
minHeight
:
'800px'
,
overflow
:
'auto'
,
padding
:
'20px'
,
maxWidth
:
'99%'
,
maxHeight
:
'99%'
,
}}
{...
ModalProps
}
>
...
...
@@ -132,28 +177,28 @@ export default function PictureSignature({
draggable={false}
id={'dropZone'}
>
{Array.isArray(signConfig) &&
signConfig.map(g => {
return (
<div
key={g.key}
data-mes={g.key}
draggable={false}
className={styles.oneSetItem}
style={{
top: g.y,
left: g.x,
}}
>
<div className={styles.draggableIcon} draggable={true}>
<Icon type="edit"
/>
</div>
<ShowItem {...g}
basicUrl={basicUrl}
/>
</div>
);
})}
{Array.isArray(signConfig) &&
signConfig.map(g => {
return (
<div
key={g.key}
data-mes={g.key}
draggable={false}
className={styles.oneSetItem}
style={{
top: g.y,
left: g.x,
}}
>
<div className={styles.draggableIcon} draggable={true}>
<Icon type="edit"
/>
</div>
<ShowItem {...g}
basicUrl={basicUrl}
/>
</div>
);
})}
</div>
)}
{!openEdit && ( // 不开启签章功能 只是预览图片
...
...
@@ -161,7 +206,6 @@ export default function PictureSignature({
<img
src={basicUrl + fileInfo?.path}
alt={fileInfo.name}
style={{ maxWidth: '95vw' }}
/>
</div>
)}
...
...
@@ -171,3 +215,30 @@ export default function PictureSignature({
</div>
);
}
export function SignArray(props){
const {value, onChange, basicUrl, json, } = props;
console.log(props);
let files = value?.files || [];
const onChangeFile = (newFielInfo) => {
for(let item of files){
if((item.path || item.originPath) === newFielInfo.originPath){
item = newFielInfo;
}
}
value.files = files;
onChange({files});
}
return <div>
{
files.map((g) => {
return <PictureSignature json={json}
basicUrl={basicUrl}
fileInfo={g}
onChangeFile={onChangeFile}
/>
})
}
</div>
}
one_stop_public/libs/PictureSignature/styles.less
浏览文件 @
cd4a4b30
...
...
@@ -30,7 +30,11 @@
width: 100%;
display: grid;
place-items: center;
min-height: 60vh;
min-height: 800px;
img{
max-width: 1300px;
height: auto;
}
}
.oneSetItem{
position: absolute;
...
...
one_stop_public/tableCompon/index.jsx
浏览文件 @
cd4a4b30
...
...
@@ -59,7 +59,7 @@ import DraftEditorCom from '../App/DraftEditorCom';
import
MobileItem
from
'./MobileItem'
;
import
MobileCascader
from
'./CascaderDiy/MobileCascader'
;
import
{
equal
,
errorHandler
,
getBase64
,
getRender
,
isJSON
}
from
'./Split_Index/staticInfo'
;
import
PictureSignature
from
"@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature"
;
import
PictureSignature
,
{
SignArray
}
from
"@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature"
;
const
{
TextArea
}
=
Input
;
const
{
Option
}
=
Select
;
...
...
@@ -2039,6 +2039,7 @@ export default class tableCom extends Component {
return
(
<
li
key=
{
f
.
path
}
>
<
PictureSignature
json=
{
json
}
disabled=
{
true
}
// 只读模式
basicUrl=
{
queryApiActionPath
()
}
fileInfo=
{
f
}
...
...
@@ -2057,6 +2058,7 @@ export default class tableCom extends Component {
return
(
<
li
key=
{
f
.
path
}
>
<
PictureSignature
json=
{
json
}
disabled=
{
true
}
// 只读模式
basicUrl=
{
queryApiActionPath
()
}
fileInfo=
{
f
}
...
...
@@ -2992,11 +2994,10 @@ export default class tableCom extends Component {
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
initialValue
:
{
files
:
filesPictureSignature
},
})(
<
PictureSignature
json=
{
json
}
disabled=
{
disabled
||
isPreview
}
/>,
);
<
SignArray
json=
{
json
}
disabled=
{
disabled
||
isPreview
}
basicUrl=
{
queryApiActionPath
()
}
/>);
if
(
get
===
'mobile'
&&
((
json
.
isMobileLabel
!=
null
&&
json
.
isMobileLabel
)
||
...
...
one_stop_public/utils/utils.js
浏览文件 @
cd4a4b30
...
...
@@ -27,10 +27,10 @@ export const dispatch = (type, payload, callback) => {
window
.
g_app
.
_store
.
dispatch
({
type
,
payload
,
callback
});
};
export
const
getContainer
=
()
=>
{
if
(
window
.
location
.
href
.
indexOf
(
'localhost'
)
>
-
1
)
{
export
const
getContainer
=
(
node
)
=>
{
console
.
log
(
node
);
if
(
window
.
parent
?.
document
&&
node
){
return
node
;
}
return
document
.
body
;
}
else
{
return
window
.
parent
?.
document
?.
body
||
document
.
body
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论