Bläddra i källkod

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

zlisen 3 år sedan
förälder
incheckning
6e02f33b76

+ 1
- 17
config/routes.js Visa fil

27
             path: '/welcome',
27
             path: '/welcome',
28
             name: 'welcome',
28
             name: 'welcome',
29
             icon: 'smile',
29
             icon: 'smile',
30
-            component: './Welcome',
31
-          },
32
-          {
33
-            path: '/admin',
34
-            name: 'admin',
35
-            icon: 'crown',
36
-            component: './Admin',
37
-            authority: ['admin'],
38
-            routes: [
39
-              {
40
-                path: '/admin/sub-page',
41
-                name: 'sub-page',
42
-                icon: 'smile',
43
-                component: './Welcome',
44
-                authority: ['admin'],
45
-              },
46
-            ],
30
+            component: './welcome',
47
           },
31
           },
48
           {
32
           {
49
             path: '/building',
33
             path: '/building',

Binär
src/assets/login/light.png Visa fil


Binär
src/assets/welcome/icon-activity.png Visa fil


Binär
src/assets/welcome/icon-building.png Visa fil


Binär
src/assets/welcome/icon-channel.png Visa fil


Binär
src/assets/welcome/icon-customer.png Visa fil


Binär
src/assets/welcome/icon-kpi.png Visa fil


Binär
src/assets/welcome/icon-report.png Visa fil


+ 0
- 73
src/pages/Welcome.jsx Visa fil

1
-import React, { useEffect } from 'react';
2
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import { Card, Typography, Alert } from 'antd';
5
-import styles from './Welcome.less';
6
-
7
-const CodePreview = ({ children }) => (
8
-  <pre className={styles.pre}>
9
-    <code>
10
-      <Typography.Text copyable>{children}</Typography.Text>
11
-    </code>
12
-  </pre>
13
-);
14
-
15
-export default (props) => {
16
-  // console.log('--------welcome-----', JSON.stringify(props))
17
-  // useEffect(() => {
18
-  //   console.log('------useEffect-------')
19
-  // }, [])
20
-  
21
-  return (
22
-    <PageHeaderWrapper>
23
-      <Card>
24
-        <Alert
25
-          message="umi ui 现已发布,点击右下角 umi 图标即可使用"
26
-          type="success"
27
-          showIcon
28
-          banner
29
-          style={{
30
-            margin: -12,
31
-            marginBottom: 24,
32
-          }}
33
-        />
34
-        <Typography.Text strong>
35
-          <a target="_blank" rel="noopener noreferrer" href="https://pro.ant.design/docs/block">
36
-            <FormattedMessage
37
-              id="app.welcome.link.block-list"
38
-              defaultMessage="基于 block 开发,快速构建标准页面"
39
-            />
40
-          </a>
41
-        </Typography.Text>
42
-        <CodePreview> npm run ui</CodePreview>
43
-        <Typography.Text
44
-          strong
45
-          style={{
46
-            marginBottom: 12,
47
-          }}
48
-        >
49
-          <a
50
-            target="_blank"
51
-            rel="noopener noreferrer"
52
-            href="https://pro.ant.design/docs/available-script#npm-run-fetchblocks"
53
-          >
54
-            <FormattedMessage id="app.welcome.link.fetch-blocks" defaultMessage="获取全部区块" />
55
-          </a>
56
-        </Typography.Text>
57
-        <CodePreview> npm run fetch:blocks</CodePreview>
58
-      </Card>
59
-      <p
60
-        style={{
61
-          textAlign: 'center',
62
-          marginTop: 24,
63
-        }}
64
-      >
65
-        Want to add more pages? Please refer to{' '}
66
-        <a href="https://pro.ant.design/docs/block-cn" target="_blank" rel="noopener noreferrer">
67
-          use block
68
-        </a>
69
-        。
70
-      </p>
71
-    </PageHeaderWrapper>
72
-  )
73
-};

+ 0
- 8
src/pages/Welcome.less Visa fil

1
-@import '~antd/lib/style/themes/default.less';
2
-
3
-.pre {
4
-  margin: 12px 0;
5
-  padding: 12px 20px;
6
-  background: @input-bg;
7
-  box-shadow: @card-shadow;
8
-}

+ 2
- 2
src/pages/staff/Organization/form.jsx Visa fil

180
         <Button type="primary" htmlType="submit" style={{ marginLeft: '80px', marginTop: '30px' }}>
180
         <Button type="primary" htmlType="submit" style={{ marginLeft: '80px', marginTop: '30px' }}>
181
           修改
181
           修改
182
         </Button>
182
         </Button>
183
-        <Button type="danger">
183
+        {/* <Button type="danger">
184
           删除
184
           删除
185
-        </Button>
185
+        </Button> */}
186
       </FormItem>
186
       </FormItem>
187
     </Form>
187
     </Form>
188
   )
188
   )

