Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
579a0fac
提交
579a0fac
authored
1月 05, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
b1138540
5028afc0
全部展开
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
78 行增加
和
82 行删除
+78
-82
index.jsx
one_stop_public/AffairButton/AuditButton/Modal/index.jsx
+2
-4
index.jsx
one_stop_public/AffairButton/AuditButton/userTable/index.jsx
+1
-0
ZdyTable.jsx
one_stop_public/Table/ZdyTable.jsx
+0
-0
index.jsx
one_stop_public/Table/index.jsx
+0
-0
index.jsx
one_stop_public/filePreview/index.jsx
+1
-0
FormulaForm.jsx
one_stop_public/libs/FormulaForm.jsx
+1
-24
PictureSignature.js
one_stop_public/libs/PictureSignature/PictureSignature.js
+58
-52
styles.less
one_stop_public/libs/PictureSignature/styles.less
+1
-1
UploadCom.js
one_stop_public/libs/UploadCom.js
+14
-1
没有找到文件。
one_stop_public/AffairButton/AuditButton/Modal/index.jsx
浏览文件 @
579a0fac
...
...
@@ -38,7 +38,7 @@ export default class WebModal extends Component {
}
render
()
{
let
{
visible
,
handleCancel
,
title
,
width
}
=
this
.
props
;
let
{
visible
,
handleCancel
,
title
,
width
,
getContainer
}
=
this
.
props
;
const
{
top
}
=
this
.
state
;
const
style
=
{
borderRadius
:
4
,
...
...
@@ -55,9 +55,7 @@ export default class WebModal extends Component {
closable=
{
false
}
visible=
{
visible
}
footer=
{
null
}
getContainer=
{
()
=>
{
return
getContainer
(
dom
);
}
}
getContainer=
{
getContainer
!==
undefined
?
getContainer
:
undefined
}
destroyOnClose=
{
true
}
width=
{
!!
width
?
width
:
800
}
handleCancel=
{
handleCancel
}
...
...
one_stop_public/AffairButton/AuditButton/userTable/index.jsx
浏览文件 @
579a0fac
...
...
@@ -167,6 +167,7 @@ export default class userButton extends Component {
{
/* <Btn get='2' btnOne={()=>{this.showModal('不同意')}} btnTwo={()=>{this.showModal('驳回')}} btnThree={()=>{this.showModal('通过')}}/> */
}
<
MyModal
visible=
{
visibleOk
}
getContainer=
{
false
}
title=
{
isSecond
?
'重新发起'
:
'通过审批'
}
width=
{
600
}
handleCancel=
{
this
.
handleCancelOk
}
>
...
...
one_stop_public/Table/ZdyTable.jsx
0 → 100644
浏览文件 @
579a0fac
差异被折叠。
点击展开。
one_stop_public/Table/index.jsx
浏览文件 @
579a0fac
差异被折叠。
点击展开。
one_stop_public/filePreview/index.jsx
浏览文件 @
579a0fac
...
...
@@ -115,6 +115,7 @@ export default class index extends Component {
<
div
style=
{
{
height
:
650
,
maxWidth
:
1200
,
}
}
>
<
a
target=
{
'_blank'
}
href=
{
path
}
download=
{
pathName
}
>
下载文件
...
...
one_stop_public/libs/FormulaForm.jsx
浏览文件 @
579a0fac
...
...
@@ -5,13 +5,11 @@
*/
import
React
,
{
Component
}
from
'react'
;
import
styles
from
'./style.less'
;
import
{
Icon
,
Alert
,
Select
,
Button
}
from
'antd'
;
import
AceEditor
from
'react-ace'
;
import
{
Icon
}
from
'antd'
;
import
AllImg
from
'../assets/AllFuc.png'
;
import
All2Img
from
'../assets/AllFuc2.png'
;
import
ExcelBtn
from
'../excelInitFuc'
;
import
RollTab
from
'./rollTab'
;
const
{
Option
}
=
Select
;
export
default
class
FormulaForm
extends
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -149,27 +147,6 @@ export default class FormulaForm extends Component {
this
.
refs
.
rolltab
.
setCloseAll
();
}
}
>
{
this
.
props
.
editor
}
{
/* <AceEditor height={600} width={1200}
placeholder='"请输入js语句"'
mode={"javascript"}
theme={"textmate"}
fontSize={12}
value={aceValue}
onChange={this.onAceChange.bind(this)}
showPrintMargin={true}
showGutter={true}
highlightActiveLine={true}
name="UNIQUE_ID_OF_DIV"
// keyboardHandler="vim"
setOptions={{
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
enableSnippets: true,
showLineNumbers: true,
tabSize: 2,
}}
editorProps={{ $blockScrolling: true }}
/> */
}
</
div
>
</
div
>
...
...
one_stop_public/libs/PictureSignature/PictureSignature.js
浏览文件 @
579a0fac
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./styles.less'
;
import
{
Modal
,
Button
,
Icon
,
message
}
from
'antd'
;
import
ShowItem
,
{
dragEventList
,
zipImage
}
from
'./ShowItem'
;
import
{
apiRequest
}
from
"../../utils/request"
;
import
{
deepCopy
}
from
"@/webPublic/one_stop_public/utils/myutils"
;
import
{
Modal
,
Button
,
Icon
,
message
}
from
'antd'
;
import
ShowItem
,
{
dragEventList
,
zipImage
}
from
'./ShowItem'
;
import
{
apiRequest
}
from
'../../utils/request'
;
import
{
deepCopy
}
from
'@/webPublic/one_stop_public/utils/myutils'
;
let
fakeFileInfo
=
{
path
:
'/u/202112/25143111x0ki.jpg'
,
// 超大的图片
name
:
'摇摇后摇.jpg'
,
};
const
getContent
=
(
signConfig
=
[],
ratioX
)
=>
{
let
data
=
deepCopy
(
signConfig
);
return
JSON
.
stringify
({
objs
:
data
.
map
(
(
g
)
=>
{
objs
:
data
.
map
(
g
=>
{
// 1200 的 x => 1500的 x
//
g
.
x
=
Math
.
ceil
(
g
.
x
*
ratioX
,
10
);
...
...
@@ -25,7 +24,7 @@ const getContent = (signConfig = [], ratioX) => {
g
.
y
=
g
.
y
+
20
;
// g.x = g.x + 20;
}
if
(
g
.
type
===
'image'
)
{
if
(
g
.
type
===
'image'
)
{
g
.
w
=
Math
.
ceil
(
g
.
w
*
ratioX
);
g
.
h
=
Math
.
ceil
(
g
.
h
*
ratioX
);
}
...
...
@@ -35,7 +34,6 @@ const getContent = (signConfig = [], ratioX) => {
});
};
export
default
function
PictureSignature
({
json
,
disabled
,
...
...
@@ -45,18 +43,18 @@ export default function PictureSignature({
form
,
// fileInfo,
...
others
})
{
})
{
let
imageRef
=
useRef
();
const
[
fileInfo
,
setFileInfo
]
=
useState
({
...
others
?.
fileInfo
});
const
[
fileInfo
,
setFileInfo
]
=
useState
({
...
others
?.
fileInfo
});
// const [fileInfo, setFileInfo] = useState(fakeFileInfo);
const
[
openEdit
,
setOpenEdit
]
=
useState
(
false
);
const
[
showModal
,
setShowModal
]
=
useState
(
false
);
const
[
otherProps
,
setOtherProps
]
=
useState
({});
const
[
imageInfo
,
setImageInfo
]
=
useState
(
null
);
const
changeShowModal
=
()
=>
{
if
(
!
showModal
)
{
if
(
!
showModal
)
{
if
(
!
imageInfo
&&
!
disabled
)
{
zipImage
(
fileInfo
.
path
,
fileInfo
.
name
,
otherProps
?.
backgroundImageWidth
).
then
(
(
res
)
=>
{
zipImage
(
fileInfo
.
path
,
fileInfo
.
name
,
otherProps
?.
backgroundImageWidth
).
then
(
res
=>
{
let
image
=
new
Image
();
//新建一个img标签(还没嵌入DOM节点)
image
.
src
=
basicUrl
+
res
;
image
.
onload
=
()
=>
{
...
...
@@ -83,7 +81,6 @@ export default function PictureSignature({
imageRef
.
current
=
true
;
dragEventList
(
setOtherProps
,
otherProps
);
}
},
[
otherProps
]);
useEffect
(()
=>
{
...
...
@@ -100,21 +97,28 @@ export default function PictureSignature({
}
},
[
json
.
otherProps
]);
const
{
ModalProps
,
signConfig
,
footerButtons
,
originButtons
,
backgroundImageWidth
,
saveSignConfigValue
=
''
}
=
otherProps
;
const
{
ModalProps
,
signConfig
,
footerButtons
,
originButtons
,
backgroundImageWidth
,
saveSignConfigValue
=
''
,
showImageWidth
=
1200
,
}
=
otherProps
;
const
handleClickButton
=
(
clickType
)
=>
{
const
handleClickButton
=
clickType
=>
{
switch
(
clickType
)
{
case
'startEdit'
:
// 开始签章
// console.log(imageInfo);
setOpenEdit
(
true
);
break
;
case
'confirm'
:
// 确定
onChangeFile
({...
fileInfo
},
imageIndex
);
onChangeFile
({
...
fileInfo
},
imageIndex
);
changeShowModal
();
break
;
case
'save'
:
// 保存签章
let
ratioX
=
backgroundImageWidth
/
1200
;
// 本来是 1500 的 图片 宽度变成了 1200 高度变成了 1200/1500 * imageInfo.height;
let
ratioX
=
backgroundImageWidth
/
showImageWidth
;
// 本来是 1500 的 图片 宽度变成了 1200 高度变成了 1200/1500 * imageInfo.height;
// let ratioY = 1200 / backgroundImageWidth * imageInfo.height;
// console.log(ratioX);
// return ;
...
...
@@ -122,33 +126,33 @@ export default function PictureSignature({
apiRequest
(
'/ImageLibApi/merge'
,
{
background
:
fileInfo
?.
path
,
content
,
}).
then
(
(
res
)
=>
{
if
(
form
&&
saveSignConfigValue
)
{
}).
then
(
res
=>
{
if
(
form
&&
saveSignConfigValue
)
{
form
.
setFieldsValue
({
[
saveSignConfigValue
]:
content
,
})
})
;
}
if
(
res
&&
res
.
path
)
{
message
.
success
(
'操作成功'
);
let
newPath
=
res
.
path
;
fileInfo
.
originPath
=
fileInfo
.
path
;
fileInfo
.
path
=
newPath
;
setFileInfo
({
...
fileInfo
});
setFileInfo
({
...
fileInfo
});
setOpenEdit
(
false
);
}
})
})
;
break
;
case
'restore'
:
// 还原图片
if
(
fileInfo
.
originPath
)
{
fileInfo
.
path
=
fileInfo
.
originPath
;
setFileInfo
({
...
fileInfo
});
setFileInfo
({
...
fileInfo
});
setOpenEdit
(
false
);
}
break
;
default
:
return
true
;
}
}
}
;
const
Footer
=
()
=>
{
if
(
disabled
)
{
...
...
@@ -157,10 +161,11 @@ export default function PictureSignature({
if
(
openEdit
)
{
return
footerButtons
.
map
(
g
=>
{
return
(
<
Button
type
=
{
g
.
type
}
<
Button
type
=
{
g
.
type
}
key
=
{
g
.
key
}
onClick
=
{()
=>
{
handleClickButton
(
g
.
clickType
)
handleClickButton
(
g
.
clickType
);
}}
>
{
g
.
name
}
...
...
@@ -170,10 +175,11 @@ export default function PictureSignature({
}
else
{
return
originButtons
.
map
(
g
=>
{
return
(
<
Button
type
=
{
g
.
type
}
<
Button
type
=
{
g
.
type
}
key
=
{
g
.
key
}
onClick
=
{()
=>
{
handleClickButton
(
g
.
clickType
)
handleClickButton
(
g
.
clickType
);
}}
>
{
g
.
name
}
...
...
@@ -187,8 +193,7 @@ export default function PictureSignature({
}
// console.log(imageInfo, fileInfo);
return
(
<
div
className
=
{
styles
.
outSideDiv
}
>
<
div
className
=
{
styles
.
outSideDiv
}
>
{
fileInfo
&&
fileInfo
?.
path
&&
(
<
img
className
=
{
styles
.
onePic
}
...
...
@@ -205,9 +210,9 @@ export default function PictureSignature({
onCancel
=
{
changeShowModal
}
getContainer
=
{
false
}
className
=
{
styles
.
ModalClass
}
footer
=
{
<
Footer
/>
}
footer
=
{
<
Footer
/>
}
title
=
{
'图片签章'
}
width
=
{
'1250
px'
}
width
=
{
showImageWidth
+
50
+
'
px'
}
bodyStyle
=
{{
minHeight
:
'700px'
,
overflow
:
'auto'
,
...
...
@@ -223,8 +228,8 @@ export default function PictureSignature({
className
=
{
styles
.
modalDiv
}
style
=
{{
backgroundImage
:
`url(
${
basicUrl
+
fileInfo
?.
path
})
`,
width:
1200
,
height:
(imageInfo.height / (imageInfo.width / 1200)
),
width:
showImageWidth
,
height:
imageInfo.height / (imageInfo.width / showImageWidth
),
}}
alt={'拖拽区域'}
draggable={false}
...
...
@@ -243,14 +248,10 @@ export default function PictureSignature({
left: g.x,
}}
>
<div className={styles.draggableIcon}
data-mes={g.key}
draggable={true}>
<div className={styles.draggableIcon} data-mes={g.key} draggable={true}>
<Icon type="scissor" />
</div>
<ShowItem {...g}
basicUrl={basicUrl}
/>
<ShowItem {...g} basicUrl={basicUrl} />
</div>
);
})}
...
...
@@ -261,6 +262,9 @@ export default function PictureSignature({
<img
src={basicUrl + fileInfo?.path}
alt={fileInfo.name}
style={{
width: `
$
{
showImageWidth
}
px
`,
}}
/>
</div>
)}
...
...
@@ -272,29 +276,31 @@ export default function PictureSignature({
}
export function SignArray(props) {
const {
value, onChange, basicUrl, json, form
} = props;
const {
value, onChange, basicUrl, json, form
} = props;
// console.log(props);
let files = value?.files || [];
const onChangeFile = (newFielInfo, imageIndex) => {
if
(newFielInfo && newFielInfo.path)
{
if
(newFielInfo && newFielInfo.path)
{
files[imageIndex] = newFielInfo;
value.files = files;
onChange(value);
}
}
}
;
// console.log(value, '222222222222222')
return <div>
{
files.map((g, index) => {
return <PictureSignature json={json}
return (
<div>
{files.map((g, index) => {
return (
<PictureSignature
json={json}
basicUrl={basicUrl}
fileInfo={g}
form={form}
imageIndex={index}
onChangeFile={onChangeFile}
/>
})
}
);
})
}
</div>
);
}
one_stop_public/libs/PictureSignature/styles.less
浏览文件 @
579a0fac
...
...
@@ -29,7 +29,7 @@
place-items: center;
//min-height: 800px;
img{
width: 1200px;
//
width: 1200px;
height: auto;
}
}
...
...
one_stop_public/libs/UploadCom.js
浏览文件 @
579a0fac
...
...
@@ -6,6 +6,10 @@ import styles from './style.less';
import
UploadComDiyForQnZy
from
'@/webPublic/one_stop_public/libs/UploadComDiyForQnZy'
;
import
{
getContainer
}
from
"@/webPublic/one_stop_public/utils/utils"
;
message
.
config
({
top
:
300
,
})
export
function
checkIsImage
(
path
)
{
if
(
!
path
)
{
return
false
;
...
...
@@ -239,7 +243,16 @@ class UploadCom extends React.Component {
onCancel
=
{()
=>
this
.
setState
({
previewVisible
:
false
})}
width
=
{
'90vw'
}
>
<
img
alt
=
"example"
style
=
{{
width
:
'100%'
,
height
:
'auto'
}}
src
=
{
previewImage
}
/
>
<
div
style
=
{{
textAlign
:
'center'
,
width
:
'100%'
,
}}
>
<
img
alt
=
"example"
style
=
{{
maxWidth
:
'1200px'
,
maxHeight
:
'700px'
,
height
:
'auto'
,
}}
src
=
{
previewImage
}
/
>
<
/div
>
<
/Modal
>
<
/div
>
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论