Browse Source

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

傅行帆 5 years ago
parent
commit
df1a36bc66

+ 1
- 1
config/config.js View File

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

+ 16
- 2
config/routes.js View File

@@ -64,9 +64,23 @@ export default [
64 64
           },
65 65
           {
66 66
             path: '/resource',
67
-            name: '资源管理',
68
-            component: './resource',
67
+            name: '资源位管理',
68
+            component: '../layouts/BlankLayout',
69
+            routes: [
70
+              {
71
+                path: '/resource/openScreen',
72
+                name: '开屏通知',
73
+                component: './resource/openScreen',
74
+              },
75
+              {
76
+                path: '/resource/openScreen/edit',
77
+                name: '开屏通知修改',
78
+                hideInMenu: true,
79
+                component: './resource/openScreen/edit',
80
+              },
81
+            ],
69 82
           },
83
+          
70 84
           {
71 85
             component: './404',
72 86
           },

+ 0
- 197
src/pages/resource/index.jsx View File

@@ -1,197 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal,Breadcrumb } from 'antd';
4
-import router from 'umi/router';
5
-import moment from 'moment';
6
-import styles from './style.less';
7
-import { fetch, apis } from '../../utils/request';
8
-import request from '../../utils/request';
9
-import AuthButton from '@/components/AuthButton';
10
-
11
-function header(props) {
12
-
13
-    const [houseIdList, setHouseIdList] = useState([])
14
-
15
-    const handleSubmit = (e, props) => {
16
-        e.preventDefault();
17
-       
18
-      }
19
-
20
-      function handleReset() {
21
-        props.form.resetFields();
22
-        // getList({ pageNum: 1, pageSize: 10 });
23
-      }
24
-
25
-      const toEditGoods = (goodsId) => () => {
26
-        // router.push({
27
-        //   pathname: '/integralMall/editGoods',
28
-        //   query: {
29
-        //     goodsId
30
-        //   },
31
-        // });
32
-      }
33
-
34
-      const toDelBatch = rowData => () =>{
35
-        console.log(houseIdList, 'houseIdListhouseIdList')
36
-        if(houseIdList.length < 1){
37
-          openNotificationWithIcon('error', '请先选择需要删除的批次')
38
-          return
39
-        }
40
-    
41
-        Modal.confirm({
42
-          title: '确定删除批次信息吗',
43
-          okText: '确定',
44
-          cancelText: '取消',
45
-          onOk () {
46
-            // request({ ...apis.house.deleteTaSalesBatch, data: houseIdList, }).then((data) => {
47
-            //   message.info("操作成功")
48
-            //   getList({ pageNum: 1, pageSize: 10 });
49
-            // }).catch((err) => {
50
-            // })
51
-          },
52
-        });
53
-      }
54
-
55
-      const rowSelection = {
56
-        onChange: (selectedRowKeys, selectedRows) => {
57
-          console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
58
-          setHouseIdList(selectedRows)
59
-        },
60
-      };
61
-
62
-      const data =[]
63
-
64
-      const columns = [
65
-        {
66
-          title: '通知标题',
67
-          dataIndex: 'title',
68
-          key: 'title',
69
-          align: 'center',
70
-          render: (text, record) => <img src={record.imgUrl} className={styles.touxiang} />,
71
-        },
72
-        {
73
-          title: '通知图',
74
-          dataIndex: 'imgUrl',
75
-          key: 'imgUrl',
76
-          align: 'center',
77
-    
78
-        },
79
-        {
80
-          title: '关联业务类型',
81
-          dataIndex: 'pointPrice',
82
-          key: 'pointPrice',
83
-          align: 'center',
84
-        },
85
-        {
86
-          title: '关联业务',
87
-          dataIndex: 'totalNum',
88
-          key: 'totalNum',
89
-          align: 'center',
90
-        },
91
-        {
92
-          title: '发布状态',
93
-          dataIndex: 'status',
94
-          key: 'status',
95
-          align: 'center',
96
-        //   render: (status)=> <><span>{status == 1 ? '是' : '否'}</span></>
97
-        },
98
-        {
99
-          title: '自动下架时间',
100
-          dataIndex: 'inventory',
101
-          key: 'inventory',
102
-          align: 'center',
103
-        },
104
-        {
105
-          title: '权重',
106
-          dataIndex: 'status',
107
-          key: 'status',
108
-          align: 'center',
109
-         
110
-        },
111
-        {
112
-            title: '新增时间',
113
-            dataIndex: 'inventory',
114
-            key: 'inventory',
115
-            align: 'center',
116
-          },
117
-        {
118
-          title: '操作',
119
-          dataIndex: 'handle',
120
-          key: 'handle',
121
-          align: 'center',
122
-          render: (x, row) => (
123
-            <>
124
-              
125
-            
126
-                <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
127
-                  编辑<Icon type="form" className={styles.edit} />
128
-                </span>
129
-              
130
-            </>
131
-          ),
132
-        },
133
-      ];
134
-
135
-    const { getFieldDecorator } = props.form
136
-  return (
137
-
138
-    <>
139
-   <div>
140
-   <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
141
-        <Form.Item>
142
-          {getFieldDecorator('goodsName')(
143
-            <Input
144
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
145
-              placeholder="通知标题"
146
-            />,
147
-          )}
148
-        </Form.Item>
149
-        <Form.Item>
150
-          {getFieldDecorator('status')(
151
-            <Select style={{ width: '180px' }} placeholder="关联业务类型">
152
-             
153
-            </Select>,
154
-          )}
155
-        </Form.Item>
156
-       
157
-        <Form.Item>
158
-          {getFieldDecorator('priceLesser')(
159
-            <Input
160
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
161
-              placeholder="关联业务"
162
-            />,
163
-          )}
164
-        </Form.Item>
165
-        <Form.Item>
166
-          {getFieldDecorator('qbc')(
167
-            <Input
168
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
169
-              placeholder="发布状态"
170
-            />,
171
-          )}
172
-           </Form.Item>
173
-        <Form.Item>
174
-          
175
-              <Button type="primary" htmlType="submit" className={styles.searchBtn}>
176
-                搜索
177
-              </Button>
178
-         {/*  */}
179
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
180
-              重置
181
-            </Button>
182
-        </Form.Item>
183
-      </Form>
184
-
185
-      <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
186
-
187
-      <Button type="danger" className={styles.addBtn} onClick={toDelBatch()} style={{marginLeft:'30px'}} >删除</Button>
188
-
189
-      <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
190
-   </div>
191
-    </>
192
-  )
193
-}
194
-
195
-const WrappedHeader = Form.create({ name: 'header' })(header);
196
-
197
-export default WrappedHeader