+ 116
- 64
src/pages/staff/Organization/index.jsx Visa fil

1
 
1
 
2
 import { Row, Col, Card, Tree, Form, TreeSelect, Input, InputNumber, Modal, Button, message } from 'antd'
2
 import { Row, Col, Card, Tree, Form, TreeSelect, Input, InputNumber, Modal, Button, message } from 'antd'
3
+import React, { useState, useEffect } from 'react';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
3
 import moment from 'moment';
6
 import moment from 'moment';
4
-// import React, { useEffect, useState, useCallback,useRef } from 'react';
5
 import TreedataFrom from './form';
7
 import TreedataFrom from './form';
6
-
7
 const { TreeNode, DirectoryTree } = Tree;
8
 const { TreeNode, DirectoryTree } = Tree;
8
 const FormItem = Form.Item;
9
 const FormItem = Form.Item;
9
-
10
-//-----------------------------------
11
-const onAdd = (key) => {
12
-  if (expandedKeys.indexOf(key) === -1) {
13
-    expandedKeyArr.push(key);
14
-  }
15
-  expandedKeys(expandedKeyArr.slice());
16
-  addNode(key, treeData);//添加节点 树形
17
-  setData(treeData.slice());//添加子项
18
-};
19
-//-----------------------------------
20
-const confirm = data => {
21
-  // {...data,isPublish}
22
-  if (data.key !== 0) {
23
-    Modal.confirm({
24
-      title: '确认删除吗?',
25
-      okText: '确认',
26
-      cancelText: '取消',
27
-      onOk() {
28
-        message.error('失败');
29
-
30
-      },
31
-    });
32
-  } else {
33
-    message.error('error')
34
-  }
35
-}
36
-
37
-
38
-// function uuid() {
39
-//   var s = [];
40
-//   var hexDigits = "0123456789";
41
-//   for (var i = 0; i < 18; i++) {
42
-//       s[i] = hexDigits.substr(Math.floor(Math.random() * 1*10), 1);
43
-//   }
44
-
45
-//   var uuid = s.join("");
46
-//   return uuid;
47
-// }
48
-// import moment from 'moment';
49
-
10
+const { Search } = Input;
50
 
11
 
51
 const treeData =
12
 const treeData =
