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.
Files changed (58) hide show
  1. package/README.md +9 -4
  2. package/dist/css/app.dad1d596.css +1 -0
  3. package/dist/index.tmp +1 -1
  4. package/dist/js/app-legacy.4e39a313.js +2 -0
  5. package/dist/js/app-legacy.4e39a313.js.map +1 -0
  6. package/dist/js/app.4e39a313.js +2 -0
  7. package/dist/js/app.4e39a313.js.map +1 -0
  8. package/dist/js/chunk-vendors-legacy.827f1c54.js +13 -0
  9. package/dist/js/chunk-vendors-legacy.827f1c54.js.map +1 -0
  10. package/dist/js/chunk-vendors.827f1c54.js +13 -0
  11. package/dist/js/chunk-vendors.827f1c54.js.map +1 -0
  12. package/dist/w-web-perm.umd.js +2 -2
  13. package/dist/w-web-perm.umd.js.map +1 -1
  14. package/docs/WWebPerm.html +41 -5
  15. package/docs/WWebPerm.mjs.html +341 -25
  16. package/docs/index.html +1 -1
  17. package/{g.mDb.mjs → g.backupDb.mjs} +1 -1
  18. package/g.initialData.mjs +111 -0
  19. package/{g.mInitialTestData.mjs → g.initialTestData.mjs} +1 -1
  20. package/g.provideRuleGroups.mjs +56 -0
  21. package/g.provideTargets.mjs +57 -0
  22. package/g.provideUsers.mjs +45 -0
  23. package/package.json +2 -7
  24. package/public/index.html +1 -1
  25. package/server/WWebPerm.mjs +340 -24
  26. package/server/provideRuleGroups.mjs +65 -0
  27. package/server/provideTargets.mjs +59 -0
  28. package/server/provideUsers.mjs +68 -0
  29. package/src/App.vue +2 -10
  30. package/src/components/Common/CheckYes.vue +2 -2
  31. package/src/components/Common/CheckYesNo.vue +3 -3
  32. package/src/components/Common/LoadingWinBar.vue +1 -1
  33. package/src/components/LayoutContent.vue +37 -68
  34. package/src/components/LayoutContentGroups.vue +68 -62
  35. package/src/components/LayoutContentTargets.vue +56 -54
  36. package/src/components/LayoutContentUsers.vue +66 -61
  37. package/src/components/VeUser.vue +18 -26
  38. package/src/components/ruleGroup.vue +11 -11
  39. package/src/main.js +0 -2
  40. package/src/schema/tables/ruleGroups.mjs +11 -11
  41. package/src/schema/tables/targets.mjs +6 -9
  42. package/src/schema/tables/users.mjs +5 -5
  43. package/src/store/mutations.mjs +324 -69
  44. package/srv.mjs +10 -11
  45. package/tableTags-web-perm.json +1 -1
  46. package/vue.config.js +1 -1
  47. package/dist/css/app.79b4b59b.css +0 -1
  48. package/dist/css/chunk-vendors.99633b53.css +0 -5
  49. package/dist/js/app-legacy.48e6e535.js +0 -2
  50. package/dist/js/app-legacy.48e6e535.js.map +0 -1
  51. package/dist/js/app.7f6428ac.js +0 -2
  52. package/dist/js/app.7f6428ac.js.map +0 -1
  53. package/dist/js/chunk-vendors-legacy.7cb6c366.js +0 -13
  54. package/dist/js/chunk-vendors-legacy.7cb6c366.js.map +0 -1
  55. package/dist/js/chunk-vendors.7cb6c366.js +0 -13
  56. package/dist/js/chunk-vendors.7cb6c366.js.map +0 -1
  57. package/g.mInitialData.mjs +0 -147
  58. package/src/plugins/mVuetify.mjs +0 -12
package/src/App.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-app
2
+ <div
3
3
  v-domresize
4
4
  @domresize="resize"
5
5
  >
@@ -16,7 +16,7 @@
16
16
 
