w-web-perm 1.0.85 → 1.0.86
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/index.tmp +1 -1
- package/dist/js/{chunk-vendors-legacy.7b6ae0b0.js → chunk-vendors-legacy.d85138b8.js} +1 -1
- package/dist/js/{chunk-vendors.7b6ae0b0.js → chunk-vendors.d85138b8.js} +1 -1
- package/dist/w-web-perm.umd.js +1 -1
- package/docs/WWebPerm.html +1 -1
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/docs/server_WWebPerm.mjs.html +1 -1
- package/docs/server_procCore.mjs.html +1 -1
- package/docs/src_fetchJson.mjs.html +1 -1
- package/package.json +2 -2
- package/tableTags-web-perm.json +1 -1
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/README.md +0 -58
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/server_procLang.mjs.diff +0 -31
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_App.vue.diff +0 -19
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_LayoutContentGrups.vue.diff +0 -40
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_LayoutContentPemis.vue.diff +0 -40
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_ModeSelectChip.vue.new.diff +0 -124
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_RelationChip.vue.new.diff +0 -116
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_RelationChips.vue.new.diff +0 -152
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCgrups.vue.diff +0 -76
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCpemis.vue.diff +0 -76
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeCrules.vue.diff +0 -14
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VeGrupBlngUsers.vue.diff +0 -121
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/diff/src_components_VePemiBlngGrups.vue.diff +0 -121
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/server/procLang.mjs +0 -1049
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/App.vue +0 -204
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/LayoutContentGrups.vue +0 -1260
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/LayoutContentPemis.vue +0 -1262
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/ModeSelectChip.vue +0 -121
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/RelationChip.vue +0 -113
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/RelationChips.vue +0 -149
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCgrups.vue +0 -943
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCpemis.vue +0 -943
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeCrules.vue +0 -848
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VeGrupBlngUsers.vue +0 -1157
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231/src/components/VePemiBlngGrups.vue +0 -1157
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/A-/347/256/241/347/220/206/346/254/212/351/231/220/344/270/273/350/241/250.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/A-/347/256/241/347/220/206/346/254/212/351/231/220/347/276/244/347/265/204/344/270/273/350/241/250.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B1-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/260/215/350/251/261/346/241/206.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B2-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-hover/346/234/254/351/240/205chip.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B3-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/234/254/351/240/205chip/346/270/205/345/226/256.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B4-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/346/234/254/351/240/205chip/345/267/262/347/202/272AND.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B5-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/345/205/250/351/203/250/346/265/256/345/261/244.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/B6-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/213/276/351/201/270/345/276/214/346/234/254/351/240/205chip/345/234/250/351/246/226/344/275/215.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C1-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-/345/260/215/350/251/261/346/241/206.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C2-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-hover/345/267/262/345/213/276/351/201/270/345/210/227/346/216/247/345/210/266/351/240/205.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/C3-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/D1-/347/267/250/350/274/257/346/211/200/345/261/254/344/275/277/347/224/250/350/200/205-/345/260/215/350/251/261/346/241/206.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/E1-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220/347/276/244/347/265/204-hover.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/E2-/347/267/250/350/274/257/344/275/277/347/224/250/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/F1-/345/261/225/347/244/272/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/224/257/350/256/200/346/205/213.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/F2-/345/261/225/347/244/272/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/345/205/250/351/203/250.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G1-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/211/215/345/205/255/345/210/227.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G2-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-hover/346/234/254/351/240/205chip.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/G3-zoom-/347/267/250/350/274/257/346/211/200/345/261/254/346/254/212/351/231/220/347/276/244/347/265/204-/345/261/225/351/226/213/346/270/205/345/226/256.png +0 -0
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/346/210/252/345/234/226/verify.json +0 -390
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/build.log +0 -93
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/lint.log +0 -23
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_perm_probe.mjs +0 -321
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_perm_zoom.mjs +0 -173
- package/w-web-perm/351/232/250/351/231/204/350/263/207/346/226/231//351/251/227/350/255/211/350/205/263/346/234/254/zz_wwp_verify.mjs +0 -330
- package//345/273/272/350/255/260w-aggrid-vue/350/252/277/346/225/264.md +0 -193
- package//345/273/272/350/255/260w-component-vue/350/210/207wsemi/350/252/277/346/225/264.md +0 -76
- package//345/273/272/350/255/260w-web-perm/350/252/277/346/225/264.md +0 -244
- package//346/226/275/345/267/245/345/226/256_/345/273/272/350/255/260w-web-perm/350/252/277/346/225/264.md +0 -166
|
@@ -1,1260 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
style="height:100%;"
|
|
4
|
-
v-domresize
|
|
5
|
-
@domresize="resizePanel"
|
|
6
|
-
:changeParams="changeParams"
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
<div
|
|
10
|
-
style="_border-bottom:1px solid #ddd; background:#fff;"
|
|
11
|
-
v-domresize
|
|
12
|
-
@domresize="resizeHead"
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
<!-- 標題區 -->
|
|
16
|
-
<div style="padding:10px 10px 10px 20px;">
|
|
17
|
-
<div :style="`display:flex; align-items:center; padding:${drawer?'5px':'5px 5px 5px 20px'};`">
|
|
18
|
-
|
|
19
|
-
<WIcon
|
|
20
|
-
:icon="mdiSelectGroup"
|
|
21
|
-
:color="'#000'"
|
|
22
|
-
:size="32"
|
|
23
|
-
></WIcon>
|
|
24
|
-
|
|
25
|
-
<div style="padding-left:12px;">
|
|
26
|
-
|
|
27
|
-
<div style="font-size:1.4rem; color:#000;">
|
|
28
|
-
{{$t('mmGrups')}}
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<div style="padding-top:2px; font-size:0.8rem; color:#666;">
|
|
32
|
-
{{$t('mmGrupsMsg')}}
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<!-- 功能區 -->
|
|
41
|
-
<div
|
|
42
|
-
data-fmid="grups-toolbar"
|
|
43
|
-
style="padding:5px; border-top:1px solid #ddd; display:flex; align-items:center;"
|
|
44
|
-
_v-if="showIsEditable || isEditable"
|
|
45
|
-
>
|
|
46
|
-
|
|
47
|
-
<template v-if="showIsEditable">
|
|
48
|
-
|
|
49
|
-
<div style="padding:6px 0px 4px 4px;">
|
|
50
|
-
<WSwitch
|
|
51
|
-
:checkedSwitchCircleColor="'#F68200'"
|
|
52
|
-
:checkedSwitchCircleColorHover="'#FB8C00'"
|
|
53
|
-
:checkedSwitchBarColor="'#FFE0B2'"
|
|
54
|
-
:checkedSwitchBarColorHover="'#FFE6B8'"
|
|
55
|
-
v-model="isEditable"
|
|
56
|
-
:text="$t('modeEdit')"
|
|
57
|
-
></WSwitch>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div style="padding-left:10px;"></div>
|
|
61
|
-
|
|
62
|
-
</template>
|
|
63
|
-
|
|
64
|
-
<template v-if="true">
|
|
65
|
-
|
|
66
|
-
<WPopup
|
|
67
|
-
:isolated="true"
|
|
68
|
-
_show=""
|
|
69
|
-
_hide=""
|
|
70
|
-
>
|
|
71
|
-
<template v-slot:trigger>
|
|
72
|
-
<WButtonCircle
|
|
73
|
-
:paddingStyle="{v:6,h:6}"
|
|
74
|
-
:tooltip="$t('showTabCols')"
|
|
75
|
-
:icon="mdiTableHeadersEye"
|
|
76
|
-
:backgroundColor="'#fff'"
|
|
77
|
-
:backgroundColorHover="'#f2f2f2'"
|
|
78
|
-
_textColor="'#eee'"
|
|
79
|
-
_textColorHover="'#fff'"
|
|
80
|
-
:iconColor="'#444'"
|
|
81
|
-
:iconColorHover="'#222'"
|
|
82
|
-
:shadow="false"
|
|
83
|
-
_click=""
|
|
84
|
-
></WButtonCircle>
|
|
85
|
-
</template>
|
|
86
|
-
|
|
87
|
-
<template v-slot:content>
|
|
88
|
-
<div style="padding:10px 0px 10px 0px;">
|
|
89
|
-
|
|
90
|
-
<div style="padding:7px 10px; font-size:0.85rem; color:#222; background:#f2f2f2;">
|
|
91
|
-
{{$t('showTabCols')}}
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
<div style="padding:7px 9px 0px 7px;">
|
|
95
|
-
<WInputCheckbox
|
|
96
|
-
:items="tabKeysPick"
|
|
97
|
-
v-model="tabKeysShow"
|
|
98
|
-
@input="toggleTabKeys"
|
|
99
|
-
>
|
|
100
|
-
<template v-slot="props">
|
|
101
|
-
<div style="padding-left:3px; display:flex; align-items:center; font-size:0.85rem; height:24px; cursor:pointer;">
|
|
102
|
-
{{getHead(props.item.data)}}
|
|
103
|
-
</div>
|
|
104
|
-
</template>
|
|
105
|
-
</WInputCheckbox>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
</div>
|
|
109
|
-
</template>
|
|
110
|
-
</WPopup>
|
|
111
|
-
|
|
112
|
-
<div style="padding-left:4px;"></div>
|
|
113
|
-
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
<template v-if="isEditable">
|
|
117
|
-
|
|
118
|
-
<WButtonCircle
|
|
119
|
-
:paddingStyle="{v:6,h:6}"
|
|
120
|
-
:tooltip="$t('grupAdd')"
|
|
121
|
-
:icon="mdiPlus"
|
|
122
|
-
:backgroundColor="'#fff'"
|
|
123
|
-
:backgroundColorHover="'#f2f2f2'"
|
|
124
|
-
_textColor="'#eee'"
|
|
125
|
-
_textColorHover="'#fff'"
|
|
126
|
-
:iconColor="'#444'"
|
|
127
|
-
:iconColorHover="'#222'"
|
|
128
|
-
:shadow="false"
|
|
129
|
-
@click="addItem"
|
|
130
|
-
></WButtonCircle>
|
|
131
|
-
|
|
132
|
-
<div style="padding-left:4px;"></div>
|
|
133
|
-
|
|
134
|
-
</template>
|
|
135
|
-
|
|
136
|
-
<template v-if="isEditable && hasItemCheckOne">
|
|
137
|
-
|
|
138
|
-
<WButtonCircle
|
|
139
|
-
:paddingStyle="{v:6,h:6}"
|
|
140
|
-
:tooltip="$t('grupCopy')"
|
|
141
|
-
:icon="mdiContentCopy"
|
|
142
|
-
:backgroundColor="'#fff'"
|
|
143
|
-
:backgroundColorHover="'#f2f2f2'"
|
|
144
|
-
_textColor="'#eee'"
|
|
145
|
-
_textColorHover="'#fff'"
|
|
146
|
-
:iconColor="'#444'"
|
|
147
|
-
:iconColorHover="'#222'"
|
|
148
|
-
:shadow="false"
|
|
149
|
-
@click="copyItem"
|
|
150
|
-
></WButtonCircle>
|
|
151
|
-
|
|
152
|
-
<div style="padding-left:4px;"></div>
|
|
153
|
-
|
|
154
|
-
</template>
|
|
155
|
-
|
|
156
|
-
<template v-if="isEditable && hasItemsCheck">
|
|
157
|
-
|
|
158
|
-
<WButtonCircle
|
|
159
|
-
:paddingStyle="{v:6,h:6}"
|
|
160
|
-
:tooltip="$t('grupDeleteCheckGrups')"
|
|
161
|
-
:icon="mdiTrashCanOutline"
|
|
162
|
-
:backgroundColor="'#fff'"
|
|
163
|
-
:backgroundColorHover="'#f2f2f2'"
|
|
164
|
-
_textColor="'#eee'"
|
|
165
|
-
_textColorHover="'#fff'"
|
|
166
|
-
:iconColor="'#444'"
|
|
167
|
-
:iconColorHover="'#222'"
|
|
168
|
-
:shadow="false"
|
|
169
|
-
@click="deleteItemsCheck"
|
|
170
|
-
></WButtonCircle>
|
|
171
|
-
|
|
172
|
-
<div style="padding-left:4px;"></div>
|
|
173
|
-
|
|
174
|
-
</template>
|
|
175
|
-
|
|
176
|
-
<template v-if="isEditable && isModified">
|
|
177
|
-
|
|
178
|
-
<WButtonCircle
|
|
179
|
-
:paddingStyle="{v:6,h:6}"
|
|
180
|
-
:tooltip="$t('saveChanges')"
|
|
181
|
-
:icon="mdiCloudUploadOutline"
|
|
182
|
-
:backgroundColor="'rgba(255,0,50,0.7)'"
|
|
183
|
-
:backgroundColorHover="'rgba(255,0,50,0.8)'"
|
|
184
|
-
:textColor="'#eee'"
|
|
185
|
-
:textColorHover="'#fff'"
|
|
186
|
-
:iconColor="'#eee'"
|
|
187
|
-
:iconColorHover="'#fff'"
|
|
188
|
-
:shadow="false"
|
|
189
|
-
:promiseUnlock="true"
|
|
190
|
-
@click="saveGrups"
|
|
191
|
-
></WButtonCircle>
|
|
192
|
-
|
|
193
|
-
<div style="padding-left:4px;"></div>
|
|
194
|
-
|
|
195
|
-
</template>
|
|
196
|
-
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
</div>
|
|
200
|
-
|
|
201
|
-
<template
|
|
202
|
-
v-if="!firstLoading"
|
|
203
|
-
>
|
|
204
|
-
|
|
205
|
-
<template v-if="items">
|
|
206
|
-
<WAggridVue
|
|
207
|
-
ref="rftable"
|
|
208
|
-
:style="`width:100%;`"
|
|
209
|
-
:height="contentHeight"
|
|
210
|
-
:opt="opt"
|
|
211
|
-
>
|
|
212
|
-
<template v-slot:cell-render="props">
|
|
213
|
-
<template v-if="props.key==='name'">
|
|
214
|
-
<span v-if="errItemsByName[props.value]" :title="errItemsByName[props.value]">
|
|
215
|
-
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
216
|
-
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
217
|
-
</span>
|
|
218
|
-
<span v-else>{{ props.value }}</span>
|
|
219
|
-
</template>
|
|
220
|
-
<template v-else-if="props.key==='belongUsers'">
|
|
221
|
-
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
222
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeGrupBlngUsersById(props.row.id)">{{ props.value }}</button>
|
|
223
|
-
</div>
|
|
224
|
-
</template>
|
|
225
|
-
<template v-else-if="props.key==='cpemis'">
|
|
226
|
-
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
227
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeCpemisById(props.row.id)">{{ getCpemisText(props.value) }}</button>
|
|
228
|
-
</div>
|
|
229
|
-
</template>
|
|
230
|
-
<span v-else>{{ props.value }}</span>
|
|
231
|
-
</template>
|
|
232
|
-
</WAggridVue>
|
|
233
|
-
</template>
|
|
234
|
-
|
|
235
|
-
</template>
|
|
236
|
-
|
|
237
|
-
<div
|
|
238
|
-
style="padding:10px 15px; font-size:0.8rem;"
|
|
239
|
-
v-else
|
|
240
|
-
>
|
|
241
|
-
{{$t('waitingData')}}
|
|
242
|
-
</div>
|
|
243
|
-
|
|
244
|
-
</div>
|
|
245
|
-
</template>
|
|
246
|
-
|
|
247
|
-
<script>
|
|
248
|
-
import { mdiSelectGroup, mdiVectorPolylinePlus, mdiCheckboxMarkedCircle, mdiCloudUploadOutline, mdiTrashCanOutline, mdiTableHeadersEye, mdiPlus, mdiPencilOutline, mdiContentCopy } from '@mdi/js/mdi.js'
|
|
249
|
-
import JSON5 from 'json5'
|
|
250
|
-
import get from 'lodash-es/get.js'
|
|
251
|
-
import set from 'lodash-es/set.js'
|
|
252
|
-
import each from 'lodash-es/each.js'
|
|
253
|
-
import map from 'lodash-es/map.js'
|
|
254
|
-
import size from 'lodash-es/size.js'
|
|
255
|
-
import filter from 'lodash-es/filter.js'
|
|
256
|
-
import sortBy from 'lodash-es/sortBy.js'
|
|
257
|
-
import cloneDeep from 'lodash-es/cloneDeep.js'
|
|
258
|
-
import haskey from 'wsemi/src/haskey.mjs'
|
|
259
|
-
import isestr from 'wsemi/src/isestr.mjs'
|
|
260
|
-
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
261
|
-
import isnum from 'wsemi/src/isnum.mjs'
|
|
262
|
-
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
263
|
-
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
264
|
-
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
265
|
-
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
266
|
-
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
267
|
-
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
268
|
-
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
269
|
-
import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
export default {
|
|
273
|
-
components: {
|
|
274
|
-
WIcon,
|
|
275
|
-
WSwitch,
|
|
276
|
-
WButtonCircle,
|
|
277
|
-
WPopup,
|
|
278
|
-
WInputCheckbox,
|
|
279
|
-
WAggridVue,
|
|
280
|
-
},
|
|
281
|
-
props: {
|
|
282
|
-
drawer: {
|
|
283
|
-
type: Boolean,
|
|
284
|
-
default: false,
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
data: function() {
|
|
288
|
-
return {
|
|
289
|
-
mdiSelectGroup,
|
|
290
|
-
mdiVectorPolylinePlus,
|
|
291
|
-
mdiCheckboxMarkedCircle,
|
|
292
|
-
mdiCloudUploadOutline,
|
|
293
|
-
mdiTrashCanOutline,
|
|
294
|
-
mdiTableHeadersEye,
|
|
295
|
-
mdiPlus,
|
|
296
|
-
mdiPencilOutline,
|
|
297
|
-
mdiContentCopy,
|
|
298
|
-
|
|
299
|
-
panelHeight: 100,
|
|
300
|
-
headHeight: 100,
|
|
301
|
-
|
|
302
|
-
firstLoading: true,
|
|
303
|
-
firstSetting: true,
|
|
304
|
-
systemProcing: false, //程式端載入/重載清單資料期間為 true, 用於排除非使用者操作之 rowsChange (見 $ui.markDataReload)
|
|
305
|
-
showIsEditable: false,
|
|
306
|
-
isEditable: false,
|
|
307
|
-
isModified: false,
|
|
308
|
-
|
|
309
|
-
tabKeys: [ //關聯欄之欄序: 本項自己管控的(管控使用權限)在左, 由上層帶過來的(管控所屬使用者)在右
|
|
310
|
-
'id',
|
|
311
|
-
'name',
|
|
312
|
-
'description',
|
|
313
|
-
'from',
|
|
314
|
-
'cpemis',
|
|
315
|
-
'belongUsers',
|
|
316
|
-
'userId',
|
|
317
|
-
'timeCreate',
|
|
318
|
-
'userIdUpdate',
|
|
319
|
-
'timeUpdate',
|
|
320
|
-
],
|
|
321
|
-
tabKeysPick: [
|
|
322
|
-
'name',
|
|
323
|
-
'description',
|
|
324
|
-
'from',
|
|
325
|
-
'cpemis',
|
|
326
|
-
'belongUsers',
|
|
327
|
-
'userId',
|
|
328
|
-
'timeCreate',
|
|
329
|
-
'userIdUpdate',
|
|
330
|
-
'timeUpdate',
|
|
331
|
-
],
|
|
332
|
-
tabKeysShow: [
|
|
333
|
-
'name',
|
|
334
|
-
'description',
|
|
335
|
-
// 'from',
|
|
336
|
-
'cpemis',
|
|
337
|
-
'belongUsers',
|
|
338
|
-
// 'userId',
|
|
339
|
-
// 'timeCreate',
|
|
340
|
-
// 'userIdUpdate',
|
|
341
|
-
// 'timeUpdate',
|
|
342
|
-
],
|
|
343
|
-
|
|
344
|
-
widthGrupsName: null,
|
|
345
|
-
widthGrupsDescription: null,
|
|
346
|
-
|
|
347
|
-
items: [],
|
|
348
|
-
itemsCheck: [],
|
|
349
|
-
opt: null,
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
mounted: function() {
|
|
354
|
-
// console.log('mounted')
|
|
355
|
-
|
|
356
|
-
let vo = this
|
|
357
|
-
|
|
358
|
-
//註冊至$dg供使用
|
|
359
|
-
vo.$dg.showVeGrupBlngUsersById = vo.showVeGrupBlngUsersById
|
|
360
|
-
vo.$dg.showVeCpemisById = vo.showVeCpemisById
|
|
361
|
-
|
|
362
|
-
//firstSetting
|
|
363
|
-
if (vo.firstSetting) {
|
|
364
|
-
// console.log('webInfor', vo.webInfor)
|
|
365
|
-
|
|
366
|
-
let showModeEditGrups = get(vo, 'webInfor.showModeEditGrups', '')
|
|
367
|
-
vo.showIsEditable = showModeEditGrups === 'y'
|
|
368
|
-
let modeEditGrups = get(vo, 'webInfor.modeEditGrups', '')
|
|
369
|
-
vo.isEditable = modeEditGrups === 'y'
|
|
370
|
-
|
|
371
|
-
vo.widthGrupsName = get(vo, 'webInfor.widthGrupsName', '')
|
|
372
|
-
vo.widthGrupsDescription = get(vo, 'webInfor.widthGrupsDescription', '')
|
|
373
|
-
|
|
374
|
-
//會觸發數據變更再導致opt變更導致觸發rowsChange等事件, 故得要延遲, 供組件偵測初始設定數據初始化之用
|
|
375
|
-
setTimeout(() => {
|
|
376
|
-
vo.firstSetting = false
|
|
377
|
-
// console.log('firstSetting', vo.firstSetting)
|
|
378
|
-
}, 1)
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
computed: {
|
|
384
|
-
|
|
385
|
-
syncState: function() {
|
|
386
|
-
let vo = this
|
|
387
|
-
return get(vo, '$store.state.syncState')
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
webInfor: function() {
|
|
391
|
-
let wi = get(this, `$store.state.webInfor`)
|
|
392
|
-
return wi
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
targets: function() {
|
|
396
|
-
let rs = get(this, `$store.state.targets`)
|
|
397
|
-
rs = sortBy(rs, 'order')
|
|
398
|
-
return rs
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
pemis: function() {
|
|
402
|
-
let rs = get(this, `$store.state.pemis`)
|
|
403
|
-
rs = sortBy(rs, 'order')
|
|
404
|
-
return rs
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
grups: function() {
|
|
408
|
-
let rs = get(this, `$store.state.grups`)
|
|
409
|
-
rs = sortBy(rs, 'order')
|
|
410
|
-
return rs
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
users: function() {
|
|
414
|
-
let rs = get(this, `$store.state.users`)
|
|
415
|
-
rs = sortBy(rs, 'order')
|
|
416
|
-
return rs
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
useUsers: function() {
|
|
420
|
-
let vo = this
|
|
421
|
-
|
|
422
|
-
//parse cgrups
|
|
423
|
-
let users = map(vo.users, (u) => {
|
|
424
|
-
|
|
425
|
-
//cloneDeep
|
|
426
|
-
u = cloneDeep(u)
|
|
427
|
-
|
|
428
|
-
//kpGrup
|
|
429
|
-
let kpGrup = {}
|
|
430
|
-
try {
|
|
431
|
-
// console.log('u.cgrups', u.cgrups)
|
|
432
|
-
kpGrup = JSON5.parse(u.cgrups)
|
|
433
|
-
}
|
|
434
|
-
catch (err) {}
|
|
435
|
-
|
|
436
|
-
//save kpGrup
|
|
437
|
-
u.kpGrup = kpGrup
|
|
438
|
-
|
|
439
|
-
return u
|
|
440
|
-
})
|
|
441
|
-
// console.log('users', users)
|
|
442
|
-
|
|
443
|
-
return users
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
kpGrupUser: function() {
|
|
447
|
-
let vo = this
|
|
448
|
-
|
|
449
|
-
//kp
|
|
450
|
-
let kp = {}
|
|
451
|
-
each(vo.useUsers, (u) => {
|
|
452
|
-
each(u.kpGrup, (v, k) => {
|
|
453
|
-
let isActive = get(v, 'isActive', '')
|
|
454
|
-
if (isActive !== 'y') {
|
|
455
|
-
return true //跳出換下一個
|
|
456
|
-
}
|
|
457
|
-
if (!haskey(kp, k)) {
|
|
458
|
-
kp[k] = []
|
|
459
|
-
}
|
|
460
|
-
kp[k].push({
|
|
461
|
-
user: u,
|
|
462
|
-
grup: v,
|
|
463
|
-
})
|
|
464
|
-
})
|
|
465
|
-
})
|
|
466
|
-
// console.log('kp', kp)
|
|
467
|
-
|
|
468
|
-
return kp
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
kpUseGrupUser: function() {
|
|
472
|
-
let vo = this
|
|
473
|
-
|
|
474
|
-
//_kp
|
|
475
|
-
let _kp = {}
|
|
476
|
-
each(vo.grups, (v, k) => {
|
|
477
|
-
_kp[v.name] = true
|
|
478
|
-
})
|
|
479
|
-
// console.log('_kp', _kp)
|
|
480
|
-
|
|
481
|
-
//kp
|
|
482
|
-
let kp = {}
|
|
483
|
-
each(vo.kpGrupUser, (v, k) => {
|
|
484
|
-
if (haskey(_kp, k)) {
|
|
485
|
-
kp[k] = v
|
|
486
|
-
}
|
|
487
|
-
})
|
|
488
|
-
// console.log('kp', kp)
|
|
489
|
-
|
|
490
|
-
return kp
|
|
491
|
-
},
|
|
492
|
-
|
|
493
|
-
changeParams: function() {
|
|
494
|
-
// console.log('computed changeParams')
|
|
495
|
-
|
|
496
|
-
let vo = this
|
|
497
|
-
|
|
498
|
-
//trigger
|
|
499
|
-
let isEditable = vo.isEditable
|
|
500
|
-
let grups = cloneDeep(vo.grups)
|
|
501
|
-
let kpUseGrupUser = cloneDeep(vo.kpUseGrupUser)
|
|
502
|
-
|
|
503
|
-
//items
|
|
504
|
-
let items = vo.genItems(grups, kpUseGrupUser)
|
|
505
|
-
|
|
506
|
-
//save
|
|
507
|
-
vo.items = items
|
|
508
|
-
|
|
509
|
-
//genOpt
|
|
510
|
-
vo.genOpt({ isEditable })
|
|
511
|
-
|
|
512
|
-
//firstLoading
|
|
513
|
-
vo.firstLoading = false
|
|
514
|
-
|
|
515
|
-
return ''
|
|
516
|
-
},
|
|
517
|
-
|
|
518
|
-
contentHeight: function() {
|
|
519
|
-
let vo = this
|
|
520
|
-
|
|
521
|
-
//h
|
|
522
|
-
let h = vo.panelHeight - vo.headHeight
|
|
523
|
-
h = Math.max(h, 0)
|
|
524
|
-
|
|
525
|
-
return h
|
|
526
|
-
},
|
|
527
|
-
|
|
528
|
-
hasItemsCheck: function() {
|
|
529
|
-
let vo = this
|
|
530
|
-
|
|
531
|
-
//h
|
|
532
|
-
let b = size(vo.itemsCheck) > 0
|
|
533
|
-
|
|
534
|
-
return b
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
hasItemCheckOne: function() {
|
|
538
|
-
let vo = this
|
|
539
|
-
|
|
540
|
-
//h
|
|
541
|
-
let b = size(vo.itemsCheck) === 1
|
|
542
|
-
|
|
543
|
-
return b
|
|
544
|
-
},
|
|
545
|
-
|
|
546
|
-
errItemsByName: function() {
|
|
547
|
-
let vo = this
|
|
548
|
-
|
|
549
|
-
//rows
|
|
550
|
-
let rows = get(vo, 'opt.rows', [])
|
|
551
|
-
|
|
552
|
-
//kpErr
|
|
553
|
-
let kpErr = {}
|
|
554
|
-
let kpName = {}
|
|
555
|
-
each(rows, (v, k) => {
|
|
556
|
-
|
|
557
|
-
//name
|
|
558
|
-
let name = get(v, 'name', '')
|
|
559
|
-
|
|
560
|
-
//check
|
|
561
|
-
if (!isestr(name)) {
|
|
562
|
-
|
|
563
|
-
//kpErr
|
|
564
|
-
kpErr[name] = vo.$t(`grupNameEmpty`)
|
|
565
|
-
|
|
566
|
-
return true //跳出換下一個
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
//check
|
|
570
|
-
if (haskey(kpName, name)) {
|
|
571
|
-
|
|
572
|
-
//kpErr
|
|
573
|
-
kpErr[name] = vo.$t(`grupNameDuplicate`)
|
|
574
|
-
|
|
575
|
-
return true //跳出換下一個
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
//kpName
|
|
579
|
-
kpName[name] = true
|
|
580
|
-
|
|
581
|
-
})
|
|
582
|
-
|
|
583
|
-
return kpErr
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
isError: function() {
|
|
587
|
-
let vo = this
|
|
588
|
-
|
|
589
|
-
let c = ''
|
|
590
|
-
let b = false
|
|
591
|
-
b = iseobj(vo.errItemsByName)
|
|
592
|
-
if (b) {
|
|
593
|
-
c = vo.$t('errInNames')
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
return c
|
|
597
|
-
},
|
|
598
|
-
|
|
599
|
-
kpHead: function() {
|
|
600
|
-
let vo = this
|
|
601
|
-
|
|
602
|
-
let kp = {
|
|
603
|
-
'id': vo.$t('id'),
|
|
604
|
-
'name': vo.$t('name'),
|
|
605
|
-
'description': vo.$t('description'),
|
|
606
|
-
'from': vo.$t('from'),
|
|
607
|
-
'belongUsers': vo.$t('belongUsers'),
|
|
608
|
-
'cpemis': vo.$t('grupCpemis'),
|
|
609
|
-
'userId': vo.$t('userId'),
|
|
610
|
-
'timeCreate': vo.$t('timeCreate'),
|
|
611
|
-
'userIdUpdate': vo.$t('userIdUpdate'),
|
|
612
|
-
'timeUpdate': vo.$t('timeUpdate'),
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
return kp
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
619
|
-
methods: {
|
|
620
|
-
|
|
621
|
-
resizePanel: function(msg) {
|
|
622
|
-
// console.log('methods resizePanel', msg)
|
|
623
|
-
|
|
624
|
-
let vo = this
|
|
625
|
-
|
|
626
|
-
//panelWidth, panelHeight
|
|
627
|
-
vo.panelHeight = msg.snew.offsetHeight
|
|
628
|
-
|
|
629
|
-
},
|
|
630
|
-
|
|
631
|
-
resizeHead: function(msg) {
|
|
632
|
-
// console.log('methods resizeHead', msg)
|
|
633
|
-
|
|
634
|
-
let vo = this
|
|
635
|
-
|
|
636
|
-
//headHeight
|
|
637
|
-
vo.headHeight = msg.snew.offsetHeight
|
|
638
|
-
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
getHead: function(key) {
|
|
642
|
-
// console.log('methods getHead', key)
|
|
643
|
-
|
|
644
|
-
let vo = this
|
|
645
|
-
|
|
646
|
-
let head = get(vo, `kpHead.${key}`, '')
|
|
647
|
-
|
|
648
|
-
return head
|
|
649
|
-
},
|
|
650
|
-
|
|
651
|
-
genOpt: function() {
|
|
652
|
-
// console.log('methods genOpt')
|
|
653
|
-
|
|
654
|
-
let vo = this
|
|
655
|
-
|
|
656
|
-
//default
|
|
657
|
-
vo.itemsCheck = []
|
|
658
|
-
|
|
659
|
-
//opt
|
|
660
|
-
let opt = null
|
|
661
|
-
if (size(vo.items) > 0) {
|
|
662
|
-
|
|
663
|
-
//ks
|
|
664
|
-
let ks = vo.tabKeys
|
|
665
|
-
// console.log('ks', ks)
|
|
666
|
-
|
|
667
|
-
//kpHead
|
|
668
|
-
let kpHead = vo.kpHead
|
|
669
|
-
|
|
670
|
-
//kpCellEditable, kpRowDrag, kpHeadCheckBox
|
|
671
|
-
let kpCellEditable = {}
|
|
672
|
-
let kpRowDrag = {}
|
|
673
|
-
let kpHeadCheckBox = {}
|
|
674
|
-
if (vo.isEditable) {
|
|
675
|
-
kpCellEditable = {
|
|
676
|
-
'name': true,
|
|
677
|
-
'description': true,
|
|
678
|
-
'from': true,
|
|
679
|
-
}
|
|
680
|
-
kpRowDrag = {
|
|
681
|
-
'name': true,
|
|
682
|
-
}
|
|
683
|
-
kpHeadCheckBox = {
|
|
684
|
-
'name': true,
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
//kpHeadHide
|
|
689
|
-
let kpHeadHide = {
|
|
690
|
-
'id': true,
|
|
691
|
-
}
|
|
692
|
-
if (true) {
|
|
693
|
-
let tabKeysHide = arrPull(vo.tabKeysPick, vo.tabKeysShow)
|
|
694
|
-
each(tabKeysHide, (k) => {
|
|
695
|
-
kpHeadHide[k] = true
|
|
696
|
-
})
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
//opt
|
|
700
|
-
opt = {
|
|
701
|
-
language: vo.$t('aggridLanguage'),
|
|
702
|
-
rows: vo.items,
|
|
703
|
-
keys: ks,
|
|
704
|
-
kpHead,
|
|
705
|
-
// autoFitColumn: true,
|
|
706
|
-
defCellEditable: false, //vo.isEditable,
|
|
707
|
-
defHeadFilter: true,
|
|
708
|
-
defCellAlignH: 'left',
|
|
709
|
-
kpHeadHide,
|
|
710
|
-
kpHeadFixLeft: {
|
|
711
|
-
'name': true,
|
|
712
|
-
},
|
|
713
|
-
defHeadMinWidth: 150,
|
|
714
|
-
kpHeadWidth: {
|
|
715
|
-
'name': isnum(vo.widthGrupsName) ? cdbl(vo.widthGrupsName) : 300,
|
|
716
|
-
'description': isnum(vo.widthGrupsDescription) ? cdbl(vo.widthGrupsDescription) : 300,
|
|
717
|
-
'belongUsers': 300,
|
|
718
|
-
'cpemis': 300,
|
|
719
|
-
'timeCreate': 220,
|
|
720
|
-
'timeUpdate': 220,
|
|
721
|
-
},
|
|
722
|
-
kpHeadFilterType: {
|
|
723
|
-
'id': 'text',
|
|
724
|
-
'name': 'text',
|
|
725
|
-
'description': 'text',
|
|
726
|
-
'from': 'text',
|
|
727
|
-
'belongUsers': 'text',
|
|
728
|
-
'cpemis': 'text',
|
|
729
|
-
'userId': 'text',
|
|
730
|
-
'timeCreate': 'text',
|
|
731
|
-
'userIdUpdate': 'text',
|
|
732
|
-
'timeUpdate': 'text',
|
|
733
|
-
},
|
|
734
|
-
kpCellEditable,
|
|
735
|
-
kpRowDrag,
|
|
736
|
-
kpHeadCheckBox,
|
|
737
|
-
kpHeadFilter: {
|
|
738
|
-
'belongUsers': false,
|
|
739
|
-
'cpemis': false,
|
|
740
|
-
},
|
|
741
|
-
kpHeadSort: {
|
|
742
|
-
'belongUsers': false,
|
|
743
|
-
'cpemis': false,
|
|
744
|
-
},
|
|
745
|
-
kpHeadFocusHighlight: { //雖然效果不完全, 但因按鈕與cell有padding可被點擊, 故還是需要開啟
|
|
746
|
-
'belongUsers': false,
|
|
747
|
-
'cpemis': false,
|
|
748
|
-
},
|
|
749
|
-
rowsChange: (rs) => {
|
|
750
|
-
// console.log('rowsChange', rs)
|
|
751
|
-
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
752
|
-
|
|
753
|
-
//check
|
|
754
|
-
if (!vo.syncState || vo.firstLoading || vo.firstSetting || vo.systemProcing) {
|
|
755
|
-
return
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
//isModified
|
|
759
|
-
vo.isModified = true
|
|
760
|
-
|
|
761
|
-
},
|
|
762
|
-
rowChecked: (rs) => {
|
|
763
|
-
// console.log('rowChecked', rs)
|
|
764
|
-
// console.log('rowChecked cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
765
|
-
|
|
766
|
-
//save itemsCheck
|
|
767
|
-
vo.itemsCheck = cloneDeep(rs)
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
}
|
|
771
|
-
// console.log('opt', opt)
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
//markDataReload, 重建 opt 屬程式端寫入, 其後非同步觸發之 rowsChange 不得視為使用者變更
|
|
776
|
-
vo.$ui.markDataReload(vo)
|
|
777
|
-
|
|
778
|
-
//save
|
|
779
|
-
vo.opt = opt
|
|
780
|
-
|
|
781
|
-
},
|
|
782
|
-
|
|
783
|
-
refresh: function() {
|
|
784
|
-
let vo = this
|
|
785
|
-
|
|
786
|
-
//cmp
|
|
787
|
-
let cmp = get(vo, '$refs.rftable')
|
|
788
|
-
// console.log('cmp', cmp)
|
|
789
|
-
|
|
790
|
-
//refresh, 因set不會觸發ag-grid重繪, 故須另外調用組件函數refresh(內為redrawRows)重繪各列, 使cell-render slot內容更新(w-aggrid-vue 2.0.56起以cell-render slot取代opt.kpCellRender)
|
|
791
|
-
cmp.refresh()
|
|
792
|
-
|
|
793
|
-
},
|
|
794
|
-
|
|
795
|
-
toggleTabKeys: function() {
|
|
796
|
-
let vo = this
|
|
797
|
-
|
|
798
|
-
//cmp
|
|
799
|
-
let cmp = get(vo, '$refs.rftable')
|
|
800
|
-
// console.log('cmp', cmp)
|
|
801
|
-
|
|
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
|
|
812
|
-
|
|
813
|
-
//items
|
|
814
|
-
let items = map(grups, (g) => {
|
|
815
|
-
|
|
816
|
-
//us
|
|
817
|
-
let us = []
|
|
818
|
-
if (haskey(kpUseGrupUser, g.name)) {
|
|
819
|
-
us = kpUseGrupUser[g.name]
|
|
820
|
-
}
|
|
821
|
-
// console.log('us', us)
|
|
822
|
-
|
|
823
|
-
//belongUsers
|
|
824
|
-
let belongUsers = vo.$t('grupBlngRnderNoUser')
|
|
825
|
-
let t = vo.$t('grupBlngRnderUsers')
|
|
826
|
-
let n = size(us)
|
|
827
|
-
if (n > 0) {
|
|
828
|
-
t = t.replace('{n}', n)
|
|
829
|
-
if (n === 1) {
|
|
830
|
-
t = t.replace('{nms}', `(${us[0].user.name})`)
|
|
831
|
-
}
|
|
832
|
-
else {
|
|
833
|
-
t = t.replace('{nms}', '')
|
|
834
|
-
}
|
|
835
|
-
belongUsers = t
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
//save belongUsers, us
|
|
839
|
-
g.belongUsers = belongUsers
|
|
840
|
-
g.us = us
|
|
841
|
-
// console.log('g', g)
|
|
842
|
-
|
|
843
|
-
return g
|
|
844
|
-
})
|
|
845
|
-
// console.log('items', items)
|
|
846
|
-
|
|
847
|
-
return items
|
|
848
|
-
},
|
|
849
|
-
|
|
850
|
-
addItem: function() {
|
|
851
|
-
// console.log('method addItem')
|
|
852
|
-
|
|
853
|
-
let vo = this
|
|
854
|
-
|
|
855
|
-
//cloneDeep
|
|
856
|
-
let rows = get(vo, 'opt.rows', [])
|
|
857
|
-
|
|
858
|
-
//cloneDeep
|
|
859
|
-
rows = cloneDeep(rows)
|
|
860
|
-
|
|
861
|
-
//r
|
|
862
|
-
let r = vo.$ds.grups.funNew()
|
|
863
|
-
r.name = vo.$s.getNameNew(rows, 'name', '', vo.$t('grupAddNameNew'))
|
|
864
|
-
r.userId = `{${vo.$t('grupAddIdNew')}}`
|
|
865
|
-
r.timeCreate = `{${vo.$t('grupAddIdNew')}}`
|
|
866
|
-
r.userIdUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
867
|
-
r.timeUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
868
|
-
// console.log('r', r)
|
|
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
|
-
|
|
879
|
-
//添加至最首
|
|
880
|
-
rows = [
|
|
881
|
-
r,
|
|
882
|
-
...rows,
|
|
883
|
-
]
|
|
884
|
-
|
|
885
|
-
//save
|
|
886
|
-
vo.opt.rows = rows
|
|
887
|
-
// console.log('cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
888
|
-
|
|
889
|
-
//isModified
|
|
890
|
-
vo.isModified = true
|
|
891
|
-
|
|
892
|
-
},
|
|
893
|
-
|
|
894
|
-
copyItem: function() {
|
|
895
|
-
// console.log('method copyItem')
|
|
896
|
-
|
|
897
|
-
let vo = this
|
|
898
|
-
|
|
899
|
-
//check
|
|
900
|
-
if (size(vo.itemsCheck) !== 1) {
|
|
901
|
-
console.log(`size(vo.itemsCheck) !== 1`, vo.itemsCheck)
|
|
902
|
-
vo.$alert(`${vo.$t('anUnexpectedErrorOccurred')}`, { type: 'error' })
|
|
903
|
-
return
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
//cloneDeep
|
|
907
|
-
let rows = get(vo, 'opt.rows', [])
|
|
908
|
-
|
|
909
|
-
//cloneDeep
|
|
910
|
-
rows = cloneDeep(rows)
|
|
911
|
-
|
|
912
|
-
//find
|
|
913
|
-
let tar = vo.itemsCheck[0]
|
|
914
|
-
let tarId = get(tar, 'data.id', '')
|
|
915
|
-
let row = null
|
|
916
|
-
each(rows, (v) => {
|
|
917
|
-
let id = get(v, 'id', '')
|
|
918
|
-
if (id === tarId) {
|
|
919
|
-
row = v
|
|
920
|
-
return false //跳出
|
|
921
|
-
}
|
|
922
|
-
})
|
|
923
|
-
// console.log('tar', tar)
|
|
924
|
-
// console.log('row', row)
|
|
925
|
-
|
|
926
|
-
//check
|
|
927
|
-
if (!iseobj(row)) {
|
|
928
|
-
console.log(`!iseobj(row)`, row)
|
|
929
|
-
vo.$alert(`${vo.$t('anUnexpectedErrorOccurred')}`, { type: 'error' })
|
|
930
|
-
return
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
//r
|
|
934
|
-
let r = cloneDeep(row)
|
|
935
|
-
let nameOld = r.name
|
|
936
|
-
let _r = vo.$ds.grups.funNew()
|
|
937
|
-
r.id = _r.id //使用新建方式預先產生id避免重複
|
|
938
|
-
r.name = vo.$s.getNameNew(rows, 'name', nameOld, vo.$t('grupCopyNameNew'))
|
|
939
|
-
r.userId = `{${vo.$t('grupAddIdNew')}}`
|
|
940
|
-
r.timeCreate = `{${vo.$t('grupAddIdNew')}}`
|
|
941
|
-
r.userIdUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
942
|
-
r.timeUpdate = `{${vo.$t('grupAddIdNew')}}`
|
|
943
|
-
// console.log('r', r)
|
|
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
|
-
|
|
954
|
-
//添加至最首
|
|
955
|
-
rows = [
|
|
956
|
-
r,
|
|
957
|
-
...rows,
|
|
958
|
-
]
|
|
959
|
-
|
|
960
|
-
//save
|
|
961
|
-
vo.opt.rows = rows
|
|
962
|
-
// console.log('cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
963
|
-
|
|
964
|
-
//isModified
|
|
965
|
-
vo.isModified = true
|
|
966
|
-
|
|
967
|
-
},
|
|
968
|
-
|
|
969
|
-
deleteItemsCheck: function() {
|
|
970
|
-
// console.log('method deleteItemsCheck')
|
|
971
|
-
|
|
972
|
-
let vo = this
|
|
973
|
-
|
|
974
|
-
//check
|
|
975
|
-
if (size(vo.itemsCheck) === 0) {
|
|
976
|
-
console.log(`size(vo.itemsCheck) === 0`, vo.itemsCheck)
|
|
977
|
-
vo.$alert(`${vo.$t('anUnexpectedErrorOccurred')}`, { type: 'error' })
|
|
978
|
-
return
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
//cloneDeep
|
|
982
|
-
let rows = get(vo, 'opt.rows', [])
|
|
983
|
-
|
|
984
|
-
//cloneDeep
|
|
985
|
-
rows = cloneDeep(rows)
|
|
986
|
-
|
|
987
|
-
//filter
|
|
988
|
-
each(vo.itemsCheck, (v) => {
|
|
989
|
-
// console.log('v', v)
|
|
990
|
-
let id = get(v, 'data.id', '')
|
|
991
|
-
if (!isestr(id)) {
|
|
992
|
-
console.log(`invalid id`)
|
|
993
|
-
return true //跳出換下一個
|
|
994
|
-
}
|
|
995
|
-
rows = filter(rows, (vv) => {
|
|
996
|
-
return vv.id !== id
|
|
997
|
-
})
|
|
998
|
-
})
|
|
999
|
-
|
|
1000
|
-
//clear
|
|
1001
|
-
vo.itemsCheck = []
|
|
1002
|
-
|
|
1003
|
-
//save
|
|
1004
|
-
vo.opt.rows = rows
|
|
1005
|
-
// console.log('deleteItemsCheck cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
1006
|
-
|
|
1007
|
-
//isModified
|
|
1008
|
-
vo.isModified = true
|
|
1009
|
-
|
|
1010
|
-
},
|
|
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
|
-
|
|
1035
|
-
getCpemisText: function(cpemis) {
|
|
1036
|
-
// console.log('method getCpemisText', cpemis)
|
|
1037
|
-
|
|
1038
|
-
let vo = this
|
|
1039
|
-
|
|
1040
|
-
//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)
|
|
1048
|
-
|
|
1049
|
-
//fltKpPemi
|
|
1050
|
-
kpPemi = vo.fltKpPemi(kpPemi)
|
|
1051
|
-
// console.log('kpPemi(fltKpPemi)', kpPemi)
|
|
1052
|
-
|
|
1053
|
-
//vs
|
|
1054
|
-
let vs = []
|
|
1055
|
-
each(kpPemi, (v, k) => {
|
|
1056
|
-
// console.log(k, 'v', v)
|
|
1057
|
-
|
|
1058
|
-
//isActive
|
|
1059
|
-
let isActive = get(v, 'isActive', '')
|
|
1060
|
-
if (isActive !== 'y') {
|
|
1061
|
-
return true //跳出換下一個
|
|
1062
|
-
}
|
|
1063
|
-
// console.log(k, '_isActive', _isActive)
|
|
1064
|
-
|
|
1065
|
-
//push
|
|
1066
|
-
vs.push(k)
|
|
1067
|
-
|
|
1068
|
-
})
|
|
1069
|
-
|
|
1070
|
-
//cpemisText
|
|
1071
|
-
let cpemisText = vo.$t('grupRnderCpemisNoPermission')
|
|
1072
|
-
let t = vo.$t('grupRnderCpemisHasNPermissions')
|
|
1073
|
-
let n = size(vs)
|
|
1074
|
-
if (n > 0) {
|
|
1075
|
-
t = t.replace('{n}', n)
|
|
1076
|
-
if (n === 1) {
|
|
1077
|
-
t = t.replace('{nms}', `(${vs[0]})`)
|
|
1078
|
-
}
|
|
1079
|
-
else {
|
|
1080
|
-
t = t.replace('{nms}', '')
|
|
1081
|
-
}
|
|
1082
|
-
cpemisText = t
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
return cpemisText
|
|
1086
|
-
},
|
|
1087
|
-
|
|
1088
|
-
showVeGrupBlngUsersById: function(id) {
|
|
1089
|
-
// console.log('method showVeGrupBlngUsersById', id)
|
|
1090
|
-
|
|
1091
|
-
let vo = this
|
|
1092
|
-
|
|
1093
|
-
//check
|
|
1094
|
-
if (!isestr(id)) {
|
|
1095
|
-
vo.$alert(`${vo.$t('grupEditBlngNoGrupId')}`, { type: 'error' })
|
|
1096
|
-
return
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
//rows
|
|
1100
|
-
let rows = get(vo, 'opt.rows', [])
|
|
1101
|
-
|
|
1102
|
-
//find
|
|
1103
|
-
let r = null
|
|
1104
|
-
// let kr = null
|
|
1105
|
-
each(rows, (v, k) => {
|
|
1106
|
-
if (get(v, 'id', '') === id) {
|
|
1107
|
-
r = v
|
|
1108
|
-
// kr = k
|
|
1109
|
-
return false //跳出
|
|
1110
|
-
}
|
|
1111
|
-
})
|
|
1112
|
-
// console.log('r', r)
|
|
1113
|
-
|
|
1114
|
-
//check
|
|
1115
|
-
if (!iseobj(r)) {
|
|
1116
|
-
vo.$alert(`${vo.$t('grupEditBlngNoGrupData')}`, { type: 'error' })
|
|
1117
|
-
return
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
//showVeGrupBlngUsers
|
|
1121
|
-
vo.$dg.showVeGrupBlngUsers({
|
|
1122
|
-
isEditable: vo.isEditable,
|
|
1123
|
-
grup: r,
|
|
1124
|
-
})
|
|
1125
|
-
.then(() => {})
|
|
1126
|
-
.catch(() => {})
|
|
1127
|
-
|
|
1128
|
-
},
|
|
1129
|
-
|
|
1130
|
-
showVeCpemisById: function(id) {
|
|
1131
|
-
// console.log('method showVeCpemisById', id)
|
|
1132
|
-
|
|
1133
|
-
let vo = this
|
|
1134
|
-
|
|
1135
|
-
//check
|
|
1136
|
-
if (!isestr(id)) {
|
|
1137
|
-
vo.$alert(`${vo.$t('grupEditBlngNoGrupId')}`, { type: 'error' })
|
|
1138
|
-
return
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
//rows
|
|
1142
|
-
let rows = get(vo, 'opt.rows', [])
|
|
1143
|
-
|
|
1144
|
-
//find
|
|
1145
|
-
let r = null
|
|
1146
|
-
let kr = null
|
|
1147
|
-
each(rows, (v, k) => {
|
|
1148
|
-
if (get(v, 'id', '') === id) {
|
|
1149
|
-
r = v
|
|
1150
|
-
kr = k
|
|
1151
|
-
return false //跳出
|
|
1152
|
-
}
|
|
1153
|
-
})
|
|
1154
|
-
|
|
1155
|
-
//check
|
|
1156
|
-
if (!iseobj(r)) {
|
|
1157
|
-
vo.$alert(`${vo.$t('grupEditBlngNoGrupData')}`, { type: 'error' })
|
|
1158
|
-
return
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
//showVeCpemis
|
|
1162
|
-
vo.$dg.showVeCpemis({
|
|
1163
|
-
isEditable: vo.isEditable,
|
|
1164
|
-
grup: r,
|
|
1165
|
-
})
|
|
1166
|
-
.then((cpemis) => {
|
|
1167
|
-
// console.log('cpemis', cpemis)
|
|
1168
|
-
|
|
1169
|
-
//set
|
|
1170
|
-
set(vo, `opt.rows[${kr}].cpemis`, cpemis)
|
|
1171
|
-
// console.log('vo.opt.rows[kr]', cloneDeep(vo.opt.rows[kr]))
|
|
1172
|
-
|
|
1173
|
-
//refresh
|
|
1174
|
-
vo.refresh()
|
|
1175
|
-
|
|
1176
|
-
//isModified
|
|
1177
|
-
vo.isModified = true
|
|
1178
|
-
|
|
1179
|
-
})
|
|
1180
|
-
.catch(() => {})
|
|
1181
|
-
|
|
1182
|
-
},
|
|
1183
|
-
|
|
1184
|
-
saveGrups: function(msg) {
|
|
1185
|
-
|
|
1186
|
-
let vo = this
|
|
1187
|
-
|
|
1188
|
-
//第一行立刻釋放按鈕視覺鎖
|
|
1189
|
-
msg.pm.resolve()
|
|
1190
|
-
|
|
1191
|
-
//fire-and-forget, 不 await
|
|
1192
|
-
vo.doSaveGrups()
|
|
1193
|
-
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
doSaveGrups: function() {
|
|
1197
|
-
// console.log('method doSaveGrups')
|
|
1198
|
-
|
|
1199
|
-
let vo = this
|
|
1200
|
-
|
|
1201
|
-
async function core() {
|
|
1202
|
-
|
|
1203
|
-
//1) 同步檢測 (在開 loading 之前)
|
|
1204
|
-
if (isestr(vo.isError)) {
|
|
1205
|
-
await vo.$dg.showCheckYes(`${vo.isError}`)
|
|
1206
|
-
return
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
//rows
|
|
1210
|
-
let rows = get(vo, 'opt.rows', [])
|
|
1211
|
-
|
|
1212
|
-
//check
|
|
1213
|
-
if (size(rows) === 0) {
|
|
1214
|
-
await vo.$dg.showCheckYes(`${vo.$t('grupAddEmpty')}`)
|
|
1215
|
-
return
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
//2) 確定打 API 才開 loading
|
|
1219
|
-
vo.$ui.updateLoading(true)
|
|
1220
|
-
|
|
1221
|
-
//3) updateGrups, 各自 catch + 旗標短路
|
|
1222
|
-
let okSave = false
|
|
1223
|
-
await vo.$fapi.updateGrups(rows)
|
|
1224
|
-
.then(() => { okSave = true })
|
|
1225
|
-
.catch(async (err) => {
|
|
1226
|
-
vo.$ui.updateLoading(false) //showCheckYes 前關 loading(modal 阻斷期間避免 loading 疊在底下)
|
|
1227
|
-
await vo.$dg.showCheckYes(`${vo.$t('grupSaveGrupsFail')}: ${vo.$tErr(err)}`)
|
|
1228
|
-
})
|
|
1229
|
-
if (!okSave) return
|
|
1230
|
-
|
|
1231
|
-
//isModified
|
|
1232
|
-
vo.isModified = false
|
|
1233
|
-
|
|
1234
|
-
//alert(showCheckYes 前關 loading,避免 modal 等待期間 loading 疊在底下)
|
|
1235
|
-
vo.$ui.updateLoading(false)
|
|
1236
|
-
await vo.$dg.showCheckYes(vo.$t('grupSaveGrupsSuccess'), { type: 'success' })
|
|
1237
|
-
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
//core
|
|
1241
|
-
core()
|
|
1242
|
-
.catch((err) => {
|
|
1243
|
-
console.log('catch', err)
|
|
1244
|
-
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
1245
|
-
})
|
|
1246
|
-
.finally(() => {
|
|
1247
|
-
|
|
1248
|
-
//hide loading
|
|
1249
|
-
vo.$ui.updateLoading(false)
|
|
1250
|
-
|
|
1251
|
-
})
|
|
1252
|
-
|
|
1253
|
-
},
|
|
1254
|
-
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
</script>
|
|
1258
|
-
|
|
1259
|
-
<style scoped>
|
|
1260
|
-
</style>
|