52
   [
13
   [
53
     {
14
     {
54
-      title: '分厂厂长管理',
55
-      key: '0',
15
+      title: 'institutionId',
16
+      name: 'institutionName',
17
+      key: '0-0-0',
56
       selectable: false,
18
       selectable: false,
57
       children: [
19
       children: [
58
-        { title: '郎岩', phone: '15920583224', remark: "", day: "1992-11-13", cardId: '511502199103223189', sex: 1, id: '0212', belon: 1, homeaddres: 1, key: '0-0-0-1' },//这个不行么 你写错了 你那是v4的写法在哪?刚刚那个啊。对
20
+        { name: 'institutionName', phone: '13184013427', remark: "", day: "1991-11-22", cardId: '210203197503102721', sex: 2, id: '4242', belon: 2, homeaddres: 2, key: '0-0-0-1', },
59
         { title: '柯琼彦', phone: '13184013427', remark: "", day: "1991-11-22", cardId: '210203197503102721', sex: 2, id: '4242', belon: 2, homeaddres: 2, key: '0-0-0-2', },
21
         { title: '柯琼彦', phone: '13184013427', remark: "", day: "1991-11-22", cardId: '210203197503102721', sex: 2, id: '4242', belon: 2, homeaddres: 2, key: '0-0-0-2', },
60
       ],
22
       ],
61
     },
23
     },
74
 
36
 
75
 
37
 
76
 
38
 
77
-// const item = this.info.node.key 不是!!!!
39
+// const item = this.info.node.key 
78
 
40
 
79
 class TreeDemo extends React.Component {
41
 class TreeDemo extends React.Component {
80
   formRef = React.createRef();
42
   formRef = React.createRef();
81
 
43
 
82
-
83
   constructor(props) {
44
   constructor(props) {
84
     super(props)
45
     super(props)
85
     this.state = {
46
     this.state = {
86
       expandedKeys: ['0-0-0', '0-0-1'],
47
       expandedKeys: ['0-0-0', '0-0-1'],
87
       autoExpandParent: false,
48
       autoExpandParent: false,
88
       checkedKeys: ['0-0-0'],
49
       checkedKeys: ['0-0-0'],
50
+      searchValue: '',
89
       selectedKeys: [],
51
       selectedKeys: [],
90
       // treeTitle: [info.node.props],
52
       // treeTitle: [info.node.props],
91
       checked: true,
53
       checked: true,
92
-      treeData: treeData
54
+      treeData: [],
55
+      testarr: []
93
     };
56
     };
94
   }
57
   }
95
 
58
 
112
     console.log(valeu);
75
     console.log(valeu);
113
   };
76
   };
114
 
77
 
115
-
78
+  //修改
116
   onChangethis = (value) => {
79
   onChangethis = (value) => {
117
 
80
 
118
     const treeData = this.state.treeData
81
     const treeData = this.state.treeData
119
-
120
     let Data1 = this.state.treeData
82
     let Data1 = this.state.treeData
121
     for (var i = 0; i < treeData.length; i++) {
83
     for (var i = 0; i < treeData.length; i++) {
122
-
123
       for (var j = 0; j < treeData[i].children.length; j++) {
84
       for (var j = 0; j < treeData[i].children.length; j++) {
124
         // console.log(Data1[i].children[j].key);
85
         // console.log(Data1[i].children[j].key);
125
         // console.log("---------")
86
         // console.log("---------")
133
           break
94
           break
134
         }
95
         }
135
       }
96
       }
136
-
137
     }
97
     }
98
+    this.setState({
99
+      treeData1: Data1
100
+    }, () => {
101
+      message.success('修改成功!')
102
+    })
103
+
138
   }
104
   }
139
   //删除
105
   //删除
140
   onDelect = (value) => {
106
   onDelect = (value) => {
173
         key: info.node.props.eventKey,//event
139
         key: info.node.props.eventKey,//event
174
         day: moment(info.node.props.day)
140
         day: moment(info.node.props.day)
175
       })
141
       })
176
-
177
-      console.log(values, info)
142
+      console.log(this.getTreeData)
178
 
143
 
179
       // moment(info.node.props.day).format('YYYY-MM-DD')
144
       // moment(info.node.props.day).format('YYYY-MM-DD')
180
     })
145
     })
182
 
147
 
183
 
148
 
184
 
149
 
150
+  // getTreeData = (e) => {
151
+  //   request({
152
+  //     url: "http://localhost:8000/api/admin/institution/list",
153
+  //     method: 'GET',
154
+
155
+  //     // params: {leveltype: 3, cityId},
156
+  //     action: "admin.institution.get",
157
+  //   }).then((treeData) => {
158
+  //     setData(treeData)
159
+  //     console.log(this.getTreeData)
160
+  //   })
161
+  // }
162
+
163
+
164
+
165
+
166
+
167
+
168
+  async institutionTree(params) {
169
+    let arr = []
170
+
171
+    return request('/api/admin/institution/list', {
172
+      method: 'GET',
173
+      data: params,
174
+    }).then((testarr2) => {
175
+      this.setState({ testarr: testarr2 }, () => {
176
+        console.log("testarr2")
177
+        console.log(this.state.testarr)
178
+        // title: 'institutionId',
179
+        // name: 'institutionName',
180
+        // key: '0-0-0',
181
+        const arr2 = this.state.testarr
182
+        for (var i = 0; i < this.state.testarr.length; i++) {
183
+          let list = {
184
+            title: 'institutionId',
185
+            name: 'institutionName',
186
+            key: '0-0-0'
187
+          }
188
+          list.title = arr2[i].institutionName
189
+          list.key = '0' + i.toString
190
+          arr.push(list)
191
+
192
+        }
193
+
194
+        this.setState({
195
+          treeData: arr
196
+        })
197
+
198
+      })
199
+      // console.log(this.getTreeData)
200
+    })
201
+  }
202
+
203
+  componentDidMount() {
204
+    // fetch(`http://localhost:8000/api/admin/institution/list`, {
205
+    //   headers: {
206
+    //     Authorization: "Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiIxIiwib3JnSWQiOiIxIiwiZXhwIjoxNjI3MDQ1MjQxfQ.7FhVDoI0dEECZinRUzMzcLl-kcobkamZSqoUzTxBTRo"
207
+    //   }
208
+    // }).then((res) => {
209
+    //   console.log(res)
210
+    // }),
211
+    // this.institutionTree()
212
+    this.institutionTree([])
213
+
214
+  }
215
+
216
+
217
+
218
+
219
+
220
+
185
 
