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
56aed0db
Commit
56aed0db
authored
Nov 27, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 小程序配置优化
parent
624cb4c1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
7 deletions
+39
-7
SiteConfig.jsx
src/pages/mobileConfig/SiteConfig.jsx
+13
-4
index.js
src/pages/mobileConfig/index.js
+26
-3
No files found.
src/pages/mobileConfig/SiteConfig.jsx
View file @
56aed0db
...
...
@@ -10,7 +10,7 @@ import PicturesWall from '@/components/Upload/index';
const
{
Item
}
=
Form
;
const
{
Option
}
=
Select
;
const
SiteConfig
=
props
=>
{
const
{
miniTitle
,
submitCallback
,
subType
}
=
props
;
const
{
miniTitle
,
submitCallback
,
subType
,
addCallback
}
=
props
;
console
.
log
(
subType
,
'ubType'
);
const
[
config
,
setConfig
]
=
useState
(
''
);
// 网站配置信息
const
[
loginList
,
setLoginList
]
=
useState
([
...
...
@@ -73,7 +73,7 @@ const SiteConfig = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
submitCallback
(
);
addCallback
(
params
.
title
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -151,7 +151,16 @@ const SiteConfig = props => {
>
<Input placeholder="请输入系统图标名称" allowClear />
</Item> */
}
<
Item
label=
"系统图标预览:"
name=
"shortcutIcon"
>
<
Item
label=
"系统图标:"
name=
"shortcutIcon"
rules=
{
[
{
required
:
true
,
message
:
'请选择系统图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
...
...
@@ -212,7 +221,7 @@ const SiteConfig = props => {
))
}
</
Select
>
</
Item
>
<
Item
label=
"开启云登陆:"
name=
"cloudLogin"
>
<
Item
label=
"开启云登陆:"
name=
"cloudLogin"
initialValue=
{
false
}
>
<
Radio
.
Group
onChange=
{
radioChange
}
>
<
Radio
value
>
是
</
Radio
>
<
Radio
value=
{
false
}
>
否
</
Radio
>
...
...
src/pages/mobileConfig/index.js
View file @
56aed0db
...
...
@@ -65,13 +65,22 @@ const MobileConfigPage = props => {
setFlag
(
flag
+
1
);
setSubType
(
''
);
};
const
addCallback
=
val
=>
{
console
.
log
(
val
);
setSubType
(
''
);
setMiniTitle
(
val
);
setPosition
([
'right'
]);
};
// 删除小程序
const
delMini
=
()
=>
{
setLoading
(
true
);
deleteWebsite
({
client
:
'miniapp'
,
_version
:
9999
,
_dc
:
Date
.
now
(),
}).
then
(
res
=>
{
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
setFlag
(
flag
+
1
);
notification
.
success
({
...
...
@@ -86,6 +95,9 @@ const MobileConfigPage = props => {
description
:
res
.
message
||
'删除失败'
,
});
}
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
addMini
=
()
=>
{
...
...
@@ -130,6 +142,7 @@ const MobileConfigPage = props => {
miniTitle
=
{
miniTitle
}
submitCallback
=
{
submitCallback
}
subType
=
{
subType
}
addCallback
=
{
addCallback
}
/
>
),
},
...
...
@@ -149,13 +162,23 @@ const MobileConfigPage = props => {
onChange
=
{
handleChange
}
tabBarExtraContent
=
{
slot
}
>
{
showConfig
&&
{
/* {
showConfig &&
tabArr?.length > 0 &&
tabArr.map(item => (
<TabPane tab={item.title} key={item.key}>
{activeKey === item.key && item.component}
</TabPane>
))}
))} */
}
{
showConfig
&&
(
<
TabPane
tab
=
{
tabArr
[
0
].
title
}
key
=
{
tabArr
[
0
].
key
}
>
{
activeKey
===
tabArr
[
0
].
key
&&
tabArr
[
0
].
component
}
<
/TabPane
>
)}
{
showConfig
&&
subType
!==
'add'
&&
(
<
TabPane
tab
=
{
tabArr
[
1
].
title
}
key
=
{
tabArr
[
1
].
key
}
>
{
activeKey
===
tabArr
[
1
].
key
&&
tabArr
[
1
].
component
}
<
/TabPane
>
)}
<
/Tabs
>
<
/Spin
>
<
/ProCard
>
...
...
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