w-web-perm 1.0.24 → 1.0.26
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/dist/css/{app.f22995d1.css → app.d0e43dcc.css} +1 -1
- package/dist/index.tmp +9 -1
- package/dist/js/app-legacy.b0850281.js +2 -0
- package/dist/js/app-legacy.b0850281.js.map +1 -0
- package/dist/js/app.db01fef5.js +2 -0
- package/dist/js/app.db01fef5.js.map +1 -0
- package/dist/js/chunk-vendors-legacy.0432e7bc.js +13 -0
- package/dist/js/chunk-vendors-legacy.0432e7bc.js.map +1 -0
- package/dist/js/chunk-vendors.0432e7bc.js +13 -0
- package/dist/js/chunk-vendors.0432e7bc.js.map +1 -0
- package/dist/w-web-perm.umd.js +2 -2
- package/dist/w-web-perm.umd.js.map +1 -1
- package/docs/WWebPerm.html +1 -1
- package/docs/WWebPerm.mjs.html +30 -2
- package/docs/index.html +1 -1
- package/package.json +5 -5
- package/public/index.html +8 -0
- package/server/WWebPerm.mjs +29 -1
- package/src/App.vue +6 -1
- package/src/components/Layout.vue +0 -11
- package/src/components/LayoutContent.vue +22 -22
- package/src/components/LayoutContentGrups.vue +378 -97
- package/src/components/LayoutContentPemis.vue +422 -100
- package/src/components/LayoutContentTargets.vue +225 -55
- package/src/components/LayoutContentUsers.vue +256 -69
- package/src/components/VeCgrups.vue +28 -35
- package/src/components/VeCpemis.vue +28 -35
- package/src/components/VeCrules.vue +25 -31
- package/src/components/VeGrupBlngUsers.vue +63 -36
- package/src/components/VePemiBlngGrups.vue +63 -36
- package/src/schema/tables/pemis.mjs +1 -1
- package/src/store/mutations.mjs +77 -10
- package/srv.mjs +9 -1
- package/tableTags-web-perm.json +1 -1
- package/dist/js/app-legacy.128a1ced.js +0 -2
- package/dist/js/app-legacy.128a1ced.js.map +0 -1
- package/dist/js/app.128a1ced.js +0 -2
- package/dist/js/app.128a1ced.js.map +0 -1
- package/dist/js/chunk-vendors-legacy.d89048a8.js +0 -13
- package/dist/js/chunk-vendors-legacy.d89048a8.js.map +0 -1
- package/dist/js/chunk-vendors.d89048a8.js +0 -13
- package/dist/js/chunk-vendors.d89048a8.js.map +0 -1
- package/g.mjs +0 -0
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
style="height:100%;"
|
|
4
4
|
v-domresize
|
|
5
5
|
@domresize="resizePanel"
|
|
6
|
-
:
|
|
6
|
+
:changeParams="changeParams"
|
|
7
7
|
>
|
|
8
8
|
|
|
9
9
|
<div
|
|
10
|
-
style="
|
|
10
|
+
style="_border-bottom:1px solid #ddd; background:#fff;"
|
|
11
11
|
v-domresize
|
|
12
12
|
@domresize="resizeHead"
|
|
13
13
|
>
|
|
@@ -19,20 +19,96 @@
|
|
|
19
19
|
<WIcon
|
|
20
20
|
:icon="mdiSelectGroup"
|
|
21
21
|
:color="'#000'"
|
|
22
|
-
:size="
|
|
22
|
+
:size="32"
|
|
23
23
|
></WIcon>
|
|
24
24
|
|
|
25
|
-
<div style="padding-left:
|
|
26
|
-
|
|
25
|
+
<div style="padding-left:12px;">
|
|
26
|
+
|
|
27
|
+
<div style="font-size:1.4rem; color:#000;">
|
|
28
|
+
{{$t('managementGrups')}}
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div style="padding-top:2px; font-size:0.8rem; color:#666;">
|
|
32
|
+
{{$t('managementGrupsMsg')}}
|
|
33
|
+
</div>
|
|
34
|
+
|
|
27
35
|
</div>
|
|
28
36
|
|
|
29
37
|
</div>
|
|
30
38
|
</div>
|
|
31
39
|
|
|
32
40
|
<!-- 功能區 -->
|
|
33
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
style="padding:5px; border-top:1px solid #ddd; display:flex; align-items:center;"
|
|
43
|
+
_v-if="showIsEditable || isEditable"
|
|
44
|
+
>
|
|
45
|
+
|
|
46
|
+
<template v-if="showIsEditable">
|
|
47
|
+
|
|
48
|
+
<div style="padding:6px 0px 4px 4px;">
|
|
49
|
+
<WSwitch
|
|
50
|
+
v-model="isEditable"
|
|
51
|
+
:text="$t('modeEdit')"
|
|
52
|
+
></WSwitch>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div style="padding-left:10px;"></div>
|
|
56
|
+
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<template v-if="true">
|
|
60
|
+
|
|
61
|
+
<WPopup
|
|
62
|
+
:isolated="true"
|
|
63
|
+
_show=""
|
|
64
|
+
_hide=""
|
|
65
|
+
>
|
|
66
|
+
<template v-slot:trigger>
|
|
67
|
+
<WButtonCircle
|
|
68
|
+
:paddingStyle="{v:6,h:6}"
|
|
69
|
+
:tooltip="$t('showTabCols')"
|
|
70
|
+
:icon="mdiTableHeadersEye"
|
|
71
|
+
:backgroundColor="'#fff'"
|
|
72
|
+
:backgroundColorHover="'#f2f2f2'"
|
|
73
|
+
_textColor="'#eee'"
|
|
74
|
+
_textColorHover="'#fff'"
|
|
75
|
+
:iconColor="'#444'"
|
|
76
|
+
:iconColorHover="'#222'"
|
|
77
|
+
:shadow="false"
|
|
78
|
+
_click=""
|
|
79
|
+
></WButtonCircle>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<template v-slot:content>
|
|
83
|
+
<div style="padding:10px 0px 10px 0px;">
|
|
84
|
+
|
|
85
|
+
<div style="padding:7px 10px; font-size:0.85rem; color:#222; background:#f2f2f2;">
|
|
86
|
+
{{$t('showTabCols')}}
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div style="padding:7px 9px 0px 7px;">
|
|
90
|
+
<WInputCheckbox
|
|
91
|
+
:items="tabKeysPick"
|
|
92
|
+
v-model="tabKeysShow"
|
|
93
|
+
@input="toggleTabKeys"
|
|
94
|
+
>
|
|
95
|
+
<template v-slot="props">
|
|
96
|
+
<div style="padding-left:3px; display:flex; align-items:center; font-size:0.85rem; height:24px; cursor:pointer;">
|
|
97
|
+
{{getHead(props.item.data)}}
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
</WInputCheckbox>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
</WPopup>
|
|
106
|
+
|
|
107
|
+
<div style="padding-left:4px;"></div>
|
|
108
|
+
|
|
109
|
+
</template>
|
|
34
110
|
|
|
35
|
-
<template>
|
|
111
|
+
<template v-if="isEditable">
|
|
36
112
|
|
|
37
113
|
<WButtonCircle
|
|
38
114
|
:paddingStyle="{v:6,h:6}"
|
|
@@ -48,11 +124,11 @@
|
|
|
48
124
|
@click="addItem"
|
|
49
125
|
></WButtonCircle>
|
|
50
126
|
|
|
51
|
-
<div style="padding-left:
|
|
127
|
+
<div style="padding-left:4px;"></div>
|
|
52
128
|
|
|
53
129
|
</template>
|
|
54
130
|
|
|
55
|
-
<template v-if="hasItemCheckOne">
|
|
131
|
+
<template v-if="isEditable && hasItemCheckOne">
|
|
56
132
|
|
|
57
133
|
<WButtonCircle
|
|
58
134
|
:paddingStyle="{v:6,h:6}"
|
|
@@ -68,11 +144,11 @@
|
|
|
68
144
|
@click="copyItem"
|
|
69
145
|
></WButtonCircle>
|
|
70
146
|
|
|
71
|
-
<div style="padding-left:
|
|
147
|
+
<div style="padding-left:4px;"></div>
|
|
72
148
|
|
|
73
149
|
</template>
|
|
74
150
|
|
|
75
|
-
<template v-if="hasItemsCheck">
|
|
151
|
+
<template v-if="isEditable && hasItemsCheck">
|
|
76
152
|
|
|
77
153
|
<WButtonCircle
|
|
78
154
|
:paddingStyle="{v:6,h:6}"
|
|
@@ -88,11 +164,11 @@
|
|
|
88
164
|
@click="deleteItemsCheck"
|
|
89
165
|
></WButtonCircle>
|
|
90
166
|
|
|
91
|
-
<div style="padding-left:
|
|
167
|
+
<div style="padding-left:4px;"></div>
|
|
92
168
|
|
|
93
169
|
</template>
|
|
94
170
|
|
|
95
|
-
<template v-if="isModified">
|
|
171
|
+
<template v-if="isEditable && isModified">
|
|
96
172
|
|
|
97
173
|
<WButtonCircle
|
|
98
174
|
:paddingStyle="{v:6,h:6}"
|
|
@@ -108,7 +184,7 @@
|
|
|
108
184
|
@click="saveGrups"
|
|
109
185
|
></WButtonCircle>
|
|
110
186
|
|
|
111
|
-
<div style="padding-left:
|
|
187
|
+
<div style="padding-left:4px;"></div>
|
|
112
188
|
|
|
113
189
|
</template>
|
|
114
190
|
|
|
@@ -140,7 +216,7 @@
|
|
|
140
216
|
</template>
|
|
141
217
|
|
|
142
218
|
<script>
|
|
143
|
-
import { mdiSelectGroup, mdiVectorPolylinePlus, mdiCheckboxMarkedCircle, mdiCloudUploadOutline, mdiTrashCanOutline, mdiPlus, mdiPencilOutline, mdiContentCopy } from '@mdi/js/mdi.js'
|
|
219
|
+
import { mdiSelectGroup, mdiVectorPolylinePlus, mdiCheckboxMarkedCircle, mdiCloudUploadOutline, mdiTrashCanOutline, mdiTableHeadersEye, mdiPlus, mdiPencilOutline, mdiContentCopy } from '@mdi/js/mdi.js'
|
|
144
220
|
import JSON5 from 'json5'
|
|
145
221
|
import get from 'lodash-es/get.js'
|
|
146
222
|
import set from 'lodash-es/set.js'
|
|
@@ -154,15 +230,22 @@ import haskey from 'wsemi/src/haskey.mjs'
|
|
|
154
230
|
import isestr from 'wsemi/src/isestr.mjs'
|
|
155
231
|
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
156
232
|
import cstr from 'wsemi/src/cstr.mjs'
|
|
233
|
+
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
157
234
|
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
235
|
+
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
158
236
|
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
237
|
+
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
238
|
+
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
159
239
|
import WAggridVueDyn from 'w-component-vue/src/components/WAggridVueDyn.vue'
|
|
160
240
|
|
|
161
241
|
|
|
162
242
|
export default {
|
|
163
243
|
components: {
|
|
164
244
|
WIcon,
|
|
245
|
+
WSwitch,
|
|
165
246
|
WButtonCircle,
|
|
247
|
+
WPopup,
|
|
248
|
+
WInputCheckbox,
|
|
166
249
|
WAggridVueDyn,
|
|
167
250
|
},
|
|
168
251
|
props: {
|
|
@@ -178,6 +261,7 @@ export default {
|
|
|
178
261
|
mdiCheckboxMarkedCircle,
|
|
179
262
|
mdiCloudUploadOutline,
|
|
180
263
|
mdiTrashCanOutline,
|
|
264
|
+
mdiTableHeadersEye,
|
|
181
265
|
mdiPlus,
|
|
182
266
|
mdiPencilOutline,
|
|
183
267
|
mdiContentCopy,
|
|
@@ -187,8 +271,46 @@ export default {
|
|
|
187
271
|
headHeight: 100,
|
|
188
272
|
|
|
189
273
|
firstLoading: true,
|
|
274
|
+
firstSetting: true,
|
|
275
|
+
showIsEditable: false,
|
|
276
|
+
isEditable: false,
|
|
190
277
|
isModified: false,
|
|
191
278
|
|
|
279
|
+
tabKeys: [
|
|
280
|
+
'id',
|
|
281
|
+
'name',
|
|
282
|
+
'description',
|
|
283
|
+
'from',
|
|
284
|
+
'belongUsers',
|
|
285
|
+
'cpemis',
|
|
286
|
+
'userId',
|
|
287
|
+
'timeCreate',
|
|
288
|
+
'userIdUpdate',
|
|
289
|
+
'timeUpdate',
|
|
290
|
+
],
|
|
291
|
+
tabKeysPick: [
|
|
292
|
+
'name',
|
|
293
|
+
'description',
|
|
294
|
+
'from',
|
|
295
|
+
'belongUsers',
|
|
296
|
+
'cpemis',
|
|
297
|
+
'userId',
|
|
298
|
+
'timeCreate',
|
|
299
|
+
'userIdUpdate',
|
|
300
|
+
'timeUpdate',
|
|
301
|
+
],
|
|
302
|
+
tabKeysShow: [
|
|
303
|
+
'name',
|
|
304
|
+
'description',
|
|
305
|
+
// 'from',
|
|
306
|
+
'belongUsers',
|
|
307
|
+
'cpemis',
|
|
308
|
+
// 'userId',
|
|
309
|
+
// 'timeCreate',
|
|
310
|
+
// 'userIdUpdate',
|
|
311
|
+
// 'timeUpdate',
|
|
312
|
+
],
|
|
313
|
+
|
|
192
314
|
items: [],
|
|
193
315
|
itemsCheck: [],
|
|
194
316
|
opt: null,
|
|
@@ -204,9 +326,24 @@ export default {
|
|
|
204
326
|
vo.$dg.showVeGrupBlngUsersById = vo.showVeGrupBlngUsersById
|
|
205
327
|
vo.$dg.showVeCpemisById = vo.showVeCpemisById
|
|
206
328
|
|
|
329
|
+
//firstSetting
|
|
330
|
+
if (vo.firstSetting) {
|
|
331
|
+
// console.log('webInfor', vo.webInfor)
|
|
332
|
+
let showModeEditGrups = get(vo, 'webInfor.showModeEditGrups', '')
|
|
333
|
+
vo.showIsEditable = showModeEditGrups === 'y'
|
|
334
|
+
let modeEditGrups = get(vo, 'webInfor.modeEditGrups', '')
|
|
335
|
+
vo.isEditable = modeEditGrups === 'y'
|
|
336
|
+
vo.firstSetting = false
|
|
337
|
+
}
|
|
338
|
+
|
|
207
339
|
},
|
|
208
340
|
computed: {
|
|
209
341
|
|
|
342
|
+
webInfor: function() {
|
|
343
|
+
let wi = get(this, `$store.state.webInfor`)
|
|
344
|
+
return wi
|
|
345
|
+
},
|
|
346
|
+
|
|
210
347
|
targets: function() {
|
|
211
348
|
let rs = get(this, `$store.state.targets`)
|
|
212
349
|
rs = sortBy(rs, 'order')
|
|
@@ -231,28 +368,98 @@ export default {
|
|
|
231
368
|
return rs
|
|
232
369
|
},
|
|
233
370
|
|
|
234
|
-
|
|
235
|
-
|
|
371
|
+
useUsers: function() {
|
|
372
|
+
let vo = this
|
|
373
|
+
|
|
374
|
+
//parse cgrups
|
|
375
|
+
let users = map(vo.users, (u) => {
|
|
376
|
+
|
|
377
|
+
//cloneDeep
|
|
378
|
+
u = cloneDeep(u)
|
|
379
|
+
|
|
380
|
+
//kpGrup
|
|
381
|
+
let kpGrup = {}
|
|
382
|
+
try {
|
|
383
|
+
// console.log('u.cgrups', u.cgrups)
|
|
384
|
+
kpGrup = JSON5.parse(u.cgrups)
|
|
385
|
+
}
|
|
386
|
+
catch (err) {}
|
|
387
|
+
|
|
388
|
+
//save kpGrup
|
|
389
|
+
u.kpGrup = kpGrup
|
|
390
|
+
|
|
391
|
+
return u
|
|
392
|
+
})
|
|
393
|
+
// console.log('users', users)
|
|
236
394
|
|
|
395
|
+
return users
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
kpGrupUser: function() {
|
|
237
399
|
let vo = this
|
|
238
400
|
|
|
239
|
-
//
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
401
|
+
//kp
|
|
402
|
+
let kp = {}
|
|
403
|
+
each(vo.useUsers, (u) => {
|
|
404
|
+
each(u.kpGrup, (v, k) => {
|
|
405
|
+
let isActive = get(v, 'isActive', '')
|
|
406
|
+
if (isActive !== 'y') {
|
|
407
|
+
return true //跳出換下一個
|
|
408
|
+
}
|
|
409
|
+
if (!haskey(kp, k)) {
|
|
410
|
+
kp[k] = []
|
|
411
|
+
}
|
|
412
|
+
kp[k].push({
|
|
413
|
+
user: u,
|
|
414
|
+
grup: v,
|
|
415
|
+
})
|
|
416
|
+
})
|
|
417
|
+
})
|
|
418
|
+
// console.log('kp', kp)
|
|
419
|
+
|
|
420
|
+
return kp
|
|
421
|
+
},
|
|
243
422
|
|
|
244
|
-
|
|
423
|
+
kpUseGrupUser: function() {
|
|
424
|
+
let vo = this
|
|
425
|
+
|
|
426
|
+
//_kp
|
|
427
|
+
let _kp = {}
|
|
428
|
+
each(vo.grups, (v, k) => {
|
|
429
|
+
_kp[v.name] = true
|
|
430
|
+
})
|
|
431
|
+
// console.log('_kp', _kp)
|
|
432
|
+
|
|
433
|
+
//kp
|
|
434
|
+
let kp = {}
|
|
435
|
+
each(vo.kpGrupUser, (v, k) => {
|
|
436
|
+
if (haskey(_kp, k)) {
|
|
437
|
+
kp[k] = v
|
|
438
|
+
}
|
|
439
|
+
})
|
|
440
|
+
// console.log('kp', kp)
|
|
441
|
+
|
|
442
|
+
return kp
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
changeParams: function() {
|
|
446
|
+
// console.log('computed changeParams')
|
|
447
|
+
|
|
448
|
+
let vo = this
|
|
449
|
+
|
|
450
|
+
//trigger
|
|
451
|
+
let isEditable = vo.isEditable
|
|
245
452
|
let grups = cloneDeep(vo.grups)
|
|
246
|
-
let
|
|
453
|
+
let kpUseGrupUser = cloneDeep(vo.kpUseGrupUser)
|
|
247
454
|
|
|
248
|
-
//
|
|
249
|
-
let items = vo.
|
|
455
|
+
//items
|
|
456
|
+
let items = vo.genItems(grups, kpUseGrupUser)
|
|
250
457
|
|
|
251
458
|
//save
|
|
252
459
|
vo.items = items
|
|
253
460
|
|
|
254
461
|
//genOpt
|
|
255
|
-
vo.genOpt()
|
|
462
|
+
vo.genOpt({ isEditable })
|
|
256
463
|
|
|
257
464
|
//firstLoading
|
|
258
465
|
vo.firstLoading = false
|
|
@@ -341,6 +548,25 @@ export default {
|
|
|
341
548
|
return c
|
|
342
549
|
},
|
|
343
550
|
|
|
551
|
+
kpHead: function() {
|
|
552
|
+
let vo = this
|
|
553
|
+
|
|
554
|
+
let kp = {
|
|
555
|
+
'id': vo.$t('id'),
|
|
556
|
+
'name': vo.$t('name'),
|
|
557
|
+
'description': vo.$t('description'),
|
|
558
|
+
'from': vo.$t('from'),
|
|
559
|
+
'belongUsers': vo.$t('belongUsers'),
|
|
560
|
+
'cpemis': vo.$t('grupCpemis'),
|
|
561
|
+
'userId': vo.$t('userId'),
|
|
562
|
+
'timeCreate': vo.$t('timeCreate'),
|
|
563
|
+
'userIdUpdate': vo.$t('userIdUpdate'),
|
|
564
|
+
'timeUpdate': vo.$t('timeUpdate'),
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return kp
|
|
568
|
+
},
|
|
569
|
+
|
|
344
570
|
},
|
|
345
571
|
methods: {
|
|
346
572
|
|
|
@@ -365,6 +591,16 @@ export default {
|
|
|
365
591
|
|
|
366
592
|
},
|
|
367
593
|
|
|
594
|
+
getHead: function(key) {
|
|
595
|
+
// console.log('methods getHead', key)
|
|
596
|
+
|
|
597
|
+
let vo = this
|
|
598
|
+
|
|
599
|
+
let head = get(vo, `kpHead.${key}`, '')
|
|
600
|
+
|
|
601
|
+
return head
|
|
602
|
+
},
|
|
603
|
+
|
|
368
604
|
genOpt: function() {
|
|
369
605
|
// console.log('methods genOpt')
|
|
370
606
|
|
|
@@ -378,32 +614,39 @@ export default {
|
|
|
378
614
|
if (size(vo.items) > 0) {
|
|
379
615
|
|
|
380
616
|
//ks
|
|
381
|
-
let ks =
|
|
382
|
-
'id',
|
|
383
|
-
'name',
|
|
384
|
-
'belongUsers',
|
|
385
|
-
'description',
|
|
386
|
-
'from',
|
|
387
|
-
'cpemis',
|
|
388
|
-
'userId',
|
|
389
|
-
'timeCreate',
|
|
390
|
-
'userIdUpdate',
|
|
391
|
-
'timeUpdate',
|
|
392
|
-
]
|
|
617
|
+
let ks = vo.tabKeys
|
|
393
618
|
// console.log('ks', ks)
|
|
394
619
|
|
|
395
620
|
//kpHead
|
|
396
|
-
let kpHead =
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
621
|
+
let kpHead = vo.kpHead
|
|
622
|
+
|
|
623
|
+
//kpCellEditable, kpRowDrag, kpHeadCheckBox
|
|
624
|
+
let kpCellEditable = {}
|
|
625
|
+
let kpRowDrag = {}
|
|
626
|
+
let kpHeadCheckBox = {}
|
|
627
|
+
if (vo.isEditable) {
|
|
628
|
+
kpCellEditable = {
|
|
629
|
+
'name': true,
|
|
630
|
+
'description': true,
|
|
631
|
+
'from': true,
|
|
632
|
+
}
|
|
633
|
+
kpRowDrag = {
|
|
634
|
+
'name': true,
|
|
635
|
+
}
|
|
636
|
+
kpHeadCheckBox = {
|
|
637
|
+
'name': true,
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
//kpHeadHide
|
|
642
|
+
let kpHeadHide = {
|
|
643
|
+
'id': true,
|
|
644
|
+
}
|
|
645
|
+
if (true) {
|
|
646
|
+
let tabKeysHide = arrPull(vo.tabKeysPick, vo.tabKeysShow)
|
|
647
|
+
each(tabKeysHide, (k) => {
|
|
648
|
+
kpHeadHide[k] = true
|
|
649
|
+
})
|
|
407
650
|
}
|
|
408
651
|
|
|
409
652
|
//opt
|
|
@@ -413,17 +656,17 @@ export default {
|
|
|
413
656
|
keys: ks,
|
|
414
657
|
kpHead,
|
|
415
658
|
// autoFitColumn: true,
|
|
659
|
+
defCellEditable: vo.isEditable,
|
|
416
660
|
defHeadFilter: true,
|
|
417
661
|
defCellAlignH: 'left',
|
|
418
|
-
kpHeadHide
|
|
419
|
-
'id': true,
|
|
420
|
-
},
|
|
662
|
+
kpHeadHide,
|
|
421
663
|
kpHeadFixLeft: {
|
|
422
664
|
'name': true,
|
|
423
665
|
},
|
|
424
666
|
defHeadMinWidth: 150,
|
|
425
667
|
kpHeadWidth: {
|
|
426
668
|
'name': 300,
|
|
669
|
+
'description': 300,
|
|
427
670
|
'belongUsers': 300,
|
|
428
671
|
'cpemis': 300,
|
|
429
672
|
'timeCreate': 220,
|
|
@@ -432,26 +675,18 @@ export default {
|
|
|
432
675
|
kpHeadFilterType: {
|
|
433
676
|
'id': 'text',
|
|
434
677
|
'name': 'text',
|
|
435
|
-
'belongUsers': 'text',
|
|
436
678
|
'description': 'text',
|
|
437
679
|
'from': 'text',
|
|
680
|
+
'belongUsers': 'text',
|
|
438
681
|
'cpemis': 'text',
|
|
439
682
|
'userId': 'text',
|
|
440
683
|
'timeCreate': 'text',
|
|
441
684
|
'userIdUpdate': 'text',
|
|
442
685
|
'timeUpdate': 'text',
|
|
443
686
|
},
|
|
444
|
-
kpCellEditable
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
'from': true,
|
|
448
|
-
},
|
|
449
|
-
kpRowDrag: {
|
|
450
|
-
'name': true,
|
|
451
|
-
},
|
|
452
|
-
kpHeadCheckBox: {
|
|
453
|
-
'name': true,
|
|
454
|
-
},
|
|
687
|
+
kpCellEditable,
|
|
688
|
+
kpRowDrag,
|
|
689
|
+
kpHeadCheckBox,
|
|
455
690
|
kpHeadFilter: {
|
|
456
691
|
'belongUsers': false,
|
|
457
692
|
'cpemis': false,
|
|
@@ -557,45 +792,31 @@ export default {
|
|
|
557
792
|
|
|
558
793
|
},
|
|
559
794
|
|
|
560
|
-
|
|
561
|
-
// console.log('method addUsers', grups, users)
|
|
562
|
-
|
|
795
|
+
toggleTabKeys: function() {
|
|
563
796
|
let vo = this
|
|
564
797
|
|
|
565
|
-
//
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
u.kpGrup = kpGrup
|
|
569
|
-
return u
|
|
570
|
-
})
|
|
571
|
-
// console.log('users', users)
|
|
798
|
+
//cmp
|
|
799
|
+
let cmp = get(vo, '$refs.rftable.$refs.$self')
|
|
800
|
+
// console.log('cmp', cmp)
|
|
572
801
|
|
|
573
|
-
//
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
kp[k].push({
|
|
585
|
-
user: u,
|
|
586
|
-
grup: v,
|
|
587
|
-
})
|
|
588
|
-
})
|
|
589
|
-
})
|
|
590
|
-
// console.log('kp', kp)
|
|
802
|
+
//showKeys
|
|
803
|
+
cmp.showKeys(vo.tabKeysShow)
|
|
804
|
+
// console.log('tabKeysShow', vo.tabKeysShow)
|
|
805
|
+
|
|
806
|
+
},
|
|
807
|
+
|
|
808
|
+
genItems: function(grups, kpUseGrupUser) {
|
|
809
|
+
// console.log('method genItems', grups, kpUseGrupUser)
|
|
810
|
+
|
|
811
|
+
let vo = this
|
|
591
812
|
|
|
592
813
|
//items
|
|
593
814
|
let items = map(grups, (g) => {
|
|
594
815
|
|
|
595
816
|
//us
|
|
596
817
|
let us = []
|
|
597
|
-
if (haskey(
|
|
598
|
-
us =
|
|
818
|
+
if (haskey(kpUseGrupUser, g.name)) {
|
|
819
|
+
us = kpUseGrupUser[g.name]
|
|
599
820
|
}
|
|
600
821
|
// console.log('us', us)
|
|
601
822
|
|
|
@@ -617,6 +838,7 @@ export default {
|
|
|
617
838
|
//save belongUsers, us
|
|
618
839
|
g.belongUsers = belongUsers
|
|
619
840
|
g.us = us
|
|
841
|
+
// console.log('g', g)
|
|
620
842
|
|
|
621
843
|
return g
|
|
622
844
|
})
|
|
@@ -645,6 +867,15 @@ export default {
|
|
|
645
867
|
r.timeUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
646
868
|
// console.log('r', r)
|
|
647
869
|
|
|
870
|
+
//belongUsers, us
|
|
871
|
+
let us = []
|
|
872
|
+
let belongUsers = vo.$t('grupBlngRnderNoUser')
|
|
873
|
+
|
|
874
|
+
//save belongUsers, us
|
|
875
|
+
r.belongUsers = belongUsers
|
|
876
|
+
r.us = us
|
|
877
|
+
// console.log('r', r)
|
|
878
|
+
|
|
648
879
|
//添加至最首
|
|
649
880
|
rows = [
|
|
650
881
|
r,
|
|
@@ -711,6 +942,15 @@ export default {
|
|
|
711
942
|
r.timeUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
712
943
|
// console.log('r', r)
|
|
713
944
|
|
|
945
|
+
//belongUsers, us
|
|
946
|
+
let us = []
|
|
947
|
+
let belongUsers = vo.$t('grupBlngRnderNoUser')
|
|
948
|
+
|
|
949
|
+
//save belongUsers, us
|
|
950
|
+
r.belongUsers = belongUsers
|
|
951
|
+
r.us = us
|
|
952
|
+
// console.log('r', r)
|
|
953
|
+
|
|
714
954
|
//添加至最首
|
|
715
955
|
rows = [
|
|
716
956
|
r,
|
|
@@ -769,14 +1009,48 @@ export default {
|
|
|
769
1009
|
|
|
770
1010
|
},
|
|
771
1011
|
|
|
1012
|
+
fltKpPemi: function(kp) {
|
|
1013
|
+
// console.log('fltKpPemi', kp)
|
|
1014
|
+
|
|
1015
|
+
let vo = this
|
|
1016
|
+
|
|
1017
|
+
//_kp
|
|
1018
|
+
let _kp = {}
|
|
1019
|
+
each(vo.pemis, (v, k) => {
|
|
1020
|
+
_kp[v.name] = true
|
|
1021
|
+
})
|
|
1022
|
+
// console.log('_kp', _kp)
|
|
1023
|
+
|
|
1024
|
+
//kpt
|
|
1025
|
+
let kpt = {}
|
|
1026
|
+
each(kp, (v, k) => {
|
|
1027
|
+
if (haskey(_kp, k)) {
|
|
1028
|
+
kpt[k] = v
|
|
1029
|
+
}
|
|
1030
|
+
})
|
|
1031
|
+
|
|
1032
|
+
return kpt
|
|
1033
|
+
},
|
|
1034
|
+
|
|
772
1035
|
getCpemisText: function(cpemis) {
|
|
773
1036
|
// console.log('method getCpemisText', cpemis)
|
|
774
1037
|
|
|
775
1038
|
let vo = this
|
|
776
1039
|
|
|
777
1040
|
//kpPemi
|
|
778
|
-
let kpPemi =
|
|
1041
|
+
let kpPemi = {}
|
|
1042
|
+
try {
|
|
1043
|
+
// console.log('cpemis', cpemis)
|
|
1044
|
+
kpPemi = JSON5.parse(cpemis)
|
|
1045
|
+
}
|
|
1046
|
+
catch (err) {}
|
|
1047
|
+
// console.log('kpPemi', kpPemi)
|
|
779
1048
|
|
|
1049
|
+
//fltKpPemi
|
|
1050
|
+
kpPemi = vo.fltKpPemi(kpPemi)
|
|
1051
|
+
// console.log('kpPemi(fltKpPemi)', kpPemi)
|
|
1052
|
+
|
|
1053
|
+
//vs
|
|
780
1054
|
let vs = []
|
|
781
1055
|
each(kpPemi, (v, k) => {
|
|
782
1056
|
// console.log(k, 'v', v)
|
|
@@ -835,6 +1109,7 @@ export default {
|
|
|
835
1109
|
return false //跳出
|
|
836
1110
|
}
|
|
837
1111
|
})
|
|
1112
|
+
// console.log('r', r)
|
|
838
1113
|
|
|
839
1114
|
//check
|
|
840
1115
|
if (!iseobj(r)) {
|
|
@@ -843,7 +1118,10 @@ export default {
|
|
|
843
1118
|
}
|
|
844
1119
|
|
|
845
1120
|
//showVeGrupBlngUsers
|
|
846
|
-
vo.$dg.showVeGrupBlngUsers(
|
|
1121
|
+
vo.$dg.showVeGrupBlngUsers({
|
|
1122
|
+
isEditable: vo.isEditable,
|
|
1123
|
+
grup: r,
|
|
1124
|
+
})
|
|
847
1125
|
.then(() => {})
|
|
848
1126
|
.catch(() => {})
|
|
849
1127
|
|
|
@@ -881,7 +1159,10 @@ export default {
|
|
|
881
1159
|
}
|
|
882
1160
|
|
|
883
1161
|
//showVeCpemis
|
|
884
|
-
vo.$dg.showVeCpemis(
|
|
1162
|
+
vo.$dg.showVeCpemis({
|
|
1163
|
+
isEditable: vo.isEditable,
|
|
1164
|
+
grup: r,
|
|
1165
|
+
})
|
|
885
1166
|
.then((cpemis) => {
|
|
886
1167
|
// console.log('cpemis', cpemis)
|
|
887
1168
|
|