221
 
186
   renderTreeNodes = data =>
222
   renderTreeNodes = data =>
187
     data.map(item => {
223
     data.map(item => {
194
       }
230
       }
195
       return <TreeNode key={item.key} {...item} />;
231
       return <TreeNode key={item.key} {...item} />;
196
     });
232
     });
233
+  //搜索框 
234
+  // onChange = e => {
235
+  //   const { value } = e.target;
236
+  //   const expandedKeys = treeData
237
+  //     .map(item => {
238
+  //       if (item.title.indexOf(value) > -1) {
239
+  //         return getParentKey(item.key, gData);
240
+  //       }
241
+  //       return null;
242
+  //     })
243
+  //     .filter((item, i, self) => item && self.indexOf(item) === i);
244
+  //   this.setState({
245
+  //     expandedKeys,
246
+  //     searchValue: value,
247
+  //     autoExpandParent: true,
248
+  //   });
249
+  // };
197
 
250
 
198
 
251
 
199
 
252
 
200
-  render() {
201
 
253
 
254
+  render() {
255
+    const { searchValue } = this.state;
202
     return (
256
     return (
203
       <Card>
257
       <Card>
204
         <Row >
258
         <Row >
207
               <FormItem
261
               <FormItem
208
                 label="管辖部门"
262
                 label="管辖部门"
209
               >
263
               >
210
-                <Button type="primary" onClick={onAdd} >
211
-                  增加
212
-                </Button>
213
-
264
+                {/* <Search style={{ marginBottom: 8 }} placeholder="Search" onChange={this.onChange} /> */}
214
                 <Tree
265
                 <Tree
215
-
266
+                  // api={apis.Institution.instIist}
216
                   showLine
267
                   showLine
217
-                  // switcherIcon={<DownOutlined />}
218
-                  defaultExpandedKeys={['0-0-0']}
268
+                  defaultExpandedKeys={['0-0']}
219
                   onSelect={this.onSelect}
269
                   onSelect={this.onSelect}
220
                   treeData={this.state.treeData}
270
                   treeData={this.state.treeData}
271
+                // api={apis.Institution.instIist} 
221
                 >
272
                 >
222
                   {this.renderTreeNodes(this.state.treeData)}
273
                   {this.renderTreeNodes(this.state.treeData)}
223
                   {/* 动态渲染 */}
274
                   {/* 动态渲染 */}
224
                 </Tree >
275
                 </Tree >
225
-                {/* 不加入生命周期不会有更改a */}
226
               </FormItem>
276
               </FormItem>
227
             </Card>
277
             </Card>
228
           </Col>
278
           </Col>
233
                 triggerRef={this.bindRef}
283
                 triggerRef={this.bindRef}
234
                 onChangethis={this.onChangethis}
284
                 onChangethis={this.onChangethis}
235
                 onSubmit={this.onChangethis}
285
                 onSubmit={this.onChangethis}
286
+
287
+
236
               />
288
               />
237
             </Card>
289
             </Card>
238
           </Col>
290
           </Col>

+ 25
- 20
src/pages/user/login/index.jsx Visa fil

40
   }
40
   }
41
 
41
 
42
   return (
42
   return (
43
-    <div className={styles.main}>
44
-      <div></div>
45
-      <div>
46
-        <Form onSubmit={handleSubmit}>
47
-          <Form.Item label="用户名" {...formItemLayout} colon={false}>
48
-            {getFieldDecorator('loginName', {
49
-              rules: [{ required: true, message: '请输入用户名' }]
50
-            })(<Input />)}          
51
-          </Form.Item>
52
-          <Form.Item label="密 码" {...formItemLayout} colon={false}>
53
-            {getFieldDecorator('loginPassword', {
54
-              rules: [{ required: true, message: '请输入密码' }]
55
-            })(<Input.Password visibilityToggle={false}/>)}          
56
-          </Form.Item>
43
+    <div className={styles['login-form-wapper']}>
44
+      <div className={styles.main}>
45
+        <div className={styles['login-wedget']}>
46
+          <h3>欢迎来到新联宝</h3>
47
+          <img src="http://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/login-wedget.png" alt="" />
48
+        </div>
49
+        <div className={styles['login-form']}>
50
+          <Form onSubmit={handleSubmit}>
51
+            <Form.Item label="用户名" {...formItemLayout} colon={false}>
52
+              {getFieldDecorator('loginName', {
53
+                rules: [{ required: true, message: '请输入用户名' }]
54
+              })(<Input />)}          
55
+            </Form.Item>
56
+            <Form.Item label="密 码" {...formItemLayout} colon={false}>
57
+              {getFieldDecorator('loginPassword', {
58
+                rules: [{ required: true, message: '请输入密码' }]
59
+              })(<Input.Password visibilityToggle={false}/>)}          
60
+            </Form.Item>
57
 
61
 
58
-          <Button
59
-            loading={loading}
60
-            htmlType="submit"
61
-            className={styles['login-form-button']}
62
-          >登录</Button>
63
-        </Form>
62
+            <Button
63
+              loading={loading}
64
+              htmlType="submit"
65
+              className={styles['login-form-button']}
66
+            >登录</Button>
67
+          </Form>
68
+        </div>
64
       </div>
69
       </div>
65
     </div>
70
     </div>
66
   )
71
   )

+ 96
- 63
src/pages/user/login/style.less Visa fil

1
 @import '~antd/es/style/themes/default.less';
1
 @import '~antd/es/style/themes/default.less';
2
 
2
 
3
-.main {
4
-  width: 840px;
5
-  margin: 20vh auto 0;
6
-  background: rgba(17, 40, 81, 0.41);
7
-  box-shadow: 0px 8px 38px 0px rgba(4, 0, 0, 0.12);
8
-  border-radius: 24px;
9
-  box-sizing: border-box;
10
-  padding: 87px 0 120px;
11
-  display: flex;
12
-  @media screen and (max-width: @screen-sm) {
13
-    width: 95%;
14
-  }
15
-
16
-  & > div {
17
-    flex: none;
18
-    width: 50%;
19
-  }
20
-
21
-  .icon {
22
-    margin-left: 16px;
23
-    color: rgba(0, 0, 0, 0.2);
24
-    font-size: 24px;
25
-    vertical-align: middle;
26
-    cursor: pointer;
27
-    transition: color 0.3s;
3
+.login-form-wapper {
4
+  position: absolute;
5
+  width: 100vw;
6
+  height: 100vh;
7
+  top: -32px;
8
+  background: url(http://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/login-background.png) no-repeat;
9
+  background-size: 100% 100%;
28
 
10
 
29
-    &:hover {
30
-      color: @primary-color;
11
+  .main {
12
+    width: 840px;
13
+    margin: 20vh auto 0;
14
+    background: rgba(17, 40, 81, 0.41);
15
+    box-shadow: 0px 8px 38px 0px rgba(4, 0, 0, 0.12);
16
+    border-radius: 24px;
17
+    box-sizing: border-box;
18
+    padding: 87px 0 80px;
19
+    display: flex;
20
+    @media screen and (max-width: @screen-sm) {
21
+      width: 95%;
31
     }
22
     }
32
-  }
33
-
34
-  .other {
35
-    margin-top: 24px;
36
-    line-height: 22px;
37
-    text-align: left;
38
 
23
 
39
-    .register {
40
-      float: right;
24
+    & > div {
25
+      flex: none;
26
+      width: 50%;
27
+      box-sizing: border-box;
41
     }
28
     }
42
-  }
43
 
29
 
44
-  .login-form-button {
45
-    width: 100%;
46
-    font-size: 18px;
47
-    line-height: 48px;
48
-    height: 48px !important;
49
-    color: #fff !important;
50
-    background: #1548B6 !important;
51
-    border-radius: 48px;
52
-    border: none !important;
53
-  }
30
+    .login-wedget {
31
+      text-align: center;
32
+
33
+      h3 {
34
+        color: #f8f8f8;
35
+        font-size: 24px;
36
+        line-height: 52px;
37
+      }
54
 
38
 
55
-  :global {
56
-    .ant-form {
57
-      width: 260px;
58
-      margin-left: 60px;
39
+      img {
40
+        width: 300px;
41
+        display: block;
42
+        margin: 0 auto;
43
+      }
59
     }
44
     }
60
 
45
 
61
-    .ant-form-item {
62
-      border-bottom: 2px solid #fff;
46
+    .login-form {
47
+      background: url('@/assets/login/light.png') no-repeat;
48
+      background-size: auto 100%;
49
+      padding-top: 30px;
63
     }
50
     }
64
 
51
 
65
-    .ant-form-item-label > label {
66
-      color: #fff;
52
+    .icon {
53
+      margin-left: 16px;
54
+      color: rgba(0, 0, 0, 0.2);
55
+      font-size: 24px;
56
+      vertical-align: middle;
57
+      cursor: pointer;
58
+      transition: color 0.3s;
59
+
60
+      &:hover {
61
+        color: @primary-color;
62
+      }
67
     }
63
     }
68
 
64
 
69
-    .ant-input {
70
-      color: #fff;
71
-      border: none;
72
-      background: transparent;
73
-      outline: none;
65
+    .other {
66
+      margin-top: 24px;
67
+      line-height: 22px;
68
+      text-align: left;
74
 
69
 
75
-      &:focus {
76
-        box-shadow: none;
70
+      .register {
71
+        float: right;
77
       }
72
       }
78
     }
73
     }
79
 
74
 
80
-    .antd-pro-login-submit {
75
+    .login-form-button {
81
       width: 100%;
76
       width: 100%;
82
-      margin-top: 24px;
77
+      font-size: 18px;
78
+      line-height: 48px;
79
+      height: 48px !important;
80
+      color: #fff !important;
81
+      background: #1548B6 !important;
82
+      border-radius: 48px;
83
+      border: none !important;
84
+      margin-top: 50px;
85
+    }
86
+
87
+    :global {
88
+      .ant-form {
89
+        width: 260px;
90
+        margin-left: 60px;
91
+      }
92
+
93
+      .ant-form-item {
94
+        border-bottom: 2px solid #fff;
95
+      }
96
+
97
+      .ant-form-item-label > label {
98
+        color: #fff;
99
+      }
100
+
101
+      .ant-input {
102
+        color: #fff;
103
+        border: none;
104
+        background: transparent;
105
+        outline: none;
106
+
107
+        &:focus {
108
+          box-shadow: none;
109
+        }
110
+      }
111
+
112
+      .antd-pro-login-submit {
113
+        width: 100%;
114
+        margin-top: 24px;
115
+      }
83
     }
116
     }
84
   }
117
   }
85
 }
118
 }

+ 18
- 0
src/pages/welcome/components/IconText/index.jsx Visa fil

1
+import React from 'react'
2
+import styles from './style.less'
3
+
4
+const noop = x => x
5
+
6
+export default (props) => {
7
+  const { name, onClick = noop } = props
8
+  const file = require(`@/assets/welcome/icon-${name}.png`)
9
+
10
+  return (
11
+    <div className={styles['icon-text']} onClick={onClick}>
12
+      <img src={file} alt="" className={styles['icon-img']} />
13
+      <div>
14
+        {props.children}
15
+      </div>
16
+    </div>
17
+  )
18
+}

+ 16
- 0
src/pages/welcome/components/IconText/style.less Visa fil

1
+.icon-text {
2
+  color: #fff;
3
+  font-size: 25px;
4
+  line-height: 35px;
5
+  letter-spacing: 3px;
6
+  font-weight: bold;
7
+  display: inline-block;
8
+  box-sizing: border-box;
9
+
10
+  .icon-img {
11
+    width: 88px;
12
+    height: 88px;
13
+    display: block;
14
+    border: none;
15
+  }
16
+}

+ 70
- 0
src/pages/welcome/index.jsx Visa fil

1
+import React, { useCallback, useEffect, useState } from 'react';
2
+// import { Row, Col } from 'antd'
3
+import Link from 'umi/link'
4
+import IconText from './components/IconText'
5
+import styles from './style.less';
6
+
7
+export default (props) => {
8
+  const [containerStyle, setContainerStyle] = useState({})
9
+
10
+  const computeStyle = useCallback(() => {
11
+    const body = document.body
12
+    const header = document.getElementsByClassName('ant-pro-global-header')[0]
13
+
14
+    const style = {
15
+      width: header.offsetWidth,
16
+      height: body.offsetHeight - header.offsetHeight,
17
+    }
18
+
19
+    setContainerStyle(style)
20
+  }, [setContainerStyle])
21
+
22
+  useEffect(() => {
23
+    computeStyle()
24
+
25
+    window.addEventListener('resize', computeStyle)
26
+    return () => window.removeEventListener('resize', computeStyle)
27
+  }, [computeStyle])
28
+  
29
+  return (
30
+    <div className={styles.welcome} style={containerStyle}>
31
+      <div className={styles['action-list']}>
32
+        <div>
33
+          <Link to="/building/list">
34
+            <IconText name='building'>项目列表</IconText>
35
+          </Link>
36
+        </div>
37
+
38
+        <div>
39
+          <Link to="/statistical/consultant">
40
+            <IconText name='kpi'>置业顾问KPI</IconText>
41
+          </Link>
42
+        </div>
43
+        
44
+        <div>
45
+          <Link to="/statistical/activity">
46
+            <IconText name='activity'>活动统计</IconText>
47
+          </Link>
48
+        </div>
49
+        
50
+        <div>
51
+          <Link to="/customer/customer/list">
52
+            <IconText name='customer'>客户列表</IconText>
53
+          </Link>
54
+        </div>
55
+        
56
+        <div>
57
+          {/* <Link to="/customer/customer/list"> */}
58
+            <IconText name='report'>数据报表</IconText>
59
+          {/* </Link> */}
60
+        </div>
61
+        
62
+        <div>
63
+          {/* <Link to="/customer/customer/list"> */}
64
+            <IconText name='channel'>渠道统计</IconText>
65
+          {/* </Link> */}
66
+        </div>
67
+      </div>
68
+    </div>
69
+  )
70
+};

+ 22
- 0
src/pages/welcome/style.less Visa fil

1
+@import '~antd/lib/style/themes/default.less';
2
+
3
+.welcome {
4
+  background: url(https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/background.png) no-repeat;
5
+  background-size: 100% 100%;
6
+  position: absolute;
7
+  left: -24px;
8
+  top: -24px;
9
+
10
+  .action-list {
11
+    display: flex;
12
+    width: 100%;
13
+    position: absolute;
14
+    left: 0;
15
+    bottom: 200px;
16
+
17
+    & > div {
18
+      flex: auto;
19
+      text-align: center;
20
+    }
21
+  }
22
+}

+ 28
- 0
src/services/apis.js Visa fil

1079
       action: 'admin.channel.introductionList.personNumListExport.get',
1079
       action: 'admin.channel.introductionList.personNumListExport.get',
1080
     },
1080
     },
1081
   },
