fstarter 2.10.49 → 2.10.52

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.
Files changed (80) hide show
  1. package/.babelrc +6 -6
  2. package/.editorconfig +9 -9
  3. package/index.html +22 -22
  4. package/index.js +222 -222
  5. package/package.json +104 -104
  6. package/src/App.vue +38 -38
  7. package/src/i18n/en-US.js +35 -35
  8. package/src/i18n/zh-CN.js +35 -35
  9. package/src/main.js +95 -87
  10. package/src/plugins/assets/ak.js +948 -948
  11. package/src/plugins/assets/callNative.js +490 -488
  12. package/src/plugins/assets/compressImg.js +75 -75
  13. package/src/plugins/assets/config.js +106 -106
  14. package/src/plugins/assets/fileServer.js +469 -469
  15. package/src/plugins/assets/http.js +343 -343
  16. package/src/plugins/assets/ua.js +27 -27
  17. package/src/plugins/components/BSButton.vue +61 -61
  18. package/src/plugins/components/BSCascader.vue +465 -465
  19. package/src/plugins/components/BSCell.vue +48 -48
  20. package/src/plugins/components/BSDatePicker.vue +167 -167
  21. package/src/plugins/components/BSImage.vue +42 -42
  22. package/src/plugins/components/BSInput.vue +140 -140
  23. package/src/plugins/components/BSList.vue +81 -81
  24. package/src/plugins/components/BSPicCode.vue +96 -96
  25. package/src/plugins/components/BSPopup.vue +43 -43
  26. package/src/plugins/components/BSRadio.vue +97 -97
  27. package/src/plugins/components/BSSearch.vue +109 -109
  28. package/src/plugins/components/BSSelect.vue +144 -144
  29. package/src/plugins/components/BSSign.vue +454 -454
  30. package/src/plugins/components/BSStepper.vue +115 -115
  31. package/src/plugins/components/BSUpload.vue +92 -92
  32. package/src/plugins/components/BSUpload2.vue +398 -398
  33. package/src/plugins/components/BSVerCode.vue +128 -128
  34. package/src/plugins/components/BSViewer.vue +92 -92
  35. package/src/plugins/components/base.js +496 -496
  36. package/src/plugins/components/base2.js +489 -489
  37. package/src/plugins/lib/weixin.js +20 -20
  38. package/src/plugins/platform/index.js +7 -7
  39. package/src/plugins/platform/isp_phone.js +310 -306
  40. package/src/plugins/route/index.js +140 -140
  41. package/src/plugins/selector/index.js +342 -342
  42. package/src/plugins/service/index.js +81 -81
  43. package/src/plugins/services/callCamera.js +53 -53
  44. package/src/plugins/services/exit.js +36 -36
  45. package/src/plugins/services/face.js +69 -69
  46. package/src/plugins/services/faceH5.js +54 -0
  47. package/src/plugins/services/faceInApp.js +31 -31
  48. package/src/plugins/services/faceTx.js +61 -61
  49. package/src/plugins/services/getFaceResult.js +104 -104
  50. package/src/plugins/services/getH5FaceResult.js +62 -0
  51. package/src/plugins/services/getMenus.js +40 -40
  52. package/src/plugins/services/getSystemData.js +128 -128
  53. package/src/plugins/services/getToken.js +79 -79
  54. package/src/plugins/services/getTxFaceResult.js +83 -83
  55. package/src/plugins/services/getUserInfo.js +47 -47
  56. package/src/plugins/services/goSetPage.js +40 -40
  57. package/src/plugins/services/hideFhoneTitle.js +36 -36
  58. package/src/plugins/services/index.js +45 -41
  59. package/src/plugins/services/init.js +35 -35
  60. package/src/plugins/services/jumpView.js +40 -40
  61. package/src/plugins/services/logout.js +43 -43
  62. package/src/plugins/services/share.js +113 -113
  63. package/src/plugins/services/statusBarHeight.js +39 -39
  64. package/src/plugins/session/index.js +32 -32
  65. package/src/services/getAuthInfo.js +22 -22
  66. package/src/services/index.js +9 -9
  67. package/src/services/sendVerCode.js +23 -23
  68. package/src/views/auth.vue +367 -370
  69. package/src/views/auth2.vue +90 -90
  70. package/src/views/auth3.vue +157 -157
  71. package/src/views/auth4.vue +8979 -8979
  72. package/src/views/auth5.vue +50 -50
  73. package/src/views/authh5.vue +369 -0
  74. package/src/views/components/BankSelect.vue +55 -55
  75. package/src/views/foot.vue +140 -140
  76. package/src/views/page.vue +222 -219
  77. package/src/views/shellFunc.vue +41 -41
  78. package/themes/basic.css +1 -1
  79. package/webpack.config.js +144 -144
  80. package/fstarter.iml +0 -9