17
17
  <VeUser></VeUser>
18
18
 
19
- </v-app>
19
+ </div>
20
20
  </template>
21
21
 
22
22
  <script>
@@ -124,14 +124,6 @@ button {
124
124
  font-family: inherit;
125
125
  }
126
126
 
127
- .v-application, .v-application--wrap {
128
- font-family: inherit;
129
- }
130
-
131
- .v-chip {
132
- cursor: inherit;
133
- }
134
-
135
127
  .fade-enter-active {
136
128
  animation: go 1s;
137
129
  }
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <WConfirm
3
3
  :show.sync="bShow"
4
- :title="'系統確認訊息'"
4
+ :title="$t('systemMessage')"
5
5
  :content="content"
6
6
  :_contentColor="'white'"
7
7
  :_contentIconColor="'white'"
8
8
  :_contentBackgroundColor="'orange lighten-5'"
9
9
  :headerBackgroundColor="'grey lighten-3'"
10
10
  :hasNoBtn="false"
11
- :yesBtnText="'確認'"
11
+ :yesBtnText="$t('ok')"
12
12
  @click-yes="clickUnit()"
13
13
  ></WConfirm>
14
14
  </template>
@@ -1,15 +1,15 @@
1
1
  <template>
2
2
  <WConfirm
3
3
  :show.sync="bShow"
4
- :title="'系統確認訊息'"
4
+ :title="$t('systemMessage')"
5
5
  :content="content"
6
6
  :_contentColor="'white'"
7
7
  :_contentIconColor="'white'"
8
8
  :_contentBackgroundColor="'orange lighten-5'"
9
9
  :_titleColor="'white'"
10
10
  :headerBackgroundColor="'grey lighten-3'"
11
- :noBtnText="'取消'"
12
- :yesBtnText="'確定'"
11
+ :noBtnText="$t('no')"
12
+ :yesBtnText="$t('yes')"
13
13
  @click-no="clickBtn(false)"
14
14
  @click-yes="clickBtn(true)"
15
15
  ></WConfirm>
@@ -13,7 +13,7 @@
13
13
 
14
14
  <span v-if="msg!==''">{{msg}}</span>
15
15
 
16
- <span v-else>處理中請稍後...</span>
16
+ <span v-else>{{$t('processing')}}</span>
17
17
 
18
18
  </div>
19
19
 
@@ -14,14 +14,13 @@
14
14
  :drawerWidthMin="drawerWidthMin"
15
15
  :drawerWidthMax="drawerWidthMax"
16
16
  :mode="'from-left'"
17
- :afloat="drawerAfloat"
18
17
  :dragDrawerWidth="true"
18
+ :autoSwitch="true"
19
+ :switchWidth="drawerWidth*2.3"
19
20
  >
20
21
 
21
22
  <template v-slot:drawer="props">
22
-
23
- <!-- 因drawer內部resize觸發可能不足或有容許誤差, 使用props.height可能會有多1px情形, 導致出現垂直捲軸 -->
24
- <div :style="`height:${panelHeight}px; background:#fff; position:relative;`">
23
+ <div :style="`height:${props.height}px; background:#fff; position:relative;`">
25
24
 
26
25
  <WListVertical
27
26
  style="height:100%;"
@@ -61,17 +60,15 @@
61
60
  </div>
62
61
 
63
62
  </div>
64
-
65
63
  </template>
66
64
 
67
65
  <template v-slot:content="props">
68
- <!-- 因drawer內部resize觸發可能不足或有容許誤差, 使用props.height可能會有多1px情形, 導致出現垂直捲軸 -->
69
- <div :style="`height:${panelHeight}px; width:${props.width}px; position:relative;`">
66
+ <div :style="`height:${props.height}px; width:${props.width}px; position:relative;`">
70
67
 
71
68
  <template>
72
69
 
73
70
  <LayoutContentTargets
74
- v-if="menuKey==='blocks'"
71
+ v-if="menuKey==='targets'"
75
72
  ></LayoutContentTargets>
