zhoulisen 5 anni fa
parent
commit
7bd6f2cc10
2 ha cambiato i file con 229 aggiunte e 3 eliminazioni
  1. 181
    3
      src/pages/resource/index.jsx
  2. 48
    0
      src/pages/resource/style.less

+ 181
- 3
src/pages/resource/index.jsx Vedi File

@@ -1,19 +1,197 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal,Breadcrumb } from 'antd';
3 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';
4 10
 
5
-function WrappedHeader(props) {
11
+function header(props) {
6 12
 
13
+    const [houseIdList, setHouseIdList] = useState([])
7 14
 
15
+    const handleSubmit = (e, props) => {
16
+        e.preventDefault();
17
+       
18
+      }
8 19
 
9
-  
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
10 136
   return (
11 137
 
12 138
     <>
13
-   <div>123</div>
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>
14 191
     </>
15 192
   )
16 193
 }
17 194
 
195
+const WrappedHeader = Form.create({ name: 'header' })(header);
18 196
 
19 197
 export default WrappedHeader

+ 48
- 0
src/pages/resource/style.less Vedi File

@@ -0,0 +1,48 @@
1
+.addBtn {
2
+    padding: 0 40px;
3
+    height: 36px;
4
+    margin: 30px 0;
5
+  }
6
+  
7
+  .touxiang {
8
+    width: 93px;
9
+    height: 93px;
10
+  }
11
+  
12
+  .imgPerfect {
13
+    width: 120px;
14
+    height: 40px;
15
+  }
16
+  
17
+  .imgIndex {
18
+    width: 150px;
19
+    height: 92.7px;
20
+  }
21
+  
22
+  .imgSmall {
23
+    width: 128px;
24
+    height: 192px;
25
+  }
26
+  
27
+  .propaganda {
28
+    width: 240px;
29
+    height: 60px;
30
+  }
31
+  
32
+  .ant-table-column-title {
33
+    font-weight: 600;
34
+  }
35
+  
36
+  .shoppingCart {
37
+    // color: #dcdcdc;
38
+    color: #bebebe;
39
+    margin-left: 6px;
40
+    font-size: 16px;
41
+  }
42
+  
43
+  .edit {
44
+    // color: #dcdcdc;
45
+    color: #bebebe;
46
+    margin-left: 6px;
47
+    font-size: 15px;
48
+  }