w-web-perm 1.0.47 → 1.0.49
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/.github/workflows/ci-test.yml +2 -2
- package/_gh-pages-deploy/.nojekyll +0 -0
- package/_gh-pages-deploy/WWebPerm.html +938 -0
- package/_gh-pages-deploy/WWebPerm.mjs.html +1228 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/_gh-pages-deploy/index.html +84 -0
- package/_gh-pages-deploy/scripts/collapse.js +39 -0
- package/_gh-pages-deploy/scripts/commonNav.js +28 -0
- package/_gh-pages-deploy/scripts/linenumber.js +25 -0
- package/_gh-pages-deploy/scripts/nav.js +12 -0
- package/_gh-pages-deploy/scripts/polyfill.js +4 -0
- package/_gh-pages-deploy/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/_gh-pages-deploy/scripts/prettify/lang-css.js +2 -0
- package/_gh-pages-deploy/scripts/prettify/prettify.js +28 -0
- package/_gh-pages-deploy/scripts/search.js +99 -0
- package/_gh-pages-deploy/styles/jsdoc.css +776 -0
- package/_gh-pages-deploy/styles/prettify.css +80 -0
- package/dist/css/app.d8b16216.css +1 -0
- package/dist/css/{chunk-vendors.f149e124.css → chunk-vendors.2d3ef2ba.css} +1 -1
- package/dist/index.tmp +2 -2
- package/dist/js/app-legacy.fb48310a.js +1 -0
- package/dist/js/app.fb48310a.js +1 -0
- package/dist/js/chunk-vendors-legacy.8fdd4435.js +21 -0
- package/dist/js/chunk-vendors.8fdd4435.js +21 -0
- package/dist/w-web-perm.umd.js +2 -2
- package/dist/w-web-perm.umd.js.map +1 -1
- package/docs/WWebPerm.html +2 -2
- package/docs/WWebPerm.mjs.html +138 -199
- package/docs/index.html +1 -1
- package/package.json +15 -11
- package/public/index.html +2 -2
- package/server/WWebPerm.mjs +137 -198
- package/server/procCore.mjs +169 -0
- package/server/procLang.mjs +197 -0
- package/server/procStaInfor.mjs +118 -0
- package/server/provideTabs.mjs +1 -1
- package/server/srLog.mjs +30 -0
- package/server/staLogs/staEvent.callWorker.mjs +46 -0
- package/server/staLogs/staEvent.mjs +116 -0
- package/server/staLogs/staEvent.shellWorker.mjs +19 -0
- package/server/staLogs/staEventTable.mjs +100 -0
- package/server/staLogs/test_staEvent.mjs +22 -0
- package/settings.json +40 -0
- package/src/components/Common/CheckYes.vue +18 -1
- package/src/components/Layout.vue +1 -1
- package/src/components/LayoutContent.vue +13 -1
- package/src/components/LayoutContentGrups.vue +48 -24
- package/src/components/LayoutContentPemis.vue +48 -24
- package/src/components/LayoutContentStaInfor.vue +536 -0
- package/src/components/LayoutContentTargets.vue +48 -24
- package/src/components/LayoutContentUsers.vue +48 -24
- package/src/components/LayoutState.vue +5 -0
- package/src/components/VeCgrups.vue +62 -20
- package/src/components/VeCpemis.vue +62 -20
- package/src/components/VeCrules.vue +58 -16
- package/src/components/VeGrupBlngUsers.vue +77 -32
- package/src/components/VePemiBlngGrups.vue +77 -32
- package/src/getPerm.mjs +7 -17
- package/src/getPermUserInfor.mjs +8 -18
- package/src/main.js +1 -0
- package/src/plugins/mShare.mjs +8 -13
- package/src/plugins/mUI.mjs +15 -7
- package/src/store/mutations.mjs +1 -1
- package/srv.mjs +76 -101
- package/tableTags.json +1 -1
- package/db/wperm/grups/data.mdb +0 -0
- package/db/wperm/grups/lock.mdb +0 -0
- package/db/wperm/pemis/data.mdb +0 -0
- package/db/wperm/pemis/lock.mdb +0 -0
- package/db/wperm/targets/data.mdb +0 -0
- package/db/wperm/targets/lock.mdb +0 -0
- package/db/wperm/users/data.mdb +0 -0
- package/db/wperm/users/lock.mdb +0 -0
- package/dist/css/app.30e81bfe.css +0 -1
- package/dist/js/app-legacy.f1277a07.js +0 -1
- package/dist/js/app.f1277a07.js +0 -1
- package/dist/js/chunk-vendors-legacy.e8703728.js +0 -21
- package/dist/js/chunk-vendors.e8703728.js +0 -21
- package/test/getUserRules.test.mjs +0 -899
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
<!-- 功能區 -->
|
|
41
41
|
<div
|
|
42
|
+
data-fmid="users-toolbar"
|
|
42
43
|
style="padding:5px; border-top:1px solid #ddd; display:flex; align-items:center;"
|
|
43
44
|
_v-if="showIsEditable || isEditable"
|
|
44
45
|
>
|
|
@@ -185,6 +186,7 @@
|
|
|
185
186
|
:iconColor="'#eee'"
|
|
186
187
|
:iconColorHover="'#fff'"
|
|
187
188
|
:shadow="false"
|
|
189
|
+
:promiseUnlock="true"
|
|
188
190
|
@click="saveUsers"
|
|
189
191
|
></WButtonCircle>
|
|
190
192
|
|
|
@@ -382,12 +384,22 @@ export default {
|
|
|
382
384
|
vo.widthUsersEmail = get(vo, 'webInfor.widthUsersEmail', '')
|
|
383
385
|
vo.widthUsersDescription = get(vo, 'webInfor.widthUsersDescription', '')
|
|
384
386
|
|
|
385
|
-
|
|
387
|
+
//會觸發數據變更再導致opt變更導致觸發rowsChange等事件, 故得要延遲, 供組件偵測初始設定數據初始化之用
|
|
388
|
+
setTimeout(() => {
|
|
389
|
+
vo.firstSetting = false
|
|
390
|
+
// console.log('firstSetting', vo.firstSetting)
|
|
391
|
+
}, 1)
|
|
392
|
+
|
|
386
393
|
}
|
|
387
394
|
|
|
388
395
|
},
|
|
389
396
|
computed: {
|
|
390
397
|
|
|
398
|
+
syncState: function() {
|
|
399
|
+
let vo = this
|
|
400
|
+
return get(vo, '$store.state.syncState')
|
|
401
|
+
},
|
|
402
|
+
|
|
391
403
|
webInfor: function() {
|
|
392
404
|
let wi = get(this, `$store.state.webInfor`)
|
|
393
405
|
return wi
|
|
@@ -735,6 +747,11 @@ export default {
|
|
|
735
747
|
// console.log('rowsChange', rs)
|
|
736
748
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
737
749
|
|
|
750
|
+
//check
|
|
751
|
+
if (!vo.syncState || vo.firstLoading || vo.firstSetting) {
|
|
752
|
+
return
|
|
753
|
+
}
|
|
754
|
+
|
|
738
755
|
//isModified
|
|
739
756
|
vo.isModified = true
|
|
740
757
|
|
|
@@ -1133,20 +1150,28 @@ export default {
|
|
|
1133
1150
|
|
|
1134
1151
|
},
|
|
1135
1152
|
|
|
1136
|
-
saveUsers: function() {
|
|
1137
|
-
// console.log('method saveUsers')
|
|
1153
|
+
saveUsers: function(msg) {
|
|
1138
1154
|
|
|
1139
1155
|
let vo = this
|
|
1140
1156
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1157
|
+
//第一行立刻釋放按鈕視覺鎖
|
|
1158
|
+
msg.pm.resolve()
|
|
1143
1159
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1160
|
+
//fire-and-forget, 不 await
|
|
1161
|
+
vo.doSaveUsers()
|
|
1146
1162
|
|
|
1147
|
-
|
|
1163
|
+
},
|
|
1164
|
+
|
|
1165
|
+
doSaveUsers: function() {
|
|
1166
|
+
// console.log('method doSaveUsers')
|
|
1167
|
+
|
|
1168
|
+
let vo = this
|
|
1169
|
+
|
|
1170
|
+
async function core() {
|
|
1171
|
+
|
|
1172
|
+
//1) 同步檢測 (在開 loading 之前)
|
|
1148
1173
|
if (isestr(vo.isError)) {
|
|
1149
|
-
vo.$
|
|
1174
|
+
await vo.$dg.showCheckYes(`${vo.isError}`)
|
|
1150
1175
|
return
|
|
1151
1176
|
}
|
|
1152
1177
|
|
|
@@ -1155,35 +1180,34 @@ export default {
|
|
|
1155
1180
|
|
|
1156
1181
|
//check
|
|
1157
1182
|
if (size(rows) === 0) {
|
|
1158
|
-
vo.$
|
|
1183
|
+
await vo.$dg.showCheckYes(`${vo.$t('userAddEmpty')}`)
|
|
1159
1184
|
return
|
|
1160
1185
|
}
|
|
1161
1186
|
|
|
1162
|
-
//
|
|
1187
|
+
//2) 確定打 API 才開 loading
|
|
1188
|
+
vo.$ui.updateLoading(true)
|
|
1189
|
+
|
|
1190
|
+
//3) updateUsers, 各自 catch + 旗標短路
|
|
1191
|
+
let okSave = false
|
|
1163
1192
|
await vo.$fapi.updateUsers(rows)
|
|
1164
|
-
.
|
|
1165
|
-
|
|
1193
|
+
.then(() => { okSave = true })
|
|
1194
|
+
.catch(async (err) => {
|
|
1195
|
+
vo.$ui.updateLoading(false) //showCheckYes 前關 loading(modal 阻斷期間避免 loading 疊在底下)
|
|
1196
|
+
await vo.$dg.showCheckYes(`${vo.$t('userSaveUsersFail')}: ${vo.$tErr(err)}`)
|
|
1166
1197
|
})
|
|
1167
|
-
|
|
1168
|
-
//check
|
|
1169
|
-
if (errTemp !== null) {
|
|
1170
|
-
vo.$alert(`${vo.$t('userSaveUsersFail')}: ${errTemp}`, { type: 'error' })
|
|
1171
|
-
return
|
|
1172
|
-
}
|
|
1198
|
+
if (!okSave) return
|
|
1173
1199
|
|
|
1174
1200
|
//isModified
|
|
1175
1201
|
vo.isModified = false
|
|
1176
1202
|
|
|
1177
|
-
//alert
|
|
1178
|
-
vo.$
|
|
1203
|
+
//alert(showCheckYes 前關 loading,避免 modal 等待期間 loading 疊在底下)
|
|
1204
|
+
vo.$ui.updateLoading(false)
|
|
1205
|
+
await vo.$dg.showCheckYes(vo.$t('userSaveUsersSuccess'), { type: 'success' })
|
|
1179
1206
|
|
|
1180
1207
|
}
|
|
1181
1208
|
|
|
1182
1209
|
//core
|
|
1183
1210
|
core()
|
|
1184
|
-
// .then((res) => {
|
|
1185
|
-
// console.log('then', res)
|
|
1186
|
-
// })
|
|
1187
1211
|
.catch((err) => {
|
|
1188
1212
|
console.log('catch', err)
|
|
1189
1213
|
vo.$alert(vo.$t('anUnexpectedErrorOccurred'), { type: 'error' })
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
:style="`position:absolute; top:0px; left:0px; width:100%; height:100%; transition:all 0.5s linear; display:flex; align-items:center; justify-content:center;`"
|
|
4
4
|
>
|
|
5
5
|
|
|
6
|
+
<!-- conn-state 觀看區包覆層(e2e 紅框標注用;display:flex 與原置中內容布局一致,不改視覺) -->
|
|
7
|
+
<div data-fmid="conn-state" style="display:flex; align-items:center;">
|
|
8
|
+
|
|
6
9
|
<template v-if="connState==='csIng'">
|
|
7
10
|
|
|
8
11
|
<img style="width:100px; height:100px;" :src="img_connection">
|
|
@@ -63,6 +66,8 @@
|
|
|
63
66
|
|
|
64
67
|
</template>
|
|
65
68
|
|
|
69
|
+
</div>
|
|
70
|
+
|
|
66
71
|
</div>
|
|
67
72
|
</template>
|
|
68
73
|
|
|
@@ -115,23 +115,29 @@
|
|
|
115
115
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
-
<template
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
118
|
+
<template
|
|
119
|
+
v-if="!firstLoading"
|
|
120
|
+
>
|
|
121
|
+
|
|
122
|
+
<template v-if="items">
|
|
123
|
+
<WAggridVue
|
|
124
|
+
ref="rftable"
|
|
125
|
+
:style="`width:100%;`"
|
|
126
|
+
:height="contentHeight"
|
|
127
|
+
:opt="opt"
|
|
128
|
+
>
|
|
129
|
+
<template v-slot:cell-render="props">
|
|
130
|
+
<span v-if="props.key==='name'">{{ props.value }}</span>
|
|
131
|
+
<select v-else-if="props.key==='mode'" @change="showVeCgrupsToggleItemModeByName(props.row.name, $event.target.value)" :disabled="!isEditable">
|
|
132
|
+
<option value="OR" :selected="props.row.mode === 'OR'">OR</option>
|
|
133
|
+
<option value="AND" :selected="props.row.mode === 'AND'">AND</option>
|
|
134
|
+
</select>
|
|
135
|
+
<input v-else-if="props.key==='enable'" type="checkbox" :checked="props.value === 'y'" @click="showVeCgrupsToggleItemEnableByName(props.row.name)" :disabled="!isEditable" />
|
|
136
|
+
<span v-else>{{ props.value }}</span>
|
|
137
|
+
</template>
|
|
138
|
+
</WAggridVue>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
135
141
|
</template>
|
|
136
142
|
|
|
137
143
|
<div
|
|
@@ -196,6 +202,8 @@ export default {
|
|
|
196
202
|
panelHeight: 100,
|
|
197
203
|
headHeight: 100,
|
|
198
204
|
|
|
205
|
+
firstLoading: true,
|
|
206
|
+
firstSetting: true,
|
|
199
207
|
isEditable: false,
|
|
200
208
|
isModified: false,
|
|
201
209
|
|
|
@@ -217,9 +225,26 @@ export default {
|
|
|
217
225
|
Vue.prototype.$dg.showVeCgrupsToggleItemModeByName = vo.showVeCgrupsToggleItemModeByName
|
|
218
226
|
Vue.prototype.$dg.showVeCgrupsToggleItemEnableByName = vo.showVeCgrupsToggleItemEnableByName
|
|
219
227
|
|
|
228
|
+
//firstSetting
|
|
229
|
+
if (vo.firstSetting) {
|
|
230
|
+
// console.log('webInfor', vo.webInfor)
|
|
231
|
+
|
|
232
|
+
//會觸發數據變更再導致opt變更導致觸發rowsChange等事件, 故得要延遲, 供組件偵測初始設定數據初始化之用
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
vo.firstSetting = false
|
|
235
|
+
// console.log('firstSetting', vo.firstSetting)
|
|
236
|
+
}, 1)
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
220
240
|
},
|
|
221
241
|
computed: {
|
|
222
242
|
|
|
243
|
+
syncState: function() {
|
|
244
|
+
let vo = this
|
|
245
|
+
return get(vo, '$store.state.syncState')
|
|
246
|
+
},
|
|
247
|
+
|
|
223
248
|
targets: function() {
|
|
224
249
|
let rs = get(this, `$store.state.targets`)
|
|
225
250
|
rs = sortBy(rs, 'order')
|
|
@@ -393,6 +418,11 @@ export default {
|
|
|
393
418
|
// console.log('rowsChange', rs)
|
|
394
419
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
395
420
|
|
|
421
|
+
//check
|
|
422
|
+
if (!vo.syncState || vo.firstLoading || vo.firstSetting) {
|
|
423
|
+
return
|
|
424
|
+
}
|
|
425
|
+
|
|
396
426
|
//isModified
|
|
397
427
|
vo.isModified = true
|
|
398
428
|
|
|
@@ -717,6 +747,18 @@ export default {
|
|
|
717
747
|
|
|
718
748
|
let vo = this
|
|
719
749
|
|
|
750
|
+
//save按鈕第一行立刻釋放視覺鎖
|
|
751
|
+
msg.pm.resolve()
|
|
752
|
+
|
|
753
|
+
//fire-and-forget, 不 await
|
|
754
|
+
vo.doSave()
|
|
755
|
+
|
|
756
|
+
},
|
|
757
|
+
|
|
758
|
+
doSave: function() {
|
|
759
|
+
|
|
760
|
+
let vo = this
|
|
761
|
+
|
|
720
762
|
async function core() {
|
|
721
763
|
|
|
722
764
|
//show loading
|
|
@@ -775,9 +817,6 @@ export default {
|
|
|
775
817
|
.catch(() => { })
|
|
776
818
|
.finally(() => {
|
|
777
819
|
|
|
778
|
-
//save按鈕解除loading
|
|
779
|
-
msg.pm.resolve()
|
|
780
|
-
|
|
781
820
|
//hide loading
|
|
782
821
|
vo.$ui.updateLoading(false)
|
|
783
822
|
|
|
@@ -877,6 +916,9 @@ export default {
|
|
|
877
916
|
//genOpt
|
|
878
917
|
vo.genOpt()
|
|
879
918
|
|
|
919
|
+
//firstLoading
|
|
920
|
+
vo.firstLoading = false
|
|
921
|
+
|
|
880
922
|
//bShow
|
|
881
923
|
vo.bShow = true
|
|
882
924
|
|
|
@@ -115,23 +115,29 @@
|
|
|
115
115
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
-
<template
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
118
|
+
<template
|
|
119
|
+
v-if="!firstLoading"
|
|
120
|
+
>
|
|
121
|
+
|
|
122
|
+
<template v-if="items">
|
|
123
|
+
<WAggridVue
|
|
124
|
+
ref="rftable"
|
|
125
|
+
:style="`width:100%;`"
|
|
126
|
+
:height="contentHeight"
|
|
127
|
+
:opt="opt"
|
|
128
|
+
>
|
|
129
|
+
<template v-slot:cell-render="props">
|
|
130
|
+
<span v-if="props.key==='name'">{{ props.value }}</span>
|
|
131
|
+
<select v-else-if="props.key==='mode'" @change="showVeCpemisToggleItemModeByName(props.row.name, $event.target.value)" :disabled="!isEditable">
|
|
132
|
+
<option value="OR" :selected="props.row.mode === 'OR'">OR</option>
|
|
133
|
+
<option value="AND" :selected="props.row.mode === 'AND'">AND</option>
|
|
134
|
+
</select>
|
|
135
|
+
<input v-else-if="props.key==='enable'" type="checkbox" :checked="props.value === 'y'" @click="showVeCpemisToggleItemEnableByName(props.row.name)" :disabled="!isEditable" />
|
|
136
|
+
<span v-else>{{ props.value }}</span>
|
|
137
|
+
</template>
|
|
138
|
+
</WAggridVue>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
135
141
|
</template>
|
|
136
142
|
|
|
137
143
|
<div
|
|
@@ -196,6 +202,8 @@ export default {
|
|
|
196
202
|
panelHeight: 100,
|
|
197
203
|
headHeight: 100,
|
|
198
204
|
|
|
205
|
+
firstLoading: true,
|
|
206
|
+
firstSetting: true,
|
|
199
207
|
isEditable: false,
|
|
200
208
|
isModified: false,
|
|
201
209
|
|
|
@@ -217,9 +225,26 @@ export default {
|
|
|
217
225
|
Vue.prototype.$dg.showVeCpemisToggleItemModeByName = vo.showVeCpemisToggleItemModeByName
|
|
218
226
|
Vue.prototype.$dg.showVeCpemisToggleItemEnableByName = vo.showVeCpemisToggleItemEnableByName
|
|
219
227
|
|
|
228
|
+
//firstSetting
|
|
229
|
+
if (vo.firstSetting) {
|
|
230
|
+
// console.log('webInfor', vo.webInfor)
|
|
231
|
+
|
|
232
|
+
//會觸發數據變更再導致opt變更導致觸發rowsChange等事件, 故得要延遲, 供組件偵測初始設定數據初始化之用
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
vo.firstSetting = false
|
|
235
|
+
// console.log('firstSetting', vo.firstSetting)
|
|
236
|
+
}, 1)
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
220
240
|
},
|
|
221
241
|
computed: {
|
|
222
242
|
|
|
243
|
+
syncState: function() {
|
|
244
|
+
let vo = this
|
|
245
|
+
return get(vo, '$store.state.syncState')
|
|
246
|
+
},
|
|
247
|
+
|
|
223
248
|
targets: function() {
|
|
224
249
|
let rs = get(this, `$store.state.targets`)
|
|
225
250
|
rs = sortBy(rs, 'order')
|
|
@@ -393,6 +418,11 @@ export default {
|
|
|
393
418
|
// console.log('rowsChange', rs)
|
|
394
419
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
395
420
|
|
|
421
|
+
//check
|
|
422
|
+
if (!vo.syncState || vo.firstLoading || vo.firstSetting) {
|
|
423
|
+
return
|
|
424
|
+
}
|
|
425
|
+
|
|
396
426
|
//isModified
|
|
397
427
|
vo.isModified = true
|
|
398
428
|
|
|
@@ -717,6 +747,18 @@ export default {
|
|
|
717
747
|
|
|
718
748
|
let vo = this
|
|
719
749
|
|
|
750
|
+
//save按鈕第一行立刻釋放視覺鎖
|
|
751
|
+
msg.pm.resolve()
|
|
752
|
+
|
|
753
|
+
//fire-and-forget, 不 await
|
|
754
|
+
vo.doSave()
|
|
755
|
+
|
|
756
|
+
},
|
|
757
|
+
|
|
758
|
+
doSave: function() {
|
|
759
|
+
|
|
760
|
+
let vo = this
|
|
761
|
+
|
|
720
762
|
async function core() {
|
|
721
763
|
|
|
722
764
|
//show loading
|
|
@@ -775,9 +817,6 @@ export default {
|
|
|
775
817
|
.catch(() => { })
|
|
776
818
|
.finally(() => {
|
|
777
819
|
|
|
778
|
-
//save按鈕解除loading
|
|
779
|
-
msg.pm.resolve()
|
|
780
|
-
|
|
781
820
|
//hide loading
|
|
782
821
|
vo.$ui.updateLoading(false)
|
|
783
822
|
|
|
@@ -877,6 +916,9 @@ export default {
|
|
|
877
916
|
//genOpt
|
|
878
917
|
vo.genOpt()
|
|
879
918
|
|
|
919
|
+
//firstLoading
|
|
920
|
+
vo.firstLoading = false
|
|
921
|
+
|
|
880
922
|
//bShow
|
|
881
923
|
vo.bShow = true
|
|
882
924
|
|
|
@@ -115,19 +115,25 @@
|
|
|
115
115
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
-
<template
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
<template
|
|
119
|
+
v-if="!firstLoading"
|
|
120
|
+
>
|
|
121
|
+
|
|
122
|
+
<template v-if="items">
|
|
123
|
+
<WAggridVue
|
|
124
|
+
ref="rftable"
|
|
125
|
+
:style="`width:100%;`"
|
|
126
|
+
:height="contentHeight"
|
|
127
|
+
:opt="opt"
|
|
128
|
+
>
|
|
129
|
+
<template v-slot:cell-render="props">
|
|
130
|
+
<span v-if="props.key==='id'">{{ props.value }}</span>
|
|
131
|
+
<input v-else-if="props.key==='enable'" type="checkbox" :checked="props.value === 'y'" @click="toggleItemEnableById(props.row.id)" :disabled="!isEditable" />
|
|
132
|
+
<span v-else>{{ props.value }}</span>
|
|
133
|
+
</template>
|
|
134
|
+
</WAggridVue>
|
|
135
|
+
</template>
|
|
136
|
+
|
|
131
137
|
</template>
|
|
132
138
|
|
|
133
139
|
<div
|
|
@@ -192,6 +198,8 @@ export default {
|
|
|
192
198
|
panelHeight: 100,
|
|
193
199
|
headHeight: 100,
|
|
194
200
|
|
|
201
|
+
firstLoading: true,
|
|
202
|
+
firstSetting: true,
|
|
195
203
|
isEditable: false,
|
|
196
204
|
isModified: false,
|
|
197
205
|
|
|
@@ -212,9 +220,26 @@ export default {
|
|
|
212
220
|
Vue.prototype.$dg.showVeCrules = vo.show
|
|
213
221
|
Vue.prototype.$dg.toggleItemEnableById = vo.toggleItemEnableById
|
|
214
222
|
|
|
223
|
+
//firstSetting
|
|
224
|
+
if (vo.firstSetting) {
|
|
225
|
+
// console.log('webInfor', vo.webInfor)
|
|
226
|
+
|
|
227
|
+
//會觸發數據變更再導致opt變更導致觸發rowsChange等事件, 故得要延遲, 供組件偵測初始設定數據初始化之用
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
vo.firstSetting = false
|
|
230
|
+
// console.log('firstSetting', vo.firstSetting)
|
|
231
|
+
}, 1)
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
|
|
215
235
|
},
|
|
216
236
|
computed: {
|
|
217
237
|
|
|
238
|
+
syncState: function() {
|
|
239
|
+
let vo = this
|
|
240
|
+
return get(vo, '$store.state.syncState')
|
|
241
|
+
},
|
|
242
|
+
|
|
218
243
|
targets: function() {
|
|
219
244
|
let rs = get(this, `$store.state.targets`)
|
|
220
245
|
rs = sortBy(rs, 'order')
|
|
@@ -383,6 +408,11 @@ export default {
|
|
|
383
408
|
// console.log('rowsChange', rs)
|
|
384
409
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
385
410
|
|
|
411
|
+
//check
|
|
412
|
+
if (!vo.syncState || vo.firstLoading || vo.firstSetting) {
|
|
413
|
+
return
|
|
414
|
+
}
|
|
415
|
+
|
|
386
416
|
//isModified
|
|
387
417
|
vo.isModified = true
|
|
388
418
|
|
|
@@ -660,6 +690,18 @@ export default {
|
|
|
660
690
|
|
|
661
691
|
let vo = this
|
|
662
692
|
|
|
693
|
+
//save按鈕第一行立刻釋放視覺鎖
|
|
694
|
+
msg.pm.resolve()
|
|
695
|
+
|
|
696
|
+
//fire-and-forget, 不 await
|
|
697
|
+
vo.doSave()
|
|
698
|
+
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
doSave: function() {
|
|
702
|
+
|
|
703
|
+
let vo = this
|
|
704
|
+
|
|
663
705
|
async function core() {
|
|
664
706
|
|
|
665
707
|
//show loading
|
|
@@ -710,9 +752,6 @@ export default {
|
|
|
710
752
|
.catch(() => { })
|
|
711
753
|
.finally(() => {
|
|
712
754
|
|
|
713
|
-
//save按鈕解除loading
|
|
714
|
-
msg.pm.resolve()
|
|
715
|
-
|
|
716
755
|
//hide loading
|
|
717
756
|
vo.$ui.updateLoading(false)
|
|
718
757
|
|
|
@@ -788,6 +827,9 @@ export default {
|
|
|
788
827
|
//genOpt
|
|
789
828
|
vo.genOpt()
|
|
790
829
|
|
|
830
|
+
//firstLoading
|
|
831
|
+
vo.firstLoading = false
|
|
832
|
+
|
|
791
833
|
//bShow
|
|
792
834
|
vo.bShow = true
|
|
793
835
|
|