76
73
 
77
74
  <LayoutContentGroups
@@ -123,12 +120,9 @@
123
120
  </template>
124
121
 
125
122
  <script>
126
- import { mdiGamepadCircle, mdiStackOverflow, mdiAccountGroupOutline, mdiBallotRecountOutline } from '@mdi/js/mdi.js'
123
+ import { mdiGamepadCircle, mdiStackOverflow, mdiAccountGroupOutline } from '@mdi/js/mdi.js'
127
124
  import get from 'lodash/get'
128
- // import map from 'lodash/map'
129
- // import each from 'lodash/each'
130
- // import cloneDeep from 'lodash/cloneDeep'
131
- // import pmSeries from 'wsemi/src/pmSeries.mjs'
125
+ import find from 'lodash/find'
132
126
  import WDrawer from 'w-component-vue/src/components/WDrawer.vue'
133
127
  import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
134
128
  import WListVertical from 'w-component-vue/src/components/WListVertical.vue'
@@ -147,46 +141,16 @@ export default {
147
141
  LayoutContentUsers,
148
142
  },
149
143
  props: {
150
- // menuKey: {
151
- // type: String,
152
- // default: '',
153
- // },
154
144
  },
155
145
  data: function() {
156
- let menus = [
157
- {
158
- key: 'blocks',
159
- text: '管理區塊',
160
- icon: mdiGamepadCircle,
161
- },
162
- {
163
- key: 'groups',
164
- text: '權限群組',
165
- icon: mdiStackOverflow,
166
- },
167
- {
168
- key: 'users',
169
- text: '使用者權限',
170
- icon: mdiAccountGroupOutline,
171
- },
172
- // {
173
- // key: 'logs',
174
- // text: '事件紀錄',
175
- // icon: mdiBallotRecountOutline,
176
- // },
177
- ]
178
146
  return {
179
147
 
180
- menuKey: 'blocks',
181
- menus,
182
- menuActive: menus[0],
148
+ menuKey: 'targets',
183
149
 
184
150
  panelWidth: 0,
185
- panelWidthTemp: 0,
186
151
  panelHeight: 0,
187
152
 
188
153
  drawer: true,
189
- drawerAfloat: false,
190
154
  drawerWidth: 180,
191
155
  drawerWidthMin: 150,
192
156
  drawerWidthMax: 300,
@@ -199,6 +163,35 @@ export default {
199
163
  return get(this, '$store.state.syncState')
200
164
  },
201
165
 
166
+ menus: function() {
167
+ let vo = this
168
+ let ms = [
169
+ {
170
+ key: 'targets',
171
+ text: vo.$t('managementTargets'),
172
+ icon: mdiGamepadCircle,
173
+ },
174
+ {
175
+ key: 'groups',
176
+ text: vo.$t('permissionGroups'),
177
+ icon: mdiStackOverflow,
178
+ },
179
+ {
180
+ key: 'users',
181
+ text: vo.$t('userPermissions'),
182
+ icon: mdiAccountGroupOutline,
183
+ },
184
+ ]
185
+ return ms
186
+ },
187
+
188
+ menuActive: function() {
189
+ let vo = this
190
+ let r = find(vo.menus, { key: vo.menuKey })
191
+ // console.log(r)
192
+ return r
193
+ },
194
+
202
195
  },
203
196
  methods: {
204
197
 
@@ -212,30 +205,6 @@ export default {
212
205
  vo.panelHeight = msg.snew.clientHeight
213
206
  // console.log('vo.panelHeight', vo.panelHeight)
214
207
 
215
- //modeResize
216
- let modeResize = '' //寬度可能相同故得有預設空字串的種類
217
- if (vo.panelWidth > vo.panelWidthTemp) {
218
- modeResize = 'toLarge'
219
- }
220
- else if (vo.panelWidth < vo.panelWidthTemp) {
221
- modeResize = 'toSmall'
222
- }
223
- // console.log('modeResize', modeResize, vo.panelWidth, vo.panelWidthTemp)
224
-
225
- //drawer
226
- if (vo.drawer && modeResize === 'toSmall' && vo.panelWidth < 1.7 * vo.drawerWidthMax) { //已開啟抽屜且為變窄時才偵測
227
- vo.drawer = false
228
- }
229
- else if (!vo.drawer && modeResize === 'toLarge' && vo.panelWidth >= 1.7 * vo.drawerWidthMax) { //已隱藏抽屜且為變寬時才偵測
230
- vo.drawer = true
231
- }
232
-
233
- //drawerAfloat
234
- vo.drawerAfloat = vo.panelWidth < 1.7 * vo.drawerWidthMax
235
-
236
- //save
237
- vo.panelWidthTemp = vo.panelWidth
238
-
239
208
  },
240
209
 
241
210
  }
@@ -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:30px 25px 0px 20px; background:#fff;">
17
- <div style="padding:5px 15px 5px 5px; display:inline-block; border-bottom:3px solid #FF9100;">
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
- <WIcon
21
- :icon="mdiStackOverflow"
22
- :color="'#FF9800'"
23
- ></WIcon>
24
-
25
- <div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
26
- 管理權限群組
27
- </div>
19
+ <WIcon
20
+ :icon="mdiStackOverflow"
21
+ :color="'#FF9800'"
22
+ ></WIcon>
28
23
 
24
+ <div style="padding-left:10px; font-size:1.3rem; color:#d3912c;">
25
+ {{$t('permissionGroups')}}
29
26
  </div>
27
+
30
28
  </div>
31
29
  </div>
32
30
 
33
31
  <!-- 編輯設定區 -->
34
- <div style="background:#fff;">
32
+ <div style="display:inline-block; vertical-align:top;">
35
33
 
36
- <div style="padding:20px 20px 15px 20px; background:#fff;">
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,43 +46,44 @@
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('groupMsg1')}}
52
50
  </div>
