Ver código fonte

Merge branch 'master' of http://git.ycjcjy.com/estateagents/pc-channel

# Conflicts:
#	config/config.js
傅行帆 5 anos atrás
pai
commit
a8803d8f86

+ 1
- 1
config/config.js Ver arquivo

@@ -133,7 +133,7 @@ export default {
133 133
 
134 134
   proxy: {
135 135
     '/api': {
136
-      target: 'http://127.0.0.1:8080/',
136
+      target: 'http://192.168.2.49:8080/',
137 137
       changeOrigin: true,
138 138
       // pathRewrite: { '^/server': '' },
139 139
     },

+ 1
- 1
config/routes.js Ver arquivo

@@ -104,7 +104,7 @@ export default [
104 104
               },
105 105
               {
106 106
                 path: '/resource/openScreen/edit',
107
-                name: '开屏通知修改',
107
+                name: '开屏通知编辑',
108 108
                 hideInMenu: true,
109 109
                 component: './resource/openScreen/edit',
110 110
               },

+ 4
- 4
src/pages/contact/contact/add.jsx Ver arquivo

@@ -45,8 +45,8 @@ const header = props => {
45 45
             type: FieldTypes.Text,
46 46
             value: data.contactName,
47 47
             rules: [
48
-                { required: true, message: '请输入通知标题' },
49
-                { max: 6, message: '通知标题名称不超过6个字符' }
48
+                { required: true, message: '请输入姓名' },
49
+                { max: 6, message: '姓名不能超过6个字符' }
50 50
             ]
51 51
         },
52 52
         {
@@ -74,7 +74,7 @@ const header = props => {
74 74
             rules: [
75 75
                 { required: false, message: '请选择头像' },
76 76
             ],
77
-            help: '建议尺寸:Npx*Npx,比例:1:1,格式:jpg,大小:不超过300KB,用于客户查看',
77
+            help: '建议尺寸:100px*100px,比例:1:1,格式:jpg,大小:不超过300KB,用于样例列表封面',
78 78
         },
79 79
         {
80 80
             label: '对外头衔',
@@ -133,7 +133,7 @@ const header = props => {
133 133
             value: data.address,
134 134
             rules: [
135 135
                 { required: false, message: '请输入联系地址' },
136
-                { max: 40, message: '邮箱不能超过40个字符' }
136
+                { max: 40, message: '联系地址不能超过40个字符' }
137 137
             ]
138 138
         },
139 139
         {

+ 5
- 5
src/pages/contact/contact/detail.jsx Ver arquivo

@@ -62,15 +62,15 @@ const header = props => {
62 62
             type: FieldTypes.Text,
63 63
             value: data.contactName,
64 64
             rules: [
65
-                { required: true, message: '请输入通知标题' },
66
-                { max: 6, message: '通知标题名称不超过6个字符' }
65
+                { required: true, message: '请输入姓名' },
66
+                { max: 6, message: '姓名不能超过6个字符' }
67 67
             ]
68 68
         },
69 69
         {
70 70
             label: '性别',
71 71
             name: 'sex',
72 72
             type: FieldTypes.Select,
73
-            value: data.sex === 1 ? '男' : '女',
73
+            value: data.sex != null ? (data.sex === 1 ? '男' : '女') : "",
74 74
             dict: [{
75 75
                 name: '男',
76 76
                 value: '1',
@@ -91,7 +91,7 @@ const header = props => {
91 91
             rules: [
92 92
                 { required: false, message: '请选择头像' },
93 93
             ],
94
-            help: '建议尺寸:Npx*Npx,比例:1:1,格式:jpg,大小:不超过300KB,用于客户查看',
94
+            help: '建议尺寸:100*100px,比例:1:1,格式:jpg,大小:不超过300KB,用于样例列表封面',
95 95
         },
96 96
         {
97 97
             label: '对外头衔',
@@ -150,7 +150,7 @@ const header = props => {
150 150
             value: data.address,
151 151
             rules: [
152 152
                 { required: false, message: '请输入联系地址' },
153
-                { max: 40, message: '邮箱不能超过40个字符' }
153
+                { max: 50, message: '联系地址不能超过50个字符' }
154 154
             ]
155 155
         },
156 156
         {

+ 5
- 5
src/pages/contact/contact/list.jsx Ver arquivo

@@ -12,7 +12,6 @@ function header(props) {
12 12
 
13 13
     const [data, setData] = useState([])
14 14
     const [contactList, setContactList] = useState([])
15
-
16 15
     useEffect(() => {
17 16
         getList({ pageNum: 1, pageSize: 10 });
18 17
     }, [])
@@ -64,7 +63,7 @@ function header(props) {
64 63
         }
65 64
 
66 65
         Modal.confirm({
67
-            title: '确定联系人信息吗',
66
+            title: '确定删除联系人信息吗',
68 67
             okText: '确定',
69 68
             cancelText: '取消',
70 69
             onOk() {
@@ -72,9 +71,10 @@ function header(props) {
72 71
                     message.info("操作成功")
73 72
                     getList({ pageNum: 1, pageSize: 10 });
74 73
                 }).catch((err) => {
75
-                    
74
+
76 75
                 })
77 76
             },
77
+            onCancel() { },
78 78
         });
79 79
     }
80 80
 
@@ -102,7 +102,7 @@ function header(props) {
102 102
             dataIndex: 'sex',
103 103
             key: 'sex',
104 104
             align: 'center',
105
-            render: (sex) => <span>{sex === 1 ? '男' : '女'}</span>,
105
+            render: (sex) => <span>{sex != null ? (sex === 1 ? '男' : '女') : ""}</span>,
106 106
         },
107 107
         {
108 108
             title: '头像',
@@ -205,7 +205,7 @@ function header(props) {
205 205
 
206 206
                 <Button type="primary" className={styles.addBtn} onClick={toDel()} style={{ marginLeft: '30px' }} >删除</Button>
207 207
 
208
-                <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data.records} columns={columns} pagination={false} />
208
+                <Table rowSelection={rowSelection} rowKey={r => r.contactId} dataSource={data.records} columns={columns} pagination={false} />
209 209
 
210 210
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
211 211
                     {<Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} />}

+ 251
- 84
src/pages/resource/openScreen/edit.jsx Ver arquivo

@@ -1,7 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Modal, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
2
+import { Input, DatePicker, Pagination, Search, Modal, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import XForm, { FieldTypes } from '../../../components/XForm';
4
+import XForm, { FieldTypes, createForm } from '../../../components/XForm';
5
+// import XForm, { FieldTypes } from '../../../components/XForm';
6
+import styles from './style.less';
5 7
 import router from 'umi/router';
6 8
 import apis from '../../../services/apis';
7 9
 import request from '../../../utils/request';
@@ -11,101 +13,229 @@ import moment from 'moment';
11 13
 
12 14
 const header = props => {
13 15
 
16
+    const noticeId = props.location.query.id
17
+
14 18
     const [data, setData] = useState({})
19
+    const [sample, setsample] = useState({})
15 20
 
16
-    const [datas, setDatas] = useState([])//表格数据
17 21
     const [visible, setVisible] = useState()
18 22
     const [formsdate, setFormsDate] = useState({})
19 23
     //   const [page, changePage] = useState({})
20 24
     useEffect(() => {
21 25
 
22 26
         setVisible(false)
23
-
27
+        setsample({
28
+            sampleNme : ''
29
+        })
30
+        if (noticeId) {
31
+            console.log(noticeId, 'noticeId')
32
+            getNewsData(noticeId)
33
+        }
24 34
     }, [])
35
+
36
+    const getNewsData = (noticeId) => {
37
+        request({
38
+            ...apis.openScreen.get,
39
+            urlData: { id: noticeId }
40
+        }).then((data) => {
41
+            console.log(data, 'data')
42
+            setData(data)
43
+            setsample({
44
+                sampleId: data.targetId,
45
+                sampleName: data.targetName
46
+            })
47
+        }).catch((err) => {
48
+            message.error(err.msg || err.message)
49
+        })
50
+
51
+    }
52
+
25 53
     const ModalData = props => {
26
-        
27
-    const data = []
54
+        // console.log('data', data.targetId)
55
+        // const targetId = data.targetType
28 56
 
29
-    const columns = [
30
-        {
31
-            title: '样例名',
32
-            dataIndex: 'title',
33
-            key: 'title',
34
-            align: 'center',
35 57
 
36
-        },
37
-        {
38
-            title: '权重',
39
-            dataIndex: 'imgUrl',
40
-            key: 'imgUrl',
41
-            align: 'center',
42
-            
43
-        },
44
-        {
45
-            title: '新增人',
46
-            dataIndex: 'pointPrice',
47
-            key: 'pointPrice',
48
-            align: 'center',
49
-        },
50
-        {
51
-            title: '新增时间',
52
-            dataIndex: 'totalNum',
53
-            key: 'totalNum',
54
-            align: 'center',
55
-        },
56
-        {
57
-            title: '修改人',
58
-            dataIndex: 'status',
59
-            key: 'status',
60
-            align: 'center',
61
-            // render: (status) => <><span>{status == 1 ? '是' : '否'}</span></>
62
-        },
63
-        {
64
-            title: '修改时间',
65
-            dataIndex: 'inventory',
66
-            key: 'inventory',
67
-            align: 'center',
68
-        },
69
-    
70
-        {
71
-            title: '操作',
72
-            dataIndex: 'handle',
73
-            key: 'handle',
74
-            align: 'center',
75
-            render: (x, row) => (
76
-                <>
58
+        const [h5data, setH5data] = useState({})
59
+        const [name, setName] = useState()
77 60
 
61
+        useEffect(() => {
78 62
 
79
-                    <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
80
-                        选择<Icon type="form" className={styles.edit} />
81
-                    </span>
82 63
 
83
-                </>
84
-            ),
85
-        },
86
-    ];
64
+            // console.log(targetType, 'targetType')
65
+            getH5data({ pageNum: 1, pageSize: 10 })
66
+
67
+        }, [])
68
+        // const getList = params => {
69
+        //     request({ ...apis.openScreen.list, params: { ...params } }).then(data => {
70
+        //         setData(data)
71
+        //     })
72
+        // }
73
+        const getH5data = params => {
74
+            request({
75
+                ...apis.openScreen.getSample, params: { ...params }
76
+            }).then((data) => {
77
+                setH5data(data)
78
+            }).catch((err) => {
79
+                message.error(err.msg || err.message)
80
+            })
81
+
82
+        }
83
+
84
+
85
+        const toChoice = (value) => {
86
+
87
+            Modal.confirm({
88
+                title: '是否关联此业务',
89
+                okText: '确定',
90
+                cancelText: '取消',
91
+                onOk() {
92
+                    setsample({
93
+                        sampleId: value.sampleId,
94
+                        sampleName: value.sampleName
95
+                    })
96
+                    message.info("操作成功")
97
+                    setVisible(false)
98
+                },
99
+            });
100
+
101
+            console.log(value, 'value')
102
+
103
+
104
+        }
105
+
106
+        const changePageNum = pageNumber => {
107
+
108
+            getH5data({ pageNum: pageNumber, pageSize: 10, })
109
+        }
110
+
111
+
112
+
113
+        const columns = [
114
+            {
115
+                title: '样例名',
116
+                dataIndex: 'sampleName',
117
+                key: 'sampleName',
118
+                align: 'center',
119
+
120
+            },
121
+            {
122
+                title: '权重',
123
+                dataIndex: 'orderNo',
124
+                key: 'orderNo',
125
+                align: 'center',
126
+
127
+            },
128
+            {
129
+                title: '新增人',
130
+                dataIndex: 'pointPrice',
131
+                key: 'pointPrice',
132
+                align: 'center',
133
+            },
134
+            {
135
+                title: '新增时间',
136
+                dataIndex: 'createDate',
137
+                key: 'createDate',
138
+                align: 'center',
139
+            },
140
+            {
141
+                title: '修改人',
142
+                dataIndex: 'status',
143
+                key: 'status',
144
+                align: 'center',
145
+                // render: (status) => <><span>{status == 1 ? '是' : '否'}</span></>
146
+            },
147
+            {
148
+                title: '修改时间',
149
+                dataIndex: 'inventory',
150
+                key: 'inventory',
151
+                align: 'center',
152
+            },
153
+
154
+            {
155
+                title: '操作',
156
+                dataIndex: 'handle',
157
+                key: 'handle',
158
+                align: 'center',
159
+                render: (x, row) => (
160
+                    <>
161
+
162
+
163
+                        <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={e => toChoice(row)}>
164
+                            选择<Icon type="form" />
165
+                        </span>
166
+                        {/* className={styles.edit} */}
167
+                    </>
168
+                ),
169
+            },
170
+        ];
171
+
172
+        const getname = value => {
173
+            console.log(value.value, '44')
174
+            setName(value)
175
+            // setH5data({ pageNum: 1, pageSize: 10,sampleName:value })
176
+        }
177
+
178
+
179
+        const handleSubmitName = (e, props) => {
180
+            e.preventDefault();
181
+            getH5data({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
182
+        }
183
+
184
+        function handleReset() {
185
+            props.form.resetFields();
186
+            getH5data({ pageNum: 1, pageSize: 10 });
187
+        }
188
+
189
+        const { getFieldDecorator } = props.form
87 190
         return (
88 191
             <>
89 192
                 <div>
90
-                <Input placeholder="样例名" style={{ width: 200 }} />
91
-                <Button>搜索</Button><Button>重置</Button>
92
-                <Table  rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
193
+                    <Form layout="inline" onSubmit={e => handleSubmitName(e, props)}>
194
+                        <Form.Item>
195
+                            {getFieldDecorator('sampleName')(
196
+                                <Input
197
+                                    prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
198
+                                    placeholder="样例名"
199
+                                />,
200
+                            )}
201
+                        </Form.Item>
202
+                        <Form.Item>
203
+                            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
204
+                                搜索
205
+                            </Button>
206
+                            {/*  */}
207
+                            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
208
+                                重置
209
+                              </Button>
210
+                        </Form.Item>
211
+                    </Form>
212
+                    <Table rowKey="H5List" dataSource={h5data.records || []} columns={columns} pagination={false} />
213
+                    <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
214
+                        <Pagination showQuickJumper defaultCurrent={1} total={h5data.total} onChange={e => changePageNum(e)} current={h5data.current} />
215
+                    </div>
93 216
                 </div>
94 217
             </>
95 218
         )
96 219
     }
97
-
220
+    const ModalDatas = Form.create({ name: 'ModalData' })(ModalData);
98 221
     const onSelectBusiness = (e) => {
99 222
         console.log('11111')
100 223
 
101 224
     }
102 225
 
226
+    const handleChange = (value) => { }
227
+
228
+    function disabledDate(current) {
229
+        // Can not select days before today and today
230
+        return current && current < moment().endOf('day');
231
+    }
232
+
103 233
     const fields = [
104 234
         {
105 235
             label: '通知标题',
106
-            name: 'channelProxyName',
236
+            name: 'title',
107 237
             type: FieldTypes.Text,
108
-            value: data.channelProxyName,
238
+            value: data.title,
109 239
             rules: [
110 240
                 { required: true, message: '请输入通知标题' },
111 241
                 { max: 20, message: '通知标题名称不超过20个字符' }
@@ -113,9 +243,9 @@ const header = props => {
113 243
         },
114 244
         {
115 245
             label: '通知图',
116
-            name: 'channelImg',
246
+            name: 'noticeImg',
117 247
             type: FieldTypes.ImageUploader,
118
-            value: data.channelImg,
248
+            value: data.noticeImg,
119 249
             rules: [
120 250
                 { required: true, message: '请选择通知图' },
121 251
             ],
@@ -123,23 +253,40 @@ const header = props => {
123 253
         },
124 254
         {
125 255
             label: '关联业务类型',
126
-            name: 'channelContactName',
127
-
128
-            value: data.channelContactName,
256
+            name: 'targetType',
129 257
             type: FieldTypes.Select,
130
-
258
+            dict: [{
259
+                name: "H5",
260
+                value: "H5"
261
+            },
262
+            ],
263
+            value: data.targetType,
131 264
         },
132 265
         {
133 266
             label: '关联业务',
134
-            name: 'channelTel',
135
-            value: data.channelTel,
267
+            name: 'targetName',
268
+            // value: data.targetId,
136 269
             //   type: FieldTypes.Text,
137
-            render: (text, record) => <div style={{ display:'flex' }}><div onClick={handleShowModel}>选择关联业务</div><div>234</div></div>,
270
+        render: <div onClick={e => handleShowModel(data.targetId)}>{sample.sampleName || '选择关联业务'}{console.log(sample,'13')}</div>,
138 271
         },
139 272
         {
140 273
             label: '发布状态',
141
-            name: 'userName',
142
-            type: FieldTypes.Text,
274
+            type: FieldTypes.Select,
275
+            name: 'status',
276
+            dict: [{
277
+                name: "删除",
278
+                value: "-1"
279
+            },
280
+            {
281
+                name: "已下架",
282
+                value: "0"
283
+            },
284
+            {
285
+                name: "已上架",
286
+                value: "1"
287
+            },],
288
+            value: data.status === undefined ? null : data.status + "",
289
+
143 290
             rules: [
144 291
                 { required: true, message: '请选择有效发布状态' },
145 292
             ],
@@ -147,18 +294,19 @@ const header = props => {
147 294
         },
148 295
         {
149 296
             label: '自动下架时间',
150
-            name: 'expireDate',
151
-            type: FieldTypes.DatePicker,
152
-            value: data.expireDate != null ? moment(data.expireDate, 'YYYY-MM-DD') : null,
297
+            name: 'invalidTime',
298
+            render: (text, record) => <DatePicker disabledDate={disabledDate}></DatePicker>,
299
+            // type: FieldTypes.DatePicker,
300
+            value: data.invalidTime != null ? moment(data.invalidTime, 'YYYY-MM-DD') : null,
153 301
 
154 302
             help: '下架时间仅支持未来时间,到达未来时间后系统自动将开屏通知发布状态修改为否'
155 303
 
156 304
         },
157 305
         {
158 306
             label: '权重',
159
-            name: 'appMaxNum',
307
+            name: 'orderNo',
160 308
             type: FieldTypes.Number,
161
-            value: data.appMaxNum,
309
+            value: data.orderNo,
162 310
 
163 311
             help: '用于列表排序,越大越靠前'
164 312
         },
@@ -166,6 +314,25 @@ const header = props => {
166 314
 
167 315
     const handleSubmit = (values) => {
168 316
 
317
+        values.targetId = sample.sampleId
318
+        values.sampleName = sample.sampleName
319
+        if (noticeId) {
320
+            values.noticeId = noticeId
321
+            request({ ...apis.openScreen.put, urlData: { id: noticeId }, data: { ...values } }).then((data) => {
322
+                cancelPage();
323
+            }).catch((err) => {
324
+                message.error(err.msg || err.message)
325
+            })
326
+        } else {
327
+            request({ ...apis.openScreen.post, data: { ...values } }).then((data) => {
328
+                console.log('success')
329
+                cancelPage();
330
+            }).catch((err) => {
331
+                message.error(err.msg || err.message)
332
+            })
333
+        }
334
+
335
+
169 336
     }
170 337
     //model
171 338
     const handleShowModel = val => {
@@ -178,7 +345,7 @@ const header = props => {
178 345
 
179 346
     const cancelPage = () => {
180 347
         router.push({
181
-            pathname: '/resource/pathname',
348
+            pathname: '/resource/openScreen',
182 349
         });
183 350
     }
184 351
 
@@ -194,7 +361,7 @@ const header = props => {
194 361
                     onCancel={handleCancel}
195 362
                     footer={null}
196 363
                 >
197
-                    <ModalData></ModalData>
364
+                    <ModalDatas></ModalDatas>
198 365
                     {/* <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} /> */}
199 366
                 </Modal>
200 367
             </div>

+ 71
- 56
src/pages/resource/openScreen/index.jsx Ver arquivo

@@ -9,43 +9,44 @@ import request from '../../../utils/request';
9 9
 import AuthButton from '@/components/AuthButton';
10 10
 
11 11
 function header(props) {
12
-
13
-    const [houseIdList, setHouseIdList] = useState([])
12
+    
13
+    const [taNoticeList, setTaNoticeList] = useState([])
14
+    const [ data, setData ] = useState({})
14 15
 
15 16
     useEffect(() => {
16 17
         getList({ pageNum: 1, pageSize: 10 });
17 18
     }, [])
18 19
     // 查询列表
20
+    // /api/admin/listNoticeByCondition
19 21
     const getList = params => {
20
-        // request({ ...apis.house.taSalesBatch, params: { ...params } }).then(data => {
21
-        //     console.log(data)
22
-        //     setData(data)
23
-        // })
22
+        request({ ...apis.openScreen.list, params: { ...params } }).then(data => {
23
+            setData(data)
24
+        })
24 25
     }
25 26
 
26 27
     const toEditResource = (id) => () => {
27 28
         router.push({
28
-          pathname: '/resource/openScreen/edit',
29
-        //   query: {
30
-        //     id
31
-        //   },
29
+            pathname: '/resource/openScreen/edit',
30
+              query: {
31
+                id
32
+              },
32 33
         });
33
-      }
34
+    }
34 35
 
35 36
     const handleSubmit = (e, props) => {
36 37
         e.preventDefault();
37
-
38
+        getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
38 39
     }
39 40
 
40 41
     function handleReset() {
41 42
         props.form.resetFields();
42
-        // getList({ pageNum: 1, pageSize: 10 });
43
+        getList({ pageNum: 1, pageSize: 10 });
43 44
     }
44 45
 
45 46
     const toDelBatch = rowData => () => {
46
-        console.log(houseIdList, 'houseIdListhouseIdList')
47
-        if (houseIdList.length < 1) {
48
-            openNotificationWithIcon('error', '请先选择需要删除的批次')
47
+        console.log(taNoticeList, 'taNoticeList')
48
+        if (taNoticeList.length < 1) {
49
+            // openNotificationWithIcon('error', '请先选择需要删除的批次')
49 50
             return
50 51
         }
51 52
 
@@ -54,27 +55,22 @@ function header(props) {
54 55
             okText: '确定',
55 56
             cancelText: '取消',
56 57
             onOk() {
57
-                // request({ ...apis.house.deleteTaSalesBatch, data: houseIdList, }).then((data) => {
58
-                //   message.info("操作成功")
59
-                //   getList({ pageNum: 1, pageSize: 10 });
60
-                // }).catch((err) => {
61
-                // })
58
+                request({ ...apis.openScreen.delete, data: taNoticeList, }).then((data) => {
59
+                  message.info("操作成功")
60
+                  getList({ pageNum: 1, pageSize: 10 });
61
+               
62
+                //   setHouseIdList([])
63
+                }).catch((err) => {
64
+                })
62 65
             },
63 66
         });
64 67
     }
65 68
 
66
-    const rowSelection = {
67
-        onChange: (selectedRowKeys, selectedRows) => {
68
-            console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
69
-            setHouseIdList(selectedRows)
70
-        },
71
-    };
72
-
73 69
     const changePageNum = pageNumber => {
74
-        // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
70
+        getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
75 71
     }
76 72
 
77
-    const data = []
73
+    // const data = []
78 74
 
79 75
     const columns = [
80 76
         {
@@ -86,21 +82,21 @@ function header(props) {
86 82
         },
87 83
         {
88 84
             title: '通知图',
89
-            dataIndex: 'imgUrl',
90
-            key: 'imgUrl',
85
+            dataIndex: 'noticeImg',
86
+            key: 'noticeImg',
91 87
             align: 'center',
92
-            render: (text, record) => <img src={record.imgUrl} className={styles.touxiang} />,
88
+            render: (text, record) => <img src={record.noticeImg} className={styles.touxiang} />,
93 89
         },
94 90
         {
95 91
             title: '关联业务类型',
96
-            dataIndex: 'pointPrice',
97
-            key: 'pointPrice',
92
+            dataIndex: 'targetType',
93
+            key: 'targetType',
98 94
             align: 'center',
99 95
         },
100 96
         {
101 97
             title: '关联业务',
102
-            dataIndex: 'totalNum',
103
-            key: 'totalNum',
98
+            dataIndex: 'targetName',
99
+            key: 'targetName',
104 100
             align: 'center',
105 101
         },
106 102
         {
@@ -108,25 +104,25 @@ function header(props) {
108 104
             dataIndex: 'status',
109 105
             key: 'status',
110 106
             align: 'center',
111
-            // render: (status) => <><span>{status == 1 ? '是' : '否'}</span></>
107
+            render: (status) => <><span>{status === 1 ? '已上架' : status === 0 ? '已下架':'删除'}</span></>
112 108
         },
113 109
         {
114 110
             title: '自动下架时间',
115
-            dataIndex: 'inventory',
116
-            key: 'inventory',
111
+            dataIndex: 'invalidTime',
112
+            key: 'invalidTime',
117 113
             align: 'center',
118 114
         },
119 115
         {
120 116
             title: '权重',
121
-            dataIndex: 'status',
122
-            key: 'status',
117
+            dataIndex: 'orderNo',
118
+            key: 'orderNo',
123 119
             align: 'center',
124 120
 
125 121
         },
126 122
         {
127 123
             title: '新增时间',
128
-            dataIndex: 'inventory',
129
-            key: 'inventory',
124
+            dataIndex: 'createDate',
125
+            key: 'createDate',
130 126
             align: 'center',
131 127
         },
132 128
         {
@@ -138,7 +134,7 @@ function header(props) {
138 134
                 <>
139 135
 
140 136
 
141
-                    <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
137
+                    <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditResource(row.noticeId)}>
142 138
                         编辑<Icon type="form" className={styles.edit} />
143 139
                     </span>
144 140
 
@@ -147,14 +143,28 @@ function header(props) {
147 143
         },
148 144
     ];
149 145
 
146
+    // const onSelectChange = (selectedRowKeys, selectedRows) => {
147
+    //     console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
148
+    //     setTaNoticeList(selectedRows)
149
+    //     // this.setState({ selectedRowKeys });
150
+    //   };
151
+
150 152
     const { getFieldDecorator } = props.form
153
+
154
+    const rowSelection = {
155
+        onChange: (selectedRowKeys, selectedRows) => {
156
+          console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
157
+          setTaNoticeList(selectedRows)
158
+        },
159
+      };
160
+ 
151 161
     return (
152 162
 
153 163
         <>
154 164
             <div>
155 165
                 <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
156 166
                     <Form.Item>
157
-                        {getFieldDecorator('goodsName')(
167
+                        {getFieldDecorator('title')(
158 168
                             <Input
159 169
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
160 170
                                 placeholder="通知标题"
@@ -162,9 +172,9 @@ function header(props) {
162 172
                         )}
163 173
                     </Form.Item>
164 174
                     <Form.Item>
165
-                        {getFieldDecorator('status')(
175
+                        {getFieldDecorator('targetType')(
166 176
                             <Select style={{ width: '180px' }} placeholder="关联业务类型">
167
-
177
+                                   <Option value='H5'>H5</Option>
168 178
                             </Select>,
169 179
                         )}
170 180
                     </Form.Item>
@@ -178,11 +188,16 @@ function header(props) {
178 188
                         )}
179 189
                     </Form.Item>
180 190
                     <Form.Item>
181
-                        {getFieldDecorator('qbc')(
182
-                            <Input
183
-                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
184
-                                placeholder="发布状态"
185
-                            />,
191
+                        {getFieldDecorator('status')(
192
+
193
+                            <Select style={{ width: '180px' }} placeholder="发布状态">
194
+                                 <Option value="">全部</Option>
195
+                                <Option value="-1">删除</Option>
196
+                                <Option value="0">未发布</Option>
197
+                                <Option value="1">已发布</Option>
198
+
199
+                            </Select>,
200
+
186 201
                         )}
187 202
                     </Form.Item>
188 203
                     <Form.Item>
@@ -201,10 +216,10 @@ function header(props) {
201 216
 
202 217
                 <Button type="primary" className={styles.addBtn} onClick={toDelBatch()} style={{ marginLeft: '30px' }} >删除</Button>
203 218
 
204
-                <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
205
-
219
+                <Table id='noticeTable' rowSelection={rowSelection} rowKey={r => r.noticeId} dataSource={data.records} columns={columns} pagination={false} />
220
+                {/* selectedRowKeys */}
206 221
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
207
-                    {/* <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} /> */}
222
+                    <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} />
208 223
                 </div>
209 224
             </div>
210 225
         </>

+ 37
- 0
src/services/apis.js Ver arquivo

@@ -123,6 +123,43 @@ const apis = {
123 123
       action: 'center',
124 124
     },
125 125
   },
126
+  openScreen: {
127
+    list: {
128
+      url: `${prefix}/listNoticeByCondition`,
129
+      method: 'GET',
130
+      action: 'channel',
131
+    },
132
+    post: {
133
+      url: `${prefix}/taNotice`,
134
+      method: 'post',
135
+      action: 'channel',
136
+    },
137
+    // /api/admin/taNotice/{id}
138
+    put: {
139
+      url: `${prefix}/taNotice/:id`,
140
+      method: 'put',
141
+      action: 'channel',
142
+    },
143
+
144
+   
145
+    get:{
146
+      url: `${prefix}/taNotice/:id`,
147
+      method: 'GET',
148
+      action: 'channel',
149
+    },
150
+    delete:{
151
+      url: `${prefix}/taNotice/batchDelete`,
152
+      method: 'put',
153
+      action: 'channel',
154
+    },
155
+    getSample:{
156
+      url: `${prefix}/ListH5SampleByCondition`,
157
+      method: 'GET',
158
+      action: 'channel',
159
+    }
160
+    // /api/admin/ListH5SampleByCondition
161
+  },
162
+  
126 163
   contact:{
127 164
     listContactByCondition: {
128 165
       url: `${prefix}/listContactByCondition`,