周立森 5 年之前
父節點
當前提交
dde4f7fa10
共有 3 個文件被更改,包括 323 次插入2 次删除
  1. 13
    2
      config/routes.js
  2. 73
    0
      src/pages/activity/drainage/Detail.jsx
  3. 237
    0
      src/pages/activity/drainage/DrainageList.jsx

+ 13
- 2
config/routes.js 查看文件

@@ -114,7 +114,7 @@ export default [
114 114
               },
115 115
               {
116 116
                 path: '/customer/recommendCustomer/audit',
117
-                name: '客户审核', 
117
+                name: '客户审核',
118 118
                 hideInMenu: true,
119 119
                 component: './customer/recommendCustomer/audit',
120 120
               },
@@ -263,6 +263,17 @@ export default [
263 263
                 hideInMenu: true,
264 264
                 component: './activity/SignList',
265 265
               },
266
+              {
267
+                path: '/activity/drainage/DrainageList',
268
+                name: '全网投放引流',
269
+                component: './activity/drainage/DrainageList',
270
+              },
271
+              {
272
+                path: '/activity/drainage/Detail',
273
+                name: '查看详情',
274
+                hideInMenu: true,
275
+                component: './activity/drainage/Detail',
276
+              },
266 277
             ],
267 278
           },
268 279
           {
@@ -298,7 +309,7 @@ export default [
298 309
                 name: '添加角色',
299 310
                 hideInMenu: true,
300 311
                 component: './staff/list/addRole',
301
-              },  
312
+              },
302 313
             ],
303 314
           },
