w-web-perm 1.0.0

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 (101) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.github/workflows/ci-test.yml +24 -0
  5. package/.jsdoc +25 -0
  6. package/.vscode/launch.json +21 -0
  7. package/LICENSE +21 -0
  8. package/README.md +24 -0
  9. package/SECURITY.md +5 -0
  10. package/babel.config.js +15 -0
  11. package/dist/css/app.79b4b59b.css +1 -0
  12. package/dist/css/chunk-vendors.65775501.css +5 -0
  13. package/dist/index.tmp +1 -0
  14. package/dist/js/app-legacy.954e168c.js +2 -0
  15. package/dist/js/app-legacy.954e168c.js.map +1 -0
  16. package/dist/js/app.954e168c.js +2 -0
  17. package/dist/js/app.954e168c.js.map +1 -0
  18. package/dist/js/chunk-vendors-legacy.f5f1a231.js +13 -0
  19. package/dist/js/chunk-vendors-legacy.f5f1a231.js.map +1 -0
  20. package/dist/js/chunk-vendors.f5f1a231.js +13 -0
  21. package/dist/js/chunk-vendors.f5f1a231.js.map +1 -0
  22. package/dist/w-web-perm.umd.js +7 -0
  23. package/dist/w-web-perm.umd.js.map +1 -0
  24. package/docs/WWebPerm.html +826 -0
  25. package/docs/WWebPerm.mjs.html +558 -0
  26. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  27. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  28. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  29. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  30. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  31. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  32. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  33. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  34. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  35. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  36. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  37. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  38. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  39. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  40. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  41. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  42. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  43. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  44. package/docs/index.html +84 -0
  45. package/docs/scripts/collapse.js +39 -0
  46. package/docs/scripts/commonNav.js +28 -0
  47. package/docs/scripts/linenumber.js +25 -0
  48. package/docs/scripts/nav.js +12 -0
  49. package/docs/scripts/polyfill.js +4 -0
  50. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  51. package/docs/scripts/prettify/lang-css.js +2 -0
  52. package/docs/scripts/prettify/prettify.js +28 -0
  53. package/docs/scripts/search.js +99 -0
  54. package/docs/styles/jsdoc.css +776 -0
  55. package/docs/styles/prettify.css +80 -0
  56. package/g.getSettings.mjs +17 -0
  57. package/g.mDb.mjs +10 -0
  58. package/g.mInitialTestData.mjs +20 -0
  59. package/g.mOrm.mjs +24 -0
  60. package/package.json +75 -0
  61. package/public/index.html +23 -0
  62. package/server/WWebPerm.mjs +486 -0
  63. package/src/App.vue +153 -0
  64. package/src/components/Common/CheckYes.vue +85 -0
  65. package/src/components/Common/CheckYesNo.vue +91 -0
  66. package/src/components/Common/LabelItem.vue +106 -0
  67. package/src/components/Common/LoadingWinBar.vue +87 -0
  68. package/src/components/Layout.vue +152 -0
  69. package/src/components/LayoutContent.vue +246 -0
  70. package/src/components/LayoutContentGroups.vue +664 -0
  71. package/src/components/LayoutContentTargets.vue +538 -0
  72. package/src/components/LayoutContentUsers.vue +493 -0
  73. package/src/components/LayoutState.vue +91 -0
  74. package/src/components/VeUser.vue +453 -0
  75. package/src/components/ruleGroup.vue +667 -0
  76. package/src/main.js +103 -0
  77. package/src/perm.mjs +61 -0
  78. package/src/plugins/mDataSelectorSchema.mjs +30 -0
  79. package/src/plugins/mDataSupport.mjs +66 -0
  80. package/src/plugins/mShare.mjs +366 -0
  81. package/src/plugins/mUI.mjs +229 -0
  82. package/src/plugins/mVuetify.mjs +12 -0
  83. package/src/schema/gi.mjs +8 -0
  84. package/src/schema/index.mjs +20 -0
  85. package/src/schema/tables/ruleGroups.mjs +100 -0
  86. package/src/schema/tables/targets.mjs +100 -0
  87. package/src/schema/tables/users.mjs +125 -0
  88. package/src/store/actions.mjs +1 -0
  89. package/src/store/getters.mjs +1 -0
  90. package/src/store/index.mjs +25 -0
  91. package/src/store/mutations.mjs +201 -0
  92. package/src/store/types.mjs +15 -0
  93. package/srv.mjs +52 -0
  94. package/tableTags-web-perm.json +1 -0
  95. package/test/all.test.mjs +10 -0
  96. package/toolg/addVersion.mjs +4 -0
  97. package/toolg/cleanFolder.mjs +4 -0
  98. package/toolg/gDistRollup.mjs +36 -0
  99. package/toolg/genEntry.mjs +23 -0
  100. package/toolg/modifyReadme.mjs +4 -0
  101. package/vue.config.js +15 -0