53
51
  <div style="padding:3px 0px;">
54
- 2. 開啟編輯時可拖曳權限群組變更其相對順序。
55
- </div>
56
- <div style="padding:3px 0px;">
57
- 3. 此區域變更時將自動儲存。
52
+ 2. {{$t('groupMsg2')}}
58
53
  </div>
59
54
  </div>
60
55
 
61
56
  </div>
62
57
 
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="'儲存變更'"
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="saveGroups"
79
- ></WButtonChip>
58
+ </div>
80
59
 
81
- </div>
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>
82
78
 
83
79
  </div>
84
80
 
85
81
  </div>
86
82
 
87
- <div :style="`padding:${spacePading}px;`" v-if="!firstLoading">
83
+ <div
84
+ :style="`padding:${spacePading}px;`"
85
+ v-if="!firstLoading"
86
+ >
88
87
 
89
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);">
90
89
 
@@ -101,8 +100,8 @@
101
100
  :draggable="isOperatable"
102
101
  :editableClose="isOperatable"
103
102
  :editableInput="isOperatable"
104
- :addButtonText="'新增群組'"
105
- :addButtonTooltip="'新增權限群組'"
103
+ :addButtonText="$t('addGroup')"
104
+ :addButtonTooltip="$t('addPermissionGroup')"
106
105
  :addButtonTextColor="'#eee'"
107
106
  :addButtonTextColorHover="'#fff'"
108
107
  :addButtonIconColor="'#eee'"
@@ -132,7 +131,7 @@
132
131
  style="padding:20px; _color:#666; font-size:0.85rem;"
133
132
  v-else
134
133
  >
135
- 未選擇權限群組,請點擇上方任一權限群組以顯示管理範圍。
134
+ {{$t('groupMsgNoPick')}}
136
135
  </div>
137
136
 
138
137
  </div>
@@ -140,7 +139,7 @@
140
139
  </div>
141
140
 
142
141
  <div style="padding:10px 15px; font-size:0.8rem;" v-else>
143
- 載入中...
142
+ {{$t('waitingData')}}
144
143
  </div>
