zhoulisen 5 年之前
父節點
當前提交
832dd67c14

+ 19
- 0
config/routes.js 查看文件

@@ -887,6 +887,25 @@ export default [
887 887
               }
888 888
             ],
889 889
           },
890
+          {
891
+            path: '/qrcode',
892
+            name: '二维码管理',
893
+            component: '../layouts/BlankLayout',
894
+            routes: [
895
+              {
896
+                path: '/qrcode/qrcodelist',
897
+                name: '二维码列表',
898
+                component: './qrcode/qrcodelist/index',
899
+              },
900
+           
901
+              {
902
+                path: '/qrcode/qrcodelist/add',
903
+                name: '新增',
904
+                hideInMenu: true,
905
+                component: './qrcode/qrcodelist/add',
906
+              },   
907
+            ],
908
+          },
890 909
           // {
891 910
           //   path: '/miniapp',
892 911
           //   name: '小程序管理',

+ 11
- 9
src/components/SelectButton/channelSelect.jsx 查看文件

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect, useRef } from 'react';
1
+import React, { useState, useEffect, useMemo } from 'react';
2 2
 import { Select } from 'antd';
3 3
 import apis from '../../services/apis';
4 4
 import request from '../../utils/request'
@@ -13,21 +13,22 @@ const { Option } = Select;
13 13
  */
