张延森 5 anos atrás
pai
commit
5e5953c785
42 arquivos alterados com 2389 adições e 663 exclusões
  1. 1
    0
      .eslintrc.js
  2. 4
    0
      config/config.js
  3. 2
    0
      package.json
  4. 18
    0
      src/app.js
  5. 4
    1
      src/global.less
  6. 6
    24
      src/pages/activity/ActivityList.jsx
  7. 2
    6
      src/pages/activity/SignList.jsx
  8. 11
    46
      src/pages/activity/editActivity.jsx
  9. 401
    0
      src/pages/building/list/add/amap.css
  10. 437
    0
      src/pages/building/list/add/amap.less
  11. 401
    0
      src/pages/building/list/add/amap.wxss
  12. 107
    0
      src/pages/building/list/add/components/amap.jsx
  13. 4
    2
      src/pages/building/list/add/components/base.jsx
  14. 57
    74
      src/pages/building/list/add/components/buildingProjectType.jsx
  15. 10
    1
      src/pages/building/list/add/components/imageSet.jsx
  16. 6
    5
      src/pages/building/list/add/components/modalImage.jsx
  17. 147
    0
      src/pages/building/list/add/components/poster.jsx
  18. 97
    0
      src/pages/building/list/add/components/share.jsx
  19. 42
    15
      src/pages/building/list/add/index.jsx
  20. 20
    0
      src/pages/building/list/add/style.less
  21. 5
    21
      src/pages/carouselFigure/advertisingList.jsx
  22. 5
    21
      src/pages/carouselFigure/carouselFigureList.jsx
  23. 4
    14
      src/pages/carouselFigure/editAdvertising.jsx
  24. 4
    14
      src/pages/carouselFigure/editCarousel.jsx
  25. 38
    38
      src/pages/channel/channelList.jsx
  26. 3
    11
      src/pages/integralMall/GoodsList.jsx
  27. 3
    10
      src/pages/integralMall/achieve.jsx
  28. 4
    14
      src/pages/integralMall/editGoods.jsx
  29. 2
    6
      src/pages/integralMall/exchangeRecords.jsx
  30. 3
    11
      src/pages/integralMall/verifyList.jsx
  31. 2
    5
      src/pages/staff/list/RoleList.jsx
  32. 61
    48
      src/pages/staff/list/StaffList.jsx
  33. 234
    160
      src/pages/staff/list/addRole.jsx
  34. 1
    1
      src/pages/staff/list/editRole.jsx
  35. 5
    19
      src/pages/staff/list/editStaff.jsx
  36. 22
    30
      src/pages/staff/list/style.less
  37. 4
    14
      src/pages/system/editPolicy.jsx
  38. 5
    20
      src/pages/system/housingPolicy.jsx
  39. 6
    13
      src/pages/system/intention.jsx
  40. 2
    6
      src/pages/system/messageList.jsx
  41. 4
    13
      src/pages/system/report.jsx
  42. 195
    0
      src/services/apis.js

+ 1
- 0
.eslintrc.js Ver arquivo

@@ -5,5 +5,6 @@ module.exports = {
5 5
   globals: {
6 6
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
7 7
     page: true,
8
+    AMap: true,
8 9
   },
9 10
 };

+ 4
- 0
config/config.js Ver arquivo

