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
7907de55
Commit
7907de55
authored
Jul 15, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 'web配置登录模板参数管理'
parent
b0493a0b
Pipeline
#55492
waiting for manual action with stages
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
161 additions
and
11 deletions
+161
-11
Tree.png
src/assets/images/title/Tree.png
+0
-0
fieldEditor.jsx
...s/bsmanager/base/tablemanager/filedConfig/fieldEditor.jsx
+0
-0
ParmarModal.jsx
src/pages/productCenter/webConfig/components/ParmarModal.jsx
+119
-0
siteConfigDrawer.js
...es/productCenter/webConfig/components/siteConfigDrawer.js
+42
-11
No files found.
src/assets/images/title/Tree.png
0 → 100644
View file @
7907de55
This diff was suppressed by a .gitattributes entry.
src/pages/bsmanager/base/tablemanager/filedConfig/fieldEditor.jsx
View file @
7907de55
This diff is collapsed.
Click to expand it.
src/pages/productCenter/webConfig/components/ParmarModal.jsx
0 → 100644
View file @
7907de55
import
React
,
{
useEffect
}
from
'react'
;
import
{
Modal
,
Form
,
Button
,
Input
,
Space
}
from
'antd'
;
import
{
MinusCircleOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
const
ParmarModal
=
props
=>
{
const
{
pageUrl
,
visible
,
handleCancel
,
parmarCallBack
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
if
(
visible
)
{
// 给url通过字符串分割成表单需要的数据形式
let
parma
=
pageUrl
.
split
(
'|'
)[
1
]
?.
split
(
'&'
)
?.
map
(
item
=>
({
key
:
item
.
split
(
'='
)[
0
],
value
:
item
.
split
(
'='
)[
1
]
}));
form
.
setFieldsValue
({
parmars
:
parma
});
}
else
{
// 关闭弹窗清除表单数据
form
.
resetFields
();
}
},
[
visible
]);
// 保存
const
onFinish
=
()
=>
{
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
let
parma
=
form
.
getFieldValue
(
'parmars'
)
?.
map
(
item
=>
`
${
item
.
key
}
=
${
item
.
value
}
`
)
.
join
(
'&'
);
console
.
log
(
parma
,
'parma'
);
if
(
parma
)
{
parmarCallBack
(
`
${
pageUrl
.
split
(
'|'
)[
0
]}
|
${
parma
}
`
);
}
else
{
parmarCallBack
(
`
${
pageUrl
.
split
(
'|'
)[
0
]}
`
);
}
}
});
};
return
(
<
div
>
<
Modal
title=
"参数配置"
visible=
{
visible
}
onOk=
{
onFinish
}
onCancel=
{
handleCancel
}
maskClosable=
{
false
}
destroyOnClose
centered
>
<
div
style=
{
{
maxHeight
:
'400px'
,
overflowY
:
'scroll'
,
marginBottom
:
'10px'
}
}
>
<
Form
name=
"form"
form=
{
form
}
labelCol=
{
{
span
:
7
}
}
>
<
Form
.
List
name=
"parmars"
>
{
(
fields
,
{
add
,
remove
})
=>
(
<>
{
fields
.
map
(({
key
,
name
,
fieldKey
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
8
,
justifyContent
:
'center'
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'key'
]
}
fieldKey=
{
[
fieldKey
,
'key'
]
}
validateTrigger=
{
[
'onChange'
,
'onBlur'
]
}
rules=
{
[
{
required
:
true
,
message
:
'请填写参数名'
},
{
validator
:
()
=>
{
// 验证参数名不能重复
const
allKey
=
form
.
getFieldsValue
()
.
parmars
.
map
(
item
=>
(
item
?
item
.
key
:
''
));
const
repeatKey
=
new
Set
(
allKey
);
if
(
repeatKey
.
size
!==
allKey
.
length
)
{
return
Promise
.
reject
(
new
Error
(
'参数名重复'
));
}
return
Promise
.
resolve
();
},
},
]
}
>
<
Input
placeholder=
"请填写参数名"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'value'
]
}
fieldKey=
{
[
fieldKey
,
'value'
]
}
rules=
{
[{
required
:
true
,
message
:
'请填写参数'
}]
}
>
<
Input
placeholder=
"请填写参数"
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
style=
{
{
marginLeft
:
'10px'
,
fontSize
:
'20px'
}
}
/>
</
Space
>
))
}
<
Form
.
Item
>
<
Button
style=
{
{
width
:
'375px'
,
marginLeft
:
'30px'
}
}
type=
"dashed"
onClick=
{
()
=>
add
()
}
block
icon=
{
<
PlusOutlined
/>
}
>
添加参数
</
Button
>
</
Form
.
Item
>
</>
)
}
</
Form
.
List
>
</
Form
>
</
div
>
</
Modal
>
</
div
>
);
};
export
default
ParmarModal
;
src/pages/productCenter/webConfig/components/siteConfigDrawer.js
View file @
7907de55
...
...
@@ -22,6 +22,7 @@ import WebConfigForm from './webConfigForm';
import
ColorLinear
from
'./ColorLinear'
;
import
Upload
from
'@/components/Upload'
;
import
styles
from
'./siteConfigDrawer.less'
;
import
ParmarModal
from
'./ParmarModal'
;
const
{
Option
}
=
Select
;
const
plainOptions
=
[
'搜索'
,
'消息'
,
'反馈'
];
const
defaultCheckedList
=
[
'搜索'
,
'消息'
,
'反馈'
];
...
...
@@ -54,6 +55,8 @@ export default props => {
const
[
color
,
setColor
]
=
useState
(
''
);
const
CheckboxGroup
=
Checkbox
.
Group
;
const
[
showAdvanced
,
setShowAdvanced
]
=
useState
(
false
);
// 是否显示高级设置
const
[
showParmarModal
,
setShowParmarModal
]
=
useState
(
false
);
useEffect
(()
=>
{
onGetLoginPages
();
console
.
log
(
isEdit
);
...
...
@@ -173,10 +176,20 @@ export default props => {
setColor
(
value
);
form
.
setFieldsValue
({
headerPrimaryColor
:
value
});
};
const
addParama
=
()
=>
{
console
.
log
(
form
.
getFieldValue
(
'loginTemplate'
));
if
(
!
form
.
getFieldValue
(
'loginTemplate'
))
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先选择登录模板'
});
return
;
}
setShowParmarModal
(
true
);
};
return
(
<
Drawer
title
=
{
isEdit
?
'查看/编辑网站配置'
:
'新增网站'
}
width
=
{
5
00
}
width
=
{
6
00
}
onClose
=
{
onClose
}
visible
=
{
visible
}
destroyOnClose
...
...
@@ -192,7 +205,7 @@ export default props => {
<
Form
form
=
{
form
}
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
1
8
}}
wrapperCol
=
{{
span
:
1
9
}}
initialValues
=
{{
remember
:
true
}}
>
<
Form
.
Item
...
...
@@ -261,15 +274,24 @@ export default props => {
>
<
Input
autoComplete
=
"off"
disabled
=
{
isEdit
}
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
"登录模板"
name
=
"loginTemplate"
>
<
Select
placeholder
=
"请选择登录模板"
>
{
loginPages
.
map
(
item
=>
(
<
Option
value
=
{
item
.
value
}
key
=
{
item
.
value
}
>
{
item
.
value
}
<
/Option
>
))}
<
/Select
>
<
/Form.Item
>
<
Row
>
<
Col
span
=
{
20
}
>
<
Form
.
Item
label
=
"登录模板"
name
=
"loginTemplate"
labelCol
=
{{
span
:
6
}}
>
<
Select
placeholder
=
"请选择登录模板"
>
{
loginPages
.
map
(
item
=>
(
<
Option
value
=
{
item
.
value
}
key
=
{
item
.
value
}
>
{
item
.
value
}
<
/Option
>
))}
<
/Select
>
<
/Form.Item
>
<
/Col
>
<
Col
span
=
{
4
}
>
<
Form
.
Item
>
<
Button
onClick
=
{
addParama
}
>
参数管理
<
/Button
>
<
/Form.Item
>
<
/Col
>
<
/Row
>
<
Divider
orientation
=
"left"
style
=
{{
borderTopColor
:
'#99bbe8'
}}
>
主页配置
<
/Divider
>
...
...
@@ -438,6 +460,15 @@ export default props => {
onSubumit
=
{
colorChange
}
handleCancel
=
{()
=>
setDisplayColorPicker
(
false
)}
/
>
<
ParmarModal
pageUrl
=
{
form
.
getFieldValue
(
'loginTemplate'
)}
handleCancel
=
{()
=>
setShowParmarModal
(
false
)}
visible
=
{
showParmarModal
}
parmarCallBack
=
{
url
=>
{
form
.
setFieldsValue
({
loginTemplate
:
url
});
setShowParmarModal
(
false
);
}}
/
>
<
/Drawer
>
);
};
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