zhoulisen 5 anos atrás
pai
commit
2e07c5245d

+ 11
- 4
src/pages/qrcode/qrcodelist/add.jsx Ver arquivo

@@ -32,7 +32,7 @@ const header = props => {
32 32
             router.go(-1)
33 33
         }).catch(err => {
34 34
             console.log(err)
35
-            message.info(err.msg || err.message)
35
+            // message.info(err.msg || err.message)
36 36
         })
37 37
     }
38 38
 
@@ -58,8 +58,15 @@ const header = props => {
58 58
     function onChange(checked) {
59 59
         console.log(`switch to ${checked}`);
60 60
         setVisible(checked)
61
-    }
61
+        props.form.resetFields(['targetName', 'targetType', []]);
62
+        // props.form.resetFields([targetName, targetType])
63
+        // props.form.setFieldsValue({
64
+        //     targetName: '',
65
+        //     targetType: '',
66
+        // });
67
+        setTargetType()
62 68
 
69
+    }
63 70
     // QrcodeType
64 71
     function onTtypeChange(values) {
65 72
         console.log(`onTtypeChange to ${values}`);
@@ -118,7 +125,7 @@ const header = props => {
118 125
                 {targetType === 'project' && <div>
119 126
                     {getFieldDecorator('targetName')}
120 127
                 </div>}
121
-                <Form.Item label="是否关联项目">
128
+                <Form.Item label="关联渠道">
122 129
                     {getFieldDecorator('channelId')(
123 130
                         <ChannelSelect />,
124 131
                     )}
@@ -127,7 +134,7 @@ const header = props => {
127 134
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
128 135
                     <div style={{ width: '190px' }}>
129 136
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">立即生成</Button>
130
-                        <Button onClick={() => router.go(-1)} htmlType="submit">取消</Button>
137
+                        <Button onClick={() => router.go(-1)} >取消</Button>
131 138
                     </div>
132 139
                 </Form.Item>
133 140
             </Form>

+ 12
- 1
src/pages/qrcode/qrcodelist/table/index.jsx Ver arquivo

@@ -34,6 +34,7 @@ const table = props => {
34 34
         title: '访问时间',
35 35
         dataIndex: 'visitTime',
36 36
         key: 'visitTime',
37
+        align: 'center',
37 38
         render: (x, row) => <><span>{`${moment(row.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
38 39
     }
39 40
 
@@ -41,12 +42,14 @@ const table = props => {
41 42
         title: '访问次数',
42 43
         dataIndex: 'accessCount',
43 44
         key: 'accessCount',
45
+        align: 'center',
44 46
     }
45 47
 
46 48
     const newuser = {
47 49
         title: '注册时间',
48 50
         dataIndex: 'registerTime',
49 51
         key: 'registerTime',
52
+        align: 'center',
50 53
         render: (x, row) => <><span>{`${moment(row.registerTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
51 54
     }
52 55
 
@@ -55,16 +58,22 @@ const table = props => {
55 58
             title: '姓名',
56 59
             dataIndex: 'userName',
57 60
             key: 'userName',
61
+            align: 'center',
62
+            width: '20%',
58 63
         },
59 64
         {
60 65
             title: '电话',
61 66
             dataIndex: 'userTel',
62 67
             key: 'userTel',
68
+            align: 'center',
69
+            width: '20%',
63 70
         },
64 71
         {
65 72
             title: '性别',
66 73
             dataIndex: 'sex',
67 74
             key: 'sex',
75
+            align: 'center',
76
+            width: '20%',
68 77
             // eslint-disable-next-line no-nested-ternary
69 78
             render: x => <><span>{x === 1 ? '男' : x === 2 ? '女' : '未知'}</span></>,
70 79
         },
@@ -72,6 +81,8 @@ const table = props => {
72 81
             title: '归属地',
73 82
             dataIndex: 'city',
74 83
             key: 'city',
84
+            align: 'center',
85
+            width: '20%',
75 86
         },
76 87
         // eslint-disable-next-line no-nested-ternary
77 88
         type === '1' ? visitors : type === '2' ? visitNum : newuser,
@@ -79,7 +90,7 @@ const table = props => {
79 90
 
80 91
 
81 92
     const changePageNum = pageNumber => {
82
-        getList({ pageNum: pageNumber, pageSize: 10 })
93
+        getList({ pageNum: pageNumber, pageSize: 10, qrCodeId: id, type })
83 94
     }
84 95
 
85 96
     // 下载文档