1- import { Form } from 'antd' ;
1+ import { Form , Image } from 'antd' ;
22import { FileImageOutlined } from '@ant-design/icons' ;
33import { Button , Input , message } from 'antd' ;
44import React , { useEffect , useState } from 'react' ;
@@ -11,6 +11,7 @@ export const SystemSetting = ({ setting }) => {
1111 const [ mode , setMode ] = useState ( 'logo' ) ;
1212 const [ systemUrl , setSystemUrl ] = useState ( null ) ;
1313 const [ systemTitle , setSystemTitle ] = useState ( null ) ;
14+ const [ systemSubTitle , setSystemSubTitle ] = useState ( null ) ;
1415 const [ systemBg , setSystemBg ] = useState ( null ) ;
1516 const [ systemLogo , setSystemLogo ] = useState ( null ) ;
1617 const [ systemFavicon , setSystemFavicon ] = useState ( null ) ;
@@ -20,6 +21,7 @@ export const SystemSetting = ({ setting }) => {
2021
2122 useEffect ( ( ) => {
2223 setSystemUrl ( ( setting && setting . systemUrl ) || null ) ;
24+ setSystemSubTitle ( ( setting && setting . systemSubTitle ) || null ) ;
2325 setSystemTitle ( ( setting && setting . systemTitle ) || null ) ;
2426 setSystemBg ( ( setting && setting . systemBg ) || null ) ;
2527 setSystemLogo ( ( setting && setting . systemLogo ) || null ) ;
@@ -33,6 +35,7 @@ export const SystemSetting = ({ setting }) => {
3335 const data = {
3436 systemUrl,
3537 systemTitle,
38+ systemSubTitle,
3639 systemBg,
3740 systemLogo,
3841 systemFavicon,
@@ -47,6 +50,24 @@ export const SystemSetting = ({ setting }) => {
4750
4851 return (
4952 < Form layout = "vertical" >
53+ < Form . Item label = "系统标题" >
54+ < Input
55+ placeholder = "请输入系统标题,将作为 head.title 显示"
56+ value = { systemTitle }
57+ onChange = { ( e ) => {
58+ setSystemTitle ( e . target . value ) ;
59+ } }
60+ />
61+ </ Form . Item >
62+ < Form . Item label = "系统标题" >
63+ < Input
64+ placeholder = "请输入系统副标题,首页将在系统标题后展示"
65+ value = { systemSubTitle }
66+ onChange = { ( e ) => {
67+ setSystemSubTitle ( e . target . value ) ;
68+ } }
69+ />
70+ </ Form . Item >
5071 < Form . Item label = "系统地址" >
5172 < Input
5273 placeholder = "请输入系统地址"
@@ -65,31 +86,23 @@ export const SystemSetting = ({ setting }) => {
6586 } }
6687 />
6788 </ Form . Item >
68- < Form . Item label = "系统标题" >
69- < Input
70- placeholder = "请输入系统标题,将作为 head.title 显示"
71- value = { systemTitle }
72- onChange = { ( e ) => {
73- setSystemTitle ( e . target . value ) ;
74- } }
75- />
76- </ Form . Item >
77- < Form . Item label = "全局背景" >
89+ < Form . Item label = "站点图标(Favicon)" >
7890 < Input
79- placeholder = "请输入全局背景链接或选择文件 "
91+ placeholder = "请输入 favicon 链接或选择文件 "
8092 addonAfter = {
8193 < FileImageOutlined
8294 onClick = { ( ) => {
83- setMode ( 'bg ' ) ;
95+ setMode ( 'favicon ' ) ;
8496 setVisible ( true ) ;
8597 } }
8698 />
8799 }
88- value = { systemBg }
100+ value = { systemFavicon }
89101 onChange = { ( e ) => {
90- setSystemBg ( e . target . value ) ;
102+ setSystemFavicon ( e . target . value ) ;
91103 } }
92104 />
105+ < Image width = { 30 } src = { systemFavicon } />
93106 </ Form . Item >
94107 < Form . Item label = "Logo" >
95108 < Input
@@ -107,23 +120,25 @@ export const SystemSetting = ({ setting }) => {
107120 setSystemLogo ( e . target . value ) ;
108121 } }
109122 />
123+ < Image width = { 100 } src = { systemLogo } />
110124 </ Form . Item >
111- < Form . Item label = "Favicon " >
125+ < Form . Item label = "全局背景 " >
112126 < Input
113- placeholder = "请输入 favicon 链接或选择文件 "
127+ placeholder = "请输入全局背景链接或选择文件 "
114128 addonAfter = {
115129 < FileImageOutlined
116130 onClick = { ( ) => {
117- setMode ( 'favicon ' ) ;
131+ setMode ( 'bg ' ) ;
118132 setVisible ( true ) ;
119133 } }
120134 />
121135 }
122- value = { systemFavicon }
136+ value = { systemBg }
123137 onChange = { ( e ) => {
124- setSystemFavicon ( e . target . value ) ;
138+ setSystemBg ( e . target . value ) ;
125139 } }
126140 />
141+ < Image width = { 200 } src = { systemBg } />
127142 </ Form . Item >
128143 < Form . Item label = "系统通知" >
129144 < Input . TextArea
0 commit comments