w-web-perm 1.0.4 → 1.0.6
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/README.md +9 -4
- package/dist/css/app.dad1d596.css +1 -0
- package/dist/index.tmp +1 -1
- package/dist/js/app-legacy.4e39a313.js +2 -0
- package/dist/js/app-legacy.4e39a313.js.map +1 -0
- package/dist/js/app.4e39a313.js +2 -0
- package/dist/js/app.4e39a313.js.map +1 -0
- package/dist/js/chunk-vendors-legacy.827f1c54.js +13 -0
- package/dist/js/chunk-vendors-legacy.827f1c54.js.map +1 -0
- package/dist/js/chunk-vendors.827f1c54.js +13 -0
- package/dist/js/chunk-vendors.827f1c54.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 +41 -5
- package/docs/WWebPerm.mjs.html +341 -25
- package/docs/index.html +1 -1
- package/{g.mDb.mjs → g.backupDb.mjs} +1 -1
- package/g.initialData.mjs +111 -0
- package/{g.mInitialTestData.mjs → g.initialTestData.mjs} +1 -1
- package/g.provideRuleGroups.mjs +56 -0
- package/g.provideTargets.mjs +57 -0
- package/g.provideUsers.mjs +45 -0
- package/package.json +2 -7
- package/public/index.html +1 -1
- package/server/WWebPerm.mjs +340 -24
- package/server/provideRuleGroups.mjs +65 -0
- package/server/provideTargets.mjs +59 -0
- package/server/provideUsers.mjs +68 -0
- package/src/App.vue +2 -10
- package/src/components/Common/CheckYes.vue +2 -2
- package/src/components/Common/CheckYesNo.vue +3 -3
- package/src/components/Common/LoadingWinBar.vue +1 -1
- package/src/components/LayoutContent.vue +37 -68
- package/src/components/LayoutContentGroups.vue +68 -62
- package/src/components/LayoutContentTargets.vue +56 -54
- package/src/components/LayoutContentUsers.vue +66 -61
- package/src/components/VeUser.vue +18 -26
- package/src/components/ruleGroup.vue +11 -11
- package/src/main.js +0 -2
- package/src/schema/tables/ruleGroups.mjs +11 -11
- package/src/schema/tables/targets.mjs +6 -9
- package/src/schema/tables/users.mjs +5 -5
- package/src/store/mutations.mjs +324 -69
- package/srv.mjs +10 -11
- package/tableTags-web-perm.json +1 -1
- package/vue.config.js +1 -1
- package/dist/css/app.79b4b59b.css +0 -1
- package/dist/css/chunk-vendors.99633b53.css +0 -5
- package/dist/js/app-legacy.48e6e535.js +0 -2
- package/dist/js/app-legacy.48e6e535.js.map +0 -1
- package/dist/js/app.7f6428ac.js +0 -2
- package/dist/js/app.7f6428ac.js.map +0 -1
- package/dist/js/chunk-vendors-legacy.7cb6c366.js +0 -13
- package/dist/js/chunk-vendors-legacy.7cb6c366.js.map +0 -1
- package/dist/js/chunk-vendors.7cb6c366.js +0 -13
- package/dist/js/chunk-vendors.7cb6c366.js.map +0 -1
- package/g.mInitialData.mjs +0 -147
- package/src/plugins/mVuetify.mjs +0 -12
|
@@ -7,37 +7,35 @@
|
|
|
7
7
|
>
|
|
8
8
|
|
|
9
9
|
<div
|
|
10
|
-
style="border-bottom:1px solid #ddd;"
|
|
10
|
+
style="border-bottom:1px solid #ddd; background:#fff;"
|
|
11
11
|
v-domresize
|
|
12
12
|
@domresize="resizeHead"
|
|
13
13
|
>
|
|
14
14
|
|
|
15
15
|
<!-- 標題區 -->
|
|
16
|
-
<div style="padding:
|
|
17
|
-
<div style="padding:5px 15px 5px 5px;
|
|
18
|
-
<div style="display:flex; align-items:center;">
|
|
16
|
+
<div style="display:inline-block; vertical-align:top; padding:10px 0px 5px 20px;">
|
|
17
|
+
<div style="display:flex; align-items:center; padding:5px 15px 5px 5px; border-bottom:3px solid #FF9100;">
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
|
|
26
|
-
管理區塊
|
|
27
|
-
</div>
|
|
19
|
+
<WIcon
|
|
20
|
+
:icon="mdiGamepadCircle"
|
|
21
|
+
:color="'#FF9800'"
|
|
22
|
+
></WIcon>
|
|
28
23
|
|
|
24
|
+
<div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
|
|
25
|
+
{{$t('managementTargets')}}
|
|
29
26
|
</div>
|
|
27
|
+
|
|
30
28
|
</div>
|
|
31
29
|
</div>
|
|
32
30
|
|
|
33
31
|
<!-- 編輯設定區 -->
|
|
34
|
-
<div style="
|
|
32
|
+
<div style="display:inline-block; vertical-align:top;">
|
|
35
33
|
|
|
36
|
-
<div style="padding:
|
|
34
|
+
<div style="padding:15px 20px 15px 20px; background:#fff;">
|
|
37
35
|
|
|
38
36
|
<div style="display:flex;">
|
|
39
37
|
<WSwitch
|
|
40
|
-
:text="'
|
|
38
|
+
:text="$t('isEditabled')"
|
|
41
39
|
:checkedSwitchCircleColor="'#D81B60'"
|
|
42
40
|
:checkedSwitchCircleColorHover="'#f26'"
|
|
43
41
|
:checkedSwitchBarColor="'#F8BBD0'"
|
|
@@ -50,40 +48,44 @@
|
|
|
50
48
|
|
|
51
49
|
<div style="padding-top:5px; font-size:0.8rem; _color:#f26;" v-if="isOperatable">
|
|
52
50
|
<div style="padding:3px 0px;">
|
|
53
|
-
1.
|
|
51
|
+
1. {{$t('targetMsg1')}}
|
|
54
52
|
</div>
|
|
55
53
|
<div style="padding:3px 0px;">
|
|
56
|
-
2.
|
|
54
|
+
2. {{$t('targetMsg2')}}
|
|
57
55
|
</div>
|
|
58
56
|
</div>
|
|
59
57
|
|
|
60
58
|
</div>
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
style="padding:10px 10px 12px 10px; border-top:1px solid #F48FB1; border-bottom:1px solid #F48FB1; background:#FCE4EC; display:flex; align-items:center; justify-content:flex-end;"
|
|
64
|
-
v-if="isModified"
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
<WButtonChip
|
|
68
|
-
:paddingStyle="{v:0,h:11}"
|
|
69
|
-
:text="'儲存變更'"
|
|
70
|
-
:icon="mdiCloudUploadOutline"
|
|
71
|
-
:backgroundColor="'rgba(255,0,50,0.7)'"
|
|
72
|
-
:backgroundColorHover="'rgba(255,0,50,0.8)'"
|
|
73
|
-
:textColor="'#eee'"
|
|
74
|
-
:textColorHover="'#fff'"
|
|
75
|
-
:iconColor="'#eee'"
|
|
76
|
-
:iconColorHover="'#fff'"
|
|
77
|
-
@click="saveRuleGroupsAndTargets"
|
|
78
|
-
></WButtonChip>
|
|
60
|
+
</div>
|
|
79
61
|
|
|
80
|
-
|
|
62
|
+
<!-- 儲存變更提示區 -->
|
|
63
|
+
<div
|
|
64
|
+
style="padding:10px 10px 12px 10px; border-top:1px solid #F48FB1; border-bottom:1px solid #F48FB1; background:#FCE4EC; display:flex; align-items:center; justify-content:flex-end;"
|
|
65
|
+
v-if="isModified"
|
|
66
|
+
>
|
|
67
|
+
|
|
68
|
+
<WButtonChip
|
|
69
|
+
:paddingStyle="{v:0,h:11}"
|
|
70
|
+
:text="$t('saveChanges')"
|
|
71
|
+
:icon="mdiCloudUploadOutline"
|
|
72
|
+
:backgroundColor="'rgba(255,0,50,0.7)'"
|
|
73
|
+
:backgroundColorHover="'rgba(255,0,50,0.8)'"
|
|
74
|
+
:textColor="'#eee'"
|
|
75
|
+
:textColorHover="'#fff'"
|
|
76
|
+
:iconColor="'#eee'"
|
|
77
|
+
:iconColorHover="'#fff'"
|
|
78
|
+
@click="saveRuleGroupsAndTargets"
|
|
79
|
+
></WButtonChip>
|
|
81
80
|
|
|
82
81
|
</div>
|
|
83
82
|
|
|
84
83
|
</div>
|
|
85
84
|
|
|
86
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
:style="`padding:${spacePading}px;`"
|
|
87
|
+
v-if="!firstLoading"
|
|
88
|
+
>
|
|
87
89
|
|
|
88
90
|
<div style="background:#fff; box-shadow:0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);">
|
|
89
91
|
<WTree
|
|
@@ -96,16 +98,16 @@
|
|
|
96
98
|
:iconToggleBackgroundColor="'transparent'"
|
|
97
99
|
:iconToggleBackgroundColorHover="'transparent'"
|
|
98
100
|
:operatable="isOperatable"
|
|
99
|
-
:operateBtnTooltip="'
|
|
100
|
-
:operateItemTextForRename="'
|
|
101
|
-
:operateItemTextForInsertBefore="'
|
|
102
|
-
:operateItemTextForInsertChild="'
|
|
103
|
-
:operateItemTextForInsertAfter="'
|
|
104
|
-
:operateItemTextForDelete="'
|
|
105
|
-
:editorRenameSaveBtnText="'
|
|
101
|
+
:operateBtnTooltip="$t('edit')"
|
|
102
|
+
:operateItemTextForRename="$t('changeName')"
|
|
103
|
+
:operateItemTextForInsertBefore="$t('insertBefore')"
|
|
104
|
+
:operateItemTextForInsertChild="$t('insertChild')"
|
|
105
|
+
:operateItemTextForInsertAfter="$t('insertAfter')"
|
|
106
|
+
:operateItemTextForDelete="$t('deleteTarget')"
|
|
107
|
+
:editorRenameSaveBtnText="$t('save')"
|
|
106
108
|
:editorRenameSaveBtnTextColor="'#444'"
|
|
107
109
|
:editorRenameSaveBtnTextColorHover="'#222'"
|
|
108
|
-
:editorRenameCancelBtnText="'
|
|
110
|
+
:editorRenameCancelBtnText="$t('cancel')"
|
|
109
111
|
:editorRenameCancelBtnTextColor="'#444'"
|
|
110
112
|
:editorRenameCancelBtnTextColorHover="'#222'"
|
|
111
113
|
@click-operate-item="clickOperateItem"
|
|
@@ -115,7 +117,7 @@
|
|
|
115
117
|
</div>
|
|
116
118
|
|
|
117
119
|
<div style="padding:10px 15px; font-size:0.8rem;" v-else>
|
|
118
|
-
|
|
120
|
+
{{$t('waitingData')}}
|
|
119
121
|
</div>
|
|
120
122
|
|
|
121
123
|
</div>
|
|
@@ -168,7 +170,7 @@ export default {
|
|
|
168
170
|
headHeight: 100,
|
|
169
171
|
|
|
170
172
|
firstLoading: true,
|
|
171
|
-
isOperatable:
|
|
173
|
+
isOperatable: true,
|
|
172
174
|
isModified: false,
|
|
173
175
|
|
|
174
176
|
treeBlocks: null,
|
|
@@ -312,7 +314,7 @@ export default {
|
|
|
312
314
|
// })
|
|
313
315
|
.catch((err) => {
|
|
314
316
|
console.log('catch', err)
|
|
315
|
-
vo.$alert(
|
|
317
|
+
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
316
318
|
})
|
|
317
319
|
.finally(() => {
|
|
318
320
|
|
|
@@ -333,7 +335,7 @@ export default {
|
|
|
333
335
|
//fun, 僅處理並回傳新項目, 不處理其他項目
|
|
334
336
|
let fun = async function() {
|
|
335
337
|
let id = genID()
|
|
336
|
-
let text = '
|
|
338
|
+
let text = vo.$t('newTarget')
|
|
337
339
|
let dataNew = {
|
|
338
340
|
id,
|
|
339
341
|
text,
|
|
@@ -359,7 +361,7 @@ export default {
|
|
|
359
361
|
// })
|
|
360
362
|
.catch((err) => {
|
|
361
363
|
console.log('catch', err)
|
|
362
|
-
vo.$alert(
|
|
364
|
+
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
363
365
|
})
|
|
364
366
|
|
|
365
367
|
},
|
|
@@ -474,7 +476,7 @@ export default {
|
|
|
474
476
|
|
|
475
477
|
//check
|
|
476
478
|
if (errTemp !== null) {
|
|
477
|
-
vo.$alert(
|
|
479
|
+
vo.$alert(`${vo.$t('failedToChangePermissionGroups')}: ${errTemp}`, { type: 'error' })
|
|
478
480
|
return
|
|
479
481
|
}
|
|
480
482
|
|
|
@@ -495,7 +497,7 @@ export default {
|
|
|
495
497
|
|
|
496
498
|
//check
|
|
497
499
|
if (errTemp !== null) {
|
|
498
|
-
vo.$alert(
|
|
500
|
+
vo.$alert(`${vo.$t('failedToClearTargets')}: ${errTemp}`, { type: 'error' })
|
|
499
501
|
return
|
|
500
502
|
}
|
|
501
503
|
|
|
@@ -507,7 +509,7 @@ export default {
|
|
|
507
509
|
|
|
508
510
|
//check
|
|
509
511
|
if (errTemp !== null) {
|
|
510
|
-
vo.$alert(
|
|
512
|
+
vo.$alert(`${vo.$t('failedToSaveTargets')}: ${errTemp}`, { type: 'error' })
|
|
511
513
|
return
|
|
512
514
|
}
|
|
513
515
|
|
|
@@ -515,7 +517,7 @@ export default {
|
|
|
515
517
|
vo.isModified = false
|
|
516
518
|
|
|
517
519
|
//alert
|
|
518
|
-
vo.$alert(
|
|
520
|
+
vo.$alert(vo.$t('successfulToSaveTargets'))
|
|
519
521
|
|
|
520
522
|
}
|
|
521
523
|
|
|
@@ -526,7 +528,7 @@ export default {
|
|
|
526
528
|
// })
|
|
527
529
|
.catch((err) => {
|
|
528
530
|
console.log('catch', err)
|
|
529
|
-
vo.$alert(
|
|
531
|
+
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
530
532
|
})
|
|
531
533
|
.finally(() => {
|
|
532
534
|
|
|
@@ -7,37 +7,35 @@
|
|
|
7
7
|
>
|
|
8
8
|
|
|
9
9
|
<div
|
|
10
|
-
style="border-bottom:1px solid #ddd;"
|
|
10
|
+
style="border-bottom:1px solid #ddd; background:#fff;"
|
|
11
11
|
v-domresize
|
|
12
12
|
@domresize="resizeHead"
|
|
13
13
|
>
|
|
14
14
|
|
|
15
15
|
<!-- 標題區 -->
|
|
16
|
-
<div style="padding:
|
|
17
|
-
<div style="padding:5px 15px 5px 5px;
|
|
18
|
-
<div style="display:flex; align-items:center;">
|
|
16
|
+
<div style="display:inline-block; vertical-align:top; padding:10px 0px 5px 20px;">
|
|
17
|
+
<div style="display:flex; align-items:center; padding:5px 15px 5px 5px; border-bottom:3px solid #FF9100;">
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
|
|
26
|
-
使用者權限
|
|
27
|
-
</div>
|
|
19
|
+
<WIcon
|
|
20
|
+
:icon="mdiAccountGroupOutline"
|
|
21
|
+
:color="'#FF9800'"
|
|
22
|
+
></WIcon>
|
|
28
23
|
|
|
24
|
+
<div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
|
|
25
|
+
{{$t('userPermissions')}}
|
|
29
26
|
</div>
|
|
27
|
+
|
|
30
28
|
</div>
|
|
31
29
|
</div>
|
|
32
30
|
|
|
33
31
|
<!-- 編輯設定區 -->
|
|
34
|
-
<div style="
|
|
32
|
+
<div style="display:inline-block; vertical-align:top;">
|
|
35
33
|
|
|
36
|
-
<div style="padding:
|
|
34
|
+
<div style="padding:15px 20px 15px 20px; background:#fff;">
|
|
37
35
|
|
|
38
36
|
<div style="display:flex;">
|
|
39
37
|
<WSwitch
|
|
40
|
-
:text="'
|
|
38
|
+
:text="$t('isEditabled')"
|
|
41
39
|
:checkedSwitchCircleColor="'#D81B60'"
|
|
42
40
|
:checkedSwitchCircleColorHover="'#f26'"
|
|
43
41
|
:checkedSwitchBarColor="'#F8BBD0'"
|
|
@@ -48,60 +46,65 @@
|
|
|
48
46
|
|
|
49
47
|
<div style="padding-top:5px; font-size:0.8rem; _color:#f26;" v-if="isOperatable">
|
|
50
48
|
<div style="padding:3px 0px;">
|
|
51
|
-
1.
|
|
49
|
+
1. {{$t('userMsg1')}}
|
|
52
50
|
</div>
|
|
53
51
|
<div style="padding:3px 0px;">
|
|
54
|
-
2.
|
|
52
|
+
2. {{$t('userMsg2')}}
|
|
55
53
|
</div>
|
|
56
54
|
</div>
|
|
57
55
|
|
|
58
56
|
</div>
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
style="padding:10px 10px 12px 10px; border-top:1px solid #F48FB1; border-bottom:1px solid #F48FB1; background:#FCE4EC; display:flex; align-items:center; justify-content:flex-end;"
|
|
62
|
-
v-if="isModified"
|
|
63
|
-
>
|
|
58
|
+
</div>
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
<!-- 儲存變更提示區 -->
|
|
61
|
+
<div
|
|
62
|
+
style="padding:10px 10px 12px 10px; border-top:1px solid #F48FB1; border-bottom:1px solid #F48FB1; background:#FCE4EC; display:flex; align-items:center; justify-content:flex-end;"
|
|
63
|
+
v-if="isModified"
|
|
64
|
+
>
|
|
65
|
+
|
|
66
|
+
<WButtonChip
|
|
67
|
+
:paddingStyle="{v:0,h:11}"
|
|
68
|
+
:text="$t('saveChanges')"
|
|
69
|
+
:icon="mdiCloudUploadOutline"
|
|
70
|
+
:backgroundColor="'rgba(255,0,50,0.7)'"
|
|
71
|
+
:backgroundColorHover="'rgba(255,0,50,0.8)'"
|
|
72
|
+
:textColor="'#eee'"
|
|
73
|
+
:textColorHover="'#fff'"
|
|
74
|
+
:iconColor="'#eee'"
|
|
75
|
+
:iconColorHover="'#fff'"
|
|
76
|
+
@click="saveGroups"
|
|
77
|
+
></WButtonChip>
|
|
79
78
|
|
|
80
79
|
</div>
|
|
81
80
|
|
|
82
81
|
</div>
|
|
83
82
|
|
|
84
|
-
<div
|
|
83
|
+
<div
|
|
84
|
+
:style="`padding:${spacePading}px;`"
|
|
85
|
+
v-if="!firstLoading"
|
|
86
|
+
>
|
|
85
87
|
|
|
86
88
|
<div style="background:#fff; box-shadow:0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);">
|
|
87
89
|
|
|
88
90
|
<div
|
|
89
|
-
style="padding:20px
|
|
91
|
+
style="padding:20px 10px 10px 20px; border-bottom:3px solid #ddd;"
|
|
90
92
|
v-domresize
|
|
91
93
|
@domresize="resizeGroupInfor"
|
|
92
94
|
>
|
|
93
95
|
|
|
94
|
-
<div style="color:#666; font-size:1.1rem;">
|
|
95
|
-
|
|
96
|
+
<div style="padding:0px 10px 10px 0px; display:inline-block; vertical-align:middle; color:#666; font-size:1.1rem;">
|
|
97
|
+
{{$t('userList')}}
|
|
96
98
|
</div>
|
|
97
99
|
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
<div
|
|
101
|
+
style="padding:0px 10px 10px 0px; display:inline-block; vertical-align:middle;"
|
|
102
|
+
v-if="isOperatable"
|
|
103
|
+
>
|
|
101
104
|
|
|
102
105
|
<WButtonChip
|
|
103
106
|
:paddingStyle="{v:0,h:11}"
|
|
104
|
-
:text="'
|
|
107
|
+
:text="$t('addUser')"
|
|
105
108
|
:icon="mdiAccountPlusOutline"
|
|
106
109
|
:backgroundColor="'rgba(255,0,50,0.7)'"
|
|
107
110
|
:backgroundColorHover="'rgba(255,0,50,0.8)'"
|
|
@@ -112,7 +115,7 @@
|
|
|
112
115
|
@click="clickAddUser"
|
|
113
116
|
></WButtonChip>
|
|
114
117
|
|
|
115
|
-
</
|
|
118
|
+
</div>
|
|
116
119
|
|
|
117
120
|
</div>
|
|
118
121
|
|
|
@@ -129,7 +132,7 @@
|
|
|
129
132
|
|
|
130
133
|
<div style="padding-bottom:5px; display:flex; align-items:center; border-bottom:1px dashed #ddd;">
|
|
131
134
|
<div style="padding-right:5px; color:#888; font-size:0.8rem;">
|
|
132
|
-
|
|
135
|
+
{{$t('from')}}:
|
|
133
136
|
</div>
|
|
134
137
|
<div style="color:#000; font-size:0.8rem;">
|
|
135
138
|
{{getFrom(kus)}}
|
|
@@ -147,7 +150,7 @@
|
|
|
147
150
|
<WButtonChip
|
|
148
151
|
:text="u.name"
|
|
149
152
|
:paddingStyle="{
|
|
150
|
-
v:
|
|
153
|
+
v: 2,
|
|
151
154
|
h: 12,
|
|
152
155
|
}"
|
|
153
156
|
:icon="getIsAdmin(u)?mdiChessRook:''"
|
|
@@ -157,7 +160,7 @@
|
|
|
157
160
|
:textColorHover="'#fff'"
|
|
158
161
|
:iconColor="'#eee'"
|
|
159
162
|
:iconColorHover="'#fff'"
|
|
160
|
-
:close="isOperatable
|
|
163
|
+
:close="isOperatable"
|
|
161
164
|
@click="clickEditUser(u)"
|
|
162
165
|
@click-close="clickRemoveUser(u)"
|
|
163
166
|
></WButtonChip>
|
|
@@ -176,7 +179,7 @@
|
|
|
176
179
|
</div>
|
|
177
180
|
|
|
178
181
|
<div style="padding:10px 15px; font-size:0.8rem;" v-else>
|
|
179
|
-
|
|
182
|
+
{{$t('waitingData')}}
|
|
180
183
|
</div>
|
|
181
184
|
|
|
182
185
|
</div>
|
|
@@ -223,7 +226,7 @@ export default {
|
|
|
223
226
|
groupInforHeight: 100,
|
|
224
227
|
|
|
225
228
|
firstLoading: true,
|
|
226
|
-
isOperatable:
|
|
229
|
+
isOperatable: true,
|
|
227
230
|
isModified: false,
|
|
228
231
|
|
|
229
232
|
pickGroupId: '',
|
|
@@ -321,8 +324,9 @@ export default {
|
|
|
321
324
|
|
|
322
325
|
getFrom: function(kus) {
|
|
323
326
|
// console.log('methods getFrom', kus)
|
|
327
|
+
let vo = this
|
|
324
328
|
if (!isestr(kus)) {
|
|
325
|
-
kus = '
|
|
329
|
+
kus = vo.$t('empty')
|
|
326
330
|
}
|
|
327
331
|
return kus
|
|
328
332
|
},
|
|
@@ -349,9 +353,8 @@ export default {
|
|
|
349
353
|
//u
|
|
350
354
|
let u = {
|
|
351
355
|
id: genID(),
|
|
352
|
-
name: '
|
|
356
|
+
name: vo.$t('newUser'),
|
|
353
357
|
from: '',
|
|
354
|
-
isVirtual: 'n', //新增使用者代表為權限使用者, 故非虛擬使用者
|
|
355
358
|
isAdmin: 'n',
|
|
356
359
|
isActive: 'y',
|
|
357
360
|
}
|
|
@@ -364,7 +367,7 @@ export default {
|
|
|
364
367
|
|
|
365
368
|
//check
|
|
366
369
|
if (errTemp !== null) {
|
|
367
|
-
vo.$alert(
|
|
370
|
+
vo.$alert(`${vo.$t('failedToAddUser')}: ${errTemp}`, { type: 'error' })
|
|
368
371
|
}
|
|
369
372
|
|
|
370
373
|
//un
|
|
@@ -380,7 +383,7 @@ export default {
|
|
|
380
383
|
.catch(() => {})
|
|
381
384
|
|
|
382
385
|
//alert
|
|
383
|
-
vo.$alert(
|
|
386
|
+
vo.$alert(vo.$t('successfulToAddUser'))
|
|
384
387
|
|
|
385
388
|
}
|
|
386
389
|
|
|
@@ -391,7 +394,7 @@ export default {
|
|
|
391
394
|
// })
|
|
392
395
|
.catch((err) => {
|
|
393
396
|
console.log('catch', err)
|
|
394
|
-
vo.$alert(
|
|
397
|
+
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
395
398
|
})
|
|
396
399
|
.finally(() => {
|
|
397
400
|
|
|
@@ -412,7 +415,9 @@ export default {
|
|
|
412
415
|
|
|
413
416
|
//showCheckYesNo
|
|
414
417
|
let bExit = false
|
|
415
|
-
|
|
418
|
+
let t_confirmToDeleteUser = vo.$t('confirmToDeleteUser')
|
|
419
|
+
t_confirmToDeleteUser = t_confirmToDeleteUser.replace('{name}', u.name)
|
|
420
|
+
await vo.$dg.showCheckYesNo(t_confirmToDeleteUser)
|
|
416
421
|
.catch(() => {
|
|
417
422
|
bExit = true
|
|
418
423
|
})
|
|
@@ -431,7 +436,7 @@ export default {
|
|
|
431
436
|
|
|
432
437
|
//check
|
|
433
438
|
if (errTemp !== null) {
|
|
434
|
-
vo.$alert(
|
|
439
|
+
vo.$alert(`${vo.$t('failedToDeleteUser')}: ${errTemp}`, { type: 'error' })
|
|
435
440
|
return
|
|
436
441
|
}
|
|
437
442
|
|
|
@@ -439,14 +444,14 @@ export default {
|
|
|
439
444
|
let un = null
|
|
440
445
|
await waitFun(() => {
|
|
441
446
|
un = find(vo.users, (v) => {
|
|
442
|
-
return v.id === u.id
|
|
447
|
+
return v.id === u.id
|
|
443
448
|
})
|
|
444
449
|
return !iseobj(un) //確認g.id已不存在
|
|
445
450
|
})
|
|
446
451
|
// console.log('un', un)
|
|
447
452
|
|
|
448
453
|
//alert
|
|
449
|
-
vo.$alert(
|
|
454
|
+
vo.$alert(vo.$t('successfulToDeleteUser'))
|
|
450
455
|
|
|
451
456
|
}
|
|
452
457
|
|
|
@@ -457,7 +462,7 @@ export default {
|
|
|
457
462
|
// })
|
|
458
463
|
.catch((err) => {
|
|
459
464
|
console.log('catch', err)
|
|
460
|
-
vo.$alert(
|
|
465
|
+
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
461
466
|
})
|
|
462
467
|
.finally(() => {
|
|
463
468
|
|
|
@@ -475,7 +480,7 @@ export default {
|
|
|
475
480
|
|
|
476
481
|
//check
|
|
477
482
|
if (!vo.isOperatable) {
|
|
478
|
-
vo.$alert(
|
|
483
|
+
vo.$alert(vo.$t('cannotShowUserDetailsInViewMode'), { type: 'error' })
|
|
479
484
|
return
|
|
480
485
|
}
|
|
481
486
|
|