14 14
 const ChannelSelect = props => {
15 15
   const [data, setData] = useState([])
16
-  const [value, setValue] = useState([])
17 16
   useEffect(() => {
18 17
     getChannelSelect();
19 18
   }, [props.value])
20 19
 
20
+  const all = props.all || false
21
+
21 22
 
22 23
   const getChannelSelect = e => {
23 24
     request({ ...apis.channelList.getList, params: { pageNumber: 1, pageSize: 999 } }).then(data => {
24
-        setData(data.channelNmae)
25
-        // 默认选中第一个
25
+      setData(data.channelNmae)
26
+      // 默认选中第一个
26 27
     })
27 28
   }
28 29
 
29 30
   return (
30
-      <Select
31
+    <Select
31 32
       showSearch
32 33
       value={props.value}
33 34
       style={{ width: '250px' }}
@@ -36,10 +37,11 @@ const ChannelSelect = props => {
36 37
       filterOption={(input, option) =>
37 38
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38 39
       }>
39
-          {data.map(Item => (
40
-            <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
41
-          ))}
42
-      </Select>
40
+      {all && <Option key="" value="">全部渠道</Option>}
41
+      {data.map(Item => (
42
+        <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
43
+      ))}
44
+    </Select>
43 45
   )
44 46
 }
45 47
 export default ChannelSelect

+ 0
- 0
src/pages/qrcode/qrcodelist/add.jsx 查看文件


+ 158
- 0
src/pages/qrcode/qrcodelist/index.jsx 查看文件

@@ -0,0 +1,158 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, notification } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import withActions from '@/components/ActionList';
7
+import EditIcon from '@/components/EditIcon';
8
+import Navigate from '@/components/Navigate';
9
+import styles from '../../style/GoodsList.less';
10
+import SelectCity from '../../../components/SelectButton/CitySelect'
11
+import BuildSelect from '@/components/SelectButton/BuildSelect'
12
+import ChannelSelect from '@/components/SelectButton/channelSelect'
13
+import apis from '../../../services/apis';
14
+import request from '../../../utils/request';
15
+
16
+// import RaiseHelpDoc from '../edit/components/RaiseHelpDoc';
17
+
18
+
19
+
20
+const header = props => {
21
+    const [data, setData] = useState()
22
+
23
+
24
+    // 查询列表
25
+    //   const getList = params => {
26
+    //     request({ ...apis.taEcontract.listContractTemplate, params: { ...params } }).then(data => {
27
+    //       console.log(data)
28
+    //       setData(data)
29
+    //     })
30
+    //   }
31
+
32
+    // eslint-disable-next-line react-hooks/rules-of-hooks
33
+    //   useEffect(() => {
34
+    //     getList({ pageNum: 1, pageSize: 10 });
35
+    //   }, [])
36
+
37
+    //   const toAdd = rowData => () => {
38
+    //     router.push({
39
+    //       pathname: '/eContract/template/add',
40
+    //     });
41
+    //   }
42
+
43
+
44
+
45
+    /**
46
+     *
47
+     *
48
+     * @param {*} props
49
+     * @returns
50
+     */
51
+    //   const columns = [
52
+    //     {
53
+    //       title: '合同标题',
54
+    //       dataIndex: 'contractTemplateName',
55
+    //       key: 'contractTemplateName',
56
+    //       align: 'center',
57
+    //       render:  (x, row) => <Navigate onClick={toDetail(row)}>{row.contractTemplateName}</Navigate>,
58
+    //     },
59
+    //     {
60
+    //       title: '新增时间',
61
+    //       dataIndex: 'createDate',
62
+    //       key: 'createDate',
63
+    //       align: 'center',
64
+    //       render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
65
+    //     },
66
+    //     {
67
+    //       title: '操作',
68
+    //       dataIndex: '',
69
+    //       key: '',
70
+    //       align: 'center',
71
+    //       render: withActions((text, record) => [(
72
+    //           <AuthButton name="admin.eContractTemplate.detail.get" noRight={null}>
73
+    //             <EditIcon type="look" text="查看详情" onClick={toDetail(record)}></EditIcon>
74
+    //           </AuthButton>
75
+    //       ),])
76
+    //     },
77
+    //   ];
78
+
79
+
80
+    //   const changePageNum = pageNumber => {
81
+    //     getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
82
+    //   }
83
+
84
+    //   const rowSelection = {
85
+    //     onChange: (selectedRowKeys, selectedRows) => {
86
+    //       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
87
+    //       setContractList(selectedRows)
88
+    //     },
89
+    //   };
90
+
91
+    //   // 提交事件
92
+    //   const handleSubmit = e => {
93
+    //     e.preventDefault();
94
+    //     props.form.validateFields((err, values) => {
95
+    //       if (!err) {      
96
+    //         getList({ pageNum: 1, pageSize: 10, ...values })
97
+    //       }
98
+    //     });
99
+    //   }
100
+
101
+    //   // 重置搜索
102
+    function handleReset() {
103
+        props.form.resetFields();
104
+        // setTime('')
105
+        // getList({ pageNum: 1, pageSize: 10 })
106
+    }
107
+
108
+    const { getFieldDecorator } = props.form
109
+    return (
110
+
111
+        <>
112
+            <div>234</div>
113
+            <Form layout="inline" onSubmit={e => handleSubmit(e)}>
114
+                <Form.Item>
115
+                    {getFieldDecorator('qrcodetype')(
116
+                        <Input
117
+                            placeholder="二维码类型"
118
+                        />,
119
+                    )}
120
+                </Form.Item>
121
+                <Form.Item>
122
+                    {getFieldDecorator('qrcodename')(
123
+                        <Input
124
+                            placeholder="二维码内容"
125
+                        />,
126
+                    )}
127
+                </Form.Item>
128
+                <Form.Item>
129
+                    {getFieldDecorator('channe')(
130
+                        <ChannelSelect all />,
131
+                    )}
132
+                </Form.Item>
133
+                <Form.Item>
134
+                    {getFieldDecorator('build')(
135
+                        <BuildSelect />,
136
+                    )}
137
+                </Form.Item>
138
+                <Form.Item>
139
+                    <Button type="primary" htmlType="submit" className={styles.searchBtn}>搜索</Button>
140
+                    <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
141
+                </Form.Item>
142
+            </Form>
143
+
144
+                <Button type="danger" >新增</Button>
145
+
146
+                <Button type="primary" style={{ marginLeft: '30px' }}>删除</Button>
147
+
148
+            {/* <Table rowSelection={rowSelection}
149
+       dataSource={data.records} columns={columns} pagination={false} rowKey={r => r.contractTemplateId} />
150
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
152
+      </div> */}
153
+        </>
154
+    )
155
+}
156
+const WrappedHeader = Form.create({ name: 'header' })(header);
157
+
158
+export default WrappedHeader