+ 206
- 0
src/pages/resource/openScreen/edit.jsx View File

@@ -0,0 +1,206 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Modal, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import XForm, { FieldTypes } from '../../../components/XForm';
5
+import router from 'umi/router';
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request';
8
+import moment from 'moment';
9
+
10
+
11
+
12
+const header = props => {
13
+
14
+    const [data, setData] = useState({})
15
+
16
+    const [datas, setDatas] = useState([])//表格数据
17
+    const [visible, setVisible] = useState()
18
+    const [formsdate, setFormsDate] = useState({})
19
+    //   const [page, changePage] = useState({})
20
+    useEffect(() => {
21
+
22
+        setVisible(false)
23
+
24
+    }, [])
25
+    const ModalData = props => {
26
+        
27
+    const data = []
28
+
29
+    const columns = [
30
+        {
31
+            title: '样例名',
32
+            dataIndex: 'title',
33
+            key: 'title',
34
+            align: 'center',
35
+
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
+                <>
77
+
78
+
79
+                    <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
80
+                        选择<Icon type="form" className={styles.edit} />
81
+                    </span>
82
+
83
+                </>
84
+            ),
85
+        },
86
+    ];
87
+        return (
88
+            <>
89
+                <div>
90
+                <Input placeholder="样例名" style={{ width: 200 }} />
91
+                <Button>搜索</Button><Button>重置</Button>
92
+                <Table  rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
93
+                </div>
94
+            </>
95
+        )
96
+    }
97
+
98
+    const onSelectBusiness = (e) => {
99
+        console.log('11111')
100
+
101
+    }
102
+
103
+    const fields = [
104
+        {
105
+            label: '通知标题',
106
+            name: 'channelProxyName',
107
+            type: FieldTypes.Text,
108
+            value: data.channelProxyName,
109
+            rules: [
110
+                { required: true, message: '请输入通知标题' },
111
+                { max: 20, message: '通知标题名称不超过20个字符' }
112
+            ]
113
+        },
114
+        {
115
+            label: '通知图',
116
+            name: 'channelImg',
117
+            type: FieldTypes.ImageUploader,
118
+            value: data.channelImg,
119
+            rules: [
120
+                { required: true, message: '请选择通知图' },
121
+            ],
122
+            help: '建议尺寸:N*N px,比例:N:N,格式:jpg,大小:不超过300KB,用于开屏通知主图',
123
+        },
124
+        {
125
+            label: '关联业务类型',
126
+            name: 'channelContactName',
127
+
128
+            value: data.channelContactName,
129
+            type: FieldTypes.Select,
130
+
131
+        },
132
+        {
133
+            label: '关联业务',
134
+            name: 'channelTel',
135
+            value: data.channelTel,
136
+            //   type: FieldTypes.Text,
137
+            render: (text, record) => <div style={{ display:'flex' }}><div onClick={handleShowModel}>选择关联业务</div><div>234</div></div>,
138
+        },
139
+        {
140
+            label: '发布状态',
141
+            name: 'userName',
142
+            type: FieldTypes.Text,
143
+            rules: [
144
+                { required: true, message: '请选择有效发布状态' },
145
+            ],
146
+
147
+        },
148
+        {
149
+            label: '自动下架时间',
150
+            name: 'expireDate',
151
+            type: FieldTypes.DatePicker,
152
+            value: data.expireDate != null ? moment(data.expireDate, 'YYYY-MM-DD') : null,
153
+
154
+            help: '下架时间仅支持未来时间,到达未来时间后系统自动将开屏通知发布状态修改为否'
155
+
156
+        },
157
+        {
158
+            label: '权重',
159
+            name: 'appMaxNum',
160
+            type: FieldTypes.Number,
161
+            value: data.appMaxNum,
162
+
163
+            help: '用于列表排序,越大越靠前'
164
+        },
165
+    ]
166
+
167
+    const handleSubmit = (values) => {
168
+
169
+    }
170
+    //model
171
+    const handleShowModel = val => {
172
+        setVisible(true);
173
+    }
174
+
175
+    const handleCancel = val => {
176
+        setVisible(false);
177
+    }
178
+
179
+    const cancelPage = () => {
180
+        router.push({
181
+            pathname: '/resource/pathname',
182
+        });
183
+    }
184
+
185
+    return (
186
+        <>
187
+            <div>
188
+                <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
189
+                <Modal
190
+                    title="选择关联业务"
191
+                    visible={visible}
192
+                    //  onOk={handleOk}
193
+
194
+                    onCancel={handleCancel}
195
+                    footer={null}
196
+                >
197
+                    <ModalData></ModalData>
198
+                    {/* <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} /> */}
199
+                </Modal>
200
+            </div>
201
+        </>
202
+    )
203
+}
204
+
205
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
206
+export default WrappedNormalLoginForm

+ 216
- 0
src/pages/resource/openScreen/index.jsx View File

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

src/pages/resource/style.less → src/pages/resource/openScreen/style.less View File