|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useEffect, useState } from 'react'
|
2
|
|
-import { Row, Col, Card, Form, Select, Input, Button, notification } from 'antd'
|
|
2
|
+import { Spin, Card, Form, Select, Input, Button, notification } from 'antd'
|
3
|
3
|
import SelectCity from '@/components/SelectButton/CitySelect'
|
4
|
4
|
import ImageUpload from '@/components/XForm/ImageUpload'
|
5
|
5
|
import Wangedit from '@/components/Wangedit/Wangedit';
|
|
@@ -76,74 +76,76 @@ const AnnouncementEdit = React.forwardRef((props, ref) => {
|
76
|
76
|
}, [id, setFieldsValue])
|
77
|
77
|
|
78
|
78
|
return (
|
79
|
|
- <Card loading={loading}>
|
80
|
|
- <Form {...formItemLayout} onSubmit={handleSubmit}>
|
81
|
|
- <FormItem label="公告类型">
|
82
|
|
- {
|
83
|
|
- getFieldDecorator('showType', {
|
84
|
|
- rules: [{ required: true, message: '请填写标题' }],
|
85
|
|
- })(
|
86
|
|
- <Select style={fullWidth} allowClear>
|
87
|
|
- {
|
88
|
|
- showTypeList.map(x => <Option key={x.value} value={x.value}>{x.label}</Option>)
|
89
|
|
- }
|
90
|
|
- </Select>
|
91
|
|
- )
|
92
|
|
- }
|
93
|
|
- </FormItem>
|
94
|
|
- <FormItem label="公告图片" help="建议图片尺寸:640*960px,比例2:3,格式:jpg">
|
95
|
|
- {
|
96
|
|
- getFieldDecorator('imageUrl', {
|
97
|
|
- rules: [{ required: true, message: '公告图片' }],
|
98
|
|
- })(<ImageUpload />)
|
99
|
|
- }
|
100
|
|
- </FormItem>
|
101
|
|
- <FormItem label="公告标题">
|
102
|
|
- {
|
103
|
|
- getFieldDecorator('title', {
|
104
|
|
- rules: [{ required: true, message: '请填写标题' }],
|
105
|
|
- })(<Input />)
|
106
|
|
- }
|
107
|
|
- </FormItem>
|
108
|
|
- <FormItem label="所属城市">
|
109
|
|
- {
|
110
|
|
- getFieldDecorator('cityId', {
|
111
|
|
- rules: [{ required: true, message: '请选择城市' }],
|
112
|
|
- })(
|
113
|
|
- <SelectCity style={fullWidth} />,
|
114
|
|
- )
|
115
|
|
- }
|
116
|
|
- </FormItem>
|
117
|
|
- <FormItem label="跳转页面">
|
118
|
|
- {
|
119
|
|
- getFieldDecorator('linkPage')(
|
120
|
|
- <Select style={fullWidth} allowClear>
|
121
|
|
- {
|
122
|
|
- pages.map(x => <Option key={x.page} value={x.page}>{x.title}</Option>)
|
123
|
|
- }
|
124
|
|
- </Select>
|
125
|
|
- )
|
126
|
|
- }
|
127
|
|
- </FormItem>
|
128
|
|
- <FormItem label="页面参数">
|
129
|
|
- {
|
130
|
|
- getFieldDecorator('pageParam')(<Input placeholder="key1=value1&key2=value2" />)
|
131
|
|
- }
|
132
|
|
- </FormItem>
|
133
|
|
- <FormItem label="公告详情">
|
134
|
|
- {
|
135
|
|
- getFieldDecorator('content')(<Wangedit menus={editorMenus} />)
|
136
|
|
- }
|
137
|
|
- </FormItem>
|
138
|
|
- <FormItem colon={false} label=" ">
|
139
|
|
- <Button type="primary" htmlType="submit" loading={loading}>
|
140
|
|
- 提交
|
141
|
|
- </Button>
|
142
|
|
- <Button onClick={router.goBack} style={{ marginLeft: '2em' }}>
|
143
|
|
- 返回
|
144
|
|
- </Button>
|
145
|
|
- </FormItem>
|
146
|
|
- </Form>
|
|
79
|
+ <Card>
|
|
80
|
+ <Spin spinning={loading}>
|
|
81
|
+ <Form {...formItemLayout} onSubmit={handleSubmit}>
|
|
82
|
+ <FormItem label="公告类型">
|
|
83
|
+ {
|
|
84
|
+ getFieldDecorator('showType', {
|
|
85
|
+ rules: [{ required: true, message: '请填写标题' }],
|
|
86
|
+ })(
|
|
87
|
+ <Select style={fullWidth} allowClear>
|
|
88
|
+ {
|
|
89
|
+ showTypeList.map(x => <Option key={x.value} value={x.value}>{x.label}</Option>)
|
|
90
|
+ }
|
|
91
|
+ </Select>
|
|
92
|
+ )
|
|
93
|
+ }
|
|
94
|
+ </FormItem>
|
|
95
|
+ <FormItem label="公告图片" help="建议图片尺寸:640*960px,比例2:3,格式:jpg">
|
|
96
|
+ {
|
|
97
|
+ getFieldDecorator('imageUrl', {
|
|
98
|
+ rules: [{ required: true, message: '公告图片' }],
|
|
99
|
+ })(<ImageUpload />)
|
|
100
|
+ }
|
|
101
|
+ </FormItem>
|
|
102
|
+ <FormItem label="公告标题">
|
|
103
|
+ {
|
|
104
|
+ getFieldDecorator('title', {
|
|
105
|
+ rules: [{ required: true, message: '请填写标题' }],
|
|
106
|
+ })(<Input />)
|
|
107
|
+ }
|
|
108
|
+ </FormItem>
|
|
109
|
+ <FormItem label="所属城市">
|
|
110
|
+ {
|
|
111
|
+ getFieldDecorator('cityId', {
|
|
112
|
+ rules: [{ required: true, message: '请选择城市' }],
|
|
113
|
+ })(
|
|
114
|
+ <SelectCity style={fullWidth} />,
|
|
115
|
+ )
|
|
116
|
+ }
|
|
117
|
+ </FormItem>
|
|
118
|
+ <FormItem label="跳转页面">
|
|
119
|
+ {
|
|
120
|
+ getFieldDecorator('linkPage')(
|
|
121
|
+ <Select style={fullWidth} allowClear>
|
|
122
|
+ {
|
|
123
|
+ pages.map(x => <Option key={x.page} value={x.page}>{x.title}</Option>)
|
|
124
|
+ }
|
|
125
|
+ </Select>
|
|
126
|
+ )
|
|
127
|
+ }
|
|
128
|
+ </FormItem>
|
|
129
|
+ <FormItem label="页面参数">
|
|
130
|
+ {
|
|
131
|
+ getFieldDecorator('pageParam')(<Input placeholder="key1=value1&key2=value2" />)
|
|
132
|
+ }
|
|
133
|
+ </FormItem>
|
|
134
|
+ <FormItem label="公告详情">
|
|
135
|
+ {
|
|
136
|
+ getFieldDecorator('content')(<Wangedit menus={editorMenus} />)
|
|
137
|
+ }
|
|
138
|
+ </FormItem>
|
|
139
|
+ <FormItem colon={false} label=" ">
|
|
140
|
+ <Button type="primary" htmlType="submit" loading={loading}>
|
|
141
|
+ 提交
|
|
142
|
+ </Button>
|
|
143
|
+ <Button onClick={router.goBack} style={{ marginLeft: '2em' }}>
|
|
144
|
+ 返回
|
|
145
|
+ </Button>
|
|
146
|
+ </FormItem>
|
|
147
|
+ </Form>
|
|
148
|
+ </Spin>
|
147
|
149
|
</Card>
|
148
|
150
|
)
|
149
|
151
|
})
|