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
a04ec4e0
Commit
a04ec4e0
authored
Nov 06, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: website config start
parent
122aeff1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
176 additions
and
36 deletions
+176
-36
index.js
src/components/BaseForm/index.js
+2
-2
siteConfigDrawer.js
src/pages/webConfig/components/siteConfigDrawer.js
+135
-0
siteConfigDrawer.less
src/pages/webConfig/components/siteConfigDrawer.less
+0
-0
siteConfig.js
src/pages/webConfig/componets/siteConfig.js
+0
-27
index.js
src/pages/webConfig/index.js
+39
-7
web4site.js
src/services/mocks/web4site.js
+0
-0
No files found.
src/components/BaseForm/index.js
View file @
a04ec4e0
...
...
@@ -20,8 +20,8 @@ export const renderButtonGroup = props => {
};
export
const
BaseFormItem
=
itemOption
=>
{
const
{
t
ype
,
...
rest
}
=
itemOption
;
switch
(
t
ype
)
{
const
{
formT
ype
,
...
rest
}
=
itemOption
;
switch
(
formT
ype
)
{
case
'input'
:
// eslint-disable-next-line no-undef
return
<
Input
allowClear
{...
rest
}
/>
;
...
...
src/pages/webConfig/components/siteConfigDrawer.js
0 → 100644
View file @
a04ec4e0
import
React
from
'react'
;
import
{
Button
,
Drawer
}
from
'antd'
;
import
styles
from
'./siteConfigDrawer.less'
;
import
BaseForm
from
'@/components/BaseForm'
;
let
form
=
null
;
const
defaultKeyMap
=
{
title
:
{
label
:
'标题'
,
formType
:
'input'
,
allowClear
:
true
,
placeholder
:
'请输入标题'
,
rules
:
[
{
required
:
true
,
message
:
'标题为必填项'
,
},
],
},
subtitle
:
{
label
:
'副标题'
,
formType
:
'input'
,
allowClear
:
true
,
},
shortcutIcon
:
{
label
:
'图标icon'
,
formType
:
'image'
,
rules
:
[
{
required
:
true
,
message
:
'请选择图标icon'
,
},
],
},
logo
:
{
label
:
'登录logo'
,
formType
:
'image'
,
rules
:
[
{
required
:
true
,
message
:
'请选择登录logo'
,
},
],
},
bannerlogo
:
{
label
:
'标题logo'
,
formType
:
'image'
,
rules
:
[
{
required
:
true
,
message
:
'请选择标题logo'
,
},
],
},
client
:
{
label
:
'虚拟目录'
,
formType
:
'input'
,
allowClear
:
true
,
size
:
'small'
,
rules
:
[
{
required
:
true
,
message
:
'虚拟目录不能为空'
,
},
],
},
homePage
:
{
label
:
'主页'
,
formType
:
'input'
,
allowClear
:
true
,
},
loginTemplate
:
{
label
:
'登录模板'
,
formType
:
'select'
,
placeholder
:
'请选择登录模板'
,
filterOption
:
(
input
,
option
)
=>
option
.
children
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
,
rules
:
[
{
required
:
true
,
message
:
'登录模板必填'
,
},
],
},
theme
:
{
label
:
'系统皮肤'
,
formType
:
'singleRadio'
,
rules
:
[
{
required
:
true
,
message
:
'请选择系统皮肤'
,
},
],
},
style
:
'系统风格'
,
menu
:
'菜单类型'
,
mode
:
'功能标签'
,
qrcode
:
'二维码地址'
,
mapPlan
:
'地图方案'
,
waterMark
:
'地图水印'
,
};
export
default
props
=>
{
const
{
visible
,
onClose
,
config
}
=
props
;
const
getForm
=
f
=>
{
form
=
f
;
};
const
adaptConfig
=
conf
=>
{};
const
formConfig
=
{
getForm
,
items
:
[
{
label
:
'标题'
,
dataIndex
:
'title'
,
initialValue
:
''
,
rules
:
[],
},
],
};
return
(
<
div
className
=
{
styles
.
siteConfigContainer
}
>
<
Drawer
title
=
"Multi-level drawer"
width
=
{
520
}
closable
onClose
=
{
onClose
}
visible
=
{
visible
}
>
<
BaseForm
{...
formConfig
}
/
>
<
/Drawer
>
<
/div
>
);
};
src/pages/webConfig/compone
ts/siteConfig
.less
→
src/pages/webConfig/compone
nts/siteConfigDrawer
.less
View file @
a04ec4e0
File moved
src/pages/webConfig/componets/siteConfig.js
deleted
100644 → 0
View file @
122aeff1
import
React
from
'react'
;
import
{
Button
}
from
'antd'
;
import
styles
from
'./siteConfig.less'
;
import
PreviewConfigDrawer
from
'@/components/PreviewConfigDrawer'
;
import
BaseForm
from
'@/components/BaseForm'
;
export
default
props
=>
{
const
{
visible
,
setVisible
}
=
props
;
return
(
<
div
className
=
{
styles
.
siteConfigContainer
}
>
<
PreviewConfigDrawer
visible
=
{
visible
}
setVisible
=
{
setVisible
}
drawerProps
=
{
{
// maskStyle: { opacity: 0.6 },
}
}
previewContent
=
{
<
Button
onClick
=
{()
=>
setVisible
(
true
)}
>
打开配置
<
/Button
>
}
>
<
BaseForm
/>
<
/PreviewConfigDrawer
>
<
/div
>
);
};
src/pages/webConfig/index.js
View file @
a04ec4e0
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
Tabs
}
from
'antd'
;
import
menuTree
from
'@/services/mocks/web4site'
;
import
menuTree
Mock
from
'@/services/mocks/web4site'
;
import
styles
from
'./index.less'
;
import
SiteConfig
from
'./compone
ts/siteConfig
'
;
import
SiteConfig
from
'./compone
nts/siteConfigDrawer
'
;
const
{
TabPane
}
=
Tabs
;
const
getMenuTree
=
()
=>
new
Promise
((
r
,
j
)
=>
{
setTimeout
(()
=>
{
r
(
menuTreeMock
);
},
1000
);
});
const
WebConfigPage
=
props
=>
{
const
[
configVisible
,
setConfigVisible
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
menuTree
,
setMeneTree
]
=
useState
({
children
:
[]
});
const
[
configObj
,
setConfigObj
]
=
useState
({});
const
renderPage
=
()
=>
{};
useEffect
(()
=>
{
getMenuTree
().
then
(
res
=>
{
setMeneTree
(
res
);
setLoading
(
false
);
});
},
[]);
const
renderTabPane
=
tabPaneItem
=>
(
<
TabPane
key
=
{
tabPaneItem
.
id
}
tab
=
{
tabPaneItem
.
text
}
>
<
SiteConfig
visible
=
{
configVisible
}
setVisible
=
{
setConfigVisible
}
/
>
<
/TabPane
>
<
TabPane
key
=
{
tabPaneItem
.
id
}
tab
=
{
tabPaneItem
.
text
}
/
>
);
const
onEdit
=
(
targetKey
,
action
)
=>
{
// console.log(targetKey, action); // action: add|remove
switch
(
action
)
{
case
'add'
:
setConfigVisible
(
true
);
break
;
case
'remove'
:
break
;
default
:
}
};
const
onDrawerClose
=
form
=>
{};
return
(
<
PageContainer
>
<
PageContainer
loading
=
{
loading
}
>
<
div
className
=
{
styles
.
webConfigContainer
}
>
<
Tabs
type
=
"editable-card"
onEdit
=
{
onEdit
}
>
{
menuTree
.
children
.
map
(
renderTabPane
)}
<
/Tabs
>
<
SiteConfig
visible
=
{
configVisible
}
onClose
=
{
onDrawerClose
}
config
=
{
configObj
}
/
>
<
/div
>
<
/PageContainer
>
);
...
...
src/services/mocks/web4site.js
View file @
a04ec4e0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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