@@ -479,7 +479,11 @@ export default {
479 479
 
480 480
   proxy: {
481 481
     '/api/': {
482
+<<<<<<< HEAD
482 483
       target: 'http://192.168.0.11:8080/',
484
+=======
485
+      target: 'http://192.168.0.172:8080/',
486
+>>>>>>> 5f3c214db5ee93d6bb88af4038dd9cec7d528a43
483 487
       changeOrigin: true,
484 488
       // pathRewrite: { '^/server': '' },
485 489
     },

+ 2
- 0
package.json Ver arquivo

@@ -55,6 +55,8 @@
55 55
     "path-to-regexp": "^3.0.0",
56 56
     "qs": "^6.7.0",
57 57
     "react": "^16.8.6",
58
+    "react-amap": "^1.2.8",
59
+    "react-amap-plugin-autocomplete": "0.0.4",
58 60
     "react-copy-to-clipboard": "^5.0.1",
59 61
     "react-document-title": "^2.0.3",
60 62
     "react-dom": "^16.8.6",

+ 18
- 0
src/app.js Ver arquivo

@@ -1,3 +1,21 @@
1
+// (function (doc, win) {
2
+//   var docEl = doc.documentElement,
3
+//     resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize',
4
+//     recalc = function () {
5
+//       var clientWidth = docEl.clientWidth;
6
+//       if (!clientWidth) return;
7
+//       if (clientWidth >= 750) {
8
+//         docEl.style.fontSize = '100px';
9
+//       } else {
10
+//         docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
11
+//       }
12
+//     };
13
+
14
+//   if (!doc.addEventListener) return;
15
+//   win.addEventListener(resizeEvt, recalc, false);
16
+//   doc.addEventListener('DOMContentLoaded', recalc, false);
17
+// })(document, window);
18
+
1 19
 export const dva = {
2 20
   config: {
3 21
     onError(e) {

+ 4
- 1
src/global.less Ver arquivo

@@ -79,9 +79,12 @@ ol {
79 79
 .ant-menu-vertical-left .ant-menu-submenu-title,
80 80
 .ant-menu-vertical-right .ant-menu-submenu-title,
81 81
 .ant-menu-inline .ant-menu-submenu-title,
82
-.ant-input ,.ant-btn,.ant-select,.ant-table {
82
+.ant-input ,.ant-btn,.ant-select,.ant-table,.ant-form-item,.ant-form label,.ant-tabs-nav-container {
83 83
   font-size: 16px;
84 84
 }
85
+.ant-row.ant-form-item .ant-form-item-label.ant-col-sm-3{
86
+  min-width: 100px;
87
+}
85 88
 .ant-breadcrumb{
86 89
   font-size: 16px;
87 90
   .anticon {

+ 6
- 24
src/pages/activity/ActivityList.jsx Ver arquivo

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
-
9
+import apis from '../../services/apis';
10 10
 import request from '../../utils/request'
11 11
 
12 12
 const { Option } = Select;
@@ -22,11 +22,7 @@ const header = (props) => {
22 22
 
23 23
   // 查询列表
24 24
   const getList = (params) => {
25
-    request({
26
-        url: '/api/admin/iBuildingDynamicList',
27
-        method: 'GET',
28
-        params: { ...params },
29
-    }).then((data) => {
25
+    request({ ...apis.activity.list, params: { ...params } }).then((data) => {
30 26
         console.log(data)
31 27
         setData(data)
32 28
     })
@@ -124,11 +120,7 @@ const toEditGoods = (dynamicId) => () => {
124 120
           okText: '确定',
125 121
           cancelText: '取消',
126 122
           onOk() {
127
-              request({
128
-                  url: '/api/admin/buildingDynamic/finish',
129
-                  method: 'PUT',
130
-                  data: {dynamicId: row.dynamicId, top: ""},
131
-              }).then((data) => {
123
+              request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
132 124
                   console.log(data)
133 125
                   message.info('操作成功!')
134 126
                   getList({ pageNum: 1, pageSize: 10 })
@@ -143,11 +135,7 @@ const toEditGoods = (dynamicId) => () => {
143 135
 //   置顶
144 136
   const topDynamic = (row) => () => {
145 137
       const weight = Math.abs(row.weight - 1)
146
-      request({
147
-          url: '/api/admin/buildingDynamic/weight',
148
-          method: 'PUT',
149
-          params: {dynamicId: row.dynamicId, weight},
150
-      }).then((data) => {
138
+      request({ ...apis.activity.weight, params: {dynamicId: row.dynamicId, weight} }).then((data) => {
151 139
           console.log(data)
152 140
           message.info('操作成功!')
153 141
           getList({ pageNum: 1, pageSize: 10 })
@@ -167,10 +155,7 @@ const toEditGoods = (dynamicId) => () => {
167 155
   
168 156
   // 取消活动
169 157
   const cancelDynamic = (row) => {
170
-      request({
171
-          url: '/api/admin/buildingDynamic/cancel/'+row.dynamicId,
172
-          method: 'PUT',
173
-      }).then((data) => {
158
+      request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
174 159
           message.info('操作成功!')
175 160
           getList({ pageNum: 1, pageSize: 10 })
176 161
       }).catch((err) => {
@@ -181,10 +166,7 @@ const toEditGoods = (dynamicId) => () => {
181 166
   
182 167
   //发布活动
183 168
   const sendDynamic = (row) => {
184
-      request({
185
-          url: '/api/admin/buildingDynamic/send/'+row.dynamicId,
186
-          method: 'PUT',
187
-      }).then((data) => {
169
+      request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
188 170
           message.info('操作成功!')
189 171
           getList({ pageNum: 1, pageSize: 10 });
190 172
       }).catch((err) => {

+ 2
- 6
src/pages/activity/SignList.jsx Ver arquivo

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7
-
7
+import apis from '../../services/apis';
8 8
 import request from '../../utils/request'
9 9
 
10 10
 const { Option } = Select;
@@ -50,11 +50,7 @@ const header = (props) => {
50 50
 
51 51
   // 查询列表
52 52
   const getSignList = (params) => {
53
-    request({
54
-        url: '/api/admin/SignList',
55
-        method: 'GET',
56
-        params: { ...params },
57
-    }).then((data) => {
53
+    request({ ...apis.activity.signList, params: { ...params },}).then((data) => {
58 54
         console.log(data)
59 55
         setData(data)
60 56
     })

+ 11
- 46
src/pages/activity/editActivity.jsx Ver arquivo

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5
+import apis from '../../services/apis';
5 6
 import moment from 'moment';
6 7
 import router from 'umi/router';
7 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
@@ -36,11 +37,7 @@ const Edit = (props) => {
36 37
 
37 38
     // 查询列表
38 39
     const getDynamicData = (dynamicId) => {
39
-      request({
40
-        url: '/api/admin/buildingDynamic/Details',
41
-        method: 'GET',
42
-        params: { dynamicId },
43
-      }).then((data) => {
40
+      request({ ...apis.activity.details, params: { dynamicId } }).then((data) => {
44 41
         console.log(data)
45 42
         setDynamicData(data)
46 43
       })
@@ -143,22 +140,14 @@ const Edit = (props) => {
143 140
       console.log('submit data --->', submitValue)
144 141
       if (dynamicId) {
145 142
         submitValue.dynamicId = dynamicId
146
-        request({
147
-          url: '/api/admin/buildingDynamic/update',
148
-          method: 'PUT',
149
-          data: submitValue,
150
-        }).then((data) => {
143
+        request({ ...apis.activity.update, data: submitValue }).then((data) => {
151 144
           message.info("保存成功")
152 145
           cancelPage()
153 146
         }).catch((err) => {
154 147
           message.info(err.msg || err.message)
155 148
         })
156 149
       } else {
157
-        request({
158
-          url: '/api/admin/buildingDynamic/add',
159
-          method: 'POST',
160
-          data: submitValue,
161
-        }).then((data) => {
150
+        request({ ...apis.activity.add, data: submitValue }).then((data) => {
162 151
           message.info("保存成功")
163 152
           cancelPage()
164 153
         }).catch((err) => {
@@ -178,11 +167,7 @@ const Edit = (props) => {
178 167
 
179 168
     if(dynamicId){
180 169
       useEffect(() => {
181
-        request({
182
-          url: '/api/admin/poster',
183
-          method: 'GET',
184
-          params: {targetId: dynamicId,targetType: 'activity'},
185
-        }).then((data) => {
170
+        request({ ...apis.activity.poster, params: {targetId: dynamicId,targetType: 'activity'} }).then((data) => {
186 171
           console.log(data,"2222")
187 172
           if(data.length > 0){
188 173
             setPosterId(data[0].posterId)
@@ -199,21 +184,13 @@ const Edit = (props) => {
199 184
     const submitPoster  = () => {
200 185
        if(dynamicId){
201 186
         if(posterId){
202
-          request({
203
-            url: '/api/admin/poster/'+posterId,
204
-            method: 'PUT',
205
-            data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},
206
-          }).then((data) => {
187
+          request({ ...apis.activity.updatePoster, urlData: {id: posterId}, data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
207 188
             message.info("保存成功")
208 189
           }).catch((err) => {
209 190
             message.info(err.msg || err.message)
210 191
           })
211 192
          }else{
212
-          request({
213
-            url: '/api/admin/poster',
214
-            method: 'POST',
215
-            data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},
216
-          }).then((data) => {
193
+          request({ ...apis.activity.addPoster, data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
217 194
             setPosterId(data.posterId)
218 195
             message.info("保存成功")
219 196
           }).catch((err) => {
@@ -245,7 +222,7 @@ const Edit = (props) => {
245 222
               textOverflow: 'ellipsis'
246 223
             }}>{inputValue ? inputValue : '海报标题'}</p>
247 224
 
248
-            <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
225
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
249 226
             <p style={{
250 227
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
251 228
               display: '-webkit-box', lineClamp: '3', height: '76px',
@@ -290,11 +267,7 @@ const Edit = (props) => {
290 267
     
291 268
     if(dynamicId){
292 269
       useEffect(() => {
293
-        request({
294
-          url: '/api/admin/shareContent',
295
-          method: 'GET',
296
-          params: {targetId: dynamicId,targetType: 'activity'},
297
-        }).then((data) => {
270
+        request({ ...apis.activity.shareContent, params: {targetId: dynamicId,targetType: 'activity'},}).then((data) => {
298 271
           console.log(data,"2222")
299 272
           if(data.length > 0){
300 273
             setShareContentId(data[0].shareContentId)
@@ -310,21 +283,13 @@ const Edit = (props) => {
310 283
     const submitShare = () => {
311 284
       if(dynamicId){
312 285
         if(shareContentId){
313
-          request({
314
-            url: '/api/admin/shareContent/'+shareContentId,
315
-            method: 'PUT',
316
-            data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},
317
-          }).then((data) => {
286
+          request({ ...apis.activity.updateShareContent, urlData: {id: shareContentId},data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
318 287
             message.info("保存成功")
319 288
           }).catch((err) => {
320 289
             message.info(err.msg || err.message)
321 290
           })
322 291
          }else{
323
-          request({
324
-            url: '/api/admin/shareContent',
325
-            method: 'POST',
326
-            data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},
327
-          }).then((data) => {
292
+          request({ ...apis.activity.addShareContent, data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
328 293
             setShareContentId(data.shareContentId)
329 294
             message.info("保存成功")
330 295
           }).catch((err) => {

+ 401
- 0
src/pages/building/list/add/amap.css Ver arquivo

@@ -0,0 +1,401 @@
1
+html {
2
+  font-size: 12px;
3
+}
4
+.amap-copyright {
5
+  box-sizing: content-box;
6
+}
7
+* {
8
+  box-sizing: border-box;
9
+}
10
+.input-textarea {
11
+  color: grey;
12
+  height: 8em;
13
+  overflow: auto;
14
+  border-radius: 0.4rem;
15
+  border: 1px solid #ced4da;
16
+  margin-bottom: 1rem;
17
+}
18
+body {
19
+  margin: 0;
20
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
21
+  line-height: 1.5;
22
+  font-weight: 300;
23
+  color: #111213;
24
+}
25
+hr {
26
+  margin: 0.5rem 0;
27
+  box-sizing: content-box;
28
+  height: 0;
29
+  overflow: visible;
30
+  border: 0;
31
+  border-top: 1px solid rgba(0, 0, 0, 0.1);
32
+}
33
+p {
34
+  margin-top: 0;
35
+  margin-bottom: 0;
36
+}
37
+label {
38
+  display: inline-block;
39
+  margin-bottom: 0.4rem;
40
+}
41
+label,
42
+.btn {
43
+  margin-left: 0;
44
+  font-size: 1rem;
45
+}
46
+button,
47
+input,
48
+select {
49
+  margin: 0;
50
+  font-family: inherit;
51
+  font-size: inherit;
52
+  line-height: inherit;
53
+  overflow: visible;
54
+  text-transform: none;
55
+}
56
+[type=button]::-moz-focus-inner,
57
+[type=reset]::-moz-focus-inner,
58
+[type=submit]::-moz-focus-inner,
59
+button::-moz-focus-inner {
60
+  padding: 0;
61
+  border-style: none;
62
+}
63
+input[type=checkbox],
64
+input[type=radio] {
65
+  -webkit-box-sizing: border-box;
66
+  box-sizing: border-box;
67
+  padding: 0;
68
+  margin: 0 0.5rem 0 0;
69
+}
70
+h4 {
71
+  font-family: inherit;
72
+  line-height: 1.8;
73
+  font-weight: 300;
74
+  color: inherit;
75
+  font-size: 1.1rem;
76
+  margin-top: 0;
77
+  margin-bottom: 0.5rem;
78
+}
79
+.btn {
80
+  display: inline-block;
81
+  font-weight: 400;
82
+  text-align: center;
83
+  white-space: nowrap;
84
+  vertical-align: middle;
85
+  -webkit-user-select: none;
86
+  -moz-user-select: none;
87
+  -ms-user-select: none;
88
+  user-select: none;
89
+  border: 1px solid transparent;
90
+  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
91
+  background-color: transparent;
92
+  background-image: none;
93
+  color: #25A5F7;
94
+  border-color: #25A5F7;
95
+  padding: .25rem .5rem;
96
+  line-height: 1.5;
97
+  border-radius: 1rem;
98
+  -webkit-appearance: button;
99
+  cursor: pointer;
100
+}
101
+.btn:hover {
102
+  color: #fff;
103
+  background-color: #25A5F7;
104
+  border-color: #25A5F7;
105
+}
106
+.btn:hover {
107
+  text-decoration: none;
108
+}
109
+.input-item {
110
+  position: relative;
111
+  display: -ms-flexbox;
112
+  display: flex;
113
+  -ms-flex-wrap: wrap;
114
+  flex-wrap: wrap;
115
+  -ms-flex-align: center;
116
+  align-items: center;
117
+  width: 100%;
118
+  height: 3rem;
119
+}
120
+.input-item:last-child {
121
+  margin-bottom: 0;
122
+}
123
+.input-item > select,
124
+.input-item > input[type=text],
125
+.input-item > input[type=date] {
126
+  position: relative;
127
+  -ms-flex: 1 1 auto;
128
+  flex: 1 1 auto;
129
+  width: 1%;
130
+  margin-bottom: 0;
131
+}
132
+.input-item > select:not(:last-child),
133
+.input-item > input[type=text]:not(:last-child),
134
+.input-item > input[type=date]:not(:last-child) {
135
+  border-top-right-radius: 0;
136
+  border-bottom-right-radius: 0;
137
+}
138
+.input-item > select:not(:first-child),
139
+.input-item > input[type=text]:not(:first-child),
140
+.input-item > input[type=date]:not(:first-child) {
141
+  border-top-left-radius: 0;
142
+  border-bottom-left-radius: 0;
143
+}
144
+.input-item-prepend {
145
+  margin-right: -1px;
146
+}
147
+.input-item-text,
148
+input[type=text],
149
+input[type=date],
150
+select {
151
+  height: calc(4.2rem);
152
+}
153
+.input-item-text {
154
+  width: 6rem;
155
+  text-align: justify;
156
+  padding: 0.4rem 0.7rem;
157
+  display: inline-block;
158
+  text-justify: distribute-all-lines;
159
+  /*ie6-8*/
160
+  text-align-last: justify;
161
+  /* ie9*/
162
+  -moz-text-align-last: justify;
163
+  /*ff*/
164
+  -webkit-text-align-last: justify;
165
+  /*chrome 20+*/
166
+  -ms-flex-align: center;
167
+  align-items: center;
168
+  margin-bottom: 0;
169
+  font-size: 1rem;
170
+  font-weight: 400;
171
+  line-height: 1.5;
172
+  color: #495057;
173
+  text-align: center;
174
+  white-space: nowrap;
175
+  background-color: #e9ecef;
176
+  border: 1px solid #ced4da;
177
+  border-radius: .25rem;
178
+  border-bottom-right-radius: 0;
179
+  border-top-right-radius: 0;
180
+}
181
+.input-item-text input[type=checkbox],
182
+.input-item-text input[type=radio] {
183
+  margin-top: 0;
184
+}
185
+.input-card {
186
+  display: flex;
187
+  flex-direction: column;
188
+  min-width: 0;
189
+  word-wrap: break-word;
190
+  background-color: #fff;
191
+  background-clip: border-box;
192
+  border-radius: .25rem;
193
+  width: 22rem;
194
+  border-width: 0;
195
+  border-radius: 0.4rem;
196
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
197
+  position: fixed;
198
+  bottom: 1rem;
199
+  right: 1rem;
200
+  -ms-flex: 1 1 auto;
201
+  flex: 1 1 auto;
202
+  padding: 0.75rem 1.25rem;
203
+}
204
+.input-text {
205
+  line-height: 2rem;
206
+  margin-right: 2rem;
207
+}
208
+.info hr {
209
+  margin-right: 0;
210
+  margin-left: 0;
211
+  border-top-color: grey;
212
+}
213
+.info {
214
+  padding: .75rem 1.25rem;
215
+  margin-bottom: 1rem;
216
+  border-radius: .25rem;
217
+  position: fixed;
218
+  top: 1rem;
219
+  background-color: white;
220
+  width: auto;
221
+  min-width: 22rem;
222
+  border-width: 0;
223
+  right: 1rem;
224
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
225
+  position: absolute;
226
+  z-index: 100;
227
+}
228
+.code {
229
+  left: 1.5rem;
230
+  right: 1.5rem;
231
+  top: 1.5rem;
232
+  bottom: 1.5rem;
233
+  overflow: auto;
234
+  margin-bottom: 0rem;
235
+}
236
+.code .btn {
237
+  top: 1rem;
238
+  position: absolute;
239
+  right: 1rem;
240
+}
241
+.code .result {
242
+  border: 1px solid rgba(0, 0, 0, 0.1);
243
+  border-radius: 0.5rem;
244
+  padding: 1rem;
245
+  bottom: 1rem;
246
+  position: absolute;
247
+  top: 5.5rem;
248
+  right: 1rem;
249
+  left: 1rem;
250
+  overflow: auto;
251
+}
252
+.code .status {
253
+  color: #80adff;
254
+  display: inline-block;
255
+  font-size: 14px;
256
+}
257
+.code h4 {
258
+  display: inline-block;
259
+  max-width: 20rem;
260
+  margin-right: 1rem;
261
+  margin-bottom: 1rem;
262
+}
263
+select,
264
+input[type=text],
265
+input[type=date] {
266
+  display: inline-block;
267
+  width: 100%;
268
+  padding: .375rem 1.75rem .375rem .75rem;
269
+  line-height: 1.5;
270
+  color: #495057;
271
+  vertical-align: middle;
272
+  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
273
+  background-size: 8px 10px;
274
+  border: 1px solid #ced4da;
275
+  border-radius: .25rem;
276
+  -webkit-appearance: none;
277
+  -moz-appearance: none;
278
+  appearance: none;
279
+}
280
+input[type=text],
281
+input[type=date] {
282
+  background: #fff;
283
+  padding: .375rem .75rem;
284
+}
285
+select:focus,
286
+input[type=text]:focus,
287
+input[type=date]:focus {
288
+  border-color: #80bdff;
289
+  outline: 0;
290
+  box-shadow: 0 0 0 0.1rem rgba(128, 189, 255, 0.1);
291
+}
292
+.btn:focus {
293
+  outline: 0;
294
+  box-shadow: none;
295
+}
296
+select:focus::-ms-value,
297
+input[type=text]:focus::-ms-value,
298
+input[type=date]:focus::-ms-value {
299
+  color: #495057;
300
+  background-color: #fff;
301
+}
302
+/* native toastr */
303
+.native-toast {
304
+  position: fixed;
305
+  background-color: rgba(50, 50, 50, 0.8);
306
+  border-radius: 33px;
307
+  color: white;
308
+  left: 50%;
309
+  text-align: center;
310
+  padding: 6px 12px;
311
+  opacity: 0;
312
+  z-index: 99999;
313
+  transition: transform .25s, opacity .25s, top .25s;
314
+  box-sizing: border-box;
315
+}
316
+.native-toast-bottom {
317
+  bottom: 50px;
318
+  -ms-transform: translateX(-50%) translateY(50px);
319
+  transform: translateX(-50%) translateY(50px);
320
+}
321
+.native-toast-bottom.native-toast-shown {
322
+  opacity: 1;
323
+  -ms-transform: translateX(-50%) translateY(0);
324
+  transform: translateX(-50%) translateY(0);
325
+}
326
+.native-toast-bottom.native-toast-edge {
327
+  bottom: 0;
328
+}
329
+.native-toast-top {
330
+  top: 50px;
331
+  -ms-transform: translateX(-50%) translateY(-50px);
332
+  transform: translateX(-50%) translateY(-50px);
333
+}
334
+.native-toast-top.native-toast-shown {
335
+  opacity: 1;
336
+  -ms-transform: translateX(-50%) translateY(0);
337
+  transform: translateX(-50%) translateY(0);
338
+}
339
+.native-toast-top.native-toast-edge {
340
+  top: 0;
341
+}
342
+.native-toast-center {
343
+  top: 0;
344
+  -ms-transform: translateX(-50%) translateY(-50px);
345
+  transform: translateX(-50%) translateY(-50px);
346
+}
347
+.native-toast-center.native-toast-shown {
348
+  opacity: 1;
349
+  top: 50%;
350
+  -ms-transform: translateX(-50%) translateY(-50%);
351
+  transform: translateX(-50%) translateY(-50%);
352
+}
353
+.native-toast-edge {
354
+  border-radius: 0;
355
+  width: 100%;
356
+  text-align: left;
357
+}
358
+@media screen and (min-width: 40rem) {
359
+  .native-toast:not(.native-toast-edge) {
360
+    max-width: 18rem;
361
+  }
362
+}
363
+/*
364
+  max-width does not seem to work in small screen?
365
+*/
366
+/*@media screen and (max-width: 768px) {
367
+  .native-toast:not(.native-toast-edge) {
368
+    max-width: 400px;
369
+  }
370
+}
371
+
372
+@media screen and (max-width: 468px) {
373
+  .native-toast:not(.native-toast-edge) {
374
+    max-width: 300px;
375
+  }
376
+}*/
377
+/* types */
378
+.native-toast-error {
379
+  background-color: #d92727;
380
+  color: white;
381
+}
382
+.native-toast-success {
383
+  background-color: #62a465;
384
+  color: white;
385
+}
386
+.native-toast-warning {
387
+  background-color: #fdaf17;
388
+  color: white;
389
+}
390
+.native-toast-info {
391
+  background-color: #5060ba;
392
+  color: white;
393
+}
394
+[class^="native-toast-icon-"] {
395
+  vertical-align: middle;
396
+  margin-right: 8px;
397
+}
398
+[class^="native-toast-icon-"] svg {
399
+  width: 16px;
400
+  height: 16px;
401
+}

+ 437
- 0
src/pages/building/list/add/amap.less Ver arquivo

@@ -0,0 +1,437 @@
1
+html {
2
+  font-size: 12px;
3
+}
4
+.amap-copyright{
5
+  box-sizing: content-box
6
+}
7
+* {
8
+  box-sizing: border-box
9
+}
10
+.input-textarea{
11
+   color:grey;
12
+   height:8em;
13
+   overflow:auto;
14
+   border-radius:0.4rem;
15
+   border:1px solid #ced4da;
16
+   margin-bottom:1rem;
17
+}
18
+body {
19
+  margin: 0;
20
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
21
+  line-height: 1.5;
22
+  font-weight: 300;
23
+  color: #111213;
24
+}
25
+
26
+hr {
27
+  margin: 0.5rem 0;
28
+  box-sizing: content-box;
29
+  height: 0;
30
+  overflow: visible;
31
+  border: 0;
32
+  border-top: 1px solid rgba(0, 0, 0, .1)
33
+}
34
+
35
+p {
36
+  margin-top: 0;
37
+  margin-bottom: 0;
38
+}
39
+
40
+label {
41
+  display: inline-block;
42
+  margin-bottom: 0.4rem;
43
+}
44
+
45
+label, .btn {
46
+  margin-left: 0;
47
+  font-size: 1rem;
48
+}
49
+
50
+button, input, select {
51
+  margin: 0;
52
+  font-family: inherit;
53
+  font-size: inherit;
54
+  line-height: inherit;
55
+  overflow: visible;
56
+  text-transform: none
57
+}
58
+
59
+[type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner, button::-moz-focus-inner {
60
+  padding: 0;
61
+  border-style: none;
62
+}
63
+
64
+input[type=checkbox], input[type=radio] {
65
+  box-sizing: border-box;
66
+  padding: 0;
67
+  -webkit-box-sizing: border-box;
68
+  box-sizing: border-box;
69
+  padding: 0;
70
+  margin: 0 0.5rem 0 0;
71
+}
72
+
73
+h4 {
74
+  font-family: inherit;
75
+  line-height: 1.8;
76
+  font-weight: 300;
77
+  color: inherit;
78
+  font-size: 1.1rem;
79
+  margin-top: 0;
80
+  margin-bottom: .5rem
81
+}
82
+
83
+.btn {
84
+  display: inline-block;
85
+  font-weight: 400;
86
+  text-align: center;
87
+  white-space: nowrap;
88
+  vertical-align: middle;
89
+  -webkit-user-select: none;
90
+  -moz-user-select: none;
91
+  -ms-user-select: none;
92
+  user-select: none;
93
+  border: 1px solid transparent;
94
+  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
95
+  background-color: transparent;
96
+  background-image: none;
97
+  color: #25A5F7;
98
+  border-color: #25A5F7;
99
+  padding: .25rem .5rem;
100
+  line-height: 1.5;
101
+  border-radius: 1rem;
102
+  -webkit-appearance: button;
103
+  cursor:pointer;
104
+}
105
+
106
+.btn:hover {
107
+  color: #fff;
108
+  background-color: #25A5F7;
109
+  border-color: #25A5F7
110
+}
111
+
112
+.btn:hover {
113
+  text-decoration: none
114
+}
115
+
116
+.input-item {
117
+  position: relative;
118
+  display: -ms-flexbox;
119
+  display: flex;
120
+  -ms-flex-wrap: wrap;
121
+  flex-wrap: wrap;
122
+  -ms-flex-align: center;
123
+  align-items: center;
124
+  width: 100%;
125
+  height: 3rem;
126
+}
127
+
128
+.input-item:last-child {
129
+  margin-bottom: 0;
130
+}
131
+
132
+.input-item>select, .input-item>input[type=text], .input-item>input[type=date] {
133
+  position: relative;
134
+  -ms-flex: 1 1 auto;
135
+  flex: 1 1 auto;
136
+  width: 1%;
137
+  margin-bottom: 0;
138
+}
139
+
140
+.input-item>select:not(:last-child), .input-item>input[type=text]:not(:last-child), .input-item>input[type=date]:not(:last-child) {
141
+  border-top-right-radius: 0;
142
+  border-bottom-right-radius: 0
143
+}
144
+
145
+.input-item>select:not(:first-child), .input-item>input[type=text]:not(:first-child), .input-item>input[type=date]:not(:first-child) {
146
+  border-top-left-radius: 0;
147
+  border-bottom-left-radius: 0
148
+}
149
+
150
+.input-item-prepend {
151
+  margin-right: -1px;
152
+}
153
+
154
+.input-item-text, input[type=text],input[type=date], select {
155
+  height: calc(2.2rem + 2px);
156
+}
157
+
158
+.input-item-text {
159
+  width: 6rem;
160
+  text-align: justify;
161
+  padding: 0.4rem 0.7rem;
162
+  display: inline-block;
163
+  text-justify: distribute-all-lines;
164
+  /*ie6-8*/
165
+  text-align-last: justify;
166
+  /* ie9*/
167
+  -moz-text-align-last: justify;
168
+  /*ff*/
169
+  -webkit-text-align-last: justify;
170
+  /*chrome 20+*/
171
+  -ms-flex-align: center;
172
+  align-items: center;
173
+  margin-bottom: 0;
174
+  font-size: 1rem;
175
+  font-weight: 400;
176
+  line-height: 1.5;
177
+  color: #495057;
178
+  text-align: center;
179
+  white-space: nowrap;
180
+  background-color: #e9ecef;
181
+  border: 1px solid #ced4da;
182
+  border-radius: .25rem;
183
+  border-bottom-right-radius: 0;
184
+  border-top-right-radius: 0;
185
+}
186
+
187
+.input-item-text input[type=checkbox], .input-item-text input[type=radio] {
188
+  margin-top: 0
189
+}
190
+
191
+.input-card {
192
+  display: flex;
193
+  flex-direction: column;
194
+  min-width: 0;
195
+  word-wrap: break-word;
196
+  background-color: #fff;
197
+  background-clip: border-box;
198
+  border-radius: .25rem;
199
+  width: 22rem;
200
+  border-width: 0;
201
+  border-radius: 0.4rem;
202
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
203
+  position: fixed;
204
+  bottom: 1rem;
205
+  right: 1rem;
206
+  -ms-flex: 1 1 auto;
207
+  flex: 1 1 auto;
208
+  padding: 0.75rem 1.25rem;
209
+}
210
+
211
+.input-text {
212
+  line-height: 2rem;
213
+  margin-right: 2rem;
214
+}
215
+
216
+.info hr {
217
+  margin-right: 0;
218
+  margin-left: 0;
219
+  border-top-color: grey;
220
+}
221
+
222
+.infoBox {
223
+  padding: .75rem 1.25rem;
224
+  position: absolute;
225
+  top: 1rem;
226
+  background-color: white;
227
+  width: auto;
228
+  min-width: 22rem;
229
+  left: 1rem;
230
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
231
+  z-index: 100;
232
+  .inputText{
233
+    margin-right: 10px;
234
+  }
235
+  .input{
236
+    width: 200px;
237
+  }
238
+ 
239
+}
240
+
241
+.code {
242
+  left: 1.5rem;
243
+  right: 1.5rem;
244
+  top: 1.5rem;
245
+  bottom: 1.5rem;
246
+  overflow: auto;
247
+  margin-bottom: 0rem;
248
+}
249
+
250
+.code .btn {
251
+  top: 1rem;
252
+  position: absolute;
253
+  right: 1rem;
254
+}
255
+
256
+.code .result {
257
+  border: 1px solid rgba(0, 0, 0, 0.1);
258
+  border-radius: 0.5rem;
259
+  padding: 1rem;
260
+  bottom: 1rem;
261
+  position: absolute;
262
+  top: 5.5rem;
263
+  right: 1rem;
264
+  left: 1rem;
265
+  overflow: auto;
266
+}
267
+
268
+.code .status {
269
+  color: #80adff;
270
+  display: inline-block;
271
+  font-size: 14px;
272
+}
273
+
274
+.code h4 {
275
+  display: inline-block;
276
+  max-width: 20rem;
277
+  margin-right: 1rem;
278
+  margin-bottom: 1rem;
279
+}
280
+
281
+select, input[type=text], input[type=date] {
282
+  display: inline-block;
283
+  // width: 100%;
284
+  padding: .375rem 1.75rem .375rem .75rem;
285
+  line-height: 1.5;
286
+  color: #495057;
287
+  vertical-align: middle;
288
+  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;
289
+  background-size: 8px 10px;
290
+  border: 1px solid #ced4da;
291
+  border-radius: .25rem;
292
+  -webkit-appearance: none;
293
+  -moz-appearance: none;
294
+  appearance: none
295
+}
296
+
297
+input[type=text],input[type=date] {
298
+  background: #fff;
299
+  padding: .375rem .75rem;
300
+}
301
+
302
+select:focus, input[type=text]:focus, input[type=date]:focus {
303
+  border-color: #80bdff;
304
+  outline: 0;
305
+  box-shadow: 0 0 0 .1rem rgba(128, 189, 255, .1)
306
+}
307
+
308
+.btn:focus {
309
+  outline: 0;
310
+  box-shadow: none;
311
+}
312
+
313
+select:focus::-ms-value, input[type=text]:focus::-ms-value,input[type=date]:focus::-ms-value {
314
+  color: #495057;
315
+  background-color: #fff
316
+}
317
+
318
+
319
+/* native toastr */
320
+.native-toast {
321
+  position: fixed;
322
+  background-color: rgba(50, 50, 50, .8);
323
+  border-radius: 33px;
324
+  color: white;
325
+  left: 50%;
326
+  text-align: center;
327
+  padding: 6px 12px;
328
+  opacity: 0;
329
+  z-index: 99999;
330
+  transition: transform .25s, opacity .25s, top .25s;
331
+  box-sizing: border-box;
332
+}
333
+
334
+.native-toast-bottom {
335
+  bottom: 50px;
336
+  -ms-transform: translateX(-50%) translateY(50px);
337
+      transform: translateX(-50%) translateY(50px)
338
+}
339
+
340
+.native-toast-bottom.native-toast-shown {
341
+  opacity: 1;
342
+  -ms-transform: translateX(-50%) translateY(0);
343
+      transform: translateX(-50%) translateY(0);
344
+}
345
+
346
+.native-toast-bottom.native-toast-edge {
347
+  bottom: 0;
348
+}
349
+
350
+.native-toast-top {
351
+  top: 50px;
352
+  -ms-transform: translateX(-50%) translateY(-50px);
353
+      transform: translateX(-50%) translateY(-50px)
354
+}
355
+
356
+.native-toast-top.native-toast-shown {
357
+  opacity: 1;
358
+  -ms-transform: translateX(-50%) translateY(0);
359
+      transform: translateX(-50%) translateY(0);
360
+}
361
+
362
+.native-toast-top.native-toast-edge {
363
+  top: 0;
364
+}
365
+
366
+.native-toast-center {
367
+  top: 0;
368
+  -ms-transform: translateX(-50%) translateY(-50px);
369
+      transform: translateX(-50%) translateY(-50px)
370
+}
371
+
372
+.native-toast-center.native-toast-shown {
373
+  opacity: 1;
374
+  top: 50%;
375
+  -ms-transform: translateX(-50%) translateY(-50%);
376
+      transform: translateX(-50%) translateY(-50%);
377
+}
378
+
379
+.native-toast-edge {
380
+  border-radius: 0;
381
+  width: 100%;
382
+  text-align: left;
383
+}
384
+
385
+@media screen and (min-width: 40rem) {
386
+  .native-toast:not(.native-toast-edge) {
387
+    max-width: 18rem;
388
+  }
389
+}
390
+
391
+/*
392
+  max-width does not seem to work in small screen?
393
+*/
394
+
395
+/*@media screen and (max-width: 768px) {
396
+  .native-toast:not(.native-toast-edge) {
397
+    max-width: 400px;
398
+  }
399
+}
400
+
401
+@media screen and (max-width: 468px) {
402
+  .native-toast:not(.native-toast-edge) {
403
+    max-width: 300px;
404
+  }
405
+}*/
406
+
407
+/* types */
408
+
409
+.native-toast-error {
410
+  background-color: #d92727;
411
+  color: white;
412
+}
413
+
414
+.native-toast-success {
415
+  background-color: #62a465;
416
+  color: white;
417
+}
418
+
419
+.native-toast-warning {
420
+  background-color: #fdaf17;
421
+  color: white;
422
+}
423
+
424
+.native-toast-info {
425
+  background-color: #5060ba;
426
+  color: white;
427
+}
428
+
429
+[class^="native-toast-icon-"] {
430
+  vertical-align: middle;
431
+  margin-right: 8px
432
+}
433
+
434
+[class^="native-toast-icon-"] svg {
435
+  width: 16px;
436
+  height: 16px;
437
+}

+ 401
- 0
src/pages/building/list/add/amap.wxss Ver arquivo

@@ -0,0 +1,401 @@
1
+html {
2
+  font-size: 12px;
3
+}
4
+.amap-copyright {
5
+  box-sizing: content-box;
6
+}
7
+* {
8
+  box-sizing: border-box;
9
+}
10
+.input-textarea {
11
+  color: grey;
12
+  height: 8em;
13
+  overflow: auto;
14
+  border-radius: 0.4rem;
15
+  border: 1px solid #ced4da;
16
+  margin-bottom: 1rem;
17
+}
18
+body {
19
+  margin: 0;
20
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
21
+  line-height: 1.5;
22
+  font-weight: 300;
23
+  color: #111213;
24
+}
25
+hr {
26
+  margin: 0.5rem 0;
27
+  box-sizing: content-box;
28
+  height: 0;
29
+  overflow: visible;
30
+  border: 0;
31
+  border-top: 1px solid rgba(0, 0, 0, 0.1);
32
+}
33
+p {
34
+  margin-top: 0;
35
+  margin-bottom: 0;
36
+}
37
+label {
38
+  display: inline-block;
39
+  margin-bottom: 0.4rem;
40
+}
41
+label,
42
+.btn {
43
+  margin-left: 0;
44
+  font-size: 1rem;
45
+}
46
+button,
47
+input,
48
+select {
49
+  margin: 0;
50
+  font-family: inherit;
51
+  font-size: inherit;
52
+  line-height: inherit;
53
+  overflow: visible;
54
+  text-transform: none;
55
+}
56
+[type=button]::-moz-focus-inner,
57
+[type=reset]::-moz-focus-inner,
58
+[type=submit]::-moz-focus-inner,
59
+button::-moz-focus-inner {
60
+  padding: 0;
61
+  border-style: none;
62
+}
63
+input[type=checkbox],
64
+input[type=radio] {
65
+  -webkit-box-sizing: border-box;
66
+  box-sizing: border-box;
67
+  padding: 0;
68
+  margin: 0 0.5rem 0 0;
69
+}
70
+h4 {
71
+  font-family: inherit;
72
+  line-height: 1.8;
73
+  font-weight: 300;
74
+  color: inherit;
75
+  font-size: 1.1rem;
76
+  margin-top: 0;
77
+  margin-bottom: 0.5rem;
78
+}
79
+.btn {
80
+  display: inline-block;
81
+  font-weight: 400;
82
+  text-align: center;
83
+  white-space: nowrap;
84
+  vertical-align: middle;
85
+  -webkit-user-select: none;
86
+  -moz-user-select: none;
87
+  -ms-user-select: none;
88
+  user-select: none;
89
+  border: 1px solid transparent;
90
+  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
91
+  background-color: transparent;
92
+  background-image: none;
93
+  color: #25A5F7;
94
+  border-color: #25A5F7;
95
+  padding: .25rem .5rem;
96
+  line-height: 1.5;
97
+  border-radius: 1rem;
98
+  -webkit-appearance: button;
99
+  cursor: pointer;
100
+}
101
+.btn:hover {
102
+  color: #fff;
103
+  background-color: #25A5F7;
104
+  border-color: #25A5F7;
105
+}
106
+.btn:hover {
107
+  text-decoration: none;
108
+}
109
+.input-item {
110
+  position: relative;
111
+  display: -ms-flexbox;
112
+  display: flex;
113
+  -ms-flex-wrap: wrap;
114
+  flex-wrap: wrap;
115
+  -ms-flex-align: center;
116
+  align-items: center;
117
+  width: 100%;
118
+  height: 3rem;
119
+}
120
+.input-item:last-child {
121
+  margin-bottom: 0;
122
+}
123
+.input-item > select,
124
+.input-item > input[type=text],
125
+.input-item > input[type=date] {
126
+  position: relative;
127
+  -ms-flex: 1 1 auto;
128
+  flex: 1 1 auto;
129
+  width: 1%;
130
+  margin-bottom: 0;
131
+}
132
+.input-item > select:not(:last-child),
133
+.input-item > input[type=text]:not(:last-child),
134
+.input-item > input[type=date]:not(:last-child) {
135
+  border-top-right-radius: 0;
136
+  border-bottom-right-radius: 0;
137
+}
138
+.input-item > select:not(:first-child),
139
+.input-item > input[type=text]:not(:first-child),
140
+.input-item > input[type=date]:not(:first-child) {
141
+  border-top-left-radius: 0;
142
+  border-bottom-left-radius: 0;
143
+}
144
+.input-item-prepend {
145
+  margin-right: -1px;
146
+}
147
+.input-item-text,
148
+input[type=text],
149
+input[type=date],
150
+select {
151
+  height: calc(4.2rem);
152
+}
153
+.input-item-text {
154
+  width: 6rem;
155
+  text-align: justify;
156
+  padding: 0.4rem 0.7rem;
157
+  display: inline-block;
158
+  text-justify: distribute-all-lines;
159
+  /*ie6-8*/
160
+  text-align-last: justify;
161
+  /* ie9*/
162
+  -moz-text-align-last: justify;
163
+  /*ff*/
164
+  -webkit-text-align-last: justify;
165
+  /*chrome 20+*/
166
+  -ms-flex-align: center;
167
+  align-items: center;
168
+  margin-bottom: 0;
169
+  font-size: 1rem;
170
+  font-weight: 400;
171
+  line-height: 1.5;
172
+  color: #495057;
173
+  text-align: center;
174
+  white-space: nowrap;
175
+  background-color: #e9ecef;
176
+  border: 1px solid #ced4da;
177
+  border-radius: .25rem;
178
+  border-bottom-right-radius: 0;
179
+  border-top-right-radius: 0;
180
+}
181
+.input-item-text input[type=checkbox],
182
+.input-item-text input[type=radio] {
183
+  margin-top: 0;
184
+}
185
+.input-card {
186
+  display: flex;
187
+  flex-direction: column;
188
+  min-width: 0;
189
+  word-wrap: break-word;
190
+  background-color: #fff;
191
+  background-clip: border-box;
192
+  border-radius: .25rem;
193
+  width: 22rem;
194
+  border-width: 0;
195
+  border-radius: 0.4rem;
196
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
197
+  position: fixed;
198
+  bottom: 1rem;
199
+  right: 1rem;
200
+  -ms-flex: 1 1 auto;
201
+  flex: 1 1 auto;
202
+  padding: 0.75rem 1.25rem;
203
+}
204
+.input-text {
205
+  line-height: 2rem;
206
+  margin-right: 2rem;
207
+}
208
+.info hr {
209
+  margin-right: 0;
210
+  margin-left: 0;
211
+  border-top-color: grey;
212
+}
213
+.info {
214
+  padding: .75rem 1.25rem;
215
+  margin-bottom: 1rem;
216
+  border-radius: .25rem;
217
+  position: fixed;
218
+  top: 1rem;
219
+  background-color: white;
220
+  width: auto;
221
+  min-width: 22rem;
222
+  border-width: 0;
223
+  right: 1rem;
224
+  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
225
+  position: absolute;
226
+  z-index: 100;
227
+}
228
+.code {
229
+  left: 1.5rem;
230
+  right: 1.5rem;
231
+  top: 1.5rem;
232
+  bottom: 1.5rem;
233
+  overflow: auto;
234
+  margin-bottom: 0rem;
235
+}
236
+.code .btn {
237
+  top: 1rem;
238
+  position: absolute;
239
+  right: 1rem;
240
+}
241
+.code .result {
242
+  border: 1px solid rgba(0, 0, 0, 0.1);
243
+  border-radius: 0.5rem;
244
+  padding: 1rem;
245
+  bottom: 1rem;
246
+  position: absolute;
247
+  top: 5.5rem;
248
+  right: 1rem;
249
+  left: 1rem;
250
+  overflow: auto;
251
+}
252
+.code .status {
253
+  color: #80adff;
254
+  display: inline-block;
255
+  font-size: 14px;
256
+}
257
+.code h4 {
258
+  display: inline-block;
259
+  max-width: 20rem;
260
+  margin-right: 1rem;
261
+  margin-bottom: 1rem;
262
+}
263
+select,
264
+input[type=text],
265
+input[type=date] {
266
+  display: inline-block;
267
+  width: 100%;
268
+  padding: .375rem 1.75rem .375rem .75rem;
269
+  line-height: 1.5;
270
+  color: #495057;
271
+  vertical-align: middle;
272
+  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
273
+  background-size: 8px 10px;
274
+  border: 1px solid #ced4da;
275
+  border-radius: .25rem;
276
+  -webkit-appearance: none;
277
+  -moz-appearance: none;
278
+  appearance: none;
279
+}
280
+input[type=text],
281
+input[type=date] {
282
+  background: #fff;
283
+  padding: .375rem .75rem;
284
+}
285
+select:focus,
286
+input[type=text]:focus,
287
+input[type=date]:focus {
288
+  border-color: #80bdff;
289
+  outline: 0;
290
+  box-shadow: 0 0 0 0.1rem rgba(128, 189, 255, 0.1);
291
+}
292
+.btn:focus {
293
+  outline: 0;
294
+  box-shadow: none;
295
+}
296
+select:focus::-ms-value,
297
+input[type=text]:focus::-ms-value,
298
+input[type=date]:focus::-ms-value {
299
+  color: #495057;
300
+  background-color: #fff;
301
+}
302
+/* native toastr */
303
+.native-toast {
304
+  position: fixed;
305
+  background-color: rgba(50, 50, 50, 0.8);
306
+  border-radius: 33px;
307
+  color: white;
308
+  left: 50%;
309
+  text-align: center;
310
+  padding: 6px 12px;
311
+  opacity: 0;
312
+  z-index: 99999;
313
+  transition: transform .25s, opacity .25s, top .25s;
314
+  box-sizing: border-box;
315
+}
316
+.native-toast-bottom {
317
+  bottom: 50px;
318
+  -ms-transform: translateX(-50%) translateY(50px);
319
+  transform: translateX(-50%) translateY(50px);
320
+}
321
+.native-toast-bottom.native-toast-shown {
322
+  opacity: 1;
323
+  -ms-transform: translateX(-50%) translateY(0);
324
+  transform: translateX(-50%) translateY(0);
325
+}
326
+.native-toast-bottom.native-toast-edge {
327
+  bottom: 0;
328
+}
329
+.native-toast-top {
330
+  top: 50px;
331
+  -ms-transform: translateX(-50%) translateY(-50px);
332
+  transform: translateX(-50%) translateY(-50px);
333
+}
334
+.native-toast-top.native-toast-shown {
335
+  opacity: 1;
336
+  -ms-transform: translateX(-50%) translateY(0);
337
+  transform: translateX(-50%) translateY(0);
338
+}
339
+.native-toast-top.native-toast-edge {
340
+  top: 0;
341
+}
342
+.native-toast-center {
343
+  top: 0;
344
+  -ms-transform: translateX(-50%) translateY(-50px);
345
+  transform: translateX(-50%) translateY(-50px);
346
+}
347
+.native-toast-center.native-toast-shown {
348
+  opacity: 1;
349
+  top: 50%;
350
+  -ms-transform: translateX(-50%) translateY(-50%);
351
+  transform: translateX(-50%) translateY(-50%);
352
+}
353
+.native-toast-edge {
354
+  border-radius: 0;
355
+  width: 100%;
356
+  text-align: left;
357
+}
358
+@media screen and (min-width: 40rem) {
359
+  .native-toast:not(.native-toast-edge) {
360
+    max-width: 18rem;
361
+  }
362
+}
363
+/*
364
+  max-width does not seem to work in small screen?
365
+*/
366
+/*@media screen and (max-width: 768px) {
367
+  .native-toast:not(.native-toast-edge) {
368
+    max-width: 400px;
369
+  }
370
+}
371
+
372
+@media screen and (max-width: 468px) {
373
+  .native-toast:not(.native-toast-edge) {
374
+    max-width: 300px;
375
+  }
376
+}*/
377
+/* types */
378
+.native-toast-error {
379
+  background-color: #d92727;
380
+  color: white;
381
+}
382
+.native-toast-success {
383
+  background-color: #62a465;
384
+  color: white;
385
+}
386
+.native-toast-warning {
387
+  background-color: #fdaf17;
388
+  color: white;
389
+}
390
+.native-toast-info {
391
+  background-color: #5060ba;
392
+  color: white;
393
+}
394
+[class^="native-toast-icon-"] {
395
+  vertical-align: middle;
396
+  margin-right: 8px;
397
+}
398
+[class^="native-toast-icon-"] svg {
399
+  width: 16px;
400
+  height: 16px;
401
+}

+ 107
- 0
src/pages/building/list/add/components/amap.jsx Ver arquivo

@@ -0,0 +1,107 @@
1
+import React from 'react';
2
+import ReactDOM from 'react-dom';
3
+import { Map, Marker } from 'react-amap';
4
+import styles from '../amap.less'
5
+
6
+class Amap extends React.Component {
7
+  constructor(props) {
8
+    super(props);
9
+    // 高德地图 Marker 实例
10
+    this.markerInstance = undefined
11
+    // 高德地图 Map 实例
12
+    this.mapInstance = undefined
13
+    this.amapEvents = {
14
+      created: mapInstance => {
15
+        console.log('高德地图 Map 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
16
+        console.log(mapInstance.getZoom());
17
+        this.mapInstance = mapInstance
18
+
19
+        AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.CitySearch'], () => {
20
+          // 实例化Autocomplete
21
+          const autoOptions = {
22
+            // city 限定城市,默认全国
23
+            city: '全国',
24
+            // input 为绑定输入提示功能的input的DOM ID
25
+            input: 'amapInput',
26
+          }
27
+          const autoComplete = new AMap.Autocomplete(autoOptions);
28
+          // 无需再手动执行search方法,autoComplete会根据传入input对应的DOM动态触发search
29
+
30
+          const placeSearch = new AMap.PlaceSearch({
31
+            city: '南京',
32
+            map: mapInstance,
33
+          })
34
+
35
+          // 监听下拉框选中事件
36
+          AMap.event.addListener(autoComplete, 'select', e => {
37
+            // TODO 针对选中的poi实现自己的功能
38
+            placeSearch.setCity(e.poi.adcode)
39
+            placeSearch.search(e.poi.name)
40
+          })
41
+
42
+
43
+          const citySearch = new AMap.CitySearch()
44
+          citySearch.getLocalCity((status, result) => {
45
+            if (status === 'complete' && result.info === 'OK') {
46
+              // 查询成功,result即为当前所在城市信息
47
+              console.log('当前所在城市:', result)
48
+              if (result && result.city && result.bounds) {
49
+                // 当前城市名称
50
+                // const cityinfo = result.city;
51
+
52
+                // 当前城市位置信息
53
+                const citybounds = result.bounds;
54
+                // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
55
+                // 地图显示当前城市
56
+                mapInstance.setBounds(citybounds);
57
+              }
58
+            }
59
+          })
60
+        })
61
+
62
+        // 实例点击事件
63
+        mapInstance.on('click', e => {
64
+          const lngLat = `${e.lnglat.getLng()},${e.lnglat.getLat()}`
65
+          console.log('坐标位置:', lngLat)
66
+          this.props.onChange(lngLat)
67
+        });
68
+      },
69
+    };
70
+    this.markerEvents = {
71
+      created: markerInstance => {
72
+        console.log('高德地图 Marker 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
73
+        console.log(markerInstance.getPosition());
74
+
75
+        this.markerInstance = markerInstance
76
+      },
77
+    }
78
+    this.markerPosition = { longitude: 120, latitude: 30 };
79
+  }
80
+
81
+  render() {
82
+    const { value } = this.props
83
+    if (value) {
84
+      this.markerInstance.setPosition(value.split(','))
85
+    }
86
+
87
+    return (
88
+      <>
89
+        <div style={{ width: '100%', height: '400px', position: 'relative' }}>
90
+          <Map events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03">
91
+            <Marker position={this.markerPosition} events={this.markerEvents} />
92
+          </Map>
93
+          {
94
+          <div className={styles.infoBox}>
95
+            <span className={styles.inputText}>请输入关键字</span>
96
+            <input id="amapInput" className={styles.input} type="text" />
97
+          </div>
98
+          }
99
+        </div>
100
+      </>
101
+    )
102
+  }
103
+}
104
+
105
+// f0d1d4f82432504003ebf46e5e36ff03
106
+
107
+export default Amap

+ 4
- 2
src/pages/building/list/add/components/base.jsx Ver arquivo

@@ -9,6 +9,7 @@ import ImageUpload from '../../../../../components/XForm/ImageUpload'
9 9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
10 10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
11 11
 import TagGroup from './tags'
12
+import Amap from './amap'
12 13
 import BudildingProjectType from './buildingProjectType'
13 14
 
14 15
 const { Option } = Select
@@ -79,6 +80,7 @@ function AddBuilding(props) {
79 80
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
80 81
     request({ ...api, data: { ...data } }).then(() => {
81 82
       openNotificationWithIcon('success', '操作成功')
83
+      router.go(-1)
82 84
     }).catch(err => {
83 85
       openNotificationWithIcon('error', err.message)
84 86
     })
@@ -123,7 +125,7 @@ function AddBuilding(props) {
123 125
           <Form.Item label="销售状态" hasFeedback>
124 126
             {getFieldDecorator('marketStatus')(<Input />)}
125 127
           </Form.Item>
126
-          <Form.Item label="标签" hasFeedback>
128
+          <Form.Item label="标签" hasFeedback style={{ display: 'none' }}>
127 129
             {getFieldDecorator('tags')(
128 130
               <Select mode="multiple" placeholder="标签" style={{ width: '1016px' }}>
129 131
                 <Option value="未知">未知</Option>
@@ -176,7 +178,7 @@ function AddBuilding(props) {
176 178
             {getFieldDecorator('coordinate')(<Input disabled />)}
177 179
           </Form.Item>
178 180
           <Form.Item label="地图位置" hasFeedback>
179
-            {(<Input />)}
181
+            {getFieldDecorator('coordinate')(<Amap />)}
180 182
           </Form.Item>
181 183
           <Form.Item label="周边交通" hasFeedback>
182 184
             {getFieldDecorator('buildingTransport')(

+ 57
- 74
src/pages/building/list/add/components/buildingProjectType.jsx Ver arquivo

@@ -51,35 +51,33 @@ class TypeForm extends React.Component {
51 51
 
52 52
     return (
53 53
       <>
54
-        <div>
55
-          <Row>
56
-            <Col span={8}>{ this.props.type.buildingTypeName || ''}</Col>
57
-            <Col span={1}>
58
-              <Button type="link" icon="close" onClick={() => this.close()} />
59
-            </Col>
60
-          </Row>
61
-          <Row>
62
-            <Col span={12}>
63
-              <Form {...formItemLayout}>
64
-                <Form.Item label="类型编号" style={{ display: 'none' }}>
65
-                  {getFieldDecorator('buildingTypeId')(<Input disabled />)}
66
-                </Form.Item>
67
-                <Form.Item label="状态" style={{ display: 'none' }}>
68
-                  {getFieldDecorator('status')(<Input disabled />)}
69
-                </Form.Item>
70
-                <Form.Item label="价格">
71
-                  {getFieldDecorator('price')(<Input type="number" placeholder="元/㎡" onChange={e => this.onChange(e, 'price')}/>)}
72
-                </Form.Item>
73
-                <Form.Item label="装修标准">
74
-                  {getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')}/>)}
75
-                </Form.Item>
76
-                <Form.Item label="产权年限">
77
-                  {getFieldDecorator('rightsYear')(<Input onChange={e => this.onChange(e, 'rightsYear')}/>)}
78
-                </Form.Item>
79
-              </Form>
80
-            </Col>
81
-          </Row>
82
-        </div>
54
+        <Col span={11} style={{
55
+          position: 'relative',
56
+          border: '1px solid #eee',
57
+          borderRadius: '4px',
58
+          marginTop:'16px'
59
+        }}>
60
+
61
+          <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
62
+
63
+          <Form {...formItemLayout} style={{ padding: '10px 0px 10px 10px' }}>
64
+            <Form.Item label="类型编号" style={{ display: 'none' }}>
65
+              {getFieldDecorator('buildingTypeId')(<Input disabled />)}
66
+            </Form.Item>
67
+            <Form.Item label="状态" style={{ display: 'none' }}>
68
+              {getFieldDecorator('status')(<Input disabled />)}
69
+            </Form.Item>
70
+            <Form.Item label="价格">
71
+              {getFieldDecorator('price')(<Input type="number" placeholder="元/㎡" onChange={e => this.onChange(e, 'price')} />)}
72
+            </Form.Item>
73
+            <Form.Item label="装修标准">
74
+              {getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')} />)}
75
+            </Form.Item>
76
+            <Form.Item label="产权年限">
77
+              {getFieldDecorator('rightsYear')(<Input onChange={e => this.onChange(e, 'rightsYear')} />)}
78
+            </Form.Item>
79
+          </Form>
80
+        </Col>
83 81
       </>
84 82
     )
85 83
   }
@@ -119,10 +117,7 @@ class ProjectTypeBody extends React.Component {
119 117
   }
120 118
 
121 119
   onSuccess = (values, item) => {
122
-    console.log('values: ', values)
123
-    console.log('data: ', this.state.data, 'item: ', item)
124 120
     const newData = this.getNewProjectType(values)
125
-    console.log('newData: ', newData)
126 121
     this.setState({ data: newData })
127 122
     if (typeof this.props.onChange === 'function') {
128 123
       this.props.onChange(newData)
@@ -130,22 +125,20 @@ class ProjectTypeBody extends React.Component {
130 125
   }
131 126
 
132 127
   onCheckboxChange = checkedValues => {
133
-      const checked = (`${checkedValues}` || '').split(',')
134
-      const { projectType } = this.state
135
-      const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
128
+    // console.log('checkedValues: ', checkedValues)
129
+    const checked = (`${checkedValues}` || '').split(',')
130
+    const { projectType } = this.state
131
+    const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
136 132
 
137
-      // 这里会把值替换掉
138
-
139
-      const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, price: '', decoration: '', rightsYear: '', status: '1' }))
140
-      const updateProjectDate = this.updateProjectType(checkedValues)
141
-      console.log('updateProjectDate: ', updateProjectDate)
142
-      this.setState({ data: updateProjectDate })
133
+    const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, price: '', decoration: '', rightsYear: '', status: '1' }))
134
+    const updateProjectDate = this.updateProjectType(tempDate)
135
+    console.log('updateProjectDate: ', updateProjectDate)
136
+    this.setState({ data: updateProjectDate })
143 137
   }
144 138
 
145 139
   onClose = e => {
146 140
     const { data } = this.state
147 141
     const buildingType = data.filter(item => e.buildingTypeId !== item.buildingTypeId)
148
-    console.log('buildingType: ', buildingType)
149 142
     this.setState({ data: buildingType })
150 143
     this.setState({ defaultCheckboxValue: buildingType.map(item => item.buildingTypeId) })
151 144
   }
@@ -153,7 +146,6 @@ class ProjectTypeBody extends React.Component {
153 146
   getNewProjectType = values => {
154 147
     const data = []
155 148
     this.state.data.map(item => {
156
-      console.log('item: ', item)
157 149
       if (item.buildingTypeId === values.buildingTypeId) {
158 150
         data.push(values)
159 151
       } else {
@@ -165,18 +157,22 @@ class ProjectTypeBody extends React.Component {
165 157
   }
166 158
 
167 159
   updateProjectType = values => {
168
-    const data = []
169
-    this.state.data.map(item => {
170
-      values.map(va => {
171
-        if (item.buildingTypeId === va.buildingTypeId) {
172
-          data.push(va)
173
-        } else {
174
-          data.push(item)
175
-        }
176
-      })
177
-    })
160
+    // 获取所有复选框选中的id
161
+    const valueIdArray = values.map(item => item.buildingTypeId)
162
+    // console.log('valueIdArray: ', valueIdArray)
178 163
 
179
-    return data
164
+    // 获取 data 中已经赋值的数据  交集
165
+    const valueData = this.state.data.filter(item => valueIdArray.includes(item.buildingTypeId))
166
+    // console.log('valueData: ', valueData)
167
+
168
+    // 获取 非 data中数据(也就是没有赋值),交集
169
+    const trueValueArr = valueData.map(item => item.buildingTypeId)
170
+    const trueValueData = values.filter(item => !trueValueArr.includes(item.buildingTypeId))
171
+
172
+    // console.log('trueValueData: ', trueValueData)
173
+
174
+    // 把两个 数组的值,合并返回
175
+    return valueData.concat(trueValueData)
180 176
   }
181 177
 
182 178
   getList = params => {
@@ -196,11 +192,7 @@ class ProjectTypeBody extends React.Component {
196 192
       tempData = value
197 193
       tempCheckboxValue = tempData.map(item => item.buildingTypeId)
198 194
       this.setState({ defaultCheckboxValue: tempCheckboxValue })
199
-      this.setState({ data: tempData }, () => {
200
-        console.log("state: ", this.state.data)
201
-      })
202
-
203
-      console.log("tempData: ", tempData, "tempCheckboxValue: ", tempCheckboxValue, "value: ", value)
195
+      this.setState({ data: tempData })
204 196
     }
205 197
   }
206 198
 
@@ -228,18 +220,7 @@ class ProjectTypeBody extends React.Component {
228 220
     this.getList({ pageNum: 1, pageSize: 999 })
229 221
   }
230 222
 
231
-  render () {
232
-
233
-    // let tempData = []
234
-    // let tempCheckboxValue = []
235
-    // const { value } = this.props
236
-    // if (value !== undefined && value !== null) {
237
-    //   tempData = value
238
-    // } else {
239
-    //   tempData = this.state.data
240
-    // }
241
-
242
-    // tempCheckboxValue = tempData.map(item => item.buildingTypeId)
223
+  render() {
243 224
     return (
244 225
       <>
245 226
         <Button type="primary" icon="plus" size="large" onClick={() => this.showMadel()} />
@@ -251,9 +232,11 @@ class ProjectTypeBody extends React.Component {
251 232
         >
252 233
           <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
253 234
         </Modal>
254
-        {
255
-          this.state.data.map(item => <WrappedTypeForm type={item} key={item.id} onSuccess={(e) => this.onSuccess(e, item)} onClose={(e) => this.onClose(e)} />)
256
-        }
235
+        <Row type="flex" justify="space-between">
236
+          {
237
+            this.state.data.map(item => <WrappedTypeForm type={item} key={item.id} onSuccess={(e) => this.onSuccess(e, item)} onClose={(e) => this.onClose(e)} />)
238
+          }
239
+        </Row>
257 240
       </>
258 241
     )
259 242
   }

+ 10
- 1
src/pages/building/list/add/components/imageSet.jsx Ver arquivo

@@ -61,6 +61,15 @@ function imageSet(props) {
61 61
     })
62 62
   }
63 63
 
64
+  /**
65
+   *回调事件
66
+   *
67
+   */
68
+  function onModalChange() {
69
+    getList()
70
+    setVisibleData({ visible: false, apartmentId: '', buildingId: '' })
71
+  }
72
+
64 73
   /**
65 74
    *打开编辑页
66 75
    *
@@ -138,7 +147,7 @@ function imageSet(props) {
138 147
 
139 148
       {/* 编辑页 */}
140 149
       {/*  onSuccess是子组件传递事件信息  */}
141
-      <ModalImage visibleData={visibleData} key={1} onSuccess={getList}/>
150
+      <ModalImage visibleData={visibleData} key={1} onSuccess={() => onModalChange()}/>
142 151
     </>
143 152
   )
144 153
 }

+ 6
- 5
src/pages/building/list/add/components/modalImage.jsx Ver arquivo

@@ -5,6 +5,7 @@ import request from '../../../../../utils/request';
5 5
 import apis from '../../../../../services/apis';
6 6
 import Styles from '../style.less';
7 7
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
8
+import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
8 9
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
9 10
 
10 11
 
@@ -61,8 +62,8 @@ class ModalImage extends React.Component {
61 62
   // }
62 63
 
63 64
   componentDidUpdate(preProps, preState) {
64
-    console.log(this.props.visibleData)
65 65
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
66
+      console.log(this.props.visibleData)
66 67
       this.getById()
67 68
       this.setState({ visibleData: this.props.visibleData });
68 69
     }
@@ -91,7 +92,7 @@ class ModalImage extends React.Component {
91 92
 
92 93
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
93 94
       // res.img = res.buildingImgList.map((item, _) => item.url)
94
-      res.img = res.buildingImgList[0].url
95
+      res.img = res.buildingImgList.map(item => item.url)
95 96
       this.props.form.setFieldsValue(res)
96 97
     }).catch(err => {
97 98
      this.openNotificationWithIcon('error', err)
@@ -118,7 +119,7 @@ class ModalImage extends React.Component {
118 119
 
119 120
   submitData(data) {
120 121
     // TODO 这里应该是要支持多图,但是封装的控件没有
121
-    data.img = [{ imgType: 'aparment', url: data.img, orderNo: 1 }]
122
+    data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
122 123
     data.buildingId = this.props.visibleData.buildingId;
123 124
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
124 125
 
@@ -131,7 +132,7 @@ class ModalImage extends React.Component {
131 132
       // onSuccess() 是自定义
132 133
       this.props.onSuccess()
133 134
 
134
-      this.handleCancel()
135
+      // this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } }, () => console.log('回调:', this.state.visibleData))
135 136
     }).catch(err => {
136 137
       // eslint-disable-next-line no-unused-expressions
137 138
       this.openNotificationWithIcon('error', err)
@@ -186,7 +187,7 @@ class ModalImage extends React.Component {
186 187
               </Form.Item>
187 188
               <Form.Item label="图片">
188 189
               {getFieldDecorator('img')(
189
-                <ImageUpload />,
190
+                <ImageListUpload />,
190 191
               )}
191 192
               </Form.Item>
192 193
               <Form.Item label="面积">

+ 147
- 0
src/pages/building/list/add/components/poster.jsx Ver arquivo

@@ -0,0 +1,147 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../../components/XForm';
8
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../../utils/request'
10
+import PosterBottom from '../../../../../assets/bottom.png'
11
+import yinhao from '../../../../../assets/yinhao.png'
12
+import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
+import poster1 from '../../../../../assets/poster1.png';
14
+import poster2 from '../../../../../assets/poster2.png';
15
+import Styles from '../style.less';
16
+import apis from '../../../../../services/apis';
17
+
18
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
+const { TextArea } = Input;
20
+
21
+const Poster = props => {
22
+  const [inputValue, changeInput] = useState('')
23
+  const [textAreaValue, changeTextArea] = useState('')
24
+  const [imgValue, changeImg] = useState('')
25
+  const [posterId, setPosterId] = useState('')
26
+
27
+  const [building, setBuilding] = useState({})
28
+  const { buildingId } = props.building
29
+
30
+  if (buildingId) {
31
+    // eslint-disable-next-line react-hooks/rules-of-hooks
32
+    useEffect(() => {
33
+      request({
34
+        url: '/api/admin/poster',
35
+        method: 'GET',
36
+        params: { targetId: buildingId, targetType: 'building' },
37
+      }).then(data => {
38
+        console.log(data, '2222')
39
+        if (data.length > 0) {
40
+          setPosterId(data[0].posterId)
41
+          changeImg(data[0].posterImg)
42
+          changeTextArea(data[0].posterDescription)
43
+          changeInput(data[0].posterTitle)
44
+        }
45
+      }).catch(err => {
46
+        message.info(err.msg || err.message)
47
+      })
48
+
49
+      getById(buildingId)
50
+    }, [])
51
+  }
52
+
53
+  // 获取详情信息
54
+  function getById(currentId) {
55
+    const { url, method } = apis.building.buildingGetById
56
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
57
+
58
+    request({ url: tempUrl, method }).then(res => {
59
+      setBuilding(res)
60
+    })
61
+  }
62
+
63
+  const submitPoster = () => {
64
+    if (buildingId) {
65
+      if (posterId) {
66
+        request({
67
+          url: `/api/admin/poster/${posterId}`,
68
+          method: 'PUT',
69
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
70
+        }).then(() => {
71
+          message.info('保存成功')
72
+        }).catch(err => {
73
+          message.info(err.msg || err.message)
74
+        })
75
+      } else {
76
+        request({
77
+          url: '/api/admin/poster',
78
+          method: 'POST',
79
+          data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
80
+        }).then(data => {
81
+          setPosterId(data.posterId)
82
+          message.info('保存成功')
83
+        }).catch(err => {
84
+          message.info(err.msg || err.message)
85
+        })
86
+      }
87
+    } else {
88
+      message.warn('请先保存基本信息数据')
89
+    }
90
+  }
91
+
92
+  return <div>
93
+    <div style={{ display: 'flex' }}>
94
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
95
+        <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
96
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
97
+
98
+          <p className={Styles.tagLabel}>
99
+            {
100
+              building.buildingTag && building.buildingTag.map(item => <span>{item.tagName}</span>)
101
+            }
102
+          </p>
103
+          <p style={{
104
+            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
105
+            display: '-webkit-box', lineClamp: '3', height: '36px',lineHeight:'36px',
106
+            WebkitLineClamp: '1',
107
+            WebkitBoxOrient: 'vertical',
108
+            overflow: 'hidden',
109
+            textOverflow: 'ellipsis',
110
+          }}>{building.buildingName || '楼盘标题'}</p>
111
+          <p style={{ color: '#999',padding:' 0 20px' }}>约<span style={{ color: '#fd0d0c', fontSize: '24px',marginLeft:'6px' }}>{ building.price }</span><span style={{ color: '#fd0d0c', fontSize: '20px' }}>元/m²</span></p>
112
+
113
+          <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
114
+          <p style={{
115
+            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
116
+            display: '-webkit-box', lineClamp: '3', height: '76px',
117
+            WebkitLineClamp: '3',
118
+            WebkitBoxOrient: 'vertical',
119
+            overflow: 'hidden',
120
+            textOverflow: 'ellipsis',
121
+          }}>{textAreaValue || '海报描述'}</p>
122
+          <img src={PosterBottom} style={{ width: '100%' }} alt="" />
123
+        </div>
124
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
125
+      </div>
126
+      <div >
127
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
128
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
129
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
130
+        </div>
131
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
132
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
133
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
134
+        </div>
135
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
136
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
137
+          <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
138
+        </div>
139
+
140
+      </div>
141
+    </div>
142
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
143
+    <Button onClick={() => router.go(-1)}>取消</Button>
144
+  </div>
145
+}
146
+
147
+export default Poster

+ 97
- 0
src/pages/building/list/add/components/share.jsx Ver arquivo

@@ -0,0 +1,97 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import moment from 'moment';
5
+import router from 'umi/router';
6
+import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
+import XForm, { FieldTypes } from '../../../../../components/XForm';
8
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
+import request from '../../../../../utils/request'
10
+import PosterBottom from '../../../../../assets/bottom.png'
11
+import yinhao from '../../../../../assets/yinhao.png'
12
+import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
+import logo from '../../../../../assets/logo.png';
14
+import touxiang from '../../../../../assets/touxiang.jpg';
15
+import poster1 from '../../../../../assets/poster1.png';
16
+import poster2 from '../../../../../assets/poster2.png';
17
+
18
+const Share = props => {
19
+  const [inputValue, changeInput] = useState('')
20
+  const [imgValue, changeImg] = useState('')
21
+  const [shareContentId, setShareContentId] = useState('')
22
+
23
+  const { buildingId } = props.building
24
+  if (buildingId) {
25
+    // eslint-disable-next-line react-hooks/rules-of-hooks
26
+    useEffect(() => {
27
+      request({
28
+        url: '/api/admin/shareContent',
29
+        method: 'GET',
30
+        params: { targetId: buildingId, targetType: 'building' },
31
+      }).then(data => {
32
+        if (data.length > 0) {
33
+          setShareContentId(data[0].shareContentId)
34
+          changeImg(data[0].shareContentImg)
35
+          changeInput(data[0].shareContentTitle)
36
+        }
37
+      }).catch(err => {
38
+        message.info(err.msg || err.message)
39
+      })
40
+    }, [])
41
+  }
42
+
43
+  const submitShare = () => {
44
+    if (buildingId) {
45
+      if (shareContentId) {
46
+        request({
47
+          url: `/api/admin/shareContent/${shareContentId}`,
48
+          method: 'PUT',
49
+          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
50
+        }).then(data => {
51
+          message.info('保存成功')
52
+        }).catch(err => {
53
+          message.info(err.msg || err.message)
54
+        })
55
+       } else {
56
+        request({
57
+          url: '/api/admin/shareContent',
58
+          method: 'POST',
59
+          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
60
+        }).then(data => {
61
+          setShareContentId(data.shareContentId)
62
+          message.info('保存成功')
63
+        }).catch(err => {
64
+          message.info(err.msg || err.message)
65
+        })
66
+       }
67
+     } else {
68
+      message.warn('请先保存基本信息数据')
69
+     }
70
+  }
71
+
72
+  return <div style={{ padding: '20px' }}>
73
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
74
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
75
+      <div>
76
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
77
+          <img src={logo} style={{ width: '22px', marginRight: '10px' }} />
78
+          知与行互动
79
+        </p>
80
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
81
+        <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
82
+      </div>
83
+    </div>
84
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
85
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
86
+      <Input placeholder="请输入海报标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
87
+    </div>
88
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
89
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
90
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
91
+    </div>
92
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
93
+    <Button onClick={() => router.go(-1)}>取消</Button>
94
+  </div>
95
+}
96
+
97
+export default Share

+ 42
- 15
src/pages/building/list/add/index.jsx Ver arquivo

@@ -12,6 +12,8 @@ import Wangedit from '../../../../components/Wangedit/Wangedit'
12 12
 import TagGroup from './components/tags'
13 13
 import Base from './components/base'
14 14
 import ImageSet from './components/imageSet'
15
+import Poster from './components/poster'
16
+import Share from './components/share'
15 17
 
16 18
 
17 19
 const { Option } = Select
@@ -29,25 +31,50 @@ const formItemLayout = {
29 31
 };
30 32
 
31 33
 function AddBuilding(props) {
32
-  function tabsCallback(key) {
33
-    console.log(key);
34
+
35
+  const [tab, setTab] = useState('base')
36
+
37
+  function tabsCallback(e) {
38
+    console.log(e);
39
+    setTab(e.target.value)
34 40
   }
35 41
 
36
-  console.log(props.location)
42
+  // console.log(props.location)
37 43
 
38 44
   return (
39
-    <Tabs defaultActiveKey="1" onChange={tabsCallback}>
40
-      <TabPane tab="基本信息" key="1">
41
-        <Base building={{ buildingId: props.location.query && props.location.query.id }} />
42
-      </TabPane>
43
-      {
44
-        props.location.query.id &&
45
-        <TabPane tab="图片" key="2">
46
-          {/* '159fd19bb973b6972c10fbebf07ddeb1' */}
47
-          <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />
48
-        </TabPane>
49
-      }
50
-    </Tabs>
45
+    <>
46
+      <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
47
+        <Radio.Button value="base">基本信息</Radio.Button>
48
+        {
49
+          props.location.query.id &&
50
+          (
51
+            <>
52
+              <Radio.Button value="image">图片</Radio.Button>
53
+              <Radio.Button value="poster">海报图片</Radio.Button>
54
+              <Radio.Button value="share">分享设置</Radio.Button>
55
+            </>
56
+          )
57
+        }
58
+      </Radio.Group>
59
+      <div style={{ marginTop: '20px' }}>
60
+        { tab === 'base' && <Base building={{ buildingId: props.location.query && props.location.query.id }} /> }
61
+        { props.location.query.id && (tab === 'image' && <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />)}
62
+        { props.location.query.id && (tab === 'poster' && <Poster building={{ buildingId: props.location.query && props.location.query.id }} />)}
63
+        { props.location.query.id && (tab === 'share' && <Share building={{ buildingId: props.location.query && props.location.query.id }} />)}
64
+      </div>
65
+    </>
66
+    // <Tabs defaultActiveKey="1" onChange={tabsCallback}>
67
+    //   <TabPane tab="基本信息" key="1">
68
+    //     <Base building={{ buildingId: props.location.query && props.location.query.id }} />
69
+    //   </TabPane>
70
+    //   {
71
+    //     props.location.query.id &&
72
+    //     <TabPane tab="图片" key="2">
73
+    //       {/* '159fd19bb973b6972c10fbebf07ddeb1' */}
74
+    //       <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />
75
+    //     </TabPane>
76
+    //   }
77
+    // </Tabs>
51 78
   )
52 79
 }
53 80
 

+ 20
- 0
src/pages/building/list/add/style.less Ver arquivo

@@ -0,0 +1,20 @@
1
+.tagLabel{
2
+  padding: 14px 20px 0 20px;
3
+  margin: 0 0 5px 0;
4
+  span{
5
+    padding: 2px 8px;
6
+    font-size: 10px;
7
+    background-color: #e1f7eb;
8
+    color: #3de180;
9
+    border-radius: 2px;
10
+    margin-right: 10px;
11
+  }
12
+  span:nth-child(3n+2){
13
+    color: #72a0d1;
14
+    background-color: #eaeff5;
15
+  }
16
+  span:nth-child(3n+3){
17
+    color: #ff5858;
18
+    background-color: #fff0f1;
19
+  }
20
+}

+ 5
- 21
src/pages/carouselFigure/advertisingList.jsx Ver arquivo

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
-
9
+import apis from '../../services/apis';
10 10
 import request from '../../utils/request'
11 11
 
12 12
 const { Option } = Select;
@@ -22,11 +22,7 @@ const header = (props) => {
22 22
 
23 23
   // 查询列表
24 24
   const getList = (params) => {
25
-    request({
26
-        url: '/api/admin/extendContent',
27
-        method: 'GET',
28
-        params: { ...params },
29
-    }).then((data) => {
25
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
30 26
         console.log(data)
31 27
         setData(data)
32 28
     })
@@ -97,11 +93,7 @@ const toEdit = (contentId) => () => {
97 93
           okText: '确定',
98 94
           cancelText: '取消',
99 95
           onOk() {
100
-              request({
101
-                  url: '/api/admin/buildingDynamic/finish',
102
-                  method: 'PUT',
103
-                  data: {dynamicId: row.dynamicId, top: ""},
104
-              }).then((data) => {
96
+              request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
105 97
                   console.log(data)
106 98
                   message.info('操作成功!')
107 99
                   getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
@@ -123,11 +115,7 @@ const toEdit = (contentId) => () => {
123 115
           okText: '确定',
124 116
           cancelText: '取消',
125 117
           onOk() {
126
-              request({
127
-                  url: '/api/admin/extendContent/'+row.contentId,
128
-                  method: 'PUT',
129
-                  data: row,
130
-              }).then((data) => {
118
+              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
131 119
                   message.info('操作成功!')
132 120
                   getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
133 121
               }).catch((err) => {
@@ -143,11 +131,7 @@ const toEdit = (contentId) => () => {
143 131
           okText: '确定',
144 132
           cancelText: '取消',
145 133
           onOk() {
146
-              request({
147
-                  url: '/api/admin/extendContent/'+row.contentId,
148
-                  method: 'PUT',
149
-                  data: row,
150
-              }).then((data) => {
134
+              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
151 135
                   message.info('操作成功!')
152 136
                   getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
153 137
               }).catch((err) => {

+ 5
- 21
src/pages/carouselFigure/carouselFigureList.jsx Ver arquivo

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
-
9
+import apis from '../../services/apis';
10 10
 import request from '../../utils/request'
11 11
 
12 12
 const { Option } = Select;
@@ -22,11 +22,7 @@ const header = (props) => {
22 22
 
23 23
   // 查询列表
24 24
   const getList = (params) => {
25
-    request({
26
-        url: '/api/admin/extendContent',
27
-        method: 'GET',
28
-        params: { ...params },
29
-    }).then((data) => {
25
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
30 26
         console.log(data)
31 27
         setData(data)
32 28
     })
@@ -97,11 +93,7 @@ const toEditCarouse = (contentId) => () => {
97 93
           okText: '确定',
98 94
           cancelText: '取消',
99 95
           onOk() {
100
-              request({
101
-                  url: '/api/admin/buildingDynamic/finish',
102
-                  method: 'PUT',
103
-                  data: {dynamicId: row.dynamicId, top: ""},
104
-              }).then((data) => {
96
+            request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
105 97
                   console.log(data)
106 98
                   message.info('操作成功!')
107 99
                   getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
@@ -123,11 +115,7 @@ const toEditCarouse = (contentId) => () => {
123 115
           okText: '确定',
124 116
           cancelText: '取消',
125 117
           onOk() {
126
-              request({
127
-                  url: '/api/admin/extendContent/'+row.contentId,
128
-                  method: 'PUT',
129
-                  data: row,
130
-              }).then((data) => {
118
+            request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
131 119
                   message.info('操作成功!')
132 120
                   getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
133 121
               }).catch((err) => {
@@ -143,11 +131,7 @@ const toEditCarouse = (contentId) => () => {
143 131
           okText: '确定',
144 132
           cancelText: '取消',
145 133
           onOk() {
146
-              request({
147
-                  url: '/api/admin/extendContent/'+row.contentId,
148
-                  method: 'PUT',
149
-                  data: row,
150
-              }).then((data) => {
134
+            request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
151 135
                   message.info('操作成功!')
152 136
                   getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
153 137
               }).catch((err) => {

+ 4
- 14
src/pages/carouselFigure/editAdvertising.jsx Ver arquivo

@@ -7,6 +7,7 @@ import router from 'umi/router';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10
+import apis from '../../services/apis';
10 11
 import request from '../../utils/request'
11 12
 
12 13
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
@@ -27,10 +28,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
27 28
 
28 29
   // 查询列表
29 30
   const getDetail = (contentId) => {
30
-    request({
31
-        url: '/api/admin/extendContent/' + contentId,
32
-        method: 'GET',
33
-    }).then((data) => {
31
+    request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
34 32
         console.log(data)
35 33
         setData(data)
36 34
     })
@@ -123,21 +121,13 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
123 121
     const handleSubmit = val => { 
124 122
       val.showType = 'screen'
125 123
       if(contentId){
126
-        request({
127
-          url: '/api/admin/extendContent/'+contentId,
128
-          method: 'PUT',
129
-          data: val,
130
-        }).then((data) => {
124
+        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
131 125
           cancelPage()
132 126
         }).catch((err) => {
133 127
           message.info(err.msg || err.message)
134 128
         })
135 129
       }else{
136
-        request({
137
-          url: '/api/admin/extendContent',
138
-          method: 'POST',
139
-          data: val,
140
-        }).then((data) => {
130
+        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
141 131
           cancelPage()
142 132
         }).catch((err) => {
143 133
           message.info(err.msg || err.message)

+ 4
- 14
src/pages/carouselFigure/editCarousel.jsx Ver arquivo

@@ -7,6 +7,7 @@ import router from 'umi/router';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10
+import apis from '../../services/apis';
10 11
 import request from '../../utils/request'
11 12
 
12 13
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
@@ -27,10 +28,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
27 28
 
28 29
   // 查询列表
29 30
   const getDetail = (contentId) => {
30
-    request({
31
-        url: '/api/admin/extendContent/' + contentId,
32
-        method: 'GET',
33
-    }).then((data) => {
31
+    request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
34 32
         console.log(data)
35 33
         setData(data)
36 34
     })
@@ -123,21 +121,13 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
123 121
     const handleSubmit = val => { 
124 122
       val.showType = 'banner'
125 123
       if(contentId){
126
-        request({
127
-          url: '/api/admin/extendContent/'+contentId,
128
-          method: 'PUT',
129
-          data: val,
130
-        }).then((data) => {
124
+        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
131 125
           cancelPage()
132 126
         }).catch((err) => {
133 127
           message.info(err.msg || err.message)
134 128
         })
135 129
       }else{
136
-        request({
137
-          url: '/api/admin/extendContent',
138
-          method: 'POST',
139
-          data: val,
140
-        }).then((data) => {
130
+        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
141 131
           cancelPage()
142 132
         }).catch((err) => {
143 133
           message.info(err.msg || err.message)

+ 38
- 38
src/pages/channel/channelList.jsx Ver arquivo

@@ -80,7 +80,7 @@ const columns = [
80 80
     dataIndex: '',
81 81
     key: '',
82 82
     align: 'center',
83
-    render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toedit(record.channelId)} >编辑</a>,
83
+    render: (text, record) => <a style={{ color: '#66B3FF' }} onClick={() => toedit(record.channelId)} >编辑</a>,
84 84
   },
85 85
 ];
86 86
 
@@ -93,16 +93,16 @@ function toAdd() {
93 93
     },
94 94
   });
95 95
 }
96
-  // 跳编辑页面
97
-  function toedit(channelId) {
98
-    // alert(channelId)
99
-    router.push({
100
-      pathname: '/channel/editChannel',
101
-      query: {
102
-        id: channelId,
103
-      },
104
-    });
105
-  }
96
+// 跳编辑页面
97
+function toedit(channelId) {
98
+  // alert(channelId)
99
+  router.push({
100
+    pathname: '/channel/editChannel',
101
+    query: {
102
+      id: channelId,
103
+    },
104
+  });
105
+}
106 106
 
107 107
 const header = props => {
108 108
   // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -118,11 +118,11 @@ const header = props => {
118 118
       url: '/api/admin/channel',
119 119
       method: 'GET',
120 120
       params: { ...params },
121
-  // eslint-disable-next-line no-shadow
122
-  }).then(data => {
121
+      // eslint-disable-next-line no-shadow
122
+    }).then(data => {
123 123
       console.log(data)
124 124
       setData(data)
125
-  })
125
+    })
126 126
   }
127 127
   // value 的值
128 128
   function handleChange(value) {
@@ -133,48 +133,48 @@ const header = props => {
133 133
   function queryList() {
134 134
     getList({ pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
135 135
   }
136
- // 重置
137
- function reset() {
138
-  getList({ pageNum: 1, pageSize: 10 })
139
- }
136
+  // 重置
137
+  function reset() {
138
+    getList({ pageNum: 1, pageSize: 10 })
139
+  }
140 140
 
141
- // 跳编辑页
142
- function toEdit() {
143
-  router.push({
144
-    pathname: '/integralMall/editGoods',
145
-    query: {
146
-      a: 'b',
147
-    },
148
-  });
149
-}
141
+  // 跳编辑页
142
+  function toEdit() {
143
+    router.push({
144
+      pathname: '/integralMall/editGoods',
145
+      query: {
146
+        a: 'b',
147
+      },
148
+    });
149
+  }
150 150
 
151 151
   // 分页
152 152
   function onChange(pageNumber) {
153 153
     // eslint-disable-next-line react-hooks/rules-of-hooks
154
-      getList({ pageNum: pageNumber, pageSize: 9 })
154
+    getList({ pageNum: pageNumber, pageSize: 9 })
155 155
   }
156 156
 
157 157
   return (
158 158
     <>
159 159
       <div className={channels.searchBox}>
160
-        <dvi>
160
+        <div>
161 161
           <span className={channels.selectName}>渠道名称</span>
162 162
           <Select defaultValue="请选择" style={{ width: 180 }} onChange={handleChange}>
163
-          <option value="">全部</option>
164
-              {data.channelNmae.map(Item =>
165
-                <Option value={ Item.channelId }> { Item.channelName } </Option>,
166
-              )}
167
-              {/* {listItems} */}
163
+            <option value="">全部</option>
164
+            {data.channelNmae.map(Item =>
165
+              <Option value={Item.channelId}> {Item.channelName} </Option>,
166
+            )}
167
+            {/* {listItems} */}
168 168
           </Select>
169
-        </dvi>
169
+        </div>
170 170
         <div >
171
-        <Button type="primary" onClick={() => queryList() }>查询</Button>
172
-        {/* <Button onClick={() => reset() }>重置</Button> */}
171
+          <Button type="primary" onClick={() => queryList()}>查询</Button>
172
+          {/* <Button onClick={() => reset() }>重置</Button> */}
173 173
         </div>
174 174
       </div>
175 175
       <Button type="danger" onClick={toAdd} className={channels.about} >新增</Button>
176 176
       <Table dataSource={data.result.records} columns={columns} pagination={{ pageSize: 10, total: data.result.total, onChange }} />
177
-  </>
177
+    </>
178 178
   )
179 179
 }
180 180
 

+ 3
- 11
src/pages/integralMall/GoodsList.jsx Ver arquivo

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import BuildSelect from '../../components/SelectButton/BuildSelect'
7
-
7
+import apis from '../../services/apis';
8 8
 import request from '../../utils/request'
9 9
 
10 10
 const { Option } = Select;
@@ -20,11 +20,7 @@ function header(props) {
20 20
 
21 21
   // 查询列表
22 22
   const getList = (params) => {
23
-    request({
24
-        url: '/api/admin/taGoods',
25
-        method: 'GET',
26
-        params: { ...params },
27
-    }).then((data) => {
23
+    request({ ...apis.integralMall.getTaGoods, params: { ...params },}).then((data) => {
28 24
         console.log(data)
29 25
         setData(data)
30 26
     })
@@ -62,11 +58,7 @@ function header(props) {
62 58
       okText: '确认',
63 59
       cancelText: '取消',
64 60
       onOk() {
65
-        request({
66
-          url: '/api/admin/taGoods/change',
67
-          method: 'PUT',
68
-          data: { ...row },
69
-        }).then((data) => {
61
+        request({ ...apis.integralMall.changeTaGoods, data: { ...row },}).then((data) => {
70 62
           message.info('操作成功!')
71 63
           getList({ pageNum: 1, pageSize: 10 });
72 64
         })

+ 3
- 10
src/pages/integralMall/achieve.jsx Ver arquivo

@@ -5,6 +5,7 @@ import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import apis from '../../services/apis';
8 9
 import request from '../../utils/request'
9 10
 
10 11
 const { TabPane } = Tabs;
@@ -28,11 +29,7 @@ useEffect(() => {
28 29
 
29 30
 // 查询列表
30 31
 const getList = (params) => {
31
-  request({
32
-      url: '/api/admin/tdPointsRules',
33
-      method: 'GET',
34
-      params: { ...params },
35
-  }).then((data) => {
32
+  request({ ...apis.integralMall.tdPointsRules, params: { ...params },}).then((data) => {
36 33
       console.log(data)
37 34
       setData(data)
38 35
   })
@@ -54,11 +51,7 @@ const changePageNum = (pageNumber) => {
54 51
   }
55 52
 
56 53
   const changeStatus = (row) => () => {
57
-    request({
58
-      url: '/api/admin/tdPointsRules/change',
59
-      method: 'PUT',
60
-      data: { ...row },
61
-    }).then((data) => {
54
+    request({ ...apis.integralMall.change, data: { ...row },}).then((data) => {
62 55
       message.info('操作成功!')
63 56
       getList({ pageNum: 1, pageSize: 10, type: carType})
64 57
     })

+ 4
- 14
src/pages/integralMall/editGoods.jsx Ver arquivo

@@ -6,6 +6,7 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
6 6
 import XForm, { FieldTypes } from '../../components/XForm';
7 7
 import Wangedit from '../../components/Wangedit/Wangedit'
8 8
 import router from 'umi/router';
9
+import apis from '../../services/apis';
9 10
 import request from '../../utils/request'
10 11
 
11 12
 const { TextArea } = Input;
@@ -21,10 +22,7 @@ const header = props => {
21 22
 
22 23
   // 查询列表
23 24
   const getGoodsData = (goodsId) => {
24
-    request({
25
-        url: '/api/admin/taGoods/' + goodsId,
26
-        method: 'GET',
27
-    }).then((data) => {
25
+    request({ ...apis.integralMall.taGoods, urlData: { id: goodsId },}).then((data) => {
28 26
         console.log(data)
29 27
         setGoodsData(data)
30 28
     })
@@ -111,21 +109,13 @@ const header = props => {
111 109
   const handleSubmit = (values) => {
112 110
     if(goodsId){
113 111
       values.goodsId = goodsId
114
-      request({
115
-        url: '/api/admin/taGoods',
116
-        method: 'PUT',
117
-        data: values,
118
-      }).then((data) => {
112
+      request({ ...apis.integralMall.updateTaGoods, data: values,}).then((data) => {
119 113
         cancelPage()
120 114
       }).catch((err) => {
121 115
         message.info(err.msg || err.message)
122 116
       })
123 117
       }else{
124
-      request({
125
-        url: '/api/admin/taGoods/add',
126
-        method: 'POST',
127
-        data: values,
128
-      }).then((data) => {
118
+      request({ ...apis.integralMall.addTaGoods, data: values,}).then((data) => {
129 119
         cancelPage()
130 120
       }).catch((err) => {
131 121
         message.info(err.msg || err.message)

+ 2
- 6
src/pages/integralMall/exchangeRecords.jsx Ver arquivo

@@ -5,7 +5,7 @@ import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
-
8
+import apis from '../../services/apis';
9 9
 import request from '../../utils/request'
10 10
 
11 11
 /**
@@ -27,11 +27,7 @@ function record(props) {
27 27
 
28 28
   // 查询列表
29 29
   const getList = (params) => {
30
-    request({
31
-        url: '/api/admin/taPointsExchange',
32
-        method: 'GET',
33
-        params: { ...params },
34
-    }).then((data) => {
30
+    request({ ...apis.integralMall.taPointsExchange, params: { ...params },}).then((data) => {
35 31
         setData(data)
36 32
     })
37 33
   }

+ 3
- 11
src/pages/integralMall/verifyList.jsx Ver arquivo

@@ -4,7 +4,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7
-
7
+import apis from '../../services/apis';
8 8
 import request from '../../utils/request'
9 9
 
10 10
 const { Option } = Select;
@@ -19,11 +19,7 @@ const header = (props) => {
19 19
 
20 20
   // 查询列表
21 21
   const getVerifyList = (params) => {
22
-    request({
23
-      url: '/api/admin/taPointsExchange',
24
-      method: 'GET',
25
-      params: { ...params },
26
-    }).then((data) => {
22
+    request({ ...apis.integralMall.taPointsExchange, params: { ...params },}).then((data) => {
27 23
         setData(data)
28 24
     })
29 25
   }
@@ -39,11 +35,7 @@ const header = (props) => {
39 35
   }
40 36
 
41 37
   const changeStatus = (row) => () => {
42
-    request({
43
-      url: '/api/admin/taPointsExchange/change',
44
-      method: 'PUT',
45
-      data: row
46
-    }).then((data) => {
38
+    request({ ...apis.integralMall.changeTaPointsExchange, data: row}).then((data) => {
47 39
         message.info("操作成功")
48 40
         getVerifyList({ pageNum: pageNumber, pageSize: 10, phone: props.location.query.telValue })
49 41
     })

+ 2
- 5
src/pages/staff/list/RoleList.jsx Ver arquivo

@@ -25,15 +25,12 @@ const header = props => {
25 25
 function addRole(roleId) {
26 26
   router.push({
27 27
     pathname: '/staff/list/addRole',
28
-    query: {
29
-      id: roleId,
30
-    },
31 28
   });
32 29
 }
33 30
 
34 31
 function toEditRole(roleId) {
35 32
   router.push({
36
-    pathname: '/staff/list/editRole',
33
+    pathname: '/staff/list/addRole',
37 34
     query: {
38 35
       id: roleId,
39 36
     },
@@ -104,7 +101,7 @@ const columns = [
104 101
       <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={() => stop(record.roleId)}>{ record.status === 1 ? '停用' : '启用' }
105 102
       <Icon type="stop" className={styles.shoppingCart} style={{ fontSize: 14 }}/>
106 103
       </span>
107
-      <span style={{ color: '#FF925C' }} onClick={toEditRole}>编辑
104
+      <span style={{ color: '#FF925C' }} onClick={() => toEditRole(record.roleId)} >编辑
108 105
       <Icon type="form" className={styles.edit} />
109 106
       </span>
110 107
     </>,

+ 61
- 48
src/pages/staff/list/StaffList.jsx Ver arquivo

@@ -5,6 +5,7 @@ import { FormattedMessage } from 'umi-plugin-react/locale';
5 5
 import styles from '../../style/GoodsList.less';
6 6
 import router from 'umi/router';
7 7
 import { Card, Avatar } from 'antd';
8
+import apis from '../../../services/apis';
8 9
 import request from '../../../utils/request'
9 10
 import Styles from './style.less';
10 11
 
@@ -22,6 +23,7 @@ const toEditStaff = (userId) => () => {
22 23
   });
23 24
 }
24 25
 
26
+
25 27
 /**
26 28
  *卡片
27 29
  *
@@ -29,19 +31,35 @@ const toEditStaff = (userId) => () => {
29 31
  */
30 32
 const CartBody = (props) => {
31 33
   const { data } = props
34
+
35
+  const confirm = (data) => () => {
36
+    console.log(data,"11111")
37
+    if(data.status === 1){
38
+      Modal.confirm({
39
+        title: '确认停用该角色?',
40
+        okText: '确认',
41
+        cancelText: '取消',
42
+        onOk() {
43
+          request({ ...apis.staff.change, urlData: {id:data.userId,type:'off'}}).then((data) => {
44
+            message.info("操作成功")
45
+            props.onFresh()
46
+          })
47
+        }
48
+      });
49
+    }else{
50
+      Modal.confirm({
51
+        title: '确认启用该角色?',
52
+        okText: '确认',
53
+        cancelText: '取消',
54
+        onOk() {
55
+          request({ ...apis.staff.change, urlData: {id:data.userId,type:'on'}}).then((data) => {
56
+            message.info("操作成功")
57
+            props.onFresh()
58
+          })
59
+        }
60
+      });
61
+    }
32 62
     
33
-  const confirm = () => {
34
-    Modal.confirm({
35
-      title: '确认停用该角色?',
36
-      okText: '确认',
37
-      cancelText: '取消',
38
-      onOk () {
39
-        console.log('OK');
40
-      },
41
-      onCancel () {
42
-        console.log('Cancel');
43
-      },
44
-    });
45 63
   }
46 64
   return (
47 65
 
@@ -49,14 +67,18 @@ const CartBody = (props) => {
49 67
       <div>
50 68
 
51 69
         <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
52
-        <span className={Styles.ediText} style={{ marginLeft: '20px' }} onClick={toEditStaff(data.userId)}>
70
+        <Button type="link" style={{ marginLeft: '10px', color: '#FF925C', fontSize: '18px' }} onClick={toEditStaff(data.userId)}>
53 71
           编辑
54
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
55
-        </span>
56
-        <span className={Styles.ediText} style={{ marginLeft: '50px' }} onClick={confirm}>
57
-          停用
58
-                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
59
-        </span>
72
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
73
+        </Button>
74
+        <Button type="link" style={{ fontSize: '18px', color: '#cacaca', position: 'absolute', top: '50px', right: '0' }} onClick={confirm(data)}>
75
+          {data.status === 1 ? '停用' : '启用'}
76
+                <Icon type={data.status===1?'close-circle':'form'} style={{ color: '#C0C4CC', marginLeft: '8px' }} />
77
+        </Button>
78
+        {/* <Button type="link" style={{ fontSize: '18px', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
79
+          启用
80
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
81
+        </Button> */}
60 82
 
61 83
       </div>
62 84
       <div>
@@ -69,14 +91,11 @@ const CartBody = (props) => {
69 91
           }
70 92
         </span>
71 93
 
72
-        <p className={Styles.cardText} style={{ width: '300px' }}>
73
-          <span>姓名:{data.userName}</span>
74
-
75
-          <span style={{ float: "right" }}>状态:{data.status === '1' ? '启用' : '停用'}</span>
76
-
94
+        <p className={Styles.cardText} >姓名 : {data.userName}
77 95
         </p>
78
-        <p className={Styles.cardText} style={{ width: '300px' }}>
79
-          <span>电话:{data.phone}</span>
96
+        <p className={Styles.statusText} > 状态 : {data.status === 1 ? '启用' : '停用'} </p>
97
+        <p className={Styles.phoneText} >
98
+          电话 : {data.phone}
80 99
         </p>
81 100
       </div>
82 101
 
@@ -84,21 +103,16 @@ const CartBody = (props) => {
84 103
   )
85 104
 }
86 105
 
87
-
88 106
 const header = (props) => {
89
-  const [tempData,setTempData] = useState([])
107
+  const [tempData, setTempData] = useState([])
90 108
   useEffect(() => {
91 109
     getList({ pageNum: 1, pageSize: 10 });
92
-  },[])
110
+  }, [])
93 111
 
94 112
   const getList = (params) => {
95
-    request({
96
-      url: '/api/admin/taUser',
97
-      method: 'GET',
98
-      params: { ...params },
99
-    }).then((data) => {
100
-        console.log(data,"listData")
101
-        setTempData(data.records)
113
+    request({ ...apis.staff.taUser, params: { ...params } }).then((data) => {
114
+      console.log(data, "listData")
115
+      setTempData(data.records)
102 116
     })
103 117
   }
104 118
 
@@ -108,15 +122,15 @@ const header = (props) => {
108 122
   }
109 123
 
110 124
   // 提交事件
111
-const handleSubmit = (e, props) => {
112
-  e.preventDefault();
113
-  props.form.validateFields((err, values) => {
114
-    if (!err) {
115
-      console.log('提交数据: ', values)
116
-      getList({ pageNum: 1, pageSize: 10, ...values })
117
-    }
118
-  });
119
-}
125
+  const handleSubmit = (e, props) => {
126
+    e.preventDefault();
127
+    props.form.validateFields((err, values) => {
128
+      if (!err) {
129
+        console.log('提交数据: ', values)
130
+        getList({ pageNum: 1, pageSize: 10, ...values })
131
+      }
132
+    });
133
+  }
120 134
 
121 135
   const { getFieldDecorator } = props.form
122 136
   return (
@@ -156,13 +170,12 @@ const handleSubmit = (e, props) => {
156 170
           </Button>
157 171
         </Form.Item>
158 172
       </Form>
159
-      <Button type="danger" className={styles.addBtn} onClick={toEditStaff()}>新增</Button>
160
-
173
+      <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
161 174
       <Row style={{ padding: ' 0 10px' }}>
162 175
         {
163 176
           tempData.map((item, index) => (
164 177
             <Col span={6}>
165
-              <CartBody data={item} />
178
+              <CartBody data={item} onFresh={()=> getList({ pageNum: 1, pageSize: 10 })}/>
166 179
             </Col>
167 180
           ))
168 181
         }

+ 234
- 160
src/pages/staff/list/addRole.jsx Ver arquivo

@@ -1,10 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Checkbox, Input, Card } from 'antd';
2
+import { Checkbox, Input, Card, Form, Button,Row,Col } from 'antd';
3 3
 import { connect } from 'dva';
4 4
 import XForm, { FieldTypes } from '../../../components/XForm';
5 5
 import request from '../../../utils/request';
6 6
 import channels from './channelList.less';
7
-import { resolve } from 'path';
7
+import { resolve, join } from 'path';
8
+import router from 'umi/router';
8 9
 
9 10
 const { TextArea } = Input;
10 11
 
@@ -15,174 +16,247 @@ const { TextArea } = Input;
15 16
  * @param {*} props
16 17
  * @returns
17 18
  */
18
-const add = props => {
19
-  const Poster = propses => {
20
-    console.log('props,props', props.user.currentUser)
21
-    const userMenus = props.user.currentUser.menus;
22
-    const userBtns = props.user.currentUser.buttons;
23
-    const [data, setData] = useState({ data: [] })
24
-   // 获取当前所有菜单
25
-    useEffect(() => {
26
-      localStorage.removeItem('value');
27
-      menuList({ pageNum: 1, pageSize: 100 })
28
-    }, [])
29
-  
30
-    function menuList(params) {
31
-      request({
32
-        url: '/api/admin/menuList',
33
-        method: 'GET',
34
-        params: { ...params },
35
-    // eslint-disable-next-line no-shadow
19
+const Poster = props => {
20
+  console.log('props,props', props.user.currentUser)
21
+  const userMenus = props.user.currentUser.menus;
22
+  const userBtns = props.user.currentUser.buttons;
23
+
24
+  // 获取当前所有菜单
25
+  const [data, setData] = useState({ data: [] })
26
+  const [buutonDate, setBuutonDate] = useState({})
27
+
28
+  // 展示要显示的菜单和按钮----(编辑)
29
+  const [dataMenuId, setDataMenuId] = useState([])
30
+  const [dataButtonId, setDataButtonId] = useState([])
31
+
32
+  useEffect(() => {
33
+    // 新增和编辑用一个页面,判断新增是否为0和null
34
+    if (props.location.query) {
35
+      const { id } = props.location.query
36
+      if (id) {
37
+        buttonAndMenuList('', id)
38
+      }
39
+    }
40
+    // menuList({ pageNum: 1, pageSize: 100 })
41
+    buttonList({ pageNum: 1, pageSize: 100 })
42
+  }, [])
43
+  // 当前所有的菜单
44
+  function menuList(params) {
45
+    request({
46
+      url: '/api/admin/menuList',
47
+      method: 'GET',
48
+      params: { ...params },
49
+      // eslint-disable-next-line no-shadow
36 50
     }).then(data => {
37
-        console.log(data)
38
-        setData(data)
51
+      setData(data)
39 52
     })
40
-    }
53
+  }
54
+  // 所有按钮
55
+  function buttonList(params) {
56
+    request({
57
+      url: '/api/admin/buttonList',
58
+      method: 'GET',
59
+      params: { ...params },
60
+      // eslint-disable-next-line no-shadow
61
+    }).then(data => {
62
+      console.log(data)
63
+      setBuutonDate(data)
64
+    })
65
+  }
41 66
 
67
+  // 根据角色id查询当前的菜单及其按钮
68
+  function buttonAndMenuList(params, id) {
69
+    console.log('id: ', id)
70
+    request({
71
+      url: `/api/admin/taRole/details/${id}`,
72
+      method: 'GET',
73
+      params: { ...params },
74
+      // eslint-disable-next-line no-shadow
75
+    }).then(data => {
76
+      console.log('data.roleName: ', data)
77
+      props.form.setFieldsValue({ roleName: data.roleName })
78
+      console.log(data)
79
+      setData(data)
42 80
 
43
-    // const [menus, setMenus] = useState([]);
44
-// 判断menus是否有值
45
-    const [menus, setMenus] = useState([]);
81
+      // 获取所有的权限Id
82
+      setDataMenuId(data.sysMenuList.map(item => item.menuId))
83
+      setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a)))
84
+    })
85
+  }
86
+  // 添加角色
87
+  function addRole(params) {
88
+    request({
89
+      url: '/api/admin/taRole/',
90
+      method: 'GET',
91
+      params: { ...params },
92
+      // eslint-disable-next-line no-shadow
93
+    }).then(data => {
94
+      console.log(data)
95
+      setData(data)
96
+    })
97
+  }
46 98
 
47 99
 
48
-    const addMenus = m => {
49
-      const newMenus = [...menus, m]
50
-      setMenus([...menus, m])
51
-    };
52
-    const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
53
-    const handleMenuChange = m => e => {
54
-      console.log('e', m)
55
-      if (e.target.checked) {
56
-        // setMenusData(m)
57
-        addMenus(m)
58
-      } else {
59
-        delMenus(m)
60
-      }
61
-      console.log('menus1111', menus)
100
+  // const [menus, setMenus] = useState([]);
101
+  // 判断menus是否有值
102
+  const [menus, setMenus] = useState([]);
103
+  const addMenus = m => {
104
+    const newMenus = [...menus, m]
105
+    setMenus([...menus, m])
106
+  };
107
+  const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
108
+  const handleMenuChange = m => e => {
109
+    if (e.target.checked) {
110
+      setDataMenuId(dataMenuId.concat(m.menuId))
111
+      addMenus(m)
112
+    } else {
113
+      setDataMenuId([m.menuId])
114
+      delMenus(m)
62 115
     }
116
+    console.log('dataMenuId', dataMenuId)
117
+    console.log('menus', menus)
118
+  }
63 119
 
64
-    const [but, setBut] = useState([]);
65
-    // 判断menus是否有值
66
-        const addBut = m => setBut([...but, m]);
67
-        const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
68
-        const handleButChange = m => e => {
69
-          console.log('e', m)
70
-          if (e.target.checked) {
71
-            addBut(m)
72
-          } else {
73
-            delBut(m)
74
-          }
75
-          // console.log('menus', menus)
76
-
77
-          console.log('menus', menus)
78
-          console.log('but', but)
79
-        }
80
-
81
-    const dataSource = [
82
-      {
83
-        name: '员工管理',
84
-        per: [
85
-          '111111',
86
-          '22222',
87
-          '33333',
88
-        ],
89
-      },
90
-      {
91
-        name: '角色管理',
92
-        per: [
93
-          '444',
94
-          '555',
95
-          '666',
96
-        ],
97
-      },
98
-    ];
99
-
100
-
101
-    const gridStyle1 = {
102
-      width: '20%',
103
-      textAlign: 'left',
104
-    };
105
-    const gridStyle2 = {
106
-      width: '80%',
107
-      textAlign: 'left',
108
-      height: '69px',
109
-    };
110
-
111
-    return (
112
-    <>
113
-      <div >
114
-        {/* { console.log('userMenus', userMenus) }
115
-        { console.log('userBtns', userBtns) } */}
116
-        {userMenus.map(item => (
117
-          (item.parentCode === '-1') &&
118
-          <Card title={<Checkbox onChange={handleMenuChange(item)}>{item.name}</Checkbox>} bordered style={{ width: '100%', alignItems: 'center' }} >
119
-              {
120
-                   userMenus.map(menu => (
121
-
122
-                    (item.menuId === menu.menuRoot && item.menuId !== menu.menuId) &&
123
-                    <>
124
-                      <Card.Grid style={gridStyle1} >
125
-                          <Checkbox onChange={handleMenuChange(menu)}>{menu.name}</Checkbox>
126
-                      </Card.Grid>
127
-                      <Card.Grid style={gridStyle2}>
128
-                        {userBtns.map(btn => (
129
-                          <>
130
-                            {
131
-                              btn.menuId === menu.menuId &&
132
-                              <Checkbox onChange={handleButChange(btn)}>{btn.name}</Checkbox>
133
-                            }
134
-                          </>
135
-                        ))}
136
-                      </Card.Grid>
137
-                   </>
138
-                   ))
139
-              }
140
-          </Card>
141
-        ))}
142
-      </div>
143
-    </>
144
-    )
120
+  const [but, setBut] = useState([]);
121
+  // 判断menus是否有值
122
+  const addBut = m => setBut([...but, m]);
123
+  const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
124
+  const handleButChange = m => e => {
125
+    console.log('e', m)
126
+    if (e.target.checked) {
127
+      addBut(m)
128
+    } else {
129
+      delBut(m)
130
+    }
145 131
   }
146
-  
147
-  const fields = [
148
-    {
149
-      label: '角色名称',
150
-      name: 'roleName',
151
-      type: FieldTypes.Text,
152
-      // placeholder: '名称',
153
-      value: ''
154
-    },
155
-    {
156
-      label: '简介',
157
-      name: 'roleIntroduction',
158
-      render: <TextArea className={channels.inpuitTxt} ></TextArea>,
159
-      value: ''
160
-
161
-    },
162
-
163
-    {
164
-      label: '菜单权限',
165
-      name: 'rolePermission',
166
-      render:
167
-        <>
168
-          <div>
169
-            <Poster/>
170
-          </div>
171
-        </>,
172
-    },
173
-
174
-  ]
175
-  const handleSubmit = val => {
176
-    window.console.log('submit data --->', val)
132
+  const gridStyle1 = {
133
+    width: '17%',
134
+    textAlign: 'left',
135
+  };
136
+  const gridStyle2 = {
137
+    width: '80%',
138
+    textAlign: 'left',
139
+    height: '72px',
140
+  };
141
+  // 添加菜单
142
+  function addMenuList() {
177 143
     request({
178
-      url: '/api/admin/menuList',
179
-      method: 'POST',
180
-      params: { ...params },
181
-  // eslint-disable-next-line no-shadow
182
-  }).then(data => {
144
+      url: '/api/admin/updateAuthMenu',
145
+      method: 'PUT',
146
+      data: { sysMenu: menus },
147
+      // eslint-disable-next-line no-shadow
148
+    }).then(data => {
183 149
       console.log(data)
184
-  })
150
+    })
185 151
   }
186
-  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
152
+
153
+  // 添加按钮
154
+  function addButt() {
155
+    request({
156
+      url: '/api/admin/updateAuthMenu',
157
+      method: 'PUT',
158
+      data: { sysMenu: but },
159
+      // eslint-disable-next-line no-shadow
160
+    }).then(data => {
161
+      console.log(data)
162
+    })
163
+  }
164
+
165
+  // 添加按钮
166
+  function editAndAddRole() {
167
+    request({
168
+      url: '/admin/editAndAddRole/{id}',
169
+      method: 'PUT',
170
+      data: { sysMenu: but },
171
+      // eslint-disable-next-line no-shadow
172
+    }).then(data => {
173
+      console.log(data)
174
+    })
175
+  }
176
+
177
+  function toRoleList(roleId) {
178
+    router.push({
179
+      pathname: '/staff/RoleList',
180
+    });
181
+  }
182
+
183
+  function handleSubmit(e) {
184
+    e.preventDefault();
185
+    props.form.validateFields((err, values) => {
186
+      console.log('values', values)
187
+      // 保存菜单
188
+      // addMenuList()
189
+      // setm
190
+      const sumitMenu = [...data.sysMenuList, ...menus]
191
+      request({
192
+        url: '/api/admin/updateAuthMenu',
193
+        method: 'POST',
194
+        data: { sysMenu: sumitMenu, name: values.roleName, id: props.location.query.id },
195
+        // eslint-disable-next-line no-shadow
196
+      }).then(data => {
197
+        toRoleList()
198
+      })
199
+    });
200
+  }
201
+  const { getFieldDecorator } = props.form;
202
+  return (
203
+    <>
204
+      <div >
205
+        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
206
+          <Form.Item label="角色名称">
207
+            {getFieldDecorator('roleName', {
208
+              rules: [{ required: true, message: '请输入渠道名称' }],
209
+            })(<Input className={channels.inpuit} />)}
210
+
211
+          </Form.Item>
212
+          {userMenus.map(item => (
213
+            (item.parentCode === '-1') &&
214
+            <Row >
215
+              <Col span={7}>
216
+
217
+              </Col>
218
+              <Col span={17}>
219
+
220
+
221
+                <Card title={<Checkbox checked={dataMenuId.includes(item.menuId)} onChange={handleMenuChange(item)}>{item.name}</Checkbox>} bordered style={{ width: '100%', alignItems: 'center' }} >
222
+                  {
223
+                    userMenus.map(menu => (
224
+
225
+                      (item.menuId === menu.menuRoot && item.menuId !== menu.menuId) &&
226
+                      <>
227
+                        <Card.Grid style={gridStyle1} >
228
+                          <Checkbox checked={dataMenuId.includes(menu.menuId)} onChange={handleMenuChange(menu)}>{menu.name}</Checkbox>
229
+                        </Card.Grid>
230
+                        <Card.Grid style={gridStyle2}>
231
+                          {buutonDate.length > 0 && buutonDate.map(btn => (
232
+                            <>
233
+                              {
234
+                                btn.menuId === menu.menuId &&
235
+                                <Checkbox checked={dataButtonId.includes(btn.btnId)} onChange={handleButChange(btn)}>{btn.name}</Checkbox>
236
+                              }
237
+                            </>
238
+                          ))}
239
+                        </Card.Grid>
240
+                      </>
241
+                    ))
242
+                  }
243
+                </Card>
244
+              </Col>
245
+
246
+            </Row>
247
+          ))}
248
+          <Form.Item wrapperCol={{ span: 15, offset: 7 }} style={{ marginTop: '10px' }}>
249
+            <Button type="primary" htmlType="submit">
250
+              保存
251
+          </Button>
252
+            <Button className={channels.formButton} htmlType="submit">
253
+              取消
254
+          </Button>
255
+          </Form.Item>
256
+        </Form>
257
+      </div>
258
+    </>
259
+  )
187 260
 }
188
-export default connect(({ user }) => ({ user }))(add);
261
+const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
262
+export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);

+ 1
- 1
src/pages/staff/list/editRole.jsx Ver arquivo

@@ -179,7 +179,7 @@ const Edit = props => {
179 179
       render:
180 180
         <>
181 181
           <div>
182
-            <Poster value="111111" />
182
+            <Poster/>
183 183
           </div>
184 184
         </>,
185 185
     },

+ 5
- 19
src/pages/staff/list/editStaff.jsx Ver arquivo

@@ -9,6 +9,7 @@ import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import Wangedit from '../../../components/Wangedit/Wangedit'
10 10
 import channels from './channelList.less';
11 11
 import Tagss from '../components/Tagss.jsx';
12
+import apis from '../../../services/apis';
12 13
 import request from '../../../utils/request'
13 14
 
14 15
 const { TextArea } = Input;
@@ -27,21 +28,14 @@ const Edit = (props) => {
27 28
   const [tagData, setTagData] = useState([])
28 29
 
29 30
   const getTagList = () => {
30
-    request({
31
-      url: '/api/admin/taTags',
32
-      method: 'GET',
33
-      params: {pageNum:1,pageSize:999}
34
-    }).then((data) => {
31
+    request({ ...apis.staff.taTags, params: {pageNum:1,pageSize:999} }).then((data) => {
35 32
       setTagData(data.records)
36 33
     })
37 34
   }
38 35
 
39 36
   // 查询列表
40 37
   const getUserData = (userId) => {
41
-    request({
42
-      url: '/api/admin/taUser/'+userId,
43
-      method: 'GET',
44
-    }).then((data) => {
38
+    request({ ...apis.staff.getTaUser, urlData: {id:userId} }).then((data) => {
45 39
       console.log(data,"tauser")
46 40
       setUserData(data)
47 41
     })
@@ -60,21 +54,13 @@ const Edit = (props) => {
60 54
 
61 55
   const handleSubmit = val => {
62 56
     if(userId){
63
-      request({
64
-        url: '/api/admin/taUser/' + userId,
65
-        method: 'PUT',
66
-        data: val,
67
-      }).then((data) => {
57
+      request({ ...apis.staff.updateTaUser, urlData: {id:userId},data: val, }).then((data) => {
68 58
         console.log(data,"tauser")
69 59
         message.info("保存成功")
70 60
         router.go(-1)
71 61
       })
72 62
     }else{
73
-      request({
74
-        url: '/api/admin/taUser',
75
-        method: 'POST',
76
-        data: val,
77
-      }).then((data) => {
63
+      request({ ...apis.staff.addTaUser, data: val, }).then((data) => {
78 64
         console.log(data,"tauser")
79 65
         message.info("保存成功")
80 66
         router.go(-1)

+ 22
- 30
src/pages/staff/list/style.less Ver arquivo

@@ -11,33 +11,37 @@
11 11
   border: 1px solid #dbdbdb;
12 12
 }
13 13
 
14
-.addButton {
15
-  // background: #50be00;
16
-  border-radius: 4px;
17
-  border: 0px;
18
-  margin: 10px 0px;
19
-}
20 14
 
21 15
 .card {
22
-  width: 348px;
16
+  min-width: 330px;
17
+  margin-right: 2vw;
23 18
   height: 244px;
24 19
   background: rgba(255, 255, 255, 1);
25 20
   box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
26 21
   border-radius: 12px;
27 22
   margin-bottom: 40px;
28
-
23
+  position: relative;
29 24
 }
30 25
 
31
-.cardText {
32 26
 
33
-  height: 28px;
27
+.cardText {
34 28
   font-size: 20px;
35
-  font-weight: 400;
36 29
   color: rgba(102, 102, 102, 1);
37
-  line-height: 28px;
38
-  margin-top: 10px;
39
-  margin-bottom: 0;
40
-
30
+  position: absolute;
31
+  bottom:52px;
32
+}
33
+.statusText {
34
+  font-size: 20px;
35
+  color: rgba(102, 102, 102, 1);
36
+  position: absolute;
37
+  bottom:52px;
38
+  right: 20px;
39
+}
40
+.phoneText{
41
+  font-size: 20px;
42
+  color: rgba(102, 102, 102, 1);
43
+  position: absolute;
44
+  bottom:16px;
41 45
 }
42 46
 
43 47
 .cardItem {
@@ -49,26 +53,15 @@
49 53
   align-items: center;
50 54
 }
51 55
 
52
-.ediText {
53
-  width: 36px;
54
-  height: 25px;
55
-  font-size: 18px;
56
-
57
-  font-weight: 400;
58
-  color: rgba(255, 146, 92, 1);
59
-  line-height: 25px;
60
-
61
-}
62 56
 
63 57
 .cardTag {
64
-  height: 18px;
65 58
   font-size: 10px;
66
-  // background: #fdce22;
67 59
   border-radius: 4px;
68 60
   color: #ffffff;
69
-  line-height: 14px;
61
+  line-height: 16px;
70 62
   margin-top: 10px;
71 63
   padding: 1px 3px;
64
+
72 65
 }
73 66
 
74 67
 .title {
@@ -76,13 +69,12 @@
76 69
   width: 84px;
77 70
   justify-content: space-between;
78 71
   text-align: justify;
79
-  text-align-last: justify
72
+  text-align-last: justify;
80 73
 }
81 74
 
82 75
 
83 76
 .roletext {
84 77
   font-size: 20px;
85
-
86 78
   font-weight: 400;
87 79
   color: rgba(51, 51, 51, 1);
88 80
   line-height: 28px;

+ 4
- 14
src/pages/system/editPolicy.jsx Ver arquivo

@@ -8,6 +8,7 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import SelectCity from '../../components/SelectButton/CitySelect'
9 9
 import XForm, { FieldTypes } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit'
11
+import apis from '../../services/apis';
11 12
 import request from '../../utils/request'
12 13
 
13 14
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
@@ -27,10 +28,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
27 28
 
28 29
   // 查询列表
29 30
   const getPolicyData = (policyId) => {
30
-    request({
31
-        url: '/api/admin/taPolicy/' + policyId,
32
-        method: 'GET',
33
-    }).then((data) => {
31
+    request({ ...apis.system.taPolicy, urlData: {id: policyId} }).then((data) => {
34 32
         console.log(data)
35 33
         setPolicyData(data)
36 34
     })
@@ -80,22 +78,14 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
80 78
       console.log('submit data --->', val)
81 79
       if(policyId){
82 80
         val.policyId = policyId
83
-        request({
84
-          url: '/api/admin/taPolicy/'+policyId,
85
-          method: 'PUT',
86
-          data: val,
87
-        }).then((data) => {
81
+        request({ ...apis.system.updateTaPolicy, urlData: {id: policyId},data: val, }).then((data) => {
88 82
           message.info("保存成功")
89 83
           cancelPage()
90 84
         }).catch((err) => {
91 85
           message.info(err.msg || err.message)
92 86
         })
93 87
       }else{
94
-        request({
95
-          url: '/api/admin/taPolicy',
96
-          method: 'POST',
97
-          data: val,
98
-        }).then((data) => {
88
+        request({ ...apis.system.addTaPolicy,data: val, }).then((data) => {
99 89
           message.info("保存成功")
100 90
           cancelPage()
101 91
         }).catch((err) => {

+ 5
- 20
src/pages/system/housingPolicy.jsx Ver arquivo

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
-
9
+import apis from '../../services/apis';
10 10
 import request from '../../utils/request'
11 11
 
12 12
 const { Option } = Select;
@@ -21,11 +21,7 @@ const header = (props) => {
21 21
 
22 22
   // 查询列表
23 23
   const getList = (params) => {
24
-    request({
25
-        url: '/api/admin/taPolicy',
26
-        method: 'GET',
27
-        params: { ...params },
28
-    }).then((data) => {
24
+    request({ ...apis.system.getTaPolicy, params: { ...params }, }).then((data) => {
29 25
         console.log(data)
30 26
         setData(data)
31 27
     })
@@ -104,10 +100,7 @@ const deletePolicy = (policyId) => () => {
104 100
     okText: '确定',
105 101
     cancelText: '取消',
106 102
     onOk() {
107
-        request({
108
-            url: '/api/admin/taPolicy/'+policyId,
109
-            method: 'DELETE',
110
-        }).then((data) => {
103
+        request({ ...apis.system.deleteTaPolicy, urlData: {id: policyId }, }).then((data) => {
111 104
             message.info('操作成功!')
112 105
             getList({ pageNum: 1, pageSize: 10,cityId: '' });
113 106
         }).catch((err) => {
@@ -123,11 +116,7 @@ const deletePolicy = (policyId) => () => {
123 116
   const topPolicy = (row) => () => {
124 117
       const weight = Math.abs(row.weight - 1)
125 118
       row.weight = weight
126
-      request({
127
-          url: '/api/admin/taPolicy/'+row.policyId,
128
-          method: 'PUT',
129
-          data: row,
130
-      }).then((data) => {
119
+      request({ ...apis.system.updateTaPolicy, urlData: {id: row.policyId},data: row, }).then((data) => {
131 120
           console.log(data)
132 121
           message.info('操作成功!')
133 122
           getList({ pageNum: 1, pageSize: 10,cityId: '' });
@@ -144,11 +133,7 @@ const deletePolicy = (policyId) => () => {
144 133
         row.publishStatus = 1
145 134
       }
146 135
 
147
-      request({
148
-        url: '/api/admin/taPolicy/'+row.policyId,
149
-        method: 'PUT',
150
-        data: row,
151
-      }).then((data) => {
136
+      request({ ...apis.system.updateTaPolicy, urlData: {id: row.policyId},data: row, }).then((data) => {
152 137
           console.log(data)
153 138
           message.info('操作成功!')
154 139
           getList({ pageNum: 1, pageSize: 10,cityId: '' });

+ 6
- 13
src/pages/system/intention.jsx Ver arquivo

@@ -7,6 +7,7 @@ import router from 'umi/router';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10
+import apis from '../../services/apis';
10 11
 import request from '../../utils/request'
11 12
 import SelectCity from '../../components/SelectButton/CitySelect'
12 13
 
@@ -23,11 +24,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
23 24
 
24 25
   const changBuilding = (buildingId) => {
25 26
     setBuildingIdData(buildingId)
26
-    request({
27
-      url: '/api/admin/tdBizEventIntention',
28
-      method: 'GET',
29
-      params: {pageNum: 1, pageSize: 999,buildingId}
30
-    }).then((data) => {
27
+    request({ ...apis.system.tdBizEventIntention, params: {pageNum: 1, pageSize: 999,buildingId}}).then((data) => {
31 28
       console.log(data)
32 29
       setData(data.records)
33 30
     })
@@ -50,11 +47,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
50 47
     if(buildingIdValue === ''){
51 48
       return
52 49
     }
53
-    request({
54
-      url: '/api/admin/taBuildingIntentionAddOrUpdate/' + buildingIdValue,
55
-      method: 'POST',
56
-      data
57
-    }).then((data) => {
50
+    request({ ...apis.system.taBuildingIntentionAddOrUpdate, urlData: {id: buildingIdValue}, data,}).then((data) => {
58 51
       message.info("保存成功")
59 52
     })
60 53
   }
@@ -66,8 +59,8 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
66 59
         <BuildSelect onChange={changBuilding}/>
67 60
       </Col>
68 61
     </Row>
69
-    <Row>
70
-      <Col span={3} offset={3}>
62
+    <Row style={{margin:'10px 0'}}>
63
+      <Col span={5} offset={2}>
71 64
         用户操作
72 65
       </Col>
73 66
       <Col span={3} offset={3}>
@@ -76,7 +69,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
76 69
     </Row>
77 70
     {data.map((x) => {
78 71
       return <Row>
79
-                <Col span={3} offset={3}>
72
+                <Col span={5} offset={2}>
80 73
                   <Checkbox checked={x.checkbox} onChange={changeBox(x)}>{x.eventName}</Checkbox>
81 74
                 </Col>
82 75
                 <Col span={3} offset={3}>

+ 2
- 6
src/pages/system/messageList.jsx Ver arquivo

@@ -6,7 +6,7 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
-
9
+import apis from '../../services/apis';
10 10
 import request from '../../utils/request'
11 11
 
12 12
 const { Option } = Select;
@@ -22,11 +22,7 @@ const header = (props) => {
22 22
 
23 23
   // 查询列表
24 24
   const getList = (params) => {
25
-    request({
26
-        url: '/api/admin/taCustomerMessage',
27
-        method: 'GET',
28
-        params: { ...params },
29
-    }).then((data) => {
25
+    request({ ...apis.system.taCustomerMessage, params: { ...params },}).then((data) => {
30 26
         console.log(data)
31 27
         setData(data)
32 28
     })

+ 4
- 13
src/pages/system/report.jsx Ver arquivo

@@ -7,6 +7,7 @@ import router from 'umi/router';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10
+import apis from '../../services/apis';
10 11
 import request from '../../utils/request'
11 12
 
12 13
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
@@ -27,19 +28,13 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
27 28
 
28 29
   // 查询数据
29 30
   const getReportList = () => {
30
-    request({
31
-        url: '/api/admin/tdReports',
32
-        method: 'GET',
33
-    }).then((data) => {
31
+    request({ ...apis.system.tdReports, }).then((data) => {
34 32
         setData((data.records || []).map(x => ({label: x.reportName, value: x.reportCode}) ))
35 33
     })
36 34
   }
37 35
 
38 36
   const getCheckedList = () => {
39
-    request({
40
-      url: '/api/admin/taBuildingReports',
41
-      method: 'GET',
42
-    }).then((data) => {
37
+    request({ ...apis.system.taBuildingReports, }).then((data) => {
43 38
       setCheckData((data.records || []).map((x) => x.reportCode))
44 39
     })
45 40
   }
@@ -51,11 +46,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
51 46
 
52 47
   const saveCheckedReport = () => {
53 48
     console.log(checkData)
54
-    request({
55
-      url: '/api/admin/taBuildingReport/add',
56
-      method: 'POST',
57
-      data: {list: checkData}
58
-    }).then((data) => {
49
+    request({ ...apis.system.addTaBuildingReports, data: {list: checkData}}).then((data) => {
59 50
       message.info("保存成功")
60 51
     })
61 52
   }

+ 195
- 0
src/services/apis.js Ver arquivo

@@ -164,6 +164,201 @@ export default {
164 164
       method:'get',
165 165
       url: `${prefix}/selectCityUser`
166 166
     },
167
+
168
+  },
169
+  activity: {
170
+      list: {
171
+        method: 'GET',
172
+        url: `${prefix}/iBuildingDynamicList`,
173
+      },
174
+      weight: {
175
+        method: 'PUT',
176
+        url: `${prefix}/buildingDynamic/weight`,
177
+      },
178
+      cancel: {
179
+        method: 'PUT',
180
+        url: `${prefix}/buildingDynamic/cancel/:id`,
181
+      },
182
+      send: {
183
+        url: `${prefix}/buildingDynamic/send/:id`,
184
+        method: 'PUT',
185
+      },
186
+      finish: {
187
+        url: `${prefix}/buildingDynamic/finish`,
188
+        method: 'PUT',
189
+      },
190
+      details: {
191
+        url: `${prefix}/buildingDynamic/Details`,
192
+        method: 'GET',
193
+      },
194
+      update: {
195
+        url: `${prefix}/buildingDynamic/update`,
196
+        method: 'PUT',
197
+      },
198
+      add: {
199
+        url: `${prefix}/buildingDynamic/add`,
200
+        method: 'POST',
201
+      },
202
+      poster: {
203
+        url: `${prefix}/poster`,
204
+        method: 'GET',
205
+      },
206
+      updatePoster: {
207
+        url: `${prefix}/poster/:id`,
208
+        method: 'PUT',
209
+      },
210
+      addPoster: {
211
+        url: `${prefix}/poster`,
212
+        method: 'POST',
213
+      },
214
+      shareContent: {
215
+        url: `${prefix}/shareContent`,
216
+        method: 'GET',
217
+      },
218
+      updateShareContent: {
219
+        url: `${prefix}/shareContent/:id`,
220
+        method: 'PUT',
221
+      },
222
+      addShareContent: {
223
+        url: `${prefix}/shareContent`,
224
+        method: 'POST',
225
+      },
226
+      signList: {
227
+        url: `${prefix}/SignList`,
228
+        method: 'GET',
229
+      }
230
+  },
231
+  integralMall: {
232
+    tdPointsRules: {
233
+      url: `${prefix}/tdPointsRules`,
234
+      method: 'GET',
235
+    },
236
+    change: {
237
+      url: `${prefix}/tdPointsRules/change`,
238
+      method: 'PUT',
239
+    },
240
+    taGoods: {
241
+      url: `${prefix}/taGoods/:id`,
242
+      method: 'GET',
243
+    },
244
+    updateTaGoods: {
245
+      url: `${prefix}/taGoods`,
246
+      method: 'PUT',
247
+    },
248
+    addTaGoods: {
249
+      url: `${prefix}/taGoods/add`,
250
+      method: 'POST',
251
+    },
252
+    taPointsExchange: {
253
+      url: `${prefix}/taPointsExchange`,
254
+        method: 'GET',
255
+    },
256
+    getTaGoods: {
257
+      url: `${prefix}/taGoods`,
258
+      method: 'GET',
259
+    },
260
+    changeTaGoods: {
261
+      url: `${prefix}/taGoods/change`,
262
+      method: 'PUT',
263
+    },
264
+    changeTaPointsExchange: {
265
+      url: `${prefix}/taPointsExchange/change`,
266
+      method: 'PUT',
267
+    }
268
+  },
269
+  carsuseFigure: {
270
+    extendContent: {
271
+      url: `${prefix}/extendContent`,
272
+      method: 'GET',
273
+    },
274
+    finish: {
275
+      url: `${prefix}/buildingDynamic/finish`,
276
+      method: 'PUT',
277
+    },
278
+    updataExtendContent: {
279
+      url: `${prefix}/extendContent/:id`,
280
+      method: 'PUT',
281
+    },
282
+    getExtendContent: {
283
+      url: `${prefix}/extendContent/:id`,
284
+      method: 'GET',
285
+    },
286
+    addExtendContent: {
287
+      url: `${prefix}/extendContent`,
288
+      method: 'POST',
289
+    }
290
+  },
291
+  system: {
292
+    taPolicy: {
293
+      url: `${prefix}/taPolicy/:id`,
294
+      method: 'GET',
295
+    },
296
+    updateTaPolicy: {
297
+      url: `${prefix}/taPolicy/:id`,
298
+      method: 'PUT',
299
+    },
300
+    addTaPolicy: {
301
+      url: `${prefix}/taPolicy`,
302
+      method: 'POST',
303
+    },
304
+    getTaPolicy: {
305
+      url: `${prefix}/taPolicy`,
306
+      method: 'GET',
307
+    },
308
+    deleteTaPolicy: {
309
+      url: `${prefix}/taPolicy/:id`,
310
+      method: 'DELETE',
311
+    },
312
+    tdBizEventIntention: {
313
+      url: `${prefix}/tdBizEventIntention`,
314
+      method: 'GET',
315
+    },
316
+    taBuildingIntentionAddOrUpdate: {
317
+      url: `${prefix}/taBuildingIntentionAddOrUpdate/:id`,
318
+      method: 'POST',
319
+    },
320
+    taCustomerMessage: {
321
+      url: `${prefix}/taCustomerMessage`,
322
+      method: 'GET',
323
+    },
324
+    tdReports: {
325
+      url: `${prefix}/tdReports`,
326
+      method: 'GET',
327
+    },
328
+    taBuildingReports: {
329
+      url: `${prefix}/taBuildingReports`,
330
+      method: 'GET',
331
+    },
332
+    addTaBuildingReports: {
333
+      url: `${prefix}/taBuildingReport/add`,
334
+      method: 'POST',
335
+    }
336
+  },
337
+  staff: {
338
+    taUser: {
339
+      url: `${prefix}/taUser`,
340
+      method: 'GET',
341
+    },
342
+    taTags: {
343
+      url: `${prefix}/taTags`,
344
+      method: 'GET',
345
+    },
346
+    getTaUser: {
347
+      url: `${prefix}/taUser/:id`,
348
+      method: 'GET',
349
+    },
350
+    updateTaUser: {
351
+      url: `${prefix}/taUser/:id`,
352
+      method: 'PUT',
353
+    },
354
+    addTaUser: {
355
+      url: `${prefix}/taUser`,
356
+      method: 'POST',
357
+    },
358
+    change: {
359
+      url: `${prefix}/turn/taUser/:id/:type`,
360
+      method: 'PUT',
361
+    }
167 362
   }
168 363
   // indexEcharts:{
169 364
   //   list:{