@@ -1,496 +1,496 @@
1
-
2
- import { fromEvent } from 'rxjs';
3
- import config from '../assets/config.js'
4
- import ak from '../assets/ak.js'
5
- import session from '../session'
6
- import route from '../route'
7
- import selector from "../selector";
8
- import {ua} from "../assets/ua";
9
-
10
- export default {
11
- props: {
12
- value: {
13
- type: Object,
14
- default: () => {
15
- return {default:true}
16
- }
17
- },
18
- mod: {
19
- type: Object,
20
- default: () => {
21
- return {default:true}
22
- }
23
- },
24
- cname:{
25
- type: String
26
- }
27
- },
28
- data() {
29
- return {
30
- baseCtl:false,
31
- fullName:undefined,
32
- sname:undefined,
33
- model:{
34
- hiddenValidate:false,
35
- validateResult:{
36
- messages:[],
37
- message:'',
38
- isSuccess:true,
39
- pending:false
40
- }
41
- },
42
- modelData:{},
43
- needLoadData:false,
44
- needProcessEvent:false,
45
- isExtend:false
46
- }
47
- },
48
- mounted() {
49
-
50
- if(this.sname == 'page'){
51
-
52
- let self = this
53
- this.$service.callService('init').then(()=>{
54
- self.$service.callService('getFaceResult',{},false)
55
- })
56
-
57
- }
58
-
59
- if(route.currentUrl != window.location.href){
60
- route.currentUrl = window.location.href
61
- let routeDefined = route.defined[ak.http.getRouteUrl(route.currentUrl)]
62
- if(routeDefined && routeDefined.needLogin){
63
- this.$service.callService('getToken').then((data)=>{
64
- if(!session.sys.isLogined){
65
- this.$service.callService('logout')
66
- }
67
- })
68
- }
69
-
70
- if(routeDefined){
71
-
72
- if('title' in routeDefined)
73
- this.session.sys.title = routeDefined.title
74
-
75
- if('title' in routeDefined)
76
- this.session.sys.toolbar.title = routeDefined.title
77
-
78
- if('toolbarIsShow' in routeDefined)
79
- this.session.sys.toolbar.isShow = routeDefined.toolbarIsShow
80
- }
81
-
82
- }
83
-
84
- this.processModel()
85
-
86
- this.needLoadData = Object.prototype.toString.call(this.$options.methods.loadData) == "[object Function]"
87
-
88
- if(this.needLoadData){
89
- this.$bus.on('porcessData', (data) => {
90
-
91
- let cb = this.$options.methods.loadData.bind(this)
92
- cb(data)
93
-
94
- })
95
- }
96
-
97
- if(this.needProcessEvent){
98
- this.$bus.on('processEvent', (data) => {
99
-
100
- let cb = this.$options.methods.processEvent.bind(this)
101
- cb(data)
102
- })
103
- }
104
-
105
- },
106
- methods: {
107
- createDefaultModel2(){
108
-
109
- let model2 = {
110
- label: '',
111
- tag:'',
112
- data: {},
113
- visible:true,
114
- readonly: false,
115
- disabled: false,
116
- required: false,
117
- clearable: true,
118
- validateType: '',
119
- validateGroup: '',
120
- validateReg: '',
121
- inputAlign: 'left',
122
- validateToken: 0,
123
- validateResult: {
124
- messages: [],
125
- message: '',
126
- isSuccess: true,
127
- pending: false
128
- }
129
- }
130
-
131
- if(this.$options.methods.createDefaultModel){
132
- return Object.assign(this.$options.methods.createDefaultModel(),model2)
133
- }else{
134
- return model2
135
- }
136
-
137
- },
138
- getGobalfullName(){
139
-
140
- let sysflag = 'normal'
141
- if(ua.isIspPhone){
142
- sysflag = 'ispPhone'
143
- }else if(ua.microMsg){
144
- sysflag = 'microMsg'
145
- }
146
-
147
- return config.sys.id + '.' + sysflag + '.' + this.fullName
148
- },
149
- saveLocalValue(val){
150
- if('local_storage' in config.other && config.other.local_storage === 'true'){
151
- let json = JSON.stringify(val)
152
- localStorage.setItem(this.getGobalfullName(),json)
153
- }
154
- },
155
- loadData(data){
156
-
157
- },
158
- processEvent(event){
159
-
160
- },
161
- processModel(){
162
-
163
- this.fullName = this.getCtlName(this)
164
-
165
- let hasValue = false
166
- if(this.$props.mod.default === true){
167
- this.modelData = this.createDefaultModel2()
168
- }else{
169
-
170
- hasValue = 'value' in this.$props.mod
171
- let defaultModel = this.createDefaultModel2()
172
- this.modelData = Object.assign({},defaultModel,this.$props.mod)
173
- }
174
-
175
- if('local_storage' in config.other && config.other.local_storage === 'true'){
176
- if(!hasValue) {
177
- let sv = localStorage.getItem(this.getGobalfullName())
178
- if(!ak.utils.isEmpty(sv)){
179
- this.modelData.value = JSON.parse(sv)
180
- }
181
- }
182
- }
183
-
184
-
185
- this.modelData = this.locale(this.modelData)
186
- this.model = ak.utils.cloneBySerialize(this.modelData)
187
-
188
- if(!this.isExtend) {
189
- this.$set(session.regedit, this.fullName, {model: this.model, ctl: this, name: this.fullName})
190
- selector.index_add(this.sname,this.fullName)
191
- console.log('regedit component ' + this.fullName)
192
- }
193
-
194
- },
195
- getCtlName(ctl){
196
-
197
- if(!ctl.$props)
198
- return ''
199
-
200
- let ctlName = ctl.$ak.utils.isEmpty(ctl.$props.cname) ? ctl.$data.vname : ctl.$props.cname
201
-
202
- if(ctl.$data.isExtend){
203
- return ''
204
- }
205
-
206
- if(ak.utils.isEmpty(ctlName)){
207
- ctlName = ak.utils.guid2()
208
- }
209
- ctlName = ctlName.replace(/RNUM/, ak.utils.guid2())
210
-
211
- this.sname = ctlName
212
-
213
- if(ak.utils.isEmpty(ctlName)){
214
- return ''
215
- }
216
-
217
- let parentName_s = undefined
218
- let parent = ctl.$parent
219
- while(parent){
220
-
221
-
222
- if(!this.$ak.utils.isEmpty(parent.$data.fullName)){
223
- parentName_s = parent.$data.fullName
224
- break
225
- }
226
-
227
- if(!(parent.$options.methods && Object.prototype.toString.call(parent.$options.methods.getCtlName) == "[object Function]")){
228
- parent = parent.$parent
229
- continue
230
- }else if(parent.$data.isExtend){
231
- parent = parent.$parent
232
- continue
233
- }else{
234
- break
235
- }
236
-
237
- }
238
-
239
-
240
- if(parent){
241
-
242
- let parentName = undefined
243
- if(parentName_s){
244
- parentName = parentName_s
245
- }else {
246
- parentName = parent.$options.methods.getCtlName.bind(parent)(parent)
247
- }
248
-
249
-
250
- let parent2 = ctl.$parent
251
- while(parent2){
252
-
253
- if(!this.$ak.utils.isEmpty(parent2.$data.fullName)){
254
- break
255
- }
256
-
257
- if(!(parent2.$options.methods && Object.prototype.toString.call(parent2.$options.methods.getCtlName) == "[object Function]")){
258
-
259
- parent2.$data.fullName = parentName
260
- parent2 = parent2.$parent
261
- continue
262
- }else if(parent2.$data.isExtend){
263
-
264
- parent2.$data.fullName = parentName
265
- parent2 = parent2.$parent
266
- continue
267
- }else{
268
- break
269
- }
270
- }
271
-
272
-
273
- if(ctl.$ak.utils.isEmpty(parentName)){
274
- return ctlName
275
- }else{
276
- return parentName + '.' + ctlName
277
- }
278
-
279
- }else{
280
- return ctlName
281
- }
282
-
283
- },
284
- service(serviceObj){
285
-
286
- let obj = serviceObj.before()
287
-
288
- return serviceObj.process(obj).then((res)=>{
289
-
290
- Promise.resolve(serviceObj.after(res))
291
-
292
- })
293
-
294
- },
295
- getValidateResult(onlyError,group){
296
-
297
- let isSuccess = true
298
- let messages = []
299
-
300
- for(var key in session.regedit){
301
-
302
- let ctl = session.regedit[key]
303
-
304
- if(!ctl.ctl.validateCtl)
305
- continue
306
-
307
-
308
- isSuccess = ctl.model.validateResult.isSuccess && isSuccess
309
- if(!ctl.model.validateResult.isSuccess){
310
-
311
- messages.push(...ctl.model.validateResult.messages)
312
-
313
- }
314
-
315
- }
316
-
317
- return {"isSuccess":isSuccess,"messages":messages}
318
-
319
- },
320
- validateAll(onlyError = true,group = ''){
321
-
322
- let isSuccess = true
323
- let promises = []
324
-
325
- for(var key in session.regedit){
326
-
327
- let ctl = session.regedit[key]
328
-
329
- if(!ctl.ctl.validateCtl)
330
- continue
331
-
332
- if(ctl.model.validateGroup != group)
333
- continue
334
-
335
- let func = ctl.ctl.$options.methods.validate.bind(ctl.ctl)
336
-
337
- let promiseV = func(true)
338
- if(promiseV){
339
- promises.push(promiseV)
340
- }
341
-
342
- }
343
-
344
- let self = this
345
- return Promise.all(promises)
346
- .then((result) => {
347
-
348
- let validateResult = self.getValidateResult(onlyError,group)
349
- return Promise.resolve(validateResult)
350
-
351
- })
352
-
353
- },
354
- selector(express){
355
- return this.$ak.utils.selector(express)
356
- },
357
- locale(obj){
358
-
359
- if(Object.prototype.toString.call(obj) == '[object Object]'){
360
-
361
- for(let key in obj){
362
- obj[key] = this.locale(obj[key])
363
- }
364
- return obj
365
-
366
- }else if(Object.prototype.toString.call(obj) == '[object Array]'){
367
-
368
- for(let key in obj){
369
- obj[key] = this.locale(obj[key])
370
- }
371
- return obj
372
-
373
- }else if(Object.prototype.toString.call(obj) == '[object String]'){
374
-
375
- if(this.$ak.utils.isEmpty(obj))
376
- return ''
377
-
378
- if(obj.startWith("lang.")){
379
- return this.$t(obj)
380
- }else{
381
- return obj
382
- }
383
-
384
- }else{
385
- return obj
386
- }
387
-
388
- },
389
- reset(){
390
- this.reset2(this.model,this.modelData)
391
- },
392
- reset2(dest,source){
393
-
394
- for(var p in source){
395
-
396
- if(Object.prototype.toString.call(source[p]) == "[object Object]"){
397
-
398
- if(dest.hasOwnProperty(p)){
399
- this.reset2(dest[p],source[p])
400
- }
401
- }else if(Object.prototype.toString.call(source[p]) == "[object Array]"){
402
-
403
- if(dest.hasOwnProperty(p) && String(p) !== 'items'){
404
- dest[p] = source[p];
405
- }
406
- }else{
407
- if(dest.hasOwnProperty(p)){
408
- dest[p] = source[p];
409
- }
410
- }
411
- }
412
-
413
- },
414
- validate(useAll){
415
-
416
- }
417
- },
418
- computed: {
419
- config(){
420
- return config;
421
- },
422
- session(){
423
- return session;
424
- },
425
- route(){
426
- return route
427
- }
428
- },
429
- watch:{
430
-
431
- 'session.regeditc':{
432
- handler(val){
433
-
434
- let event = JSON.parse(val)
435
-
436
- if(this.vname && this.vname == 'page'){
437
- this.$bus.$emit('processEvent',event)
438
- }
439
-
440
- }
441
- },
442
- 'model.validateToken':{
443
- handler(val,oldval){
444
- if(oldval != undefined)
445
- {
446
- this.validate()
447
- }
448
- },
449
- deep: false
450
- }
451
-
452
- },
453
- beforeRouteEnter(to, from, next) {
454
-
455
- console.log('beforeRouteEnter')
456
- next();
457
- },
458
- beforeRouteUpdate(to, from, next) {
459
-
460
- console.log('beforeRouteUpdate')
461
-
462
- next();
463
- },
464
- beforeRouteLeave(to, from, next) {
465
-
466
- console.log(this.route.history)
467
- console.log('beforeRouteLeave')
468
- console.log(from)
469
- console.log(to)
470
-
471
- next();
472
- },
473
- beforeDestroy() {
474
-
475
- if(!this.isExtend){
476
- this.$delete(session.regedit,this.fullName)
477
- selector.index_delete(this.sname,this.fullName)
478
- }
479
-
480
- if(this.needLoadData){
481
- this.$bus.off('porcessData' )
482
- console.log('delete load data event' + this.fullName)
483
- }
484
-
485
- if(this.needProcessEvent){
486
- this.$bus.off('processEvent')
487
- console.log('delete regedit event ' + this.fullName)
488
- }
489
-
490
- console.log('delete regedit component ' + this.fullName)
491
- },
492
- destroyed() {
493
-
494
-
495
- }
496
- }
1
+
2
+ import { fromEvent } from 'rxjs';
3
+ import config from '../assets/config.js'
4
+ import ak from '../assets/ak.js'
5
+ import session from '../session'
6
+ import route from '../route'
7
+ import selector from "../selector";
8
+ import {ua} from "../assets/ua";
9
+
10
+ export default {
11
+ props: {
12
+ value: {
13
+ type: Object,
14
+ default: () => {
15
+ return {default:true}
16
+ }
17
+ },
18
+ mod: {
19
+ type: Object,
20
+ default: () => {
21
+ return {default:true}
22
+ }
23
+ },
24
+ cname:{
25
+ type: String
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ baseCtl:false,
31
+ fullName:undefined,
32
+ sname:undefined,
33
+ model:{
34
+ hiddenValidate:false,
35
+ validateResult:{
36
+ messages:[],
37
+ message:'',
38
+ isSuccess:true,
39
+ pending:false
40
+ }
41
+ },
42
+ modelData:{},
43
+ needLoadData:false,
44
+ needProcessEvent:false,
45
+ isExtend:false
46
+ }
47
+ },
48
+ mounted() {
49
+
50
+ if(this.sname == 'page'){
51
+
52
+ let self = this
53
+ this.$service.callService('init').then(()=>{
54
+ self.$service.callService('getH5FaceResult',{},false)
55
+ })
56
+
57
+ }
58
+
59
+ if(route.currentUrl != window.location.href){
60
+ route.currentUrl = window.location.href
61
+ let routeDefined = route.defined[ak.http.getRouteUrl(route.currentUrl)]
62
+ if(routeDefined && routeDefined.needLogin){
63
+ this.$service.callService('getToken').then((data)=>{
64
+ if(!session.sys.isLogined){
65
+ this.$service.callService('logout')
66
+ }
67
+ })
68
+ }
69
+
70
+ if(routeDefined){
71
+
72
+ if('title' in routeDefined)
73
+ this.session.sys.title = routeDefined.title
74
+
75
+ if('title' in routeDefined)
76
+ this.session.sys.toolbar.title = routeDefined.title
77
+
78
+ if('toolbarIsShow' in routeDefined)
79
+ this.session.sys.toolbar.isShow = routeDefined.toolbarIsShow
80
+ }
81
+
82
+ }
83
+
84
+ this.processModel()
85
+
86
+ this.needLoadData = Object.prototype.toString.call(this.$options.methods.loadData) == "[object Function]"
87
+
88
+ if(this.needLoadData){
89
+ this.$bus.on('porcessData', (data) => {
90
+
91
+ let cb = this.$options.methods.loadData.bind(this)
92
+ cb(data)
93
+
94
+ })
95
+ }
96
+
97
+ if(this.needProcessEvent){
98
+ this.$bus.on('processEvent', (data) => {
99
+
100
+ let cb = this.$options.methods.processEvent.bind(this)
101
+ cb(data)
102
+ })
103
+ }
104
+
105
+ },
106
+ methods: {
107
+ createDefaultModel2(){
108
+
109
+ let model2 = {
110
+ label: '',
111
+ tag:'',
112
+ data: {},
113
+ visible:true,
114
+ readonly: false,
115
+ disabled: false,
116
+ required: false,
117
+ clearable: true,
118
+ validateType: '',
119
+ validateGroup: '',
120
+ validateReg: '',
121
+ inputAlign: 'left',
122
+ validateToken: 0,
123
+ validateResult: {
124
+ messages: [],
125
+ message: '',
126
+ isSuccess: true,
127
+ pending: false
128
+ }
129
+ }
130
+
131
+ if(this.$options.methods.createDefaultModel){
132
+ return Object.assign(this.$options.methods.createDefaultModel(),model2)
133
+ }else{
134
+ return model2
135
+ }
136
+
137
+ },
138
+ getGobalfullName(){
139
+
140
+ let sysflag = 'normal'
141
+ if(ua.isIspPhone){
142
+ sysflag = 'ispPhone'
143
+ }else if(ua.microMsg){
144
+ sysflag = 'microMsg'
145
+ }
146
+
147
+ return config.sys.id + '.' + sysflag + '.' + this.fullName
148
+ },
149
+ saveLocalValue(val){
150
+ if('local_storage' in config.other && config.other.local_storage === 'true'){
151
+ let json = JSON.stringify(val)
152
+ localStorage.setItem(this.getGobalfullName(),json)
153
+ }
154
+ },
155
+ loadData(data){
156
+
157
+ },
158
+ processEvent(event){
159
+
160
+ },
161
+ processModel(){
162
+
163
+ this.fullName = this.getCtlName(this)
164
+
165
+ let hasValue = false
166
+ if(this.$props.mod.default === true){
167
+ this.modelData = this.createDefaultModel2()
168
+ }else{
169
+
170
+ hasValue = 'value' in this.$props.mod
171
+ let defaultModel = this.createDefaultModel2()
172
+ this.modelData = Object.assign({},defaultModel,this.$props.mod)
173
+ }
174
+
175
+ if('local_storage' in config.other && config.other.local_storage === 'true'){
176
+ if(!hasValue) {
177
+ let sv = localStorage.getItem(this.getGobalfullName())
178
+ if(!ak.utils.isEmpty(sv)){
179
+ this.modelData.value = JSON.parse(sv)
180
+ }
181
+ }
182
+ }
183
+
184
+
185
+ this.modelData = this.locale(this.modelData)
186
+ this.model = ak.utils.cloneBySerialize(this.modelData)
187
+
188
+ if(!this.isExtend) {
189
+ this.$set(session.regedit, this.fullName, {model: this.model, ctl: this, name: this.fullName})
190
+ selector.index_add(this.sname,this.fullName)
191
+ console.log('regedit component ' + this.fullName)
192
+ }
193
+
194
+ },
195
+ getCtlName(ctl){
196
+
197
+ if(!ctl.$props)
198
+ return ''
199
+
200
+ let ctlName = ctl.$ak.utils.isEmpty(ctl.$props.cname) ? ctl.$data.vname : ctl.$props.cname
201
+
202
+ if(ctl.$data.isExtend){
203
+ return ''
204
+ }
205
+
206
+ if(ak.utils.isEmpty(ctlName)){
207
+ ctlName = ak.utils.guid2()
208
+ }
209
+ ctlName = ctlName.replace(/RNUM/, ak.utils.guid2())
210
+
211
+ this.sname = ctlName
212
+
213
+ if(ak.utils.isEmpty(ctlName)){
214
+ return ''
215
+ }
216
+
217
+ let parentName_s = undefined
218
+ let parent = ctl.$parent
219
+ while(parent){
220
+
221
+
222
+ if(!this.$ak.utils.isEmpty(parent.$data.fullName)){
223
+ parentName_s = parent.$data.fullName
224
+ break
225
+ }
226
+
227
+ if(!(parent.$options.methods && Object.prototype.toString.call(parent.$options.methods.getCtlName) == "[object Function]")){
228
+ parent = parent.$parent
229
+ continue
230
+ }else if(parent.$data.isExtend){
231
+ parent = parent.$parent
232
+ continue
233
+ }else{
234
+ break
235
+ }
236
+
237
+ }
238
+
239
+
240
+ if(parent){
241
+
242
+ let parentName = undefined
243
+ if(parentName_s){
244
+ parentName = parentName_s
245
+ }else {
246
+ parentName = parent.$options.methods.getCtlName.bind(parent)(parent)
247
+ }
248
+
249
+
250
+ let parent2 = ctl.$parent
251
+ while(parent2){
252
+
253
+ if(!this.$ak.utils.isEmpty(parent2.$data.fullName)){
254
+ break
255
+ }
256
+
257
+ if(!(parent2.$options.methods && Object.prototype.toString.call(parent2.$options.methods.getCtlName) == "[object Function]")){
258
+
259
+ parent2.$data.fullName = parentName
260
+ parent2 = parent2.$parent
261
+ continue
262
+ }else if(parent2.$data.isExtend){
263
+
264
+ parent2.$data.fullName = parentName
265
+ parent2 = parent2.$parent
266
+ continue
267
+ }else{
268
+ break
269
+ }
270
+ }
271
+
272
+
273
+ if(ctl.$ak.utils.isEmpty(parentName)){
274
+ return ctlName
275
+ }else{
276
+ return parentName + '.' + ctlName
277
+ }
278
+
279
+ }else{
280
+ return ctlName
281
+ }
282
+
283
+ },
284
+ service(serviceObj){
285
+
286
+ let obj = serviceObj.before()
287
+
288
+ return serviceObj.process(obj).then((res)=>{
289
+
290
+ Promise.resolve(serviceObj.after(res))
291
+
292
+ })
293
+
294
+ },
295
+ getValidateResult(onlyError,group){
296
+
297
+ let isSuccess = true
298
+ let messages = []
299
+
300
+ for(var key in session.regedit){
301
+
302
+ let ctl = session.regedit[key]
303
+
304
+ if(!ctl.ctl.validateCtl)
305
+ continue
306
+
307
+
308
+ isSuccess = ctl.model.validateResult.isSuccess && isSuccess
309
+ if(!ctl.model.validateResult.isSuccess){
310
+
311
+ messages.push(...ctl.model.validateResult.messages)
312
+
313
+ }
314
+
315
+ }
316
+
317
+ return {"isSuccess":isSuccess,"messages":messages}
318
+
319
+ },
320
+ validateAll(onlyError = true,group = ''){
321
+
322
+ let isSuccess = true
323
+ let promises = []
324
+
325
+ for(var key in session.regedit){
326
+
327
+ let ctl = session.regedit[key]
328
+
329
+ if(!ctl.ctl.validateCtl)
330
+ continue
331
+
332
+ if(ctl.model.validateGroup != group)
333
+ continue
334
+
335
+ let func = ctl.ctl.$options.methods.validate.bind(ctl.ctl)
336
+
337
+ let promiseV = func(true)
338
+ if(promiseV){
339
+ promises.push(promiseV)
340
+ }
341
+
342
+ }
343
+
344
+ let self = this
345
+ return Promise.all(promises)
346
+ .then((result) => {
347
+
348
+ let validateResult = self.getValidateResult(onlyError,group)
349
+ return Promise.resolve(validateResult)
350
+
351
+ })
352
+
353
+ },
354
+ selector(express){
355
+ return this.$ak.utils.selector(express)
356
+ },
357
+ locale(obj){
358
+
359
+ if(Object.prototype.toString.call(obj) == '[object Object]'){
360
+
361
+ for(let key in obj){
362
+ obj[key] = this.locale(obj[key])
363
+ }
364
+ return obj
365
+
366
+ }else if(Object.prototype.toString.call(obj) == '[object Array]'){
367
+
368
+ for(let key in obj){
369
+ obj[key] = this.locale(obj[key])
370
+ }
371
+ return obj
372
+
373
+ }else if(Object.prototype.toString.call(obj) == '[object String]'){
374
+
375
+ if(this.$ak.utils.isEmpty(obj))
376
+ return ''
377
+
378
+ if(obj.startWith("lang.")){
379
+ return this.$t(obj)
380
+ }else{
381
+ return obj
382
+ }
383
+
384
+ }else{
385
+ return obj
386
+ }
387
+
388
+ },
389
+ reset(){
390
+ this.reset2(this.model,this.modelData)
391
+ },
392
+ reset2(dest,source){
393
+
394
+ for(var p in source){
395
+
396
+ if(Object.prototype.toString.call(source[p]) == "[object Object]"){
397
+
398
+ if(dest.hasOwnProperty(p)){
399
+ this.reset2(dest[p],source[p])
400
+ }
401
+ }else if(Object.prototype.toString.call(source[p]) == "[object Array]"){
402
+
403
+ if(dest.hasOwnProperty(p) && String(p) !== 'items'){
404
+ dest[p] = source[p];
405
+ }
406
+ }else{
407
+ if(dest.hasOwnProperty(p)){
408
+ dest[p] = source[p];
409
+ }
410
+ }
411
+ }
412
+
413
+ },
414
+ validate(useAll){
415
+
416
+ }
417
+ },
418
+ computed: {
419
+ config(){
420
+ return config;
421
+ },
422
+ session(){
423
+ return session;
424
+ },
425
+ route(){
426
+ return route
427
+ }
428
+ },
429
+ watch:{
430
+
431
+ 'session.regeditc':{
432
+ handler(val){
433
+
434
+ let event = JSON.parse(val)
435
+
436
+ if(this.vname && this.vname == 'page'){
437
+ this.$bus.$emit('processEvent',event)
438
+ }
439
+
440
+ }
441
+ },
442
+ 'model.validateToken':{
443
+ handler(val,oldval){
444
+ if(oldval != undefined)
445
+ {
446
+ this.validate()
447
+ }
448
+ },
449
+ deep: false
450
+ }
451
+
452
+ },
453
+ beforeRouteEnter(to, from, next) {
454
+
455
+ console.log('beforeRouteEnter')
456
+ next();
457
+ },
458
+ beforeRouteUpdate(to, from, next) {
459
+
460
+ console.log('beforeRouteUpdate')
461
+
462
+ next();
463
+ },
464
+ beforeRouteLeave(to, from, next) {
465
+
466
+ console.log(this.route.history)
467
+ console.log('beforeRouteLeave')
468
+ console.log(from)
469
+ console.log(to)
470
+
471
+ next();
472
+ },
473
+ beforeDestroy() {
474
+
475
+ if(!this.isExtend){
476
+ this.$delete(session.regedit,this.fullName)
477
+ selector.index_delete(this.sname,this.fullName)
478
+ }
479
+
480
+ if(this.needLoadData){
481
+ this.$bus.off('porcessData' )
482
+ console.log('delete load data event' + this.fullName)
483
+ }
484
+
485
+ if(this.needProcessEvent){
486
+ this.$bus.off('processEvent')
487
+ console.log('delete regedit event ' + this.fullName)
488
+ }
489
+
490
+ console.log('delete regedit component ' + this.fullName)
491
+ },
492
+ destroyed() {
493
+
494
+
495
+ }
496
+ }