@lxzy/code-snippet 0.0.5 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +16 -0
- package/.gitignore +17 -0
- package/.opencode/commands/push-yw.md +8 -0
- package/.prettierrc +11 -0
- package/AGENTS.md +28 -0
- package/README.md +15 -0
- package/index.html +12 -0
- package/mock/activity.ts +306 -0
- package/opencode.json +11 -0
- package/package.json +78 -27
- package/public/cdn/antd.min.css +10 -0
- package/public/cdn/antd.min.js +26 -0
- package/public/cdn/axios.min.js +3 -0
- package/public/cdn/lodash.min.js +140 -0
- package/public/cdn/moment.min.js +2 -0
- package/public/cdn/react-dom.development.min.js +1 -0
- package/public/cdn/react-dom.production.min.js +245 -0
- package/public/cdn/react.development.min.js +1 -0
- package/public/cdn/react.production.min.js +31 -0
- package/src/App.tsx +34 -0
- package/src/global.css +44 -0
- package/src/layouts/index.tsx +50 -0
- package/src/ly/chart/index.less +101 -0
- package/src/ly/chart/index.tsx +272 -0
- package/src/ly/chart/test.js +43 -0
- package/src/main.tsx +11 -0
- package/src/pages/404.tsx +5 -0
- package/src/pages/activityCenter/activitySystemManagement/add.tsx +209 -0
- package/src/pages/activityCenter/activitySystemManagement/addPages/components/ChannelLinkModal.tsx +167 -0
- package/src/pages/activityCenter/activitySystemManagement/addPages/components/CustomLink.tsx +41 -0
- package/src/pages/activityCenter/activitySystemManagement/addPages/components/CustomPage.tsx +79 -0
- package/src/pages/activityCenter/activitySystemManagement/addPages/components/SystemPage.tsx +40 -0
- package/src/pages/activityCenter/activitySystemManagement/addPages/index.tsx +32 -0
- package/src/pages/activityCenter/activitySystemManagement/index.tsx +195 -0
- package/tsconfig.json +23 -0
- package/typings.d.ts +10 -0
- package/vite.config.ts +32 -0
- package/public/extensions.rar +0 -0
- package/public/wetype_installer_official_p_48.exe +0 -0
- /package/{src/index.tsx → mock/.gitkeep} +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { message, Row, Col } from 'antd';
|
|
3
|
+
import {
|
|
4
|
+
DrawerForm,
|
|
5
|
+
ProFormText,
|
|
6
|
+
ProFormCheckbox,
|
|
7
|
+
ProFormSelect,
|
|
8
|
+
ProFormRadio,
|
|
9
|
+
ProFormDependency,
|
|
10
|
+
ProFormDateTimeRangePicker,
|
|
11
|
+
} from '@ant-design/pro-form';
|
|
12
|
+
import moment from 'moment';
|
|
13
|
+
import axios from 'axios';
|
|
14
|
+
|
|
15
|
+
const sectionOptions = ['新机', '二手', '工业品', '融资'];
|
|
16
|
+
const shopTypeOptions = ['总部', '经销商', '进口', '国产'];
|
|
17
|
+
const categoryTagOptions = [
|
|
18
|
+
'机械加工',
|
|
19
|
+
'金属成型',
|
|
20
|
+
'塑料机械',
|
|
21
|
+
'印刷包装',
|
|
22
|
+
'纺织机械',
|
|
23
|
+
'食品加工',
|
|
24
|
+
'木材加工',
|
|
25
|
+
'电子制造',
|
|
26
|
+
'生产配套',
|
|
27
|
+
];
|
|
28
|
+
const strategyTagOptions = ['常态化', '拉新', '促活', '促销', '品牌联合推广'];
|
|
29
|
+
const ipTagOptions = ['品牌A', '品牌B', '品牌C', '品牌D'];
|
|
30
|
+
const industryTagOptions = ['制造业', '轻工业', '重工业', '服务业', '农业'];
|
|
31
|
+
|
|
32
|
+
interface AddDrawerProps {
|
|
33
|
+
visible: boolean;
|
|
34
|
+
editingItem: any;
|
|
35
|
+
onClose: () => void;
|
|
36
|
+
onSuccess: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const AddDrawer: React.FC<AddDrawerProps> = ({
|
|
40
|
+
visible,
|
|
41
|
+
editingItem,
|
|
42
|
+
onClose,
|
|
43
|
+
onSuccess,
|
|
44
|
+
}) => {
|
|
45
|
+
const formRef = useRef<any>();
|
|
46
|
+
|
|
47
|
+
const handleSubmit = async (values) => {
|
|
48
|
+
const { timeRange, ...rest } = values;
|
|
49
|
+
const payload = {
|
|
50
|
+
...rest,
|
|
51
|
+
startTime: timeRange?.[0]?.format('YYYY-MM-DD HH:mm:ss') || '',
|
|
52
|
+
endTime: timeRange?.[1]?.format('YYYY-MM-DD HH:mm:ss') || '',
|
|
53
|
+
};
|
|
54
|
+
if (editingItem) {
|
|
55
|
+
await axios.post('/api/activity/update', {
|
|
56
|
+
...payload,
|
|
57
|
+
id: editingItem.id,
|
|
58
|
+
});
|
|
59
|
+
message.success('编辑成功');
|
|
60
|
+
} else {
|
|
61
|
+
await axios.post('/api/activity/add', payload);
|
|
62
|
+
message.success('新增成功');
|
|
63
|
+
}
|
|
64
|
+
onSuccess();
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<DrawerForm
|
|
70
|
+
title={editingItem ? '编辑活动' : '新建活动'}
|
|
71
|
+
visible={visible}
|
|
72
|
+
onVisibleChange={(v) => {
|
|
73
|
+
if (!v) {
|
|
74
|
+
onClose();
|
|
75
|
+
}
|
|
76
|
+
}}
|
|
77
|
+
formRef={formRef}
|
|
78
|
+
width="80%"
|
|
79
|
+
drawerProps={{ destroyOnClose: true }}
|
|
80
|
+
key={editingItem?.id || 'add'}
|
|
81
|
+
initialValues={
|
|
82
|
+
editingItem
|
|
83
|
+
? {
|
|
84
|
+
...editingItem,
|
|
85
|
+
timeRange:
|
|
86
|
+
editingItem.startTime && editingItem.endTime
|
|
87
|
+
? [moment(editingItem.startTime), moment(editingItem.endTime)]
|
|
88
|
+
: undefined,
|
|
89
|
+
}
|
|
90
|
+
: { targetGroup: 'all', supportFactoryRegister: 'no' }
|
|
91
|
+
}
|
|
92
|
+
onFinish={handleSubmit}
|
|
93
|
+
>
|
|
94
|
+
<ProFormText
|
|
95
|
+
name="name"
|
|
96
|
+
label="活动名称"
|
|
97
|
+
rules={[{ required: true, message: '请输入活动名称' }]}
|
|
98
|
+
placeholder="请输入"
|
|
99
|
+
/>
|
|
100
|
+
<ProFormDateTimeRangePicker
|
|
101
|
+
name="timeRange"
|
|
102
|
+
label="活动时间范围"
|
|
103
|
+
rules={[{ required: true, message: '请选择活动时间范围' }]}
|
|
104
|
+
fieldProps={{ style: { width: '100%' } }}
|
|
105
|
+
/>
|
|
106
|
+
<ProFormCheckbox.Group
|
|
107
|
+
name="section"
|
|
108
|
+
label="所属板块"
|
|
109
|
+
options={sectionOptions}
|
|
110
|
+
rules={[{ required: true, message: '请选择所属板块' }]}
|
|
111
|
+
/>
|
|
112
|
+
<ProFormCheckbox.Group
|
|
113
|
+
name="shopTypes"
|
|
114
|
+
label="参与店铺类型"
|
|
115
|
+
options={shopTypeOptions}
|
|
116
|
+
rules={[{ required: true, message: '请选择参与店铺类型' }]}
|
|
117
|
+
/>
|
|
118
|
+
<div
|
|
119
|
+
style={{
|
|
120
|
+
background: '#f5f5f5',
|
|
121
|
+
padding: 16,
|
|
122
|
+
borderRadius: 4,
|
|
123
|
+
marginBottom: 24,
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
<div style={{ fontWeight: 500, marginBottom: 12 }}>活动标签</div>
|
|
127
|
+
<ProFormCheckbox.Group
|
|
128
|
+
name="categoryTags"
|
|
129
|
+
label="品类标签"
|
|
130
|
+
options={categoryTagOptions}
|
|
131
|
+
/>
|
|
132
|
+
<Row gutter={16} align="middle" style={{ marginBottom: 24 }}>
|
|
133
|
+
<Col>
|
|
134
|
+
<ProFormCheckbox.Group
|
|
135
|
+
name="strategyTags"
|
|
136
|
+
label="策略标签"
|
|
137
|
+
options={strategyTagOptions}
|
|
138
|
+
/>
|
|
139
|
+
</Col>
|
|
140
|
+
<Col>
|
|
141
|
+
<ProFormText
|
|
142
|
+
name="strategyCustomInput"
|
|
143
|
+
noStyle
|
|
144
|
+
placeholder="如有多个,请用/分割"
|
|
145
|
+
fieldProps={{ style: { width: 200 } }}
|
|
146
|
+
/>
|
|
147
|
+
</Col>
|
|
148
|
+
</Row>
|
|
149
|
+
<ProFormSelect
|
|
150
|
+
name="ipTags"
|
|
151
|
+
label="IP标签"
|
|
152
|
+
mode="multiple"
|
|
153
|
+
placeholder="请选择,多选"
|
|
154
|
+
fieldProps={{ style: { width: 260 } }}
|
|
155
|
+
options={ipTagOptions.map((t) => ({ label: t, value: t }))}
|
|
156
|
+
/>
|
|
157
|
+
<ProFormSelect
|
|
158
|
+
name="industryTags"
|
|
159
|
+
label="行业标签"
|
|
160
|
+
placeholder="请选择"
|
|
161
|
+
fieldProps={{ style: { width: 200 } }}
|
|
162
|
+
options={industryTagOptions.map((t) => ({ label: t, value: t }))}
|
|
163
|
+
/>
|
|
164
|
+
<ProFormText
|
|
165
|
+
name="customTags"
|
|
166
|
+
label="自定义标签"
|
|
167
|
+
placeholder="如有多个,请用/分割"
|
|
168
|
+
fieldProps={{ style: { width: 300 } }}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
<ProFormRadio.Group
|
|
172
|
+
name="targetGroup"
|
|
173
|
+
label="活动人群"
|
|
174
|
+
options={[
|
|
175
|
+
{ label: '全用户', value: 'all' },
|
|
176
|
+
{ label: '选择客群', value: 'select' },
|
|
177
|
+
]}
|
|
178
|
+
rules={[{ required: true, message: '请选择活动人群' }]}
|
|
179
|
+
/>
|
|
180
|
+
<ProFormDependency name={['targetGroup']}>
|
|
181
|
+
{({ targetGroup }) =>
|
|
182
|
+
targetGroup === 'select' ? (
|
|
183
|
+
<ProFormSelect
|
|
184
|
+
name="selectedGroup"
|
|
185
|
+
label=" "
|
|
186
|
+
placeholder="请选择选定人群"
|
|
187
|
+
fieldProps={{ style: { width: 300 } }}
|
|
188
|
+
options={[
|
|
189
|
+
{ label: 'VIP客户', value: 'VIP客户' },
|
|
190
|
+
{ label: '新用户', value: '新用户' },
|
|
191
|
+
{ label: '活跃用户', value: '活跃用户' },
|
|
192
|
+
]}
|
|
193
|
+
/>
|
|
194
|
+
) : null
|
|
195
|
+
}
|
|
196
|
+
</ProFormDependency>
|
|
197
|
+
<ProFormRadio.Group
|
|
198
|
+
name="supportFactoryRegister"
|
|
199
|
+
label="支持厂商报名"
|
|
200
|
+
options={[
|
|
201
|
+
{ label: '否', value: 'no' },
|
|
202
|
+
{ label: '是', value: 'yes' },
|
|
203
|
+
]}
|
|
204
|
+
/>
|
|
205
|
+
</DrawerForm>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export default AddDrawer;
|
package/src/pages/activityCenter/activitySystemManagement/addPages/components/ChannelLinkModal.tsx
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Modal, Button, Input, message } from 'antd';
|
|
3
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
4
|
+
import ProTable from '@ant-design/pro-table';
|
|
5
|
+
import { ModalForm, ProFormText } from '@ant-design/pro-form';
|
|
6
|
+
import axios from 'axios';
|
|
7
|
+
|
|
8
|
+
interface ChannelLinkModalProps {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
pageName: string;
|
|
11
|
+
pageId: number;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ChannelLinkModal: React.FC<ChannelLinkModalProps> = ({
|
|
16
|
+
visible,
|
|
17
|
+
pageName,
|
|
18
|
+
pageId,
|
|
19
|
+
onClose,
|
|
20
|
+
}) => {
|
|
21
|
+
const actionRef = useRef<any>();
|
|
22
|
+
const [addVisible, setAddVisible] = useState(false);
|
|
23
|
+
const [editVisible, setEditVisible] = useState(false);
|
|
24
|
+
const [editingItem, setEditingItem] = useState<any>(null);
|
|
25
|
+
|
|
26
|
+
const handleAdd = async (values) => {
|
|
27
|
+
await axios.post('/api/activity/channelLink/add', {
|
|
28
|
+
...values,
|
|
29
|
+
pageId,
|
|
30
|
+
});
|
|
31
|
+
message.success('新增成功');
|
|
32
|
+
setAddVisible(false);
|
|
33
|
+
actionRef.current?.reload();
|
|
34
|
+
return true;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleEdit = async (values) => {
|
|
38
|
+
await axios.post('/api/activity/channelLink/update', {
|
|
39
|
+
...values,
|
|
40
|
+
id: editingItem.id,
|
|
41
|
+
});
|
|
42
|
+
message.success('编辑成功');
|
|
43
|
+
setEditVisible(false);
|
|
44
|
+
setEditingItem(null);
|
|
45
|
+
actionRef.current?.reload();
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleDelete = async (record) => {
|
|
50
|
+
await axios.post('/api/activity/channelLink/delete', { id: record.id });
|
|
51
|
+
message.success('删除成功');
|
|
52
|
+
actionRef.current?.reload();
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Modal
|
|
58
|
+
title={pageName}
|
|
59
|
+
visible={visible}
|
|
60
|
+
onCancel={onClose}
|
|
61
|
+
footer={null}
|
|
62
|
+
width={900}
|
|
63
|
+
>
|
|
64
|
+
<ProTable
|
|
65
|
+
headerTitle={false}
|
|
66
|
+
toolBarRender={() => [
|
|
67
|
+
<Button
|
|
68
|
+
key="add"
|
|
69
|
+
type="primary"
|
|
70
|
+
icon={<PlusOutlined />}
|
|
71
|
+
onClick={() => setAddVisible(true)}
|
|
72
|
+
>
|
|
73
|
+
新建渠道链接
|
|
74
|
+
</Button>,
|
|
75
|
+
]}
|
|
76
|
+
actionRef={actionRef}
|
|
77
|
+
rowKey="id"
|
|
78
|
+
request={async (params) => {
|
|
79
|
+
const { data: result } = await axios.get('/api/activity/channelLinkList', {
|
|
80
|
+
params: { ...params, pageId },
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
data: result.data.list,
|
|
84
|
+
total: result.data.total,
|
|
85
|
+
success: result.success,
|
|
86
|
+
};
|
|
87
|
+
}}
|
|
88
|
+
columns={[
|
|
89
|
+
{ title: '渠道中文', dataIndex: 'nameCn' },
|
|
90
|
+
{ title: '渠道英文', dataIndex: 'nameEn' },
|
|
91
|
+
{ title: '链接参数', dataIndex: 'link' },
|
|
92
|
+
{ title: '创建时间', dataIndex: 'createTime' },
|
|
93
|
+
{
|
|
94
|
+
title: '操作',
|
|
95
|
+
valueType: 'option',
|
|
96
|
+
render: (_, record) => (
|
|
97
|
+
<>
|
|
98
|
+
<Button type="link" size="small">查看二维码</Button>
|
|
99
|
+
<Button
|
|
100
|
+
type="link"
|
|
101
|
+
size="small"
|
|
102
|
+
onClick={() => {
|
|
103
|
+
setEditingItem(record);
|
|
104
|
+
setEditVisible(true);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
编辑
|
|
108
|
+
</Button>
|
|
109
|
+
<Button type="link" danger size="small" onClick={() => handleDelete(record)}>
|
|
110
|
+
删除
|
|
111
|
+
</Button>
|
|
112
|
+
</>
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
]}
|
|
116
|
+
pagination={false}
|
|
117
|
+
options={false}
|
|
118
|
+
search={false}
|
|
119
|
+
/>
|
|
120
|
+
</Modal>
|
|
121
|
+
|
|
122
|
+
<ModalForm
|
|
123
|
+
title="新建渠道链接"
|
|
124
|
+
visible={addVisible}
|
|
125
|
+
onVisibleChange={setAddVisible}
|
|
126
|
+
onFinish={handleAdd}
|
|
127
|
+
>
|
|
128
|
+
<ProFormText
|
|
129
|
+
name="nameCn"
|
|
130
|
+
label="渠道中文"
|
|
131
|
+
rules={[{ required: true, message: '请输入渠道中文' }]}
|
|
132
|
+
placeholder="请输入"
|
|
133
|
+
/>
|
|
134
|
+
<ProFormText
|
|
135
|
+
name="nameEn"
|
|
136
|
+
label="渠道英文"
|
|
137
|
+
rules={[{ required: true, message: '请输入渠道英文' }]}
|
|
138
|
+
placeholder="请输入"
|
|
139
|
+
/>
|
|
140
|
+
</ModalForm>
|
|
141
|
+
|
|
142
|
+
<ModalForm
|
|
143
|
+
title="编辑渠道链接"
|
|
144
|
+
visible={editVisible}
|
|
145
|
+
onVisibleChange={setEditVisible}
|
|
146
|
+
onFinish={handleEdit}
|
|
147
|
+
initialValues={editingItem || {}}
|
|
148
|
+
key={editingItem?.id}
|
|
149
|
+
>
|
|
150
|
+
<ProFormText
|
|
151
|
+
name="nameCn"
|
|
152
|
+
label="渠道中文"
|
|
153
|
+
rules={[{ required: true, message: '请输入渠道中文' }]}
|
|
154
|
+
placeholder="请输入"
|
|
155
|
+
/>
|
|
156
|
+
<ProFormText
|
|
157
|
+
name="nameEn"
|
|
158
|
+
label="渠道英文"
|
|
159
|
+
rules={[{ required: true, message: '请输入渠道英文' }]}
|
|
160
|
+
placeholder="请输入"
|
|
161
|
+
/>
|
|
162
|
+
</ModalForm>
|
|
163
|
+
</>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default ChannelLinkModal;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import ProTable from '@ant-design/pro-table';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
|
|
6
|
+
const CustomLink: React.FC = () => {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<ProTable
|
|
10
|
+
headerTitle={false}
|
|
11
|
+
toolBarRender={() => [
|
|
12
|
+
<Button key="add" type="primary">新建自定义链接</Button>,
|
|
13
|
+
]}
|
|
14
|
+
rowKey="id"
|
|
15
|
+
request={async (params) => {
|
|
16
|
+
const { data: result } = await axios.get('/api/activity/customLinkList', { params });
|
|
17
|
+
return { data: result.data.list, total: result.data.total, success: result.success };
|
|
18
|
+
}}
|
|
19
|
+
columns={[
|
|
20
|
+
{ title: '跳转类型', dataIndex: 'type' },
|
|
21
|
+
{ title: '页面路径', dataIndex: 'path' },
|
|
22
|
+
{ title: '最近更新时间', dataIndex: 'updateTime' },
|
|
23
|
+
{
|
|
24
|
+
title: '操作',
|
|
25
|
+
valueType: 'option',
|
|
26
|
+
render: () => (
|
|
27
|
+
<>
|
|
28
|
+
<Button type="link" size="small">编辑</Button>
|
|
29
|
+
<Button type="link" danger size="small">删除</Button>
|
|
30
|
+
</>
|
|
31
|
+
),
|
|
32
|
+
},
|
|
33
|
+
]}
|
|
34
|
+
pagination={false}
|
|
35
|
+
options={false}
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default CustomLink;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import ProTable from '@ant-design/pro-table';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
import ChannelLinkModal from './ChannelLinkModal';
|
|
6
|
+
|
|
7
|
+
const CustomPage: React.FC = () => {
|
|
8
|
+
const [channelLinkVisible, setChannelLinkVisible] = useState(false);
|
|
9
|
+
const [currentPage, setCurrentPage] = useState<any>(null);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div>
|
|
13
|
+
<ProTable
|
|
14
|
+
headerTitle={false}
|
|
15
|
+
search={{ labelWidth: 'auto' }}
|
|
16
|
+
toolBarRender={() => [
|
|
17
|
+
<Button key="relate" type="primary">关联自定义页面</Button>,
|
|
18
|
+
<Button key="add" type="primary">新建页面</Button>,
|
|
19
|
+
]}
|
|
20
|
+
rowKey="id"
|
|
21
|
+
request={async (params) => {
|
|
22
|
+
const { data: result } = await axios.get('/api/activity/customPageList', { params });
|
|
23
|
+
return { data: result.data.list, total: result.data.total, success: result.success };
|
|
24
|
+
}}
|
|
25
|
+
columns={[
|
|
26
|
+
{ title: '页面名称', dataIndex: 'name' },
|
|
27
|
+
{ title: '页面路径', dataIndex: 'path' },
|
|
28
|
+
{ title: '状态', dataIndex: 'status' },
|
|
29
|
+
{ title: '关联活动', dataIndex: 'activity' },
|
|
30
|
+
{ title: '是否可分享', dataIndex: 'canShare', render: (_, record) => (record.canShare ? '是' : '否') },
|
|
31
|
+
{ title: '最近更新时间', dataIndex: 'updateTime' },
|
|
32
|
+
{
|
|
33
|
+
title: '操作',
|
|
34
|
+
valueType: 'option',
|
|
35
|
+
width: 300,
|
|
36
|
+
render: (_, record) => (
|
|
37
|
+
<>
|
|
38
|
+
<Button type="link" size="small">详情</Button>
|
|
39
|
+
<Button type="link" size="small">编辑</Button>
|
|
40
|
+
{record.status === '已通过' && <Button type="link" size="small">复制</Button>}
|
|
41
|
+
<Button type="link" danger size="small">删除</Button>
|
|
42
|
+
{record.status === '已通过' ? (
|
|
43
|
+
<Button
|
|
44
|
+
type="link"
|
|
45
|
+
size="small"
|
|
46
|
+
onClick={() => {
|
|
47
|
+
setCurrentPage(record);
|
|
48
|
+
setChannelLinkVisible(true);
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
设置渠道链接
|
|
52
|
+
</Button>
|
|
53
|
+
) : (
|
|
54
|
+
<Button type="link" size="small">提审</Button>
|
|
55
|
+
)}
|
|
56
|
+
</>
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
pagination={false}
|
|
61
|
+
options={false}
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
{channelLinkVisible && (
|
|
65
|
+
<ChannelLinkModal
|
|
66
|
+
visible={channelLinkVisible}
|
|
67
|
+
pageName={currentPage?.name || ''}
|
|
68
|
+
pageId={currentPage?.id}
|
|
69
|
+
onClose={() => {
|
|
70
|
+
setChannelLinkVisible(false);
|
|
71
|
+
setCurrentPage(null);
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default CustomPage;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import ProTable from '@ant-design/pro-table';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
|
|
6
|
+
const SystemPage: React.FC = () => {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<ProTable
|
|
10
|
+
headerTitle={false}
|
|
11
|
+
search={{ labelWidth: 'auto' }}
|
|
12
|
+
toolBarRender={() => [
|
|
13
|
+
<Button key="add" type="primary">
|
|
14
|
+
关联系统页面
|
|
15
|
+
</Button>,
|
|
16
|
+
]}
|
|
17
|
+
rowKey="id"
|
|
18
|
+
request={async (params) => {
|
|
19
|
+
const { data: result } = await axios.get('/api/activity/systemPageList', { params });
|
|
20
|
+
return { data: result.data.list, total: result.data.total, success: result.success };
|
|
21
|
+
}}
|
|
22
|
+
columns={[
|
|
23
|
+
{ title: '页面名称', dataIndex: 'name' },
|
|
24
|
+
{ title: '页面路径', dataIndex: 'path' },
|
|
25
|
+
{ title: '状态', dataIndex: 'status' },
|
|
26
|
+
{ title: '最近更新时间', dataIndex: 'updateTime' },
|
|
27
|
+
{
|
|
28
|
+
title: '操作',
|
|
29
|
+
valueType: 'option',
|
|
30
|
+
render: () => <Button type="primary" danger size="small">删除</Button>,
|
|
31
|
+
},
|
|
32
|
+
]}
|
|
33
|
+
pagination={false}
|
|
34
|
+
options={false}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default SystemPage;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { PageContainer } from '@ant-design/pro-layout';
|
|
3
|
+
import SystemPage from './components/SystemPage';
|
|
4
|
+
import CustomPage from './components/CustomPage';
|
|
5
|
+
import CustomLink from './components/CustomLink';
|
|
6
|
+
|
|
7
|
+
const AddPages: React.FC = () => {
|
|
8
|
+
const [activeTab, setActiveTab] = useState('system');
|
|
9
|
+
|
|
10
|
+
const tabContent = {
|
|
11
|
+
system: <SystemPage />,
|
|
12
|
+
custom: <CustomPage />,
|
|
13
|
+
link: <CustomLink />,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<PageContainer
|
|
18
|
+
title="春季内购会"
|
|
19
|
+
tabList={[
|
|
20
|
+
{ tab: '系统页面', key: 'system' },
|
|
21
|
+
{ tab: '自定义页面', key: 'custom' },
|
|
22
|
+
{ tab: '自定义链接', key: 'link' },
|
|
23
|
+
]}
|
|
24
|
+
tabActiveKey={activeTab}
|
|
25
|
+
onTabChange={(key) => setActiveTab(key)}
|
|
26
|
+
>
|
|
27
|
+
{tabContent[activeTab]}
|
|
28
|
+
</PageContainer>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default AddPages;
|