145
144
 
146
145
  </div>
@@ -161,6 +160,7 @@ import cloneDeep from 'lodash/cloneDeep'
161
160
  import genID from 'wsemi/src/genID.mjs'
162
161
  import isestr from 'wsemi/src/isestr.mjs'
163
162
  import iseobj from 'wsemi/src/iseobj.mjs'
163
+ import cstr from 'wsemi/src/cstr.mjs'
164
164
  import waitFun from 'wsemi/src/waitFun.mjs'
165
165
  import WIcon from 'w-component-vue/src/components/WIcon.vue'
166
166
  import WButtonChip from 'w-component-vue/src/components/WButtonChip.vue'
@@ -192,7 +192,7 @@ export default {
192
192
  groupInforHeight: 100,
193
193
 
194
194
  firstLoading: true,
195
- isOperatable: false,
195
+ isOperatable: true,
196
196
  isModified: false,
197
197
 
198
198
  groupsTrans: [],
@@ -318,12 +318,14 @@ export default {
318
318
  getDescription: function(g) {
319
319
  // console.log('methods getDescription', g)
320
320
 
321
+ let vo = this
322
+
321
323
  //r
322
324
  let r = get(g, 'description', '')
323
325
 
324
326
  //check
325
327
  if (!isestr(r)) {
326
- r = '無說明'
328
+ r = vo.$t('noDescription')
327
329
  }
328
330
 
329
331
  return r
@@ -365,7 +367,7 @@ export default {
365
367
  //g
366
368
  let g = {
367
369
  id: genID(),
368
- name: '新權限群組',
370
+ name: vo.$t('newGroup'),
369
371
  crules: `{ "___all___": { "show": "n", "active": "n" } }`,
370
372
  order: orderMax,
371
373
  }
@@ -378,7 +380,7 @@ export default {
378
380
 
379
381
  //check
380
382
  if (errTemp !== null) {
381
- vo.$alert(`新增權限群組失敗: ${errTemp}`, { type: 'error' })
383
+ vo.$alert(`${vo.$t('failedToAddPermissionGroup')}: ${errTemp}`, { type: 'error' })
382
384
  }
383
385
 
384
386
  //gn
@@ -392,7 +394,7 @@ export default {
392
394
  // console.log('gn', gn)
393
395
 
394
396
  //alert
395
- vo.$alert(`新增權限群組成功`)
397
+ vo.$alert(vo.$t('successfulToAddPermissionGroup'))
396
398
 
397
399
  }
398
400
 
@@ -403,7 +405,7 @@ export default {
403
405
  // })
404
406
  .catch((err) => {
405
407
  console.log('catch', err)
406
- vo.$alert(`發生非預期錯誤,請洽管理員`, { type: 'error' })
408
+ vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
407
409
  })
408
410
  .finally(() => {
409
411
 
@@ -426,11 +428,13 @@ export default {
426
428
  let g = get(msg, 'item', {})
427
429
 
428
430
  //name
429
- let name = get(g, 'name', '未知')
431
+ let name = get(g, 'name', vo.$t('unknow'))
430
432
 
431
433
  //showCheckYesNo
432
434
  let bExit = false
433
- await vo.$dg.showCheckYesNo(`確認是否刪除權限群組「${name}」?`)
435
+ let t_confirmToDeletePermissionGroup = vo.$t('confirmToDeletePermissionGroup')
436
+ t_confirmToDeletePermissionGroup = t_confirmToDeletePermissionGroup.replace('{name}', name)
437
+ await vo.$dg.showCheckYesNo(t_confirmToDeletePermissionGroup)
434
438
  .catch(() => {
435
439
  bExit = true
436
440
  })
@@ -449,7 +453,7 @@ export default {
449
453
 
450
454
  //check
451
455
  if (errTemp !== null) {
452
- vo.$alert(`刪除權限群組失敗: ${errTemp}`, { type: 'error' })
456
+ vo.$alert(`${vo.$t('failedToDeletePermissionGroup')}: ${errTemp}`, { type: 'error' })
453
457
  return
454
458
  }
455
459
 
@@ -464,7 +468,7 @@ export default {
464
468
  // console.log('gn', gn)
465
469
 
466
470
  //alert
467
- vo.$alert(`刪除權限群組成功`)
471
+ vo.$alert(vo.$t('successfulToDeletePermissionGroup'))
468
472
 
469
473
  }
470
474
 
@@ -475,7 +479,7 @@ export default {
475
479
  // })
476
480
  .catch((err) => {
477
481
  console.log('catch', err)
478
- vo.$alert(`發生非預期錯誤,請洽管理員`, { type: 'error' })
482
+ vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
479
483
  })
480
484
  .finally(() => {
481
485
 
@@ -522,7 +526,7 @@ export default {
522
526
 
523
527
  //check
524
528
  if (errTemp !== null) {
525
- vo.$alert(`變更權限群組順序失敗: ${errTemp}`, { type: 'error' })
529
+ vo.$alert(`${vo.$t('failedToChangeOrderPermissionGroup')}: ${errTemp}`, { type: 'error' })
526
530
  return
527
531
  }
528
532
 
@@ -540,7 +544,7 @@ export default {
540
544
  // console.log('gsn', gsn)
541
545
 
542
546
  //alert
543
- vo.$alert(`變更權限群組順序成功`)
547
+ vo.$alert(vo.$t('successfulToChangeOrderPermissionGroup'))
544
548
 
545
549
  }
546
550
 
@@ -551,7 +555,7 @@ export default {
551
555
  // })
552
556
  .catch((err) => {
553
557
  console.log('catch', err)
554
- vo.$alert(`發生非預期錯誤,請洽管理員`, { type: 'error' })
558
+ vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
555
559
  })
556
560
  .finally(() => {
557
561
 
@@ -569,7 +573,7 @@ export default {
569
573
 
570
574
  //check
571
575
  if (!isestr(group.name)) {
572
- vo.$alert(`權限群組名稱請記得給予`, { type: 'warning' })
576
+ vo.$alert(vo.$t('rememberToGivePermissionGroupName'), { type: 'warning' })
573
577
  }
574
578
 
575
579
  //modify
@@ -597,7 +601,9 @@ export default {
597
601
  let b = false
598
602
  each(vo.groupsTrans, (v, k) => {
599
603
  if (!isestr(v.name)) {
600
- vo.$alert(`第 ${k + 1} 個權限群組名稱為空`, { type: 'error' })
604
+ let t_isPermissionGroupNameEmpty = vo.$t('isPermissionGroupNameEmpty')
605
+ t_isPermissionGroupNameEmpty = t_isPermissionGroupNameEmpty.replace('{n}', cstr(k + 1))
606
+ vo.$alert(t_isPermissionGroupNameEmpty, { type: 'error' })
601
607
  b = true
602
608
  }
603
609
  })
@@ -627,7 +633,7 @@ export default {
627
633
 
628
634
  //check
629
635
  if (errTemp !== null) {
630
- vo.$alert(`儲存權限群組失敗: ${errTemp}`, { type: 'error' })
636
+ vo.$alert(`${vo.$t('failedToSavePermissionGroup')}: ${errTemp}`, { type: 'error' })
631
637
  return
632
638
  }
633
639
 
@@ -635,7 +641,7 @@ export default {
635
641
  vo.isModified = false
636
642
 
637
643
  //alert
638
- vo.$alert(`儲存權限群組成功`)
644
+ vo.$alert(vo.$t('successfulToSavePermissionGroup'))
639
645
 
640
646
  }
641
647
 
@@ -646,7 +652,7 @@ export default {
646
652
  // })
647
653
  .catch((err) => {
648
654
  console.log('catch', err)
649
- vo.$alert(`發生非預期錯誤,請洽管理員`, { type: 'error' })
655
+ vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
650
656
  })
651
657
  .finally(() => {
652
658