1081
   },
1082
+  //组织架构
1083
+  Institution: {
1084
+    instIist: {
1085
+      url: `${prefix}/institution/list`,
1086
+      method: 'GET',
1087
+      action: 'admin.institution.get'
1088
+    },
1089
+    instSave: {
1090
+      url: `${prefix}/institution/save`,
1091
+      method: 'POST',
1092
+      action: 'admin.institution.post'
1093
+    },
1094
+    instiDelete: {
1095
+      url: `${prefix}/institution/:id`,
1096
+      method: 'DELETE',
1097
+      action: 'admin.institution.id.delete',
1098
+    },
1099
+    instiSearch: {
1100
+      url: `${prefix}/institution/:id`,
1101
+      method: 'GET',
1102
+      action: 'admin.institution.id.get',
1103
+    },
1104
+    instiAlert: {
1105
+      url: `${prefix}/institution/:id`,
1106
+      method: 'PUT',
1107
+      action: 'admin.institution.id.put',
1108
+    }
1109
+  },
1082
   role: {
1110
   role: {
1083
     getRoleList: {
1111
     getRoleList: {
1084
       url: `${prefix}/taRole`,
1112
       url: `${prefix}/taRole`,

+ 2
- 2
src/utils/request.js Visa fil

46
 
46
 
47
   return (
47
   return (
48
     {
48
     {
49
-      url: 'https://xlk.njyz.tech' + apiURL,
50
-      // url: apiURL,
49
+      // url: 'https://xlk.njyz.tech' + apiURL,
50
+      url: apiURL,
51
       options: {
51
       options: {
52
         ...opts,
52
         ...opts,
53
         headers: {
53
         headers: {