|
@@ -2,11 +2,11 @@
|
2
|
2
|
import React, { useState, useRef, useEffect } from 'react';
|
3
|
3
|
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
|
4
|
4
|
import type { FormInstance } from 'antd';
|
5
|
|
-import { Button, message, Modal, Image,Upload,Drawer } from 'antd';
|
|
5
|
+import { Button, message, Modal, Image, Upload, Drawer } from 'antd';
|
6
|
6
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProForm, ProFormDigit, ProFormText, ProTable } from '@ant-design/pro-components';
|
7
|
7
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
|
8
|
8
|
// import { getNoticeList, removeNotice, addNotice, updateNotice, exportNotice } from '@/services/system/notice';
|
9
|
|
-import { getEnterpriseList, saveEnterprise, deleteEnterprise,upload} from '@/services/other/footer';
|
|
9
|
+import { getEnterpriseList, saveEnterprise, deleteEnterprise, upload } from '@/services/other/footer';
|
10
|
10
|
import EnterpriseForm from './edit';
|
11
|
11
|
import moment from 'moment';
|
12
|
12
|
import { KeepAlive } from 'react-activation';
|
|
@@ -17,9 +17,9 @@ import { getDataEnumList } from '../../../services/system/Enum';
|
17
|
17
|
|
18
|
18
|
const NoticeTableList: React.FC = () => {
|
19
|
19
|
const formTableRef = useRef<FormInstance>();
|
|
20
|
+ const form = useRef<FormInstance>(null)
|
20
|
21
|
|
21
|
22
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
22
|
|
-
|
23
|
23
|
const actionRef = useRef<ActionType>();
|
24
|
24
|
const intl = useIntl();
|
25
|
25
|
const [currentRow, setCurrentRow] = useState<any>();
|
|
@@ -30,13 +30,13 @@ const NoticeTableList: React.FC = () => {
|
30
|
30
|
setFileList(fileList);
|
31
|
31
|
};
|
32
|
32
|
const handleBeforeUpload = async (file: RcFile) => {
|
33
|
|
- const formData = new FormData();
|
34
|
|
- formData.append('file', file, file.name);
|
35
|
|
- const res = await upload(formData);
|
36
|
|
- if (res?.data?.uuid) {
|
37
|
|
- setImg(res.data.uuid)
|
38
|
|
- }
|
39
|
|
- return false;
|
|
33
|
+ const formData = new FormData();
|
|
34
|
+ formData.append('file', file, file.name);
|
|
35
|
+ const res = await upload(formData);
|
|
36
|
+ if (res?.data?.uuid) {
|
|
37
|
+ setImg(res.data.uuid)
|
|
38
|
+ }
|
|
39
|
+ return false;
|
40
|
40
|
};
|
41
|
41
|
const handleRemoveOne = async (selectedRow: API.System.Notice) => {
|
42
|
42
|
const hide = message.loading(intl.formatMessage({ id: 'public.loadingDelete' }));
|
|
@@ -57,7 +57,7 @@ const NoticeTableList: React.FC = () => {
|
57
|
57
|
return false;
|
58
|
58
|
}
|
59
|
59
|
};
|
60
|
|
-
|
|
60
|
+
|
61
|
61
|
const columns: ProColumns<API.System.Notice>[] = [
|
62
|
62
|
{
|
63
|
63
|
title: '序号',
|
|
@@ -105,7 +105,7 @@ const NoticeTableList: React.FC = () => {
|
105
|
105
|
>
|
106
|
106
|
编辑
|
107
|
107
|
</Button>,
|
108
|
|
-
|
|
108
|
+
|
109
|
109
|
<Button
|
110
|
110
|
type="link"
|
111
|
111
|
size="small"
|
|
@@ -139,70 +139,70 @@ const NoticeTableList: React.FC = () => {
|
139
|
139
|
<KeepAlive name='底部信息管理' path="/Enterprise/EnterpriseList">
|
140
|
140
|
<PageContainer>
|
141
|
141
|
<div style={{ width: '100%', float: 'right' }}>
|
142
|
|
-
|
143
|
|
- <ProForm
|
144
|
|
- form={form}
|
145
|
|
- grid={true}
|
146
|
|
- submitter={false}
|
147
|
|
- layout="horizontal"
|
148
|
|
- >
|
149
|
|
- <ProFormText
|
150
|
|
- name="phone"
|
151
|
|
- label='电话'
|
152
|
|
- labelCol={{
|
153
|
|
- style: { width: 95 }
|
154
|
|
- }}
|
155
|
|
- />
|
156
|
142
|
|
157
|
|
- <ProFormText
|
158
|
|
- name="postcode"
|
159
|
|
- label='邮编'
|
160
|
|
- labelCol={{
|
161
|
|
- style: { width: 95 }
|
162
|
|
- }}
|
163
|
|
- />
|
|
143
|
+ <ProForm
|
|
144
|
+ formRef={form}
|
|
145
|
+ grid={true}
|
|
146
|
+ submitter={false}
|
|
147
|
+ layout="horizontal"
|
|
148
|
+ >
|
|
149
|
+ <ProFormText
|
|
150
|
+ name="phone"
|
|
151
|
+ label='电话'
|
|
152
|
+ labelCol={{
|
|
153
|
+ style: { width: 95 }
|
|
154
|
+ }}
|
|
155
|
+ />
|
164
|
156
|
|
165
|
|
- <ProFormDigit
|
166
|
|
- name="headquarter"
|
167
|
|
- label="总部地址"
|
168
|
|
- labelCol={{
|
169
|
|
- style: { width: 95 }
|
170
|
|
- }}
|
171
|
|
- />
|
|
157
|
+ <ProFormText
|
|
158
|
+ name="postcode"
|
|
159
|
+ label='邮编'
|
|
160
|
+ labelCol={{
|
|
161
|
+ style: { width: 95 }
|
|
162
|
+ }}
|
|
163
|
+ />
|
172
|
164
|
|
173
|
|
- <ProFormDigit
|
174
|
|
- name="email"
|
175
|
|
- label="邮箱"
|
176
|
|
- labelCol={{
|
177
|
|
- style: { width: 95 }
|
178
|
|
- }}
|
179
|
|
- />
|
180
|
|
- <ProForm.Item
|
181
|
|
- label={'微信二维码'}
|
182
|
|
- extra={'图片尺寸1218*915'}
|
183
|
|
- labelCol={{
|
184
|
|
- style: { width: 95 }
|
185
|
|
- }}
|
186
|
|
- rules={[
|
187
|
|
- {
|
188
|
|
- required: true,
|
189
|
|
- message: "请上传图片!",
|
190
|
|
- }
|
191
|
|
- ]
|
192
|
|
- }
|
193
|
|
- >
|
194
|
|
- <Upload
|
195
|
|
- listType="picture-card" // 设置为图片卡片模式
|
196
|
|
- fileList={fileList}
|
197
|
|
- maxCount={1}
|
198
|
|
- onChange={handleChange}
|
199
|
|
- beforeUpload={handleBeforeUpload}
|
200
|
|
- >
|
201
|
|
- {fileList?.length < 1 && '+' + intl.formatMessage({ id: 'public.uploadImg' })}
|
202
|
|
- </Upload>
|
203
|
|
- </ProForm.Item>
|
|
165
|
+ <ProFormDigit
|
|
166
|
+ name="headquarter"
|
|
167
|
+ label="总部地址"
|
|
168
|
+ labelCol={{
|
|
169
|
+ style: { width: 95 }
|
|
170
|
+ }}
|
|
171
|
+ />
|
204
|
172
|
|
205
|
|
- </ProForm>
|
|
173
|
+ <ProFormDigit
|
|
174
|
+ name="email"
|
|
175
|
+ label="邮箱"
|
|
176
|
+ labelCol={{
|
|
177
|
+ style: { width: 95 }
|
|
178
|
+ }}
|
|
179
|
+ />
|
|
180
|
+ <ProForm.Item
|
|
181
|
+ label={'微信二维码'}
|
|
182
|
+ extra={'图片尺寸1218*915'}
|
|
183
|
+ labelCol={{
|
|
184
|
+ style: { width: 95 }
|
|
185
|
+ }}
|
|
186
|
+ rules={[
|
|
187
|
+ {
|
|
188
|
+ required: true,
|
|
189
|
+ message: "请上传图片!",
|
|
190
|
+ }
|
|
191
|
+ ]
|
|
192
|
+ }
|
|
193
|
+ >
|
|
194
|
+ <Upload
|
|
195
|
+ listType="picture-card" // 设置为图片卡片模式
|
|
196
|
+ fileList={fileList}
|
|
197
|
+ maxCount={1}
|
|
198
|
+ onChange={handleChange}
|
|
199
|
+ beforeUpload={handleBeforeUpload}
|
|
200
|
+ >
|
|
201
|
+ {fileList?.length < 1 && '+' + intl.formatMessage({ id: 'public.uploadImg' })}
|
|
202
|
+ </Upload>
|
|
203
|
+ </ProForm.Item>
|
|
204
|
+
|
|
205
|
+ </ProForm>
|
206
|
206
|
<ProTable<API.System.Notice>
|
207
|
207
|
actionRef={actionRef}
|
208
|
208
|
formRef={formTableRef}
|
|
@@ -248,7 +248,7 @@ const NoticeTableList: React.FC = () => {
|
248
|
248
|
if (currentRow) {
|
249
|
249
|
values.uuid = currentRow.uuid;
|
250
|
250
|
}
|
251
|
|
-
|
|
251
|
+
|
252
|
252
|
success = await saveEnterprise({ ...values });
|
253
|
253
|
if (success) {
|
254
|
254
|
setModalVisible(false);
|