304 315
           {

+ 73
- 0
src/pages/activity/drainage/Detail.jsx 查看文件

@@ -0,0 +1,73 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import moment from 'moment';
7
+
8
+
9
+const columns = [
10
+  {
11
+    title: '提交时间',
12
+    dataIndex: 'time',
13
+    key: 'time',
14
+    
15
+  },
16
+]
17
+
18
+const data = []
19
+
20
+const header = (props) => {
21
+  let daterange = []
22
+  function onChangetime(_dates, dateStrings) {
23
+    daterange[1] = dateStrings[1]
24
+    daterange[0] = dateStrings[0]
25
+  }
26
+
27
+  const changeNewsListStatus = (newsId) => () => {
28
+    Modal.confirm({
29
+      title: '确认删除该资讯?',
30
+      okText: '确认',
31
+      cancelText: '取消',
32
+      onOk() {
33
+        request({ ...apis.news.delete, urlData: { id: newsId }, }).then((data) => {
34
+          message.info('操作成功!')
35
+          getList({ pageNum: 1, pageSize: 10 });
36
+        }).catch((err) => {
37
+          console.log(err)
38
+          message.info(err.msg || err.message)
39
+        })
40
+      }
41
+    });
42
+  }
43
+ 
44
+  const { RangePicker } = DatePicker;
45
+  return (
46
+    <>
47
+      <RangePicker
48
+        style={{ paddingLeft: '30px' }}
49
+        ranges={{
50
+          Today: [moment(), moment()],
51
+          'This Month': [moment().startOf('month'), moment().endOf('month')],
52
+        }}
53
+        showTime
54
+        // format="YYYY/MM/DD HH:mm:ss"
55
+        onChange={(_dates, dateStrings) => onChangetime(_dates, dateStrings)}
56
+      />
57
+      {/* <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
58
+        查询
59
+        </Button> */}
60
+        <div>
61
+           H5项目名称{}  <Button type="primary">导出数据</Button>
62
+           <Table columns={columns} dataSource={data} pagination={false} />
63
+        </div>
64
+        
65
+       
66
+
67
+
68
+    </>
69
+  )
70
+}
71
+
72
+
73
+export default header

+ 237
- 0
src/pages/activity/drainage/DrainageList.jsx 查看文件

@@ -0,0 +1,237 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+
7
+const changeNewsListStatus = (newsId) => () => {
8
+  Modal.confirm({
9
+    title: '确认删除该引流?',
10
+    okText: '确认',
11
+    cancelText: '取消',
12
+    onOk() {
13
+     
14
+      
15
+    }
16
+  });
17
+}
18
+
19
+const toEditList = (newsId) => () => {
20
+  router.push({
21
+    pathname: '/activity/drainage/Detail',
22
+    // query: {
23
+    //   newsId
24
+    // },
25
+  });
26
+}
27
+
28
+const columns = [
29
+  {
30
+    title: 'H5项目编号',
31
+    dataIndex: 'Id',
32
+    key: 'Id',
33
+    
34
+  },
35
+  {
36
+    title: 'H5项目名称',
37
+    dataIndex: 'name',
38
+    key: 'name',
39
+  },
40
+  {
41
+    title: '字段1',
42
+    dataIndex: 'field1',
43
+    key: 'field1',
44
+  },
45
+  {
46
+    title: '字段2',
47
+    dataIndex: 'field2',
48
+    key: 'field2',
49
+  },
50
+  {
51
+    title: '新建时间',
52
+    dataIndex: 'StartTime',
53
+    key: 'StartTime',
54
+    // render:
55
+  },
56
+  {
57
+    title: '截止时间',
58
+    dataIndex: 'EndTime',
59
+    key: 'EndTime',
60
+    // render:
61
+  },
62
+  {
63
+    title: '参与数',
64
+    dataIndex: 'number',
65
+    key: 'number',
66
+    // render:
67
+  },
68
+  {
69
+    title: '操作',
70
+    key: 'action',
71
+    render: (text, record) => (
72
+        <>
73
+        <span style={{  right: '20px', top: '20px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList()}>
74
+            查看详情
75
+          </span>
76
+      
77
+        <span style={{  right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft:20}} onClick={changeNewsListStatus()}>
78
+            删除
79
+          </span>
80
+      </>
81
+    ),
82
+  },
83
+];
84
+
85
+const data = [
86
+
87
+  {
88
+    Id:'1',
89
+    name:'zls',
90
+    // StartTime:'',
91
+    // EndTime:'',
92
+    number: 33,
93
+  }
94
+  
95
+
96
+];
97
+
98
+const header = (props) => {
99
+  // const [data, setData] = useState({ data: [] })
100
+  const [ date, setDate ] = useState({})
101
+  //   const [page, changePage] = useState({})
102
+    useEffect(() => {
103
+      setDate({
104
+        ModalText: 'Content of the modal',
105
+    visible: false,
106
+    confirmLoading: false,
107
+      })
108
+    },[])
109
+
110
+  const handleSubmit = (e, props) => {
111
+    e.preventDefault();
112
+    props.form.validateFields((err, values) => {
113
+      // if (!err) {
114
+      //   console.log('提交数据: ', values)
115
+      //   getList({ pageNum: 1, pageSize: 10, ...values })
116
+      // }
117
+    });
118
+  }
119
+
120
+  //重置搜索
121
+  function handleReset() {
122
+    props.form.resetFields();
123
+  }
124
+
125
+const toEditGoods = (dynamicId) => () => {
126
+  // router.push({
127
+  //   pathname: '/activity/editActivity',
128
+  //   query: {
129
+  //     dynamicId
130
+  //   },
131
+  // });
132
+}
133
+
134
+
135
+function showModal ()  {
136
+  setDate({
137
+    visible: true,
138
+  });
139
+};
140
+
141
+function handleOk  () {
142
+  setDate({
143
+    ModalText: 'The modal will be closed after two seconds',
144
+    confirmLoading: true,
145
+  });
146
+  function  setTimeout()  {
147
+    setDate({
148
+      visible: false,
149
+      confirmLoading: false,
150
+    });
151
+  };
152
+};
153
+
154
+function handleCancel (){
155
+  console.log('Clicked cancel button');
156
+  setDate({
157
+    visible: false,
158
+  });
159
+};
160
+ 
161
+  const { getFieldDecorator } = props.form
162
+  const { visible, confirmLoading, ModalText } = date;
163
+  return (
164
+    <>
165
+      <div>
166
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
167
+      <Form.Item>
168
+          {getFieldDecorator('Id')(
169
+            <Input
170
+              // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
171
+              placeholder="H5项目编号"
172
+            />,
173
+          )}
174
+        </Form.Item>
175
+        <Form.Item>
176
+          {getFieldDecorator('name')(
177
+            <Input
178
+              // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
179
+              placeholder="H5项目名称"
180
+            />,
181
+          )}
182
+        </Form.Item>
183
+        <Form.Item>
184
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
185
+            搜索
186
+          </Button>
187
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
188
+              重置
189
+            </Button>
190
+        </Form.Item>
191
+      </Form>
192
+      {/* <AuthButton name="admin.buildingDynamic.add.post" noRight={null}> */}
193
+        <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
194
+
195
+        <Modal
196
+         title="新建H5项目"
197
+         visible={visible}
198
+         onOk={handleOk}
199
+         confirmLoading={confirmLoading}
200
+         onCancel={handleCancel}
201
+        >
202
+          <Form>
203
+          <Form.Item>
204
+          {getFieldDecorator('name')(
205
+            <Input
206
+              // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
207
+              placeholder="H5项目名称"
208
+            />,
209
+          )}
210
+        </Form.Item>
211
+        <Form.Item>
212
+          {getFieldDecorator('endtime')(
213
+            <Input
214
+              // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
215
+              placeholder="截止时间"
216
+            />,
217
+          )}
218
+        </Form.Item>
219
+        </Form>
220
+        </Modal>
221
+
222
+
223
+
224
+      {/* </AuthButton> */}
225
+        {/* <Table dataSource={data.list} columns={columns} pagination={false} rowKey="activityList"/> */}
226
+        <Table columns={columns} dataSource={data} pagination={false} />
227
+      {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
228
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
229
+      </div> */}
230
+      
231
+      </div>
232
+    </>
233
+  )
234
+}
235
+const WrappedHeader = Form.create({ name: 'header' })(header);
236
+
237
+export default WrappedHeader