@@ -0,0 +1,667 @@
1
+ <template>
2
+ <div
3
+ :changeGroup="changeGroup"
4
+ v-if="treeBlocks!==null"
5
+ >
6
+
7
+ <div
8
+ style=""
9
+ v-domresize
10
+ @domresize="resizeHead"
11
+ v-if="showHead"
12
+ >
13
+
14
+ <div
15
+ style="padding:15px; border-bottom:1px solid #ddd;"
16
+ v-if="editable"
17
+ >
18
+
19
+ <div style="padding:5px 0px; display:flex; align-items:center;">
20
+ <div style="padding-right:5px; font-size:0.9rem; color:#888;">
21
+ 名稱:
22
+ </div>
23
+ <div style="">
24
+ <WText
25
+ style="width:300px;"
26
+ :value="getName(group)"
27
+ @input="(v)=>{updateProp('name',v)}"
28
+ ></WText>
29
+ </div>
30
+ </div>
31
+
32
+ <div style="padding:5px 0px; display:flex; align-items:center;">
33
+ <div style="padding-right:5px; font-size:0.9rem; color:#888;">
34
+ 說明:
35
+ </div>
36
+ <div style="">
37
+ <WText
38
+ style="width:300px;"
39
+ :value="getDescription(group)"
40
+ @input="(v)=>{updateProp('description',v)}"
41
+ ></WText>
42
+ </div>
43
+ </div>
44
+
45
+ </div>
46
+
47
+ <div
48
+ style="padding:15px; border-bottom:1px solid #ddd;"
49
+ v-else
50
+ >
51
+
52
+ <div style="font-size:1.2rem; white-space:nowrap;">
53
+ {{group.name}}
54
+ </div>
55
+
56
+ <div style="color:#888; font-size:0.8rem; white-space:nowrap;">
57
+ {{getDescription(group)}}
58
+ </div>
59
+
60
+ </div>
61
+
62
+ <div
63
+ style="display:flex; align-items:center; padding:20px 15px 15px 15px; background:#eee; border-bottom:1px solid #ddd;"
64
+ v-if="false"
65
+ >
66
+
67
+ <div style="margin-right:10px;">全部項目預設值:</div>
68
+
69
+ <div style="margin-right:10px; display:flex; align-items:center;">
70
+ <div style="margin-right:5px;">顯示</div>
71
+ <div>
72
+ <WSwitch
73
+ :value="defaultShow"
74
+ @input="(b)=>{setDefaultShow(b)}"
75
+ ></WSwitch>
76
+ </div>
77
+ </div>
78
+
79
+ <div style="margin-right:10px; display:flex; align-items:center;">
80
+ <div style="margin-right:5px;">啟用</div>
81
+ <div>
82
+ <WSwitch
83
+ :value="defaultActive"
84
+ @input="(b)=>{setDefaultActive(b)}"
85
+ ></WSwitch>
86
+ </div>
87
+ </div>
88
+
89
+ </div>
90
+
91
+ </div>
92
+
93
+ <WTree
94
+ :viewHeightMax="treeHeight"
95
+ :icon-toggle-color="'#666'"
96
+ :icon-toggle-background-color="'transparent'"
97
+ :icon-toggle-background-color-hover="'transparent'"
98
+ :data="treeBlocks"
99
+ >
100
+ <template v-slot:item="props">
101
+ <div style="display:flex; align-items:center; min-height:34px;">
102
+
103
+ <div style="">
104
+ {{props.data.text}}
105
+ </div>
106
+
107
+ </div>
108
+ <div style="position:absolute; top:5px; right:15px;">
109
+
110
+ <div style="margin-left:10px; display:inline-block;" v-if="editable">
111
+
112
+ <WButtonCircle
113
+ :icon="mdiEyeCheck"
114
+ :iconSize="18"
115
+ :paddingStyle="{v:4,h:4}"
116
+ :shadow="false"
117
+ :tooltip="'所屬顯示'"
118
+ :backgroundColor="'rgba(200,200,200,0.2)'"
119
+ :backgroundColorHover="'rgba(255,150,100,0.2)'"
120
+ :backgroundColorFocus="'rgba(255,150,100,0.2)'"
121
+ :iconColor="'#444'"
122
+ :iconColorHover="'#EF6C00'"
123
+ :iconColorFocus="'#EF6C00'"
124
+ @click="treeToogleShowAndActive(props.data,true,'show')"
125
+ ></WButtonCircle>
126
+
127
+ <WButtonCircle
128
+ :icon="mdiEyeOff"
129
+ :iconSize="18"
130
+ :paddingStyle="{v:4,h:4}"
131
+ :shadow="false"
132
+ :tooltip="'所屬不顯示'"
133
+ :backgroundColor="'rgba(200,200,200,0.2)'"
134
+ :backgroundColorHover="'rgba(255,150,100,0.2)'"
135
+ :backgroundColorFocus="'rgba(255,150,100,0.2)'"
136
+ :iconColor="'#444'"
137
+ :iconColorHover="'#EF6C00'"
138
+ :iconColorFocus="'#EF6C00'"
139
+ @click="treeToogleShowAndActive(props.data,false,'show')"
140
+ ></WButtonCircle>
141
+
142
+ <WButtonCircle
143
+ :icon="mdiEyedropper"
144
+ :iconSize="18"
145
+ :paddingStyle="{v:4,h:4}"
146
+ :shadow="false"
147
+ :tooltip="'所屬啟用'"
148
+ :backgroundColor="'rgba(200,200,200,0.2)'"
149
+ :backgroundColorHover="'rgba(255,150,100,0.2)'"
150
+ :backgroundColorFocus="'rgba(255,150,100,0.2)'"
151
+ :iconColor="'#444'"
152
+ :iconColorHover="'#EF6C00'"
153
+ :iconColorFocus="'#EF6C00'"
154
+ @click="treeToogleShowAndActive(props.data,true,'active')"
155
+ ></WButtonCircle>
156
+
157
+ <WButtonCircle
158
+ :icon="mdiEyedropperOff"
159
+ :iconSize="18"
160
+ :paddingStyle="{v:4,h:4}"
161
+ :shadow="false"
162
+ :tooltip="'所屬不啟用'"
163
+ :backgroundColor="'rgba(200,200,200,0.2)'"
164
+ :backgroundColorHover="'rgba(255,150,100,0.2)'"
165
+ :backgroundColorFocus="'rgba(255,150,100,0.2)'"
166
+ :iconColor="'#444'"
167
+ :iconColorHover="'#EF6C00'"
168
+ :iconColorFocus="'#EF6C00'"
169
+ @click="treeToogleShowAndActive(props.data,false,'active')"
170
+ ></WButtonCircle>
171
+
172
+ </div>
173
+
174
+ <div style="margin-left:10px; display:inline-block;">
175
+ <div style="display:flex; align-items:center;">
176
+ <div style="margin-right:3px; font-size:0.8rem;">顯示</div>
177
+ <WCheckbox
178
+ :checkedIconColor="'yellow darken-4'"
179
+ :uncheckedIconColor="'yellow darken-4'"
180
+ :value="getShow(props.data)"
181
+ :editable="editable"
182
+ @input="toogleShow(props.data)"
183
+ ></WCheckbox>
184
+ </div>
185
+ </div>
186
+
187
+ <div style="margin-left:10px; display:inline-block;">
188
+ <div style="display:flex; align-items:center;">
189
+ <div style="margin-right:3px; font-size:0.8rem;">啟用</div>
190
+ <WCheckbox
191
+ :checkedIconColor="'yellow darken-4'"
192
+ :uncheckedIconColor="'yellow darken-4'"
193
+ :value="getActive(props.data)"
194
+ :editable="editable"
195
+ @input="toogleActive(props.data)"
196
+ ></WCheckbox>
197
+ </div>
198
+ </div>
199
+
200
+ </div>
201
+ </template>
202
+ >
203
+ </WTree>
204
+
205
+ </div>
206
+ </template>
207
+
208
+ <script>
209
+ import { mdiEyeCheck, mdiEyeOff, mdiEyedropper, mdiEyedropperOff } from '@mdi/js/mdi.js'
210
+ import get from 'lodash/get'
211
+ import set from 'lodash/set'
212
+ import each from 'lodash/each'
213
+ import size from 'lodash/size'
214
+ import cloneDeep from 'lodash/cloneDeep'
215
+ import iseobj from 'wsemi/src/iseobj.mjs'
216
+ import isobj from 'wsemi/src/isobj.mjs'
217
+ import isestr from 'wsemi/src/isestr.mjs'
218
+ import haskey from 'wsemi/src/haskey.mjs'
219
+ import debounce from 'wsemi/src/debounce.mjs'
220
+ import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
221
+ import WTree from 'w-component-vue/src/components/WTree.vue'
222
+ import WCheckbox from 'w-component-vue/src/components/WCheckbox.vue'
223
+ import WText from 'w-component-vue/src/components/WText.vue'
224
+ import { getTreeBlocks } from '../plugins/mShare.mjs'
225
+
226
+
227
+ export default {
228
+ components: {
229
+ WButtonCircle,
230
+ WTree,
231
+ WCheckbox,
232
+ WText,
233
+ },
234
+ props: {
235
+ height: {
236
+ type: Number,
237
+ default: 100,
238
+ },
239
+ group: {
240
+ type: Object,
241
+ default: () => {},
242
+ },
243
+ showHead: {
244
+ type: Boolean,
245
+ default: true,
246
+ },
247
+ editable: {
248
+ type: Boolean,
249
+ default: false,
250
+ },
251
+ },
252
+ data: function() {
253
+ return {
254
+ dbc: debounce(),
255
+
256
+ mdiEyeCheck,
257
+ mdiEyeOff,
258
+ mdiEyedropper,
259
+ mdiEyedropperOff,
260
+
261
+ headHeight: 100,
262
+
263
+ groupTrans: null,
264
+
265
+ }
266
+ },
267
+ computed: {
268
+
269
+ changeGroup: function() {
270
+ // console.log('computed changeGroup')
271
+
272
+ let vo = this
273
+
274
+ //save
275
+ let group = cloneDeep(vo.group)
276
+
277
+ //save rules
278
+ let rules = JSON.parse(group.crules)
279
+ group.rules = rules
280
+ // console.log('rules', rules)
281
+
282
+ //delete
283
+ delete group.crules
284
+
285
+ //save
286
+ vo.groupTrans = group
287
+ // console.log('group', group)
288
+
289
+ return ''
290
+ },
291
+
292
+ treeHeight: function() {
293
+ let vo = this
294
+
295
+ //h
296
+ let h = vo.height - vo.headHeight
297
+ h = Math.max(h, 0)
298
+
299
+ return h
300
+ },
301
+
302
+ targets: function() {
303
+ return get(this, `$store.state.targets`)
304
+ },
305
+
306
+ // blocks: function() {
307
+ // // console.log('computed blocks')
308
+
309
+ // let vo = this
310
+
311
+ // //rs
312
+ // let rs = map(vo.targets, (v) => {
313
+
314
+ // //text, parentId
315
+ // let s = sep(v.id, '.')
316
+ // let text = get(takeRight(s), 0) //取最後節點
317
+ // s = dropRight(s, 1)
318
+ // let parentId = join(s, '.') //取父節點
319
+
320
+ // return {
321
+ // ...v,
322
+ // parentId,
323
+ // text,
324
+ // }
325
+ // })
326
+
327
+ // return rs
328
+ // },
329
+
330
+ treeBlocks: function() {
331
+ // console.log('computed treeBlocks')
332
+
333
+ let vo = this
334
+
335
+ //check
336
+ if (size(vo.targets) === 0) {
337
+ return null
338
+ }
339
+
340
+ //getTreeBlocks
341
+ let r = getTreeBlocks(vo.targets)
342
+
343
+ return r
344
+ },
345
+
346
+ defaultShow: function() {
347
+ let r = get(this.groupTrans, 'rules.___all___.show', 'n')
348
+ return r === 'y'
349
+ },
350
+
351
+ defaultActive: function() {
352
+ let r = get(this.groupTrans, 'rules.___all___.active', 'n')
353
+ return r === 'y'
354
+ },
355
+
356
+ },
357
+ methods: {
358
+
359
+ resizeHead: function(msg) {
360
+ // console.log('methods resizeHead', msg)
361
+
362
+ let vo = this
363
+
364
+ //headHeight
365
+ vo.headHeight = msg.snew.offsetHeight
366
+
367
+ },
368
+
369
+ getName: function(g) {
370
+ // console.log('methods getName', g)
371
+
372
+ //r
373
+ let r = get(g, 'name', '')
374
+
375
+ //check
376
+ if (!isestr(r)) {
377
+ r = '無名稱'
378
+ }
379
+
380
+ return r
381
+ },
382
+
383
+ getDescription: function(g) {
384
+ // console.log('methods getDescription', g)
385
+
386
+ //r
387
+ let r = get(g, 'description', '')
388
+
389
+ //check
390
+ if (!isestr(r)) {
391
+ r = '無說明'
392
+ }
393
+
394
+ return r
395
+ },
396
+
397
+ setDefaultShow: function(b) {
398
+ let r = b ? 'y' : 'n'
399
+ return set(this.groupTrans, 'rules.___all___.show', r)
400
+ },
401
+
402
+ setDefaultActive: function(b) {
403
+ let r = b ? 'y' : 'n'
404
+ return set(this.groupTrans, 'rules.___all___.active', r)
405
+ },
406
+
407
+ getShowAndActive: function(item, key, def) {
408
+ // console.log('getShowAndActive', item, key, def)
409
+
410
+ let vo = this
411
+
412
+ //rules
413
+ let rules = get(vo.groupTrans, 'rules', null)
414
+
415
+ //rule
416
+ let rule = null
417
+ if (haskey(rules, item.id)) {
418
+ rule = rules[item.id]
419
+ }
420
+
421
+ //r
422
+ let r = get(rule, key, null)
423
+ // console.log(item.id, r, def)
424
+
425
+ //b
426
+ let b = def
427
+ if (r === 'y' || r === 'n') { //若權限內有定義則優先使用(覆蓋)
428
+ b = r === 'y'
429
+ }
430
+
431
+ return b
432
+ },
433
+
434
+ getShow: function(item) {
435
+ // console.log('getShow', item)
436
+
437
+ let vo = this
438
+
439
+ //def
440
+ let def = vo.defaultShow
441
+
442
+ //getShowAndActive
443
+ let b = vo.getShowAndActive(item, 'show', def)
444
+
445
+ return b
446
+ },
447
+
448
+ getActive: function(item) {
449
+ // console.log('getActive', item)
450
+
451
+ let vo = this
452
+
453
+ //def
454
+ let def = vo.defaultActive
455
+
456
+ //getShowAndActive
457
+ let b = vo.getShowAndActive(item, 'active', def)
458
+
459
+ return b
460
+ },
461
+
462
+ getDefaultShowAndActive: function(key) {
463
+ if (key === 'show') {
464
+ return this.defaultShow
465
+ }
466
+ return this.defaultActive
467
+ },
468
+
469
+ toogleShowAndActive: function(id, b, key) {
470
+ // console.log('toogleShowAndActive', id, b, key)
471
+
472
+ let vo = this
473
+
474
+ //def
475
+ let def = vo.getDefaultShowAndActive(key)
476
+
477
+ //groupTrans
478
+ let groupTrans = cloneDeep(vo.groupTrans)
479
+
480
+ //cb
481
+ let cb = b ? 'y' : 'n'
482
+
483
+ //rules
484
+ let rules = get(vo.groupTrans, 'rules', null)
485
+
486
+ //rule
487
+ let rule = null
488
+ if (haskey(rules, id)) {
489
+ rule = rules[id]
490
+ }
491
+
492
+ //r
493
+ let r = get(rule, key, null)
494
+
495
+ //toogle
496
+ if (r === 'y' || r === 'n') { //若權限內有定義則優先使用(覆蓋)
497
+ // console.log('權限內有定義')
498
+
499
+ //check
500
+ if (b === def) { //欲切換值與預設值相同
501
+
502
+ //delete
503
+ delete rule[key]
504
+
505
+ }
506
+ else {
507
+
508
+ //save rule
509
+ rule[key] = cb
510
+
511
+ }
512
+
513
+ }
514
+ else {
515
+ // console.log('權限內無定義')
516
+
517
+ //check
518
+ if (b === def) { //欲切換值與預設值相同, 不變更
519
+ // console.log('不變更')
520
+ }
521
+ else {
522
+
523
+ //save rule
524
+ if (isobj(rule)) {
525
+ rule[key] = cb
526
+ }
527
+ else {
528
+ rule = {
529
+ [key]: cb,
530
+ }
531
+ }
532
+
533
+ }
534
+
535
+ }
536
+
537
+ //check
538
+ if (iseobj(rule)) {
539
+
540
+ //save rule
541
+ groupTrans.rules[id] = rule
542
+
543
+ }
544
+ else {
545
+
546
+ //delete rule
547
+ delete groupTrans.rules[id]
548
+
549
+ }
550
+
551
+ //save groupTrans
552
+ vo.groupTrans = groupTrans
553
+ // console.log('groupTrans', cloneDeep(vo.groupTrans))
554
+
555
+ //emitGroupDebounce
556
+ vo.emitGroupDebounce()
557
+
558
+ },
559
+
560
+ toogleShow: function(item) {
561
+ // console.log('toogleShow', item)
562
+
563
+ let vo = this
564
+
565
+ //check
566
+ if (!vo.editable) {
567
+ return
568
+ }
569
+
570
+ //b
571
+ let b = !vo.getShow(item)
572
+
573
+ //toogleShowAndActive
574
+ vo.toogleShowAndActive(item.id, b, 'show')
575
+
576
+ },
577
+
578
+ toogleActive: function(item) {
579
+ // console.log('toogleActive', item)
580
+
581
+ let vo = this
582
+
583
+ //check
584
+ if (!vo.editable) {
585
+ return
586
+ }
587
+
588
+ //b
589
+ let b = !vo.getActive(item)
590
+
591
+ //toogleShowAndActive
592
+ vo.toogleShowAndActive(item.id, b, 'active')
593
+
594
+ },
595
+
596
+ treeToogleShowAndActive: function(item, b, key) {
597
+ // console.log('treeToogleShowAndActive', item, b, key)
598
+
599
+ let vo = this
600
+
601
+ //self
602
+ vo.toogleShowAndActive(item.id, b, key)
603
+
604
+ //children
605
+ each(item.children, (v) => {
606
+ vo.treeToogleShowAndActive(v, b, key)
607
+ })
608
+
609
+ },
610
+
611
+ updateProp: function(key, value) {
612
+ // console.log('methods updateProp', key, value)
613
+
614
+ let vo = this
615
+
616
+ //groupTrans
617
+ let groupTrans = cloneDeep(vo.groupTrans)
618
+
619
+ //save value
620
+ groupTrans[key] = value
621
+
622
+ //save groupTrans
623
+ vo.groupTrans = groupTrans
624
+ // console.log('groupTrans', cloneDeep(vo.groupTrans))
625
+
626
+ //emitGroupDebounce
627
+ vo.emitGroupDebounce()
628
+
629
+ },
630
+
631
+ emitGroupDebounce: function() {
632
+ //console.log('methods emitGroupDebounce')
633
+
634
+ let vo = this
635
+
636
+ //dbc
637
+ vo.dbc(() => {
638
+
639
+ //emitGroup
640
+ vo.emitGroup()
641
+
642
+ })
643
+
644
+ },
645
+
646
+ emitGroup: function() {
647
+ //console.log('methods emitGroup')
648
+
649
+ let vo = this
650
+
651
+ //groupTrans
652
+ let groupTrans = cloneDeep(vo.groupTrans)
653
+
654
+ //save crules
655
+ groupTrans.crules = JSON.stringify(vo.groupTrans.rules)
656
+
657
+ //emit
658
+ vo.$emit('update', groupTrans)
659
+
660
+ },
661
+
662
+ }
663
+ }
664
+ </script>
665
+
666
+ <style scoped>
667
+ </style>