system-clients 3.2.4 → 3.2.5-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.
@@ -1,625 +1,625 @@
1
- <template>
2
- <div class="syslogin">
3
- <div class="login-title" >
4
- <div class="login-title-chi" style="white-space: nowrap">
5
- <img src="../../../static/newStyle/login-info.png"/>
6
- <span>关于我们</span>
7
- <img src="../../../static/newStyle/login-con.png"/>
8
- <span>联系我们</span>
9
- </div>
10
- </div>
11
- <!--输入框-->
12
- <div class="loginmain">
13
- <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
14
- <div class="loginmain-left">
15
- <img class="loginmain-left-img" src="../../../static/newStyle/login-left.png">
16
- </div>
17
- <div class="loginmain-right">
18
-
19
- <p @click="theme()" style="white-space: nowrap">燃气客服系统</p>
20
-
21
- <form v-show="!login">
22
- <!-- <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">-->
23
- <div class="login-input">
24
- <img src="../../../static/newStyle/login-user.png"/>
25
- <input type="text" style="display: inline;background-color: white!important;" placeholder="用户名" v-model="model.ename"/>
26
- </div>
27
- <div class="login-input">
28
- <img src="../../../static/newStyle/login-pwd.png"/>
29
- <input type="password" placeholder="密码" style="display: inline;background-color: darkgray;" v-model="model.password"
30
- @keyup.enter="confirm('key')"/>
31
- </div>
32
- <div class="login-input-1">
33
- <img src="../../../static/newStyle/login-check.png"/>
34
- <input v-if="$login.Verification" class="login-check" type="text" placeholder="请输入验证码"
35
- v-model="picLyanzhengma" @keyup.enter="confirm('key')"/>
36
- </div>
37
- <div class="login-input-2" >
38
- <input v-if="$login.Verification" class="login-check-1" style="display: inline;background-color:#eeeeee !important;"
39
- type="button" @click="createCode" v-model="checkCode"/>
40
- </div>
41
- <div class="login-bt">
42
- <button type="button" id="login-button" class="login-button" @click.prevent="confirm('click')">登录</button>
43
- </div>
44
- <!-- <input type="password" placeholder="密码" v-model="model.password" class="psicon"-->
45
- <!-- @keyup.enter="confirm('key')">-->
46
- <!-- <input v-if="$login.Verification" styljiaoyane="width: 40%; display: inline" type="text" placeholder="请输入验证码"-->
47
- <!-- v-model="picLyanzhengma" @keyup.enter="confirm('key')">-->
48
- <!-- <input v-if="$login.Verification" style="width: 30%; display: inline;background-color: darkgray;"-->
49
- <!-- type="button" @click="createCode" v-model="checkCode"/><br>-->
50
-
51
- <!-- <button type="button" id="login-button" @click.prevent="confirm()"><strong>注册</strong></button> -->
52
- <!-- <span @click="register()">还没有注册,现在注册>>></span> -->
53
- </form>
54
- <div v-show="login" class="login_load">
55
- <img src="../../../static/newStyle/login-do.gif">
56
- </div>
57
- </div>
58
- </div>
59
- <div class="login-foot" v-show="false">
60
- 技术支持:西安奥枫软件有限公司
61
- </div>
62
-
63
- <modal v-if="depPromptShow" :show.sync="depPromptShow" :backdrop="false" v-ref:modal >
64
- <header slot="modal-header" class="modal-header">
65
- <h4 class="modal-title">登录信息</h4>
66
- </header>
67
- <article slot="modal-body" class="modal-body">
68
- <form class="form-horizontal">
69
- <div class="row">
70
- <div class="col-sm-12 form-group">
71
- <label class="col-sm-5 control-label">当前登录人</label>
72
- <div class="col-sm-7">
73
- <p class="form-control-static">{{$login.f.name}}</p>
74
- </div>
75
- </div>
76
- <div class="col-sm-12 form-group">
77
- <label class="col-sm-5 control-label">所在销售点</label>
78
- <div class="col-sm-7">
79
- <p class="form-control-static">{{$login.f.deps}}</p>
80
- </div>
81
- </div>
82
- </div>
83
- </form>
84
- </article>
85
- <footer slot="modal-footer" class="modal-footer">
86
- <button class="button_search" @click="depPromptConfirm">确认</button>
87
- <button class="button_clear" @click="depPromptCancel">取消</button>
88
- </footer>
89
- </modal>
90
- </div>
91
-
92
- </template>
93
-
94
- <script>
95
- import co from 'co'
96
- import $ from 'jquery'
97
-
98
- let saveGen = function *(self) {
99
- try {
100
- yield self.$login.login(self.model.ename, self.model.password)
101
- yield self.$appdata.load()
102
-
103
- yield self.$getConfig(self, 'Login')
104
- console.log('登录配置', self.config)
105
- if (self.config.isMac) {
106
- // 获取该登录人分公司下的mac配置
107
- let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_filialeids like '%${self.$login.f.f_orgids}%'`}}, {
108
- resolveMsg: null,
109
- rejectMsg: null
110
- }).catch(() => {
111
- throw new Error('获取mac配置失败')
112
- })
113
- console.log('MAC地址信息', getMacs)
114
- // 获取本地mac地址
115
- let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
116
- resolveMsg: null,
117
- rejectMsg: null
118
- }).catch(() => {
119
- throw new Error('获取本地mac配置失败')
120
- })
121
- console.log('本地MAC地址信息', getLocalMac)
122
- // 对Mac地址进行匹配
123
- let macValidate = false
124
- for (let i = 0; i < getLocalMac.data.mac.length; i++) {
125
- for (let j = 0; j < getMacs.data.length; j++) {
126
- if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
127
- macValidate = true
128
- }
129
- }
130
- }
131
- if (!macValidate) {
132
- throw new Error('Mac地址验证失败, 请联系管理员!!')
133
- }
134
- }
135
- if (self.config.depPrompt) {
136
- self.depPromptShow = true
137
- } else {
138
- self.$goto('home-page', {functions: self.$login.f})
139
- }
140
-
141
- } catch (ret) {
142
- console.error('登录失败', ret)
143
- let msg
144
- if (ret instanceof Error) {
145
- msg = ret
146
- }
147
- if (ret.status === 0) {
148
- msg = '服务连接错误,请确认服务状态'
149
- } else if (ret.status === 401) {
150
- msg = ret.data
151
- } else if (ret.status === 710) {
152
- msg = ret.data
153
- }
154
- self.createCode()
155
- self.picLyanzhengma = ''
156
- yield self.$showMessage(msg)
157
- self.model.ename = ''
158
- self.model.password = ''
159
- self.login = false
160
- $('form').fadeIn(500)
161
- }
162
- }
163
- export default {
164
- title: '登录',
165
- ready () {
166
- if (this.$login && this.$login.getUrlCompileParames('name') && this.$login.getUrlCompileParames('password')) {
167
- this.model.ename = this.$login.getUrlCompileParames('name')
168
- this.model.password = this.$login.getUrlCompileParames('password')
169
- this.$login.Verification = false
170
- this.confirm()
171
- }
172
- $('#login-button').click(function (event) {
173
- event.preventDefault()
174
- $('form').fadeOut(500)
175
- }),
176
- this.createCode()
177
- },
178
- data () {
179
- return {
180
- image:{
181
- img1: '/images/newStyle/login-info.png',
182
- img2: '/images/newStyle/login-con.png',
183
- img3: '/images/newStyle/login-left.png',
184
- img4: '/images/newStyle/login-user.png',
185
- img5: '/images/newStyle/login-pwd.png',
186
- img6: '/images/newStyle/login-check.png',
187
- img7: '/images/newStyle/login-do.png',
188
- },
189
- config: {
190
- isMac: false,
191
- depPrompt: false,
192
- },
193
- login: false,
194
- depPromptShow: false,
195
- model: {},
196
- show: false,
197
- checkCode: '',
198
- login_do:true,
199
- picLyanzhengma: ''
200
- }
201
- },
202
- methods: {
203
- theme(){
204
- // var elementList = document.querySelectorAll('body');
205
- // console.log(elementList)
206
- // document.querySelectorAll('body')[0].className='themeTwo'
207
- // var elementList = document.querySelectorAll('body');
208
- // console.log(elementList)
209
- },
210
- onReady () {
211
- this.$emit('ready')
212
- },
213
- confirm (key) {
214
- this.login_do=!this.login_do
215
- // return
216
- if (key == 'key') {
217
- $('form').fadeOut(500)
218
- }
219
- this.login = true
220
- // let gen = saveGen(this)
221
- // return co(gen)
222
- if(this.$login.Verification){
223
- if(this.picLyanzhengma == '') {
224
- this.$showMessage("请输入验证码!").then(()=>{
225
- this.login = false
226
- $('form').fadeIn(500)
227
- this.createCode()
228
- })
229
- }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
230
- //若输入的验证码与产生的验证码不一致时
231
- this.$showMessage("验证码不正确").then(()=>{
232
- this.login = false
233
- $('form').fadeIn(500)
234
- this.createCode();//刷新验证码
235
- this.picLyanzhengma = '';
236
- })
237
- }else {
238
- this.login = true
239
- let gen = saveGen(this)
240
- return co(gen)
241
- }
242
- }else {
243
- this.login = true
244
- let gen = saveGen(this)
245
- return co(gen)
246
- }
247
- },
248
- createCode(){
249
- let code = "";
250
- let codeLength = 4;//验证码的长度
251
- let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
252
- 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
253
- for (let i = 0; i < codeLength; i++) {
254
- //循环操作
255
- let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
256
- code += random[index];//根据索引取得随机数加到code上
257
- }
258
- this.checkCode = code;//把code值赋给验证码
259
- },
260
-
261
- async depPromptConfirm () {
262
- this.depPromptShow = false
263
- return this.$goto('home-page', {functions: this.$login.f})
264
- },
265
-
266
- depPromptCancel () {
267
- this.depPromptShow = false
268
- this.createCode()
269
- this.picLyanzhengma = ''
270
- this.model.ename = ''
271
- this.model.password = ''
272
- this.login = false
273
- $('form').fadeIn(500)
274
- }
275
- }
276
- }
277
- </script>
278
-
279
- <style>
280
- /*输入框样式*/
281
- /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
282
- * {
283
- box-sizing: border-box;
284
- margin: 0;
285
- padding: 0;
286
- font-weight: 300;
287
- }
288
-
289
- body {
290
- font-family: 'Source Sans Pro', sans-serif;
291
- color: white;
292
- font-weight: 300;
293
- }
294
-
295
- body ::-webkit-input-placeholder {
296
- /* WebKit browsers */
297
- font-family: 'Source Sans Pro', sans-serif;
298
- color: white;
299
- font-weight: 300;
300
- }
301
-
302
- body :-moz-placeholder {
303
- /* Mozilla Firefox 4 to 18 */
304
- font-family: 'Source Sans Pro', sans-serif;
305
- color: white;
306
- opacity: 1;
307
- font-weight: 300;
308
- }
309
-
310
- body ::-moz-placeholder {
311
- /* Mozilla Firefox 19+ */
312
- font-family: 'Source Sans Pro', sans-serif;
313
- color: white;
314
- opacity: 1;
315
- font-weight: 300;
316
- }
317
-
318
- body :-ms-input-placeholder {
319
- /* Internet Explorer 10+ */
320
- font-family: 'Source Sans Pro', sans-serif;
321
- color: white;
322
- font-weight: 300;
323
- }
324
-
325
- .wrapper {
326
- /*background: #2D83BA;
327
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
328
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
329
- opacity: 0.8;*/
330
- position: absolute;
331
- top: 50%;
332
- right: -60px;
333
- width: 40%;
334
- height: 400px;
335
- margin-top: -150px;
336
- overflow: hidden;
337
-
338
- }
339
-
340
- .wrapper.form-success .container h3 {
341
- -webkit-transform: translateY(85px);
342
- -ms-transform: translateY(85px);
343
- transform: translateY(85px);
344
- }
345
-
346
- .container {
347
- max-width: 350px;
348
- margin: 0 auto;
349
- padding: 30px 100px 50px 100px;
350
- height: 400px;
351
- text-align: center;
352
- /*以下增加*/
353
- background: #2D83BA;
354
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
355
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
356
- opacity: 0.8;
357
- }
358
-
359
- .container h3 {
360
- font-size: 40px;
361
- -webkit-transition-duration: 1s;
362
- transition-duration: 1s;
363
- -webkit-transition-timing-function: ease-in-put;
364
- transition-timing-function: ease-in-put;
365
- font-weight: 200;
366
- }
367
-
368
- .form {
369
- padding: 20px 0;
370
- position: relative;
371
- z-index: 2;
372
- }
373
-
374
- .form input {
375
- -webkit-appearance: none;
376
- -moz-appearance: none;
377
- appearance: none;
378
- outline: 0;
379
- border: 1px solid #50ABE6;
380
- background-color: #50ABE6;
381
- width: 250px;
382
- border-radius: 3px;
383
- padding: 10px 15px;
384
- margin: 0 auto 10px auto;
385
- display: block;
386
- text-align: center;
387
- font-size: 18px;
388
- color: white;
389
- -webkit-transition-duration: 0.25s;
390
- transition-duration: 0.25s;
391
- font-weight: 300;
392
- }
393
-
394
- .form input:hover {
395
- background-color: rgba(255, 255, 255, 0.4);
396
- }
397
-
398
- .form input:focus {
399
- background-color: white;
400
- width: 300px;
401
- color: #53e3a6;
402
- }
403
-
404
- .usericon {
405
- background-image: url(../../../static/usericon.png);
406
- background-repeat: no-repeat;
407
- background-size: 30px;
408
- background-position-x: 8px;
409
- background-position-y: 8px;
410
- }
411
-
412
- .psicon {
413
- background-image: url(../../../static/psicon.png);
414
- background-repeat: no-repeat;
415
- background-size: 30px;
416
- background-position-x: 8px;
417
- background-position-y: 8px;
418
- }
419
-
420
- .form button {
421
- -webkit-appearance: none;
422
- -moz-appearance: none;
423
- appearance: none;
424
- outline: 0;
425
- background-color: white;
426
- border: 0;
427
- padding: 10px 15px;
428
- color: #253830;
429
- border-radius: 3px;
430
- width: 250px;
431
- cursor: pointer;
432
- font-size: 18px;
433
- -webkit-transition-duration: 0.25s;
434
- transition-duration: 0.25s;
435
- }
436
-
437
- .form button:hover {
438
- background-color: #f5f7f9;
439
- }
440
-
441
- /*注册字体样式*/
442
- .form span {
443
- color: #fff;
444
- display: table-footer-group;
445
- position: absolute;
446
- right: 10px;
447
- margin-top: 10px;
448
- cursor: pointer;
449
- }
450
-
451
- .logotitle {
452
- color: #fff;
453
- position: absolute;
454
- top: 50px;
455
- left: 50px;
456
- font-size: 50px;
457
- }
458
-
459
- /*注册模态框界面样式*/
460
- .modifystyle {
461
- background: #FCFEEE;
462
- }
463
-
464
- .modifystyle div {
465
- height: auto;
466
- margin-bottom: 15px;
467
- /*text-align: center;*/
468
- /*margin-left: 20%;*/
469
- }
470
-
471
- /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
472
- .modifystyle div input + span {
473
- top: 0 !important;
474
- right: 32%;
475
- }
476
-
477
- .modifystyle span {
478
- color: red;
479
- }
480
-
481
- /* 通告区内容 */
482
- .notice-board {
483
- height: auto;
484
- position: absolute;
485
- top: 50%;
486
- margin-top: -150px;
487
- margin-left: 100px;
488
- color: #fff;
489
- }
490
-
491
- /*修改密码底部按钮部分样式*/
492
- .footerbtn {
493
- text-align: center;
494
- padding: 15px;
495
- }
496
-
497
- .footerbtn button {
498
- width: 100px;
499
- margin-left: 20px;
500
- }
501
-
502
- .bg-bubbles {
503
- position: absolute;
504
- top: 0;
505
- left: 0;
506
- width: 100%;
507
- height: 100%;
508
- z-index: 1;
509
- }
510
-
511
- .bg-bubbles li {
512
- position: absolute;
513
- list-style: none;
514
- display: block;
515
- width: 40px;
516
- height: 40px;
517
- background-color: rgba(255, 255, 255, 0.15);
518
- bottom: -160px;
519
- -webkit-animation: square 25s infinite;
520
- animation: square 25s infinite;
521
- -webkit-transition-timing-function: linear;
522
- transition-timing-function: linear;
523
- }
524
-
525
- .bg-bubbles li:nth-child(1) {
526
- left: 10%;
527
- }
528
-
529
- .bg-bubbles li:nth-child(2) {
530
- left: 20%;
531
- width: 80px;
532
- height: 80px;
533
- -webkit-animation-delay: 2s;
534
- animation-delay: 2s;
535
- -webkit-animation-duration: 17s;
536
- animation-duration: 17s;
537
- }
538
-
539
- .bg-bubbles li:nth-child(3) {
540
- left: 25%;
541
- -webkit-animation-delay: 4s;
542
- animation-delay: 4s;
543
- }
544
-
545
- .bg-bubbles li:nth-child(4) {
546
- left: 40%;
547
- width: 60px;
548
- height: 60px;
549
- -webkit-animation-duration: 22s;
550
- animation-duration: 22s;
551
- background-color: rgba(255, 255, 255, 0.25);
552
- }
553
-
554
- .bg-bubbles li:nth-child(5) {
555
- left: 70%;
556
- }
557
-
558
- .bg-bubbles li:nth-child(6) {
559
- left: 80%;
560
- width: 120px;
561
- height: 120px;
562
- -webkit-animation-delay: 3s;
563
- animation-delay: 3s;
564
- background-color: rgba(255, 255, 255, 0.2);
565
- }
566
-
567
- .bg-bubbles li:nth-child(7) {
568
- left: 32%;
569
- width: 160px;
570
- height: 160px;
571
- -webkit-animation-delay: 7s;
572
- animation-delay: 7s;
573
- }
574
-
575
- .bg-bubbles li:nth-child(8) {
576
- left: 55%;
577
- width: 20px;
578
- height: 20px;
579
- -webkit-animation-delay: 15s;
580
- animation-delay: 15s;
581
- -webkit-animation-duration: 40s;
582
- animation-duration: 40s;
583
- }
584
-
585
- .bg-bubbles li:nth-child(9) {
586
- left: 25%;
587
- width: 10px;
588
- height: 10px;
589
- -webkit-animation-delay: 2s;
590
- animation-delay: 2s;
591
- -webkit-animation-duration: 40s;
592
- animation-duration: 40s;
593
- background-color: rgba(255, 255, 255, 0.3);
594
- }
595
-
596
- .bg-bubbles li:nth-child(10) {
597
- left: 90%;
598
- width: 160px;
599
- height: 160px;
600
- -webkit-animation-delay: 11s;
601
- animation-delay: 11s;
602
- }
603
-
604
- @-webkit-keyframes square {
605
- 0% {
606
- -webkit-transform: translateY(0);
607
- transform: translateY(0);
608
- }
609
- 100% {
610
- -webkit-transform: translateY(-700px) rotate(600deg);
611
- transform: translateY(-700px) rotate(600deg);
612
- }
613
- }
614
-
615
- @keyframes square {
616
- 0% {
617
- -webkit-transform: translateY(0);
618
- transform: translateY(0);
619
- }
620
- 100% {
621
- -webkit-transform: translateY(-700px) rotate(600deg);
622
- transform: translateY(-700px) rotate(600deg);
623
- }
624
- }
625
- </style>
1
+ <template>
2
+ <div class="syslogin">
3
+ <div class="login-title" >
4
+ <div class="login-title-chi" style="white-space: nowrap">
5
+ <img src="../../../static/newStyle/login-info.png"/>
6
+ <span>关于我们</span>
7
+ <img src="../../../static/newStyle/login-con.png"/>
8
+ <span>联系我们</span>
9
+ </div>
10
+ </div>
11
+ <!--输入框-->
12
+ <div class="loginmain">
13
+ <!-- <img src="../../../static/login_title1.png" alt="图片加载未完成" class="img-responsive" style="margin: 0 auto; padding-top: 150px;" /> -->
14
+ <div class="loginmain-left">
15
+ <img class="loginmain-left-img" src="../../../static/newStyle/login-left.png">
16
+ </div>
17
+ <div class="loginmain-right">
18
+
19
+ <p @click="theme()" style="white-space: nowrap">燃气客服系统</p>
20
+
21
+ <form v-show="!login">
22
+ <!-- <input type="text" placeholder="用户名" v-model="model.ename" class="usericon">-->
23
+ <div class="login-input">
24
+ <img src="../../../static/newStyle/login-user.png"/>
25
+ <input type="text" style="display: inline;background-color: white!important;" placeholder="用户名" v-model="model.ename"/>
26
+ </div>
27
+ <div class="login-input">
28
+ <img src="../../../static/newStyle/login-pwd.png"/>
29
+ <input type="password" placeholder="密码" style="display: inline;background-color: darkgray;" v-model="model.password"
30
+ @keyup.enter="confirm('key')"/>
31
+ </div>
32
+ <div class="login-input-1">
33
+ <img src="../../../static/newStyle/login-check.png"/>
34
+ <input v-if="$login.Verification" class="login-check" type="text" placeholder="请输入验证码"
35
+ v-model="picLyanzhengma" @keyup.enter="confirm('key')"/>
36
+ </div>
37
+ <div class="login-input-2" >
38
+ <input v-if="$login.Verification" class="login-check-1" style="display: inline;background-color:#eeeeee !important;"
39
+ type="button" @click="createCode" v-model="checkCode"/>
40
+ </div>
41
+ <div class="login-bt">
42
+ <button type="button" id="login-button" class="login-button" @click.prevent="confirm('click')">登录</button>
43
+ </div>
44
+ <!-- <input type="password" placeholder="密码" v-model="model.password" class="psicon"-->
45
+ <!-- @keyup.enter="confirm('key')">-->
46
+ <!-- <input v-if="$login.Verification" styljiaoyane="width: 40%; display: inline" type="text" placeholder="请输入验证码"-->
47
+ <!-- v-model="picLyanzhengma" @keyup.enter="confirm('key')">-->
48
+ <!-- <input v-if="$login.Verification" style="width: 30%; display: inline;background-color: darkgray;"-->
49
+ <!-- type="button" @click="createCode" v-model="checkCode"/><br>-->
50
+
51
+ <!-- <button type="button" id="login-button" @click.prevent="confirm()"><strong>注册</strong></button> -->
52
+ <!-- <span @click="register()">还没有注册,现在注册>>></span> -->
53
+ </form>
54
+ <div v-show="login" class="login_load">
55
+ <img src="../../../static/newStyle/login-do.gif">
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <div class="login-foot" v-show="false">
60
+ 技术支持:西安奥枫软件有限公司
61
+ </div>
62
+
63
+ <modal v-if="depPromptShow" :show.sync="depPromptShow" :backdrop="false" v-ref:modal >
64
+ <header slot="modal-header" class="modal-header">
65
+ <h4 class="modal-title">登录信息</h4>
66
+ </header>
67
+ <article slot="modal-body" class="modal-body">
68
+ <form class="form-horizontal">
69
+ <div class="row">
70
+ <div class="col-sm-12 form-group">
71
+ <label class="col-sm-5 control-label">当前登录人</label>
72
+ <div class="col-sm-7">
73
+ <p class="form-control-static">{{$login.f.name}}</p>
74
+ </div>
75
+ </div>
76
+ <div class="col-sm-12 form-group">
77
+ <label class="col-sm-5 control-label">所在销售点</label>
78
+ <div class="col-sm-7">
79
+ <p class="form-control-static">{{$login.f.deps}}</p>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </form>
84
+ </article>
85
+ <footer slot="modal-footer" class="modal-footer">
86
+ <button class="button_search" @click="depPromptConfirm">确认</button>
87
+ <button class="button_clear" @click="depPromptCancel">取消</button>
88
+ </footer>
89
+ </modal>
90
+ </div>
91
+
92
+ </template>
93
+
94
+ <script>
95
+ import co from 'co'
96
+ import $ from 'jquery'
97
+
98
+ let saveGen = function *(self) {
99
+ try {
100
+ yield self.$login.login(self.model.ename, self.model.password)
101
+ yield self.$appdata.load()
102
+
103
+ yield self.$getConfig(self, 'Login')
104
+ console.log('登录配置', self.config)
105
+ if (self.config.isMac) {
106
+ // 获取该登录人分公司下的mac配置
107
+ let getMacs = yield self.$resetpost('rs/sql/equipmentQuery', {data: {condition: `f_filialeids like '%${self.$login.f.f_orgids}%'`}}, {
108
+ resolveMsg: null,
109
+ rejectMsg: null
110
+ }).catch(() => {
111
+ throw new Error('获取mac配置失败')
112
+ })
113
+ console.log('MAC地址信息', getMacs)
114
+ // 获取本地mac地址
115
+ let getLocalMac = yield self.$resetget('http://127.0.0.1:8003/loadmac', {
116
+ resolveMsg: null,
117
+ rejectMsg: null
118
+ }).catch(() => {
119
+ throw new Error('获取本地mac配置失败')
120
+ })
121
+ console.log('本地MAC地址信息', getLocalMac)
122
+ // 对Mac地址进行匹配
123
+ let macValidate = false
124
+ for (let i = 0; i < getLocalMac.data.mac.length; i++) {
125
+ for (let j = 0; j < getMacs.data.length; j++) {
126
+ if (getMacs.data[j].f_mac_number.toLocaleUpperCase() === getLocalMac.data.mac[i]) {
127
+ macValidate = true
128
+ }
129
+ }
130
+ }
131
+ if (!macValidate) {
132
+ throw new Error('Mac地址验证失败, 请联系管理员!!')
133
+ }
134
+ }
135
+ if (self.config.depPrompt) {
136
+ self.depPromptShow = true
137
+ } else {
138
+ self.$goto('home-page', {functions: self.$login.f})
139
+ }
140
+
141
+ } catch (ret) {
142
+ console.error('登录失败', ret)
143
+ let msg
144
+ if (ret instanceof Error) {
145
+ msg = ret
146
+ }
147
+ if (ret.status === 0) {
148
+ msg = '服务连接错误,请确认服务状态'
149
+ } else if (ret.status === 401) {
150
+ msg = ret.data
151
+ } else if (ret.status === 710) {
152
+ msg = ret.data
153
+ }
154
+ self.createCode()
155
+ self.picLyanzhengma = ''
156
+ yield self.$showMessage(msg)
157
+ self.model.ename = ''
158
+ self.model.password = ''
159
+ self.login = false
160
+ $('form').fadeIn(500)
161
+ }
162
+ }
163
+ export default {
164
+ title: '登录',
165
+ ready () {
166
+ if (this.$login && this.$login.getUrlCompileParames('name') && this.$login.getUrlCompileParames('password')) {
167
+ this.model.ename = this.$login.getUrlCompileParames('name')
168
+ this.model.password = this.$login.getUrlCompileParames('password')
169
+ this.$login.Verification = false
170
+ this.confirm()
171
+ }
172
+ $('#login-button').click(function (event) {
173
+ event.preventDefault()
174
+ $('form').fadeOut(500)
175
+ }),
176
+ this.createCode()
177
+ },
178
+ data () {
179
+ return {
180
+ image:{
181
+ img1: '/images/newStyle/login-info.png',
182
+ img2: '/images/newStyle/login-con.png',
183
+ img3: '/images/newStyle/login-left.png',
184
+ img4: '/images/newStyle/login-user.png',
185
+ img5: '/images/newStyle/login-pwd.png',
186
+ img6: '/images/newStyle/login-check.png',
187
+ img7: '/images/newStyle/login-do.png',
188
+ },
189
+ config: {
190
+ isMac: false,
191
+ depPrompt: false,
192
+ },
193
+ login: false,
194
+ depPromptShow: false,
195
+ model: {},
196
+ show: false,
197
+ checkCode: '',
198
+ login_do:true,
199
+ picLyanzhengma: ''
200
+ }
201
+ },
202
+ methods: {
203
+ theme(){
204
+ // var elementList = document.querySelectorAll('body');
205
+ // console.log(elementList)
206
+ // document.querySelectorAll('body')[0].className='themeTwo'
207
+ // var elementList = document.querySelectorAll('body');
208
+ // console.log(elementList)
209
+ },
210
+ onReady () {
211
+ this.$emit('ready')
212
+ },
213
+ confirm (key) {
214
+ this.login_do=!this.login_do
215
+ // return
216
+ if (key == 'key') {
217
+ $('form').fadeOut(500)
218
+ }
219
+ this.login = true
220
+ // let gen = saveGen(this)
221
+ // return co(gen)
222
+ if(this.$login.Verification){
223
+ if(this.picLyanzhengma == '') {
224
+ this.$showMessage("请输入验证码!").then(()=>{
225
+ this.login = false
226
+ $('form').fadeIn(500)
227
+ this.createCode()
228
+ })
229
+ }else if(this.picLyanzhengma.toUpperCase() != this.checkCode ) {
230
+ //若输入的验证码与产生的验证码不一致时
231
+ this.$showMessage("验证码不正确").then(()=>{
232
+ this.login = false
233
+ $('form').fadeIn(500)
234
+ this.createCode();//刷新验证码
235
+ this.picLyanzhengma = '';
236
+ })
237
+ }else {
238
+ this.login = true
239
+ let gen = saveGen(this)
240
+ return co(gen)
241
+ }
242
+ }else {
243
+ this.login = true
244
+ let gen = saveGen(this)
245
+ return co(gen)
246
+ }
247
+ },
248
+ createCode(){
249
+ let code = "";
250
+ let codeLength = 4;//验证码的长度
251
+ let random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
252
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数
253
+ for (let i = 0; i < codeLength; i++) {
254
+ //循环操作
255
+ let index = Math.floor(Math.random() * 36);//取得随机数的索引(0~35)
256
+ code += random[index];//根据索引取得随机数加到code上
257
+ }
258
+ this.checkCode = code;//把code值赋给验证码
259
+ },
260
+
261
+ async depPromptConfirm () {
262
+ this.depPromptShow = false
263
+ return this.$goto('home-page', {functions: this.$login.f})
264
+ },
265
+
266
+ depPromptCancel () {
267
+ this.depPromptShow = false
268
+ this.createCode()
269
+ this.picLyanzhengma = ''
270
+ this.model.ename = ''
271
+ this.model.password = ''
272
+ this.login = false
273
+ $('form').fadeIn(500)
274
+ }
275
+ }
276
+ }
277
+ </script>
278
+
279
+ <style>
280
+ /*输入框样式*/
281
+ /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
282
+ * {
283
+ box-sizing: border-box;
284
+ margin: 0;
285
+ padding: 0;
286
+ font-weight: 300;
287
+ }
288
+
289
+ body {
290
+ font-family: 'Source Sans Pro', sans-serif;
291
+ color: white;
292
+ font-weight: 300;
293
+ }
294
+
295
+ body ::-webkit-input-placeholder {
296
+ /* WebKit browsers */
297
+ font-family: 'Source Sans Pro', sans-serif;
298
+ color: white;
299
+ font-weight: 300;
300
+ }
301
+
302
+ body :-moz-placeholder {
303
+ /* Mozilla Firefox 4 to 18 */
304
+ font-family: 'Source Sans Pro', sans-serif;
305
+ color: white;
306
+ opacity: 1;
307
+ font-weight: 300;
308
+ }
309
+
310
+ body ::-moz-placeholder {
311
+ /* Mozilla Firefox 19+ */
312
+ font-family: 'Source Sans Pro', sans-serif;
313
+ color: white;
314
+ opacity: 1;
315
+ font-weight: 300;
316
+ }
317
+
318
+ body :-ms-input-placeholder {
319
+ /* Internet Explorer 10+ */
320
+ font-family: 'Source Sans Pro', sans-serif;
321
+ color: white;
322
+ font-weight: 300;
323
+ }
324
+
325
+ .wrapper {
326
+ /*background: #2D83BA;
327
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
328
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
329
+ opacity: 0.8;*/
330
+ position: absolute;
331
+ top: 50%;
332
+ right: -60px;
333
+ width: 40%;
334
+ height: 400px;
335
+ margin-top: -150px;
336
+ overflow: hidden;
337
+
338
+ }
339
+
340
+ .wrapper.form-success .container h3 {
341
+ -webkit-transform: translateY(85px);
342
+ -ms-transform: translateY(85px);
343
+ transform: translateY(85px);
344
+ }
345
+
346
+ .container {
347
+ max-width: 350px;
348
+ margin: 0 auto;
349
+ padding: 30px 100px 50px 100px;
350
+ height: 400px;
351
+ text-align: center;
352
+ /*以下增加*/
353
+ background: #2D83BA;
354
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
355
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
356
+ opacity: 0.8;
357
+ }
358
+
359
+ .container h3 {
360
+ font-size: 40px;
361
+ -webkit-transition-duration: 1s;
362
+ transition-duration: 1s;
363
+ -webkit-transition-timing-function: ease-in-put;
364
+ transition-timing-function: ease-in-put;
365
+ font-weight: 200;
366
+ }
367
+
368
+ .form {
369
+ padding: 20px 0;
370
+ position: relative;
371
+ z-index: 2;
372
+ }
373
+
374
+ .form input {
375
+ -webkit-appearance: none;
376
+ -moz-appearance: none;
377
+ appearance: none;
378
+ outline: 0;
379
+ border: 1px solid #50ABE6;
380
+ background-color: #50ABE6;
381
+ width: 250px;
382
+ border-radius: 3px;
383
+ padding: 10px 15px;
384
+ margin: 0 auto 10px auto;
385
+ display: block;
386
+ text-align: center;
387
+ font-size: 18px;
388
+ color: white;
389
+ -webkit-transition-duration: 0.25s;
390
+ transition-duration: 0.25s;
391
+ font-weight: 300;
392
+ }
393
+
394
+ .form input:hover {
395
+ background-color: rgba(255, 255, 255, 0.4);
396
+ }
397
+
398
+ .form input:focus {
399
+ background-color: white;
400
+ width: 300px;
401
+ color: #53e3a6;
402
+ }
403
+
404
+ .usericon {
405
+ background-image: url(../../../static/usericon.png);
406
+ background-repeat: no-repeat;
407
+ background-size: 30px;
408
+ background-position-x: 8px;
409
+ background-position-y: 8px;
410
+ }
411
+
412
+ .psicon {
413
+ background-image: url(../../../static/psicon.png);
414
+ background-repeat: no-repeat;
415
+ background-size: 30px;
416
+ background-position-x: 8px;
417
+ background-position-y: 8px;
418
+ }
419
+
420
+ .form button {
421
+ -webkit-appearance: none;
422
+ -moz-appearance: none;
423
+ appearance: none;
424
+ outline: 0;
425
+ background-color: white;
426
+ border: 0;
427
+ padding: 10px 15px;
428
+ color: #253830;
429
+ border-radius: 3px;
430
+ width: 250px;
431
+ cursor: pointer;
432
+ font-size: 18px;
433
+ -webkit-transition-duration: 0.25s;
434
+ transition-duration: 0.25s;
435
+ }
436
+
437
+ .form button:hover {
438
+ background-color: #f5f7f9;
439
+ }
440
+
441
+ /*注册字体样式*/
442
+ .form span {
443
+ color: #fff;
444
+ display: table-footer-group;
445
+ position: absolute;
446
+ right: 10px;
447
+ margin-top: 10px;
448
+ cursor: pointer;
449
+ }
450
+
451
+ .logotitle {
452
+ color: #fff;
453
+ position: absolute;
454
+ top: 50px;
455
+ left: 50px;
456
+ font-size: 50px;
457
+ }
458
+
459
+ /*注册模态框界面样式*/
460
+ .modifystyle {
461
+ background: #FCFEEE;
462
+ }
463
+
464
+ .modifystyle div {
465
+ height: auto;
466
+ margin-bottom: 15px;
467
+ /*text-align: center;*/
468
+ /*margin-left: 20%;*/
469
+ }
470
+
471
+ /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
472
+ .modifystyle div input + span {
473
+ top: 0 !important;
474
+ right: 32%;
475
+ }
476
+
477
+ .modifystyle span {
478
+ color: red;
479
+ }
480
+
481
+ /* 通告区内容 */
482
+ .notice-board {
483
+ height: auto;
484
+ position: absolute;
485
+ top: 50%;
486
+ margin-top: -150px;
487
+ margin-left: 100px;
488
+ color: #fff;
489
+ }
490
+
491
+ /*修改密码底部按钮部分样式*/
492
+ .footerbtn {
493
+ text-align: center;
494
+ padding: 15px;
495
+ }
496
+
497
+ .footerbtn button {
498
+ width: 100px;
499
+ margin-left: 20px;
500
+ }
501
+
502
+ .bg-bubbles {
503
+ position: absolute;
504
+ top: 0;
505
+ left: 0;
506
+ width: 100%;
507
+ height: 100%;
508
+ z-index: 1;
509
+ }
510
+
511
+ .bg-bubbles li {
512
+ position: absolute;
513
+ list-style: none;
514
+ display: block;
515
+ width: 40px;
516
+ height: 40px;
517
+ background-color: rgba(255, 255, 255, 0.15);
518
+ bottom: -160px;
519
+ -webkit-animation: square 25s infinite;
520
+ animation: square 25s infinite;
521
+ -webkit-transition-timing-function: linear;
522
+ transition-timing-function: linear;
523
+ }
524
+
525
+ .bg-bubbles li:nth-child(1) {
526
+ left: 10%;
527
+ }
528
+
529
+ .bg-bubbles li:nth-child(2) {
530
+ left: 20%;
531
+ width: 80px;
532
+ height: 80px;
533
+ -webkit-animation-delay: 2s;
534
+ animation-delay: 2s;
535
+ -webkit-animation-duration: 17s;
536
+ animation-duration: 17s;
537
+ }
538
+
539
+ .bg-bubbles li:nth-child(3) {
540
+ left: 25%;
541
+ -webkit-animation-delay: 4s;
542
+ animation-delay: 4s;
543
+ }
544
+
545
+ .bg-bubbles li:nth-child(4) {
546
+ left: 40%;
547
+ width: 60px;
548
+ height: 60px;
549
+ -webkit-animation-duration: 22s;
550
+ animation-duration: 22s;
551
+ background-color: rgba(255, 255, 255, 0.25);
552
+ }
553
+
554
+ .bg-bubbles li:nth-child(5) {
555
+ left: 70%;
556
+ }
557
+
558
+ .bg-bubbles li:nth-child(6) {
559
+ left: 80%;
560
+ width: 120px;
561
+ height: 120px;
562
+ -webkit-animation-delay: 3s;
563
+ animation-delay: 3s;
564
+ background-color: rgba(255, 255, 255, 0.2);
565
+ }
566
+
567
+ .bg-bubbles li:nth-child(7) {
568
+ left: 32%;
569
+ width: 160px;
570
+ height: 160px;
571
+ -webkit-animation-delay: 7s;
572
+ animation-delay: 7s;
573
+ }
574
+
575
+ .bg-bubbles li:nth-child(8) {
576
+ left: 55%;
577
+ width: 20px;
578
+ height: 20px;
579
+ -webkit-animation-delay: 15s;
580
+ animation-delay: 15s;
581
+ -webkit-animation-duration: 40s;
582
+ animation-duration: 40s;
583
+ }
584
+
585
+ .bg-bubbles li:nth-child(9) {
586
+ left: 25%;
587
+ width: 10px;
588
+ height: 10px;
589
+ -webkit-animation-delay: 2s;
590
+ animation-delay: 2s;
591
+ -webkit-animation-duration: 40s;
592
+ animation-duration: 40s;
593
+ background-color: rgba(255, 255, 255, 0.3);
594
+ }
595
+
596
+ .bg-bubbles li:nth-child(10) {
597
+ left: 90%;
598
+ width: 160px;
599
+ height: 160px;
600
+ -webkit-animation-delay: 11s;
601
+ animation-delay: 11s;
602
+ }
603
+
604
+ @-webkit-keyframes square {
605
+ 0% {
606
+ -webkit-transform: translateY(0);
607
+ transform: translateY(0);
608
+ }
609
+ 100% {
610
+ -webkit-transform: translateY(-700px) rotate(600deg);
611
+ transform: translateY(-700px) rotate(600deg);
612
+ }
613
+ }
614
+
615
+ @keyframes square {
616
+ 0% {
617
+ -webkit-transform: translateY(0);
618
+ transform: translateY(0);
619
+ }
620
+ 100% {
621
+ -webkit-transform: translateY(-700px) rotate(600deg);
622
+ transform: translateY(-700px) rotate(600deg);
623
+ }
624
+ }
625
+ </style>