system-clients 3.2.6 → 3.2.7-rongcheng
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -16
- package/.gradle/3.5/file-changes/last-build.bin +0 -0
- package/.gradle/3.5/taskHistory/taskHistory.lock +0 -0
- package/.gradle/3.5.1/file-changes/last-build.bin +0 -0
- package/.gradle/3.5.1/taskHistory/taskHistory.lock +0 -0
- package/.gradle/buildOutputCleanup/built.bin +0 -0
- package/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/.gradle/buildOutputCleanup/cache.properties.lock +1 -0
- package/SystemClient.iml +5 -2
- package/build/webpack.base.conf.js +11 -21
- package/package.json +4 -6
- package/src/App.vue +24 -24
- package/src/components/Main.vue +476 -626
- package/src/components/equipment/EquipmentManage.vue +1 -1
- package/src/components/equipment/PcAdd.vue +5 -5
- package/src/components/equipment/PcList.vue +5 -5
- package/src/components/equipment/PhoneAdd.vue +13 -26
- package/src/components/equipment/PhoneList.vue +21 -31
- package/src/components/equipment/PosAdd.vue +45 -231
- package/src/components/equipment/PosList.vue +68 -198
- package/src/components/equipment/PosManage.vue +9 -80
- package/src/components/parammanage/ParamManage.vue +2 -2
- package/src/components/parammanage/ParamPage.vue +8 -30
- package/src/components/parammanage/SinglePage.vue +4 -4
- package/src/components/server/LoadData.vue +2 -21
- package/src/components/server/Login.vue +638 -889
- package/src/components/server/ModifyPw.vue +7 -12
- package/src/components/server/ResSelect.vue +0 -5
- package/src/components/server/RightTree.vue +204 -289
- package/src/plugins/GetLoginInfoService.js +515 -521
- package/src/plugins/validation.js +1 -9
- package/src/system.js +1 -34
- package/src/components/TabButton.vue +0 -201
- package/src/components/Tabs.vue +0 -67
- package/src/components/addressManage/AddressCascadingMenu.vue +0 -145
- package/src/components/equipment/PosManageBoth.vue +0 -125
- package/src/components/equipment/PosParamAdd.vue +0 -236
- package/src/components/equipment/PosParamList.vue +0 -121
- package/src/components/equipment/PosParamManage.vue +0 -51
- package/src/components/server/ImageVieweTest.vue +0 -56
- package/src/components/server/ImageViewer.vue +0 -350
- package/src/components/server/PcdBuildingSelect.vue +0 -241
- package/src/filiale/dongguan/Main.vue +0 -715
- package/src/filiale/dongguan/system.js +0 -5
- package/src/filiale/konggang/Login.vue +0 -840
- package/src/filiale/konggang/system.js +0 -7
- package/src/filiale/qianneng/ModifyPw.vue +0 -107
- package/src/filiale/qianneng/system.js +0 -7
- package/src/filiale/rizhao/LeftTree.vue +0 -111
- package/src/filiale/rizhao/Login.vue +0 -791
- package/src/filiale/rizhao/Main.vue +0 -606
- package/src/filiale/rizhao/system.js +0 -14
- package/src/filiale/yuchuan/Login.vue +0 -889
- package/src/filiale/yuchuan/Main.vue +0 -773
- package/src/filiale/yuchuan/system.js +0 -10
- package/src/plugins/EncryptUtil.js +0 -53
- package/src/plugins/HeatGetLoginInfoService.js +0 -491
- package/src/stores/HeatAppData.js +0 -38
- package/src/styles/fonts/PINGFANG LIGHT.TTF +0 -0
- package/src/styles/fonts/PingFangSC-Regular.ttf +0 -0
- package/src/styles/fonts/glyphicons-halflings-regular.eot +0 -0
- package/src/styles/fonts/glyphicons-halflings-regular.svg +0 -288
- package/src/styles/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/src/styles/fonts/glyphicons-halflings-regular.woff +0 -0
- package/src/styles/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/src/styles/fonts/pingfang-bold.ttf +0 -0
- package/src/styles/fonts/pingfang-medium.ttf +0 -0
- package/src/styles/fonts/pingfang-regular.ttf +0 -0
- package/src/styles/fonts/trendstrends.ttf +0 -0
- package/src/styles/fonts//346/261/211/344/273/252/350/217/261/345/277/203/344/275/223/347/256/200.ttf +0 -0
- package/src/styles/less/.csscomb.json +0 -304
- package/src/styles/less/.csslintrc +0 -19
- package/src/styles/less/alerts.less +0 -73
- package/src/styles/less/aofeng/animate.min.css +0 -11
- package/src/styles/less/aofeng/expandcss.less +0 -569
- package/src/styles/less/aofeng/standard.less +0 -2507
- package/src/styles/less/aofeng/themeOne/BinaryTemplate.less +0 -686
- package/src/styles/less/aofeng/themeOne/loginStyle.less +0 -1586
- package/src/styles/less/aofeng/themeOne/systemStyle.less +0 -2650
- package/src/styles/less/aofeng/themeOne.less +0 -17
- package/src/styles/less/aofeng/themeTwo/newStyle1.less +0 -415
- package/src/styles/less/aofeng/themeTwo.less +0 -3
- package/src/styles/less/badges.less +0 -66
- package/src/styles/less/bootstrap.less +0 -66
- package/src/styles/less/breadcrumbs.less +0 -26
- package/src/styles/less/button-groups.less +0 -247
- package/src/styles/less/buttons.less +0 -172
- package/src/styles/less/carousel.less +0 -269
- package/src/styles/less/close.less +0 -34
- package/src/styles/less/code.less +0 -69
- package/src/styles/less/component-animations.less +0 -33
- package/src/styles/less/dropdowns.less +0 -216
- package/src/styles/less/fonts-list.less +0 -25
- package/src/styles/less/forms.less +0 -626
- package/src/styles/less/glyphicons.less +0 -305
- package/src/styles/less/grid.less +0 -84
- package/src/styles/less/input-groups.less +0 -167
- package/src/styles/less/jumbotron.less +0 -52
- package/src/styles/less/labels.less +0 -64
- package/src/styles/less/list-group.less +0 -141
- package/src/styles/less/manageStyle/manageChile.less +0 -180
- package/src/styles/less/manageStyle/manageStyle/manageChile.less +0 -180
- package/src/styles/less/manageStyle/manageStyle/manageStyle.less +0 -1102
- package/src/styles/less/manageStyle/manageStyle/safeStyle.less +0 -498
- package/src/styles/less/manageStyle/manageStyle.less +0 -1102
- package/src/styles/less/manageStyle/safeStyle.less +0 -498
- package/src/styles/less/media.less +0 -66
- package/src/styles/less/mixins/alerts.less +0 -14
- package/src/styles/less/mixins/background-variant.less +0 -9
- package/src/styles/less/mixins/border-radius.less +0 -18
- package/src/styles/less/mixins/buttons.less +0 -69
- package/src/styles/less/mixins/center-block.less +0 -7
- package/src/styles/less/mixins/clearfix.less +0 -22
- package/src/styles/less/mixins/forms.less +0 -90
- package/src/styles/less/mixins/gradients.less +0 -59
- package/src/styles/less/mixins/grid-framework.less +0 -92
- package/src/styles/less/mixins/grid.less +0 -122
- package/src/styles/less/mixins/hide-text.less +0 -21
- package/src/styles/less/mixins/image.less +0 -33
- package/src/styles/less/mixins/labels.less +0 -12
- package/src/styles/less/mixins/list-group.less +0 -30
- package/src/styles/less/mixins/nav-divider.less +0 -10
- package/src/styles/less/mixins/nav-vertical-align.less +0 -9
- package/src/styles/less/mixins/opacity.less +0 -8
- package/src/styles/less/mixins/pagination.less +0 -24
- package/src/styles/less/mixins/panels.less +0 -24
- package/src/styles/less/mixins/progress-bar.less +0 -10
- package/src/styles/less/mixins/reset-filter.less +0 -8
- package/src/styles/less/mixins/reset-text.less +0 -18
- package/src/styles/less/mixins/resize.less +0 -6
- package/src/styles/less/mixins/responsive-visibility.less +0 -15
- package/src/styles/less/mixins/size.less +0 -10
- package/src/styles/less/mixins/tab-focus.less +0 -9
- package/src/styles/less/mixins/table-row.less +0 -44
- package/src/styles/less/mixins/text-emphasis.less +0 -9
- package/src/styles/less/mixins/text-overflow.less +0 -8
- package/src/styles/less/mixins/vendor-prefixes.less +0 -227
- package/src/styles/less/mixins.less +0 -40
- package/src/styles/less/modals.less +0 -151
- package/src/styles/less/navbar.less +0 -660
- package/src/styles/less/navs.less +0 -285
- package/src/styles/less/normalize.less +0 -424
- package/src/styles/less/pager.less +0 -76
- package/src/styles/less/pagination.less +0 -89
- package/src/styles/less/panels.less +0 -275
- package/src/styles/less/popovers.less +0 -131
- package/src/styles/less/print.less +0 -101
- package/src/styles/less/progress-bars.less +0 -87
- package/src/styles/less/responsive-embed.less +0 -35
- package/src/styles/less/responsive-utilities.less +0 -194
- package/src/styles/less/scaffolding.less +0 -161
- package/src/styles/less/stand.less +0 -207
- package/src/styles/less/tables.less +0 -312
- package/src/styles/less/theme.less +0 -291
- package/src/styles/less/thumbnails.less +0 -36
- package/src/styles/less/tooltip.less +0 -102
- package/src/styles/less/type.less +0 -316
- package/src/styles/less/utilities.less +0 -55
- package/src/styles/less/variables.less +0 -899
- package/src/styles/less/wells.less +0 -29
- package/src/util/Daiban.json +0 -12
- package/static/images/lefticon//345/220/210/345/220/214/347/256/241/347/220/206.png +0 -0
- package/static/logo.png +0 -0
- package/static/newStyle/about-us.png +0 -0
- package/static/rizhao.png +0 -0
- package/yarn-error.log +0 -6896
@@ -1,521 +1,515 @@
|
|
1
|
-
import Vue from 'vue'
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
data =
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
let
|
56
|
-
|
57
|
-
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
let
|
87
|
-
|
88
|
-
|
89
|
-
}
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
//
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
//
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
//
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
Vue
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
}
|
189
|
-
}
|
190
|
-
}
|
191
|
-
}
|
192
|
-
}
|
193
|
-
}
|
194
|
-
|
195
|
-
} else {
|
196
|
-
let error = {status: 401, data: getLogin.data.states}
|
197
|
-
// 抛出错误
|
198
|
-
throw error
|
199
|
-
}
|
200
|
-
}
|
201
|
-
|
202
|
-
let GetLoginInfoService = {
|
203
|
-
// 登录后要处理的异步对象
|
204
|
-
afterLogin: [],
|
205
|
-
//验证码开关
|
206
|
-
Verification: true,
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
*
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
return
|
243
|
-
},
|
244
|
-
|
245
|
-
|
246
|
-
let dt = new Date()
|
247
|
-
let month = dt.getMonth() + 1
|
248
|
-
return dt.getFullYear() +
|
249
|
-
},
|
250
|
-
|
251
|
-
|
252
|
-
let dt = new Date()
|
253
|
-
let month = dt.getMonth() + 1
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
let
|
260
|
-
let
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
let
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
return
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
if (
|
318
|
-
return
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
if (key
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
element
|
370
|
-
element.setAttribute('
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
element
|
375
|
-
element.
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
//
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
let
|
399
|
-
|
400
|
-
let
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
let
|
414
|
-
|
415
|
-
|
416
|
-
endDate
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
var
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
let
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
let
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
//
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
if (timeDiff
|
499
|
-
des =
|
500
|
-
} else if (
|
501
|
-
des = `${Math.floor(timeDiff /
|
502
|
-
} else if (
|
503
|
-
des = `${Math.floor(timeDiff /
|
504
|
-
}
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
return
|
512
|
-
}
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
let nextMonth = ds[1] - 0 + 1
|
517
|
-
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
518
|
-
}
|
519
|
-
}
|
520
|
-
|
521
|
-
export default GetLoginInfoService
|
1
|
+
import Vue from 'vue'
|
2
|
+
import JSEncrypt from 'jsencrypt'
|
3
|
+
import {HttpResetClass} from 'vue-client'
|
4
|
+
|
5
|
+
let loginGen = async function (name, password,uuid, checkCode) {
|
6
|
+
let data = {name: name, password: password,uuid :uuid, checkCode:checkCode}
|
7
|
+
// rsa加密
|
8
|
+
let encrypt = new JSEncrypt();
|
9
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
|
10
|
+
console.log(data)
|
11
|
+
|
12
|
+
let getLogin = await Vue.resetpost('/rs/logic/getLogin', data, {resolveMsg: null, rejectMsg: null}, 'RSA')
|
13
|
+
if (getLogin.data.states === '登录成功') {
|
14
|
+
// 调用远程登录服务,获取所有有权访问的功能
|
15
|
+
data = {username: name, password: password}
|
16
|
+
data = encrypt.encrypt(JSON.stringify(data))
|
17
|
+
let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
|
18
|
+
resolveMsg: null,
|
19
|
+
rejectMsg: null
|
20
|
+
})
|
21
|
+
console.log('登陆获取Util', JSON.stringify(resource.data))
|
22
|
+
Vue.$login.f = resource.data
|
23
|
+
//获取jwt
|
24
|
+
Vue.$login.jwt = getLogin.data.jwt
|
25
|
+
// 把登录用户添加到cookie里
|
26
|
+
Vue.cookie.set('loginId', Vue.$login.f.id)
|
27
|
+
|
28
|
+
try {
|
29
|
+
//获取有权限的功能树
|
30
|
+
let hasRight = await Vue.resetpost(`/rs/search`, {
|
31
|
+
source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
|
32
|
+
userid: Vue.$login.f.id
|
33
|
+
},
|
34
|
+
{
|
35
|
+
resolveMsg: null,
|
36
|
+
rejectMsg: null
|
37
|
+
})
|
38
|
+
console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
|
39
|
+
//准备替换功能树
|
40
|
+
var fun=[]
|
41
|
+
hasRight.data[0].children[0].children.forEach((item) => {
|
42
|
+
if(item.name=='客服系统'){
|
43
|
+
item.children.forEach((item1) => {
|
44
|
+
fun.push(item1)
|
45
|
+
})
|
46
|
+
}
|
47
|
+
})
|
48
|
+
// console.log('替换前', JSON.stringify(Vue.$login.f.functions))
|
49
|
+
// console.log('替换后', JSON.stringify(fun))
|
50
|
+
Vue.$login.f.functions=fun
|
51
|
+
}catch (error) {
|
52
|
+
}
|
53
|
+
if (Vue.$login.f.id !== '11') {
|
54
|
+
try {
|
55
|
+
let getAllArea = await Vue.resetpost('/rs/search', {
|
56
|
+
source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
|
57
|
+
userid: Vue.$login.f.id
|
58
|
+
}, {resolveMsg: null, rejectMsg: null})
|
59
|
+
|
60
|
+
let areaTemp = []
|
61
|
+
for (let i = 0; i < getAllArea.data.length; i++) {
|
62
|
+
areaTemp.push({label: getAllArea.data[i].name, value: getAllArea.data[i]})
|
63
|
+
}
|
64
|
+
Vue.$login.f.f_allArea = areaTemp
|
65
|
+
}catch (error) {
|
66
|
+
Vue.$login.f.f_allArea =[]
|
67
|
+
console.log('获取区县',error)
|
68
|
+
}
|
69
|
+
// 获取抄表员
|
70
|
+
try {
|
71
|
+
let getGasman = await Vue.resetpost('/rs/search', {
|
72
|
+
source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
|
73
|
+
userid: Vue.$login.f.id
|
74
|
+
}, {resolveMsg: null, rejectMsg: null})
|
75
|
+
let gasman = []
|
76
|
+
for (let i = 0; i < getGasman.data.length; i++) {
|
77
|
+
gasman.push(getGasman.data[i])
|
78
|
+
}
|
79
|
+
Vue.$login.f.f_gasman = gasman
|
80
|
+
}catch (error) {
|
81
|
+
Vue.$login.f.f_gasman = []
|
82
|
+
console.log('抄表员模块',error)
|
83
|
+
}
|
84
|
+
// 获取安装人
|
85
|
+
try {
|
86
|
+
let getInstallman = await Vue.resetpost('/rs/search', {
|
87
|
+
source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
|
88
|
+
userid: Vue.$login.f.id
|
89
|
+
}, {resolveMsg: null, rejectMsg: null})
|
90
|
+
console.log('获取安装员', getInstallman)
|
91
|
+
let installman = []
|
92
|
+
for (let i = 0; i < getInstallman.data.length; i++) {
|
93
|
+
installman.push(getInstallman.data[i])
|
94
|
+
}
|
95
|
+
Vue.$login.f.f_installman = installman
|
96
|
+
}catch (error) {
|
97
|
+
Vue.$login.f.f_installman =[]
|
98
|
+
console.log('安装人模块',error)
|
99
|
+
}
|
100
|
+
// 获取换表员
|
101
|
+
try {
|
102
|
+
let getChangeMeterman = await Vue.resetpost('/rs/search', {
|
103
|
+
source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
|
104
|
+
userid: Vue.$login.f.id
|
105
|
+
}, {resolveMsg: null, rejectMsg: null})
|
106
|
+
let changemeterman = []
|
107
|
+
for (let i = 0; i < getChangeMeterman.data.length; i++) {
|
108
|
+
changemeterman.push(getChangeMeterman.data[i])
|
109
|
+
}
|
110
|
+
Vue.$login.f.f_changemeterman = changemeterman
|
111
|
+
}catch (error) {
|
112
|
+
Vue.$login.f.f_changemeterman = []
|
113
|
+
console.log('换表员模块',error)
|
114
|
+
}
|
115
|
+
// 获取资源服务权限
|
116
|
+
try {
|
117
|
+
let getLic = await Vue.resetpost('/rs/search', {data: {
|
118
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
|
119
|
+
userid: Vue.$login.f.id
|
120
|
+
}}, {resolveMsg: null, rejectMsg: null})
|
121
|
+
let arry=[]
|
122
|
+
getLic.data.forEach((item) => {
|
123
|
+
arry.push(item.name)
|
124
|
+
})
|
125
|
+
Vue.$login.f.lics=arry
|
126
|
+
}catch (error) {
|
127
|
+
Vue.$login.f.f_gasman = []
|
128
|
+
console.log('资源服务权限',error)
|
129
|
+
}
|
130
|
+
// 票据使用人
|
131
|
+
try {
|
132
|
+
let getPaperUseman = await Vue.resetpost('/rs/search', {
|
133
|
+
source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
|
134
|
+
userid: Vue.$login.f.id
|
135
|
+
}, {resolveMsg: null, rejectMsg: null})
|
136
|
+
let perperuseman = []
|
137
|
+
for (let i = 0; i < getPaperUseman.data.length; i++) {
|
138
|
+
perperuseman.push(getPaperUseman.data[i])
|
139
|
+
}
|
140
|
+
Vue.$login.f.f_paperUseman = perperuseman
|
141
|
+
}catch (error) {
|
142
|
+
Vue.$login.f.f_paperUseman = []
|
143
|
+
console.log('票据使用人模块',error)
|
144
|
+
|
145
|
+
}
|
146
|
+
// 票据分配人
|
147
|
+
try {
|
148
|
+
let getPaperAllotman = await Vue.resetpost('/rs/search', {
|
149
|
+
source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
|
150
|
+
userid: Vue.$login.f.id
|
151
|
+
}, {resolveMsg: null, rejectMsg: null})
|
152
|
+
let paperallotman = []
|
153
|
+
for (let i = 0; i < getPaperAllotman.data.length; i++) {
|
154
|
+
paperallotman.push(getPaperAllotman.data[i])
|
155
|
+
}
|
156
|
+
Vue.$login.f.f_paperAllotman = paperallotman
|
157
|
+
}catch (error) {
|
158
|
+
Vue.$login.f.f_paperAllotman = []
|
159
|
+
console.log('票据分配人模块',error)
|
160
|
+
}
|
161
|
+
// TODO 处理界面细节
|
162
|
+
try {
|
163
|
+
let viewDetails = await Vue.resetpost('rs/search', {
|
164
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
165
|
+
userid: Vue.$login.f.id
|
166
|
+
}, {resolveMsg: null, rejectMsg: null})
|
167
|
+
let r = viewDetails.data
|
168
|
+
Vue.$login.r = []
|
169
|
+
r.forEach(x => Vue.$login.r.push(x.name))
|
170
|
+
}catch (error) {
|
171
|
+
Vue.$login.r = []
|
172
|
+
console.log('加载模块失败',error)
|
173
|
+
}
|
174
|
+
// 调用登录后处理
|
175
|
+
for(let proc of Vue.$login.afterLogin) {
|
176
|
+
await proc(Vue.$login.f)
|
177
|
+
}
|
178
|
+
// 定时发送心跳
|
179
|
+
setInterval(()=> {
|
180
|
+
let http = new HttpResetClass()
|
181
|
+
http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
|
182
|
+
if(req.data.status==710){
|
183
|
+
Vue.prototype.$connectNumber = 0 //重连剩余次数
|
184
|
+
Vue.prototype.$socket.close() // 关闭websocket连接
|
185
|
+
Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
|
186
|
+
if (res === 'confirm') {
|
187
|
+
location.reload()
|
188
|
+
}
|
189
|
+
})
|
190
|
+
}
|
191
|
+
})
|
192
|
+
}, 2 * 60 * 1000)
|
193
|
+
}
|
194
|
+
|
195
|
+
} else {
|
196
|
+
let error = {status: 401, data: getLogin.data.states}
|
197
|
+
// 抛出错误
|
198
|
+
throw error
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
let GetLoginInfoService = {
|
203
|
+
// 登录后要处理的异步对象
|
204
|
+
afterLogin: [],
|
205
|
+
//验证码开关
|
206
|
+
Verification: true,
|
207
|
+
install (Vue, options) {
|
208
|
+
// 给vue增添对话框显示方法
|
209
|
+
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
210
|
+
},
|
211
|
+
|
212
|
+
f: {
|
213
|
+
|
214
|
+
},
|
215
|
+
|
216
|
+
/**
|
217
|
+
* 登录
|
218
|
+
* @param name
|
219
|
+
* @param password
|
220
|
+
*/
|
221
|
+
login (name, password,uuid,checkCode) {
|
222
|
+
return loginGen(name, password,uuid,checkCode)
|
223
|
+
},
|
224
|
+
|
225
|
+
convertToIn (val) {
|
226
|
+
let temp = ''
|
227
|
+
if (val instanceof Array) {
|
228
|
+
if (val.length >= 1) {
|
229
|
+
temp = '('
|
230
|
+
val.forEach((res) => {
|
231
|
+
temp += `'${res}',`
|
232
|
+
})
|
233
|
+
temp = temp.substr(0, temp.length - 1) + ')'
|
234
|
+
}
|
235
|
+
}
|
236
|
+
return temp
|
237
|
+
},
|
238
|
+
|
239
|
+
toStandardYearMonth () {
|
240
|
+
let dt = new Date()
|
241
|
+
let month = dt.getMonth() + 1
|
242
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
243
|
+
},
|
244
|
+
|
245
|
+
toStandardYearMonth1 () {
|
246
|
+
let dt = new Date()
|
247
|
+
let month = dt.getMonth() + 1
|
248
|
+
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
249
|
+
},
|
250
|
+
|
251
|
+
toStandardDateString () {
|
252
|
+
let dt = new Date()
|
253
|
+
let month = dt.getMonth() + 1
|
254
|
+
let date = dt.getDate()
|
255
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
256
|
+
},
|
257
|
+
|
258
|
+
toStartAndEndDateString () {
|
259
|
+
let dt = new Date()
|
260
|
+
let month = dt.getMonth() + 1
|
261
|
+
// let date = dt.getDate()
|
262
|
+
return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
|
263
|
+
dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
|
264
|
+
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
265
|
+
},
|
266
|
+
|
267
|
+
toStandardTimeString () {
|
268
|
+
let dt = new Date()
|
269
|
+
let month = dt.getMonth() + 1
|
270
|
+
let date = dt.getDate()
|
271
|
+
let hour = dt.getHours()
|
272
|
+
let min = dt.getMinutes()
|
273
|
+
let sec = dt.getSeconds()
|
274
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
275
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
276
|
+
},
|
277
|
+
|
278
|
+
guid () {
|
279
|
+
let buf = new Uint16Array(8)
|
280
|
+
window.crypto.getRandomValues(buf)
|
281
|
+
let S4 = function (num) {
|
282
|
+
let ret = num.toString(16)
|
283
|
+
while (ret.length < 4) {
|
284
|
+
ret = '0' + ret
|
285
|
+
}
|
286
|
+
return ret
|
287
|
+
}
|
288
|
+
return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
|
289
|
+
},
|
290
|
+
|
291
|
+
choices (role, param, hasBlank = false, blankHint = '请选择') {
|
292
|
+
if (role == 'view') {
|
293
|
+
Vue.getParams(param, [null])
|
294
|
+
} else {
|
295
|
+
let result = []
|
296
|
+
if (hasBlank)
|
297
|
+
result.push({label: blankHint, value: null})
|
298
|
+
if (!Vue.param || !Vue.param[param])
|
299
|
+
result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
|
300
|
+
else {
|
301
|
+
let p = Vue.param[param]
|
302
|
+
p.forEach(function (item) {
|
303
|
+
result.push({label: item.name, value: item.name})
|
304
|
+
})
|
305
|
+
}
|
306
|
+
return result
|
307
|
+
}
|
308
|
+
},
|
309
|
+
|
310
|
+
required (param) {
|
311
|
+
if (typeof param === 'number' && param == 0)
|
312
|
+
return false
|
313
|
+
if (!param)
|
314
|
+
return true
|
315
|
+
param = param + ''
|
316
|
+
param = param.trim()
|
317
|
+
if (!param)
|
318
|
+
return true
|
319
|
+
return false
|
320
|
+
},
|
321
|
+
|
322
|
+
isInt (n) {
|
323
|
+
return !window.isNaN(n) && n % 1 === 0
|
324
|
+
},
|
325
|
+
|
326
|
+
isFloat (n) {
|
327
|
+
return !window.isNaN(n)
|
328
|
+
},
|
329
|
+
|
330
|
+
// this will convert all true/false to boolean
|
331
|
+
booleanFilter (paper) {
|
332
|
+
for (let key in paper) {
|
333
|
+
if (!paper.hasOwnProperty(key))
|
334
|
+
continue
|
335
|
+
if (typeof paper[key] == 'object' && paper[key] != null) {
|
336
|
+
booleanFilter(paper[key])
|
337
|
+
} else {
|
338
|
+
if (paper[key] === 'true' || paper[key] == 'false')
|
339
|
+
paper[key] = (paper[key] === 'true')
|
340
|
+
}
|
341
|
+
}
|
342
|
+
},
|
343
|
+
// recursively traverse through each path
|
344
|
+
ratifyPics (paper) {
|
345
|
+
for (let key in paper) {
|
346
|
+
if (key.endsWith('_path')) {
|
347
|
+
if (!paper[key]) {
|
348
|
+
paper[key] = 'rs/db/file/nopic.png'
|
349
|
+
} else {
|
350
|
+
paper[key] = 'rs/db/file/' + paper[key]
|
351
|
+
}
|
352
|
+
} else if (paper[key] !== null && typeof (paper[key]) == 'object') {
|
353
|
+
ratifyPics(paper[key])
|
354
|
+
}
|
355
|
+
}
|
356
|
+
},
|
357
|
+
|
358
|
+
// load script and other stuff
|
359
|
+
loadscript (type, fileName) {
|
360
|
+
return new Promise((resolve, reject) => {
|
361
|
+
let element
|
362
|
+
if (type == 'css') {
|
363
|
+
element = document.createElement('link')
|
364
|
+
element.setAttribute('rel', 'stylesheet')
|
365
|
+
element.setAttribute('type', 'text/css')
|
366
|
+
element.setAttribute('href', fileName)
|
367
|
+
} else if (type == 'js') {
|
368
|
+
element = document.createElement('script')
|
369
|
+
element.setAttribute('type', 'text/javascript')
|
370
|
+
element.setAttribute('src', fileName)
|
371
|
+
}
|
372
|
+
if (element) {
|
373
|
+
element.setAttribute('async', '')
|
374
|
+
element.setAttribute('defer', '')
|
375
|
+
element.addEventListener('load', function () {
|
376
|
+
resolve(element)
|
377
|
+
}, false)
|
378
|
+
element.addEventListener('error', function () {
|
379
|
+
reject(element)
|
380
|
+
}, false)
|
381
|
+
document.body.appendChild(element)
|
382
|
+
}
|
383
|
+
})
|
384
|
+
},
|
385
|
+
// 不能选择器中截取掉多余的字符
|
386
|
+
orgName (name) {
|
387
|
+
return name.substring(10)
|
388
|
+
},
|
389
|
+
|
390
|
+
getNowDate (name) {
|
391
|
+
// 求取当前时间的工具
|
392
|
+
let myweekday = ''
|
393
|
+
let year = ''
|
394
|
+
let mydate = new Date()
|
395
|
+
myweekday = mydate.getDay()
|
396
|
+
let mymonth = mydate.getMonth() + 1
|
397
|
+
let myday = mydate.getDate()
|
398
|
+
let myyear = mydate.getYear()
|
399
|
+
year = (myyear > 200) ? myyear : 1900 + myyear
|
400
|
+
let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
|
401
|
+
// document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
402
|
+
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
403
|
+
},
|
404
|
+
|
405
|
+
addDate (date, days) {
|
406
|
+
// 求取当前时间的工具
|
407
|
+
let endDate = new Date(date)
|
408
|
+
endDate = endDate.valueOf()
|
409
|
+
endDate = endDate + days * 24 * 60 * 60 * 1000
|
410
|
+
endDate = new Date(endDate)
|
411
|
+
let month = endDate.getMonth() + 1
|
412
|
+
let day = endDate.getDate()
|
413
|
+
let hour = endDate.getHours()
|
414
|
+
let min = endDate.getMinutes()
|
415
|
+
let sec = endDate.getSeconds()
|
416
|
+
return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
|
417
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
418
|
+
// return a
|
419
|
+
},
|
420
|
+
|
421
|
+
// 通过地址栏的参数获取参数内容
|
422
|
+
getUrlParames (param) {
|
423
|
+
var query = window.location.search
|
424
|
+
var iLen = param.length
|
425
|
+
var iStart = query.indexOf(param)
|
426
|
+
if (iStart === -1) {
|
427
|
+
return ''
|
428
|
+
}
|
429
|
+
iStart += iLen + 1
|
430
|
+
var iEnd = query.indexOf('&', iStart)
|
431
|
+
if (iEnd === -1) {
|
432
|
+
return query.substring(iStart)
|
433
|
+
}
|
434
|
+
return query.substring(iStart, iEnd)
|
435
|
+
},
|
436
|
+
|
437
|
+
// 从地址栏获取加密的参数
|
438
|
+
getUrlCompileParames (param) {
|
439
|
+
let code = unescape(window.location.search.slice(1, window.location.search.length))
|
440
|
+
let query = String.fromCharCode(code.charCodeAt(0) - code.length)
|
441
|
+
for (var i = 1; i < code.length; i++) {
|
442
|
+
query += String.fromCharCode(code.charCodeAt(i) - query.charCodeAt(i - 1))
|
443
|
+
}
|
444
|
+
let iLen = param.length
|
445
|
+
let iStart = query.indexOf(param)
|
446
|
+
if (iStart === -1) {
|
447
|
+
return ''
|
448
|
+
}
|
449
|
+
iStart += iLen + 1
|
450
|
+
let iEnd = query.indexOf('&', iStart)
|
451
|
+
if (iEnd === -1) {
|
452
|
+
return query.substring(iStart)
|
453
|
+
}
|
454
|
+
return query.substring(iStart, iEnd)
|
455
|
+
},
|
456
|
+
|
457
|
+
// 对字符串进行加密
|
458
|
+
compileStr (code) {
|
459
|
+
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
460
|
+
for (let i = 1; i < code.length; i++) {
|
461
|
+
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
462
|
+
}
|
463
|
+
return escape(c)
|
464
|
+
},
|
465
|
+
// 字符串进行解密
|
466
|
+
uncompileStr (code) {
|
467
|
+
code = unescape(code)
|
468
|
+
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
469
|
+
for (var i = 1; i < code.length; i++) {
|
470
|
+
c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
|
471
|
+
}
|
472
|
+
return c
|
473
|
+
},
|
474
|
+
|
475
|
+
dateDescripte (date) {
|
476
|
+
let nowTime = new Date().getTime()
|
477
|
+
let oldTime = new Date(date).getTime()
|
478
|
+
let timeDiff = nowTime - oldTime
|
479
|
+
// 规则说明
|
480
|
+
// 小于等于2分钟为刚刚
|
481
|
+
// 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
|
482
|
+
// 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
|
483
|
+
// 大于24小时小于等于30天为取整的天前(例如:12天前)
|
484
|
+
// 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
|
485
|
+
// 大于365取整的年前,(例如:2年前)
|
486
|
+
let minute = 1000 * 60
|
487
|
+
let hour = minute * 60
|
488
|
+
let day = hour * 24
|
489
|
+
let month = day * 30
|
490
|
+
let year = month * 12
|
491
|
+
let des = ''
|
492
|
+
if (timeDiff <= minute * 2) {
|
493
|
+
des = '刚刚'
|
494
|
+
} else if (minute * 2 < timeDiff && timeDiff < hour) {
|
495
|
+
des = `${Math.floor(timeDiff / minute)}分钟前`
|
496
|
+
} else if (hour < timeDiff && timeDiff <= day) {
|
497
|
+
des = `${Math.floor(timeDiff / hour)}小时前`
|
498
|
+
} else if (day < timeDiff && timeDiff <= month) {
|
499
|
+
des = `${Math.floor(timeDiff / day)}天前`
|
500
|
+
} else if (month < timeDiff && timeDiff <= year) {
|
501
|
+
des = `${Math.floor(timeDiff / month)}个月前`
|
502
|
+
} else if (year < timeDiff) {
|
503
|
+
des = `${Math.floor(timeDiff / year)}年前`
|
504
|
+
}
|
505
|
+
return des
|
506
|
+
},
|
507
|
+
|
508
|
+
nextMonth20 (date) {
|
509
|
+
let ds = date.split('-')
|
510
|
+
let nextMonth = ds[1] - 0 + 1
|
511
|
+
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
export default GetLoginInfoService
|