Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
7c2c8f2f
Commit
7c2c8f2f
authored
Jul 05, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '修复图片库交互bug'
parent
604c08f5
Pipeline
#54554
waiting for manual action with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
12 deletions
+46
-12
AddModal.jsx
src/pages/integratedLogin/AddModal.jsx
+8
-1
Master.jsx
src/pages/integratedLogin/Master.jsx
+28
-3
PreviewModal.jsx
src/pages/integratedLogin/PreviewModal.jsx
+7
-7
api.js
src/services/integratedLogin/api.js
+3
-1
No files found.
src/pages/integratedLogin/AddModal.jsx
View file @
7c2c8f2f
...
@@ -15,6 +15,7 @@ const AddModal = props => {
...
@@ -15,6 +15,7 @@ const AddModal = props => {
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
imageUrl
,
setImageUrl
]
=
useState
();
const
[
imageUrl
,
setImageUrl
]
=
useState
();
const
[
im
,
setIm
]
=
useState
();
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
const
[
keepImgeUrl
,
setKeepImgeUrl
]
=
useState
(
''
);
const
[
keepImgeUrl
,
setKeepImgeUrl
]
=
useState
(
''
);
...
@@ -38,16 +39,19 @@ const AddModal = props => {
...
@@ -38,16 +39,19 @@ const AddModal = props => {
// setImageUrl(`http://192.168.12.116:8017/${pickItem.iconUrl}`);
// setImageUrl(`http://192.168.12.116:8017/${pickItem.iconUrl}`);
// } else {
// } else {
setImageUrl
(
window
.
location
.
origin
+
`/
${
pickItem
.
iconUrl
}
`
);
setImageUrl
(
window
.
location
.
origin
+
`/
${
pickItem
.
iconUrl
}
`
);
setIm
(
pickItem
.
iconUrl
);
// }
// }
}
else
{
}
else
{
form
.
setFieldsValue
({
iconUrl
:
''
});
form
.
setFieldsValue
({
iconUrl
:
''
});
setImageUrl
(
''
);
setImageUrl
(
''
);
setIm
(
''
);
}
}
}
else
{
}
else
{
// form.setFieldsValue({ method: 'Get' });
// form.setFieldsValue({ method: 'Get' });
}
}
}
else
{
}
else
{
setImageUrl
(
''
);
setImageUrl
(
''
);
setIm
(
''
);
setKeepImgeUrl
(
''
);
setKeepImgeUrl
(
''
);
form
.
resetFields
();
form
.
resetFields
();
}
}
...
@@ -152,6 +156,8 @@ const AddModal = props => {
...
@@ -152,6 +156,8 @@ const AddModal = props => {
};
};
const
handleChange
=
info
=>
{
const
handleChange
=
info
=>
{
setKeepImgeUrl
(
''
);
setIm
(
''
);
if
(
info
.
file
.
status
===
'uploading'
)
{
if
(
info
.
file
.
status
===
'uploading'
)
{
setLoading
(
true
);
setLoading
(
true
);
return
;
return
;
...
@@ -193,6 +199,7 @@ const AddModal = props => {
...
@@ -193,6 +199,7 @@ const AddModal = props => {
console
.
log
(
props
.
path
);
console
.
log
(
props
.
path
);
console
.
log
(
process
.
env
.
PROXY
);
console
.
log
(
process
.
env
.
PROXY
);
setImageUrl
(
window
.
location
.
origin
+
`/
${
props
.
path
}
`
);
setImageUrl
(
window
.
location
.
origin
+
`/
${
props
.
path
}
`
);
setIm
(
props
.
path
);
setKeepImgeUrl
(
props
.
path
);
setKeepImgeUrl
(
props
.
path
);
form
.
setFieldsValue
({
iconUrl
:
`
${
props
.
path
}
`
});
form
.
setFieldsValue
({
iconUrl
:
`
${
props
.
path
}
`
});
}
}
...
@@ -314,7 +321,7 @@ const AddModal = props => {
...
@@ -314,7 +321,7 @@ const AddModal = props => {
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setPreviewModal
(
false
);
setPreviewModal
(
false
);
}
}
}
}
imageUrl=
{
type
==
'edit'
?
pickItem
.
iconUrl
:
''
}
imageUrl=
{
im
}
keepImgeUrl=
{
keepImgeUrl
}
keepImgeUrl=
{
keepImgeUrl
}
callBackSubmit=
{
onOk
}
callBackSubmit=
{
onOk
}
/>
/>
...
...
src/pages/integratedLogin/Master.jsx
View file @
7c2c8f2f
...
@@ -2,7 +2,11 @@
...
@@ -2,7 +2,11 @@
/* eslint-disable react/jsx-boolean-value */
/* eslint-disable react/jsx-boolean-value */
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Modal
,
Input
,
notification
,
Button
,
message
,
Upload
,
Select
,
Col
,
Row
}
from
'antd'
;
import
{
Form
,
Modal
,
Input
,
notification
,
Button
,
message
,
Upload
,
Select
,
Col
,
Row
}
from
'antd'
;
import
{
AddIntegratedLogin
,
EditIntegratedLogin
}
from
'@/services/integratedLogin/api'
;
import
{
AddIntegratedLogin
,
EditIntegratedLogin
,
SaveSystemInfo
,
}
from
'@/services/integratedLogin/api'
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
PreviewModal
from
'./PreviewModal'
;
import
PreviewModal
from
'./PreviewModal'
;
...
@@ -33,9 +37,11 @@ const Master = props => {
...
@@ -33,9 +37,11 @@ const Master = props => {
const
[
imgBed
,
setImgBed
]
=
useState
();
const
[
imgBed
,
setImgBed
]
=
useState
();
const
[
imageUrl
,
setImageUrl
]
=
useState
();
const
[
imageUrl
,
setImageUrl
]
=
useState
();
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
const
[
previewModal
,
setPreviewModal
]
=
useState
(
false
);
const
[
keepImgeUrl
,
setKeepImgeUrl
]
=
useState
(
''
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
visible
)
{
if
(
visible
)
{
// SaveSystemInfo({})
form
.
setFieldsValue
({
form
.
setFieldsValue
({
primaryColor
:
'#0087F7'
,
primaryColor
:
'#0087F7'
,
});
});
...
@@ -44,9 +50,20 @@ const Master = props => {
...
@@ -44,9 +50,20 @@ const Master = props => {
// 提交
// 提交
const
onSubmit
=
()
=>
{
const
onSubmit
=
()
=>
{
let
obj
=
form
.
getFieldsValue
();
console
.
log
(
obj
);
form
.
validateFields
().
then
(
validate
=>
{
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
if
(
validate
)
{
setLoading
(
true
);
// setLoading(true);
SaveSystemInfo
({
configName
:
'集成登录网站配置'
,
configValue
:
JSON
.
stringify
(
obj
),
}).
then
(
res
=>
{
if
(
res
.
data
==
0
)
{
console
.
log
(
res
.
data
);
}
});
// if (obj.iconUrl.file) {
// if (obj.iconUrl.file) {
// obj.iconUrl = obj.iconUrl.file.response.data;
// obj.iconUrl = obj.iconUrl.file.response.data;
// }
// }
...
@@ -169,7 +186,15 @@ const Master = props => {
...
@@ -169,7 +186,15 @@ const Master = props => {
setPreviewModal
(
true
);
setPreviewModal
(
true
);
};
};
const
onOk
=
()
=>
{};
const
onOk
=
props
=>
{
if
(
props
)
{
console
.
log
(
props
.
path
);
console
.
log
(
process
.
env
.
PROXY
);
setImageUrl
(
window
.
location
.
origin
+
`/
${
props
.
path
}
`
);
setKeepImgeUrl
(
props
.
path
);
form
.
setFieldsValue
({
logo
:
`
${
props
.
path
}
`
});
}
};
return
(
return
(
<
Modal
<
Modal
...
...
src/pages/integratedLogin/PreviewModal.jsx
View file @
7c2c8f2f
...
@@ -33,30 +33,30 @@ const PreviewModal = props => {
...
@@ -33,30 +33,30 @@ const PreviewModal = props => {
GetIntegratedloginIcon
()
GetIntegratedloginIcon
()
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setImgData
(
res
.
data
);
let
bb
=
[];
res
.
data
.
map
(
i
=>
{
if
(
i
.
files
.
length
>
0
)
{
bb
.
push
(
i
);
}
});
setImgData
(
bb
);
let
aa
=
[];
let
aa
=
[];
res
.
data
.
map
(
i
=>
{
res
.
data
.
map
(
i
=>
{
aa
.
push
(
i
.
groupName
);
aa
.
push
(
i
.
groupName
);
i
.
files
.
map
((
j
,
index
)
=>
{
i
.
files
.
map
((
j
,
index
)
=>
{
if
(
keepImgeUrl
)
{
if
(
keepImgeUrl
)
{
if
(
j
.
path
==
keepImgeUrl
)
{
if
(
j
.
path
==
keepImgeUrl
)
{
console
.
log
(
keepImgeUrl
);
console
.
log
(
8
);
setKeepItem
(
i
.
groupName
);
setKeepItem
(
i
.
groupName
);
setPickItem
(
index
);
setPickItem
(
index
);
}
}
}
else
{
}
else
{
if
(
j
.
path
==
imageUrl
)
{
if
(
j
.
path
==
imageUrl
)
{
console
.
log
(
imageUrl
);
console
.
log
(
9
);
setKeepItem
(
i
.
groupName
);
setKeepItem
(
i
.
groupName
);
setPickItem
(
index
);
setPickItem
(
index
);
}
}
}
}
});
});
});
});
console
.
log
(
aa
);
setKeepGroupName
(
aa
);
setKeepGroupName
(
aa
);
}
else
{
}
else
{
notification
.
error
({
notification
.
error
({
...
...
src/services/integratedLogin/api.js
View file @
7c2c8f2f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Description:
* @Description:
* @Author: leizhe
* @Author: leizhe
* @Date: 2022-06-09 10:01:10
* @Date: 2022-06-09 10:01:10
* @LastEditTime: 2022-07-0
1 11:21:53
* @LastEditTime: 2022-07-0
4 18:05:57
* @LastEditors: leizhe
* @LastEditors: leizhe
*/
*/
import
{
get
,
post
,
PUBLISH_SERVICE
,
CITY_SERVICE
}
from
'@/services/index'
;
import
{
get
,
post
,
PUBLISH_SERVICE
,
CITY_SERVICE
}
from
'@/services/index'
;
...
@@ -22,3 +22,5 @@ export const DelIntegratedLogin = param => get(`${PUBLISH_SERVICE}/DelIntegrated
...
@@ -22,3 +22,5 @@ export const DelIntegratedLogin = param => get(`${PUBLISH_SERVICE}/DelIntegrated
// 集成登录-获取集成登录项目下的默认图标
// 集成登录-获取集成登录项目下的默认图标
export
const
GetIntegratedloginIcon
=
param
=>
export
const
GetIntegratedloginIcon
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/GetIntegratedloginIcon`
,
param
);
get
(
`
${
PUBLISH_SERVICE
}
/GetIntegratedloginIcon`
,
param
);
export
const
SaveSystemInfo
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/HostManager/SaveSystemInfo`
,
param
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment