w-web-perm 1.0.44 → 1.0.46
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 +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 +1 -0
- package/dist/css/chunk-vendors.f149e124.css +1 -0
- package/dist/index.tmp +1 -1
- package/dist/js/app-legacy.7a0dda14.js +1 -0
- package/dist/js/app.7a0dda14.js +1 -0
- package/dist/js/chunk-vendors-legacy.e8703728.js +21 -0
- package/dist/js/chunk-vendors.e8703728.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 +9 -5
- package/docs/index.html +1 -1
- package/g.initialData.mjs +3 -3
- package/g.provideUsers.mjs +3 -3
- package/package.json +9 -8
- package/server/WWebPerm.mjs +8 -4
- package/{src/plugins/mLang.mjs → server/procLang.mjs} +837 -754
- package/src/components/LayoutContentGrups.vue +26 -62
- package/src/components/LayoutContentPemis.vue +26 -62
- package/src/components/LayoutContentTargets.vue +16 -45
- package/src/components/LayoutContentUsers.vue +30 -90
- package/src/components/VeCgrups.vue +15 -46
- package/src/components/VeCpemis.vue +15 -46
- package/src/components/VeCrules.vue +11 -26
- package/src/components/VeGrupBlngUsers.vue +26 -72
- package/src/components/VePemiBlngGrups.vue +26 -72
- package/src/plugins/mUI.mjs +5 -60
- package/src/schema/tables/users.mjs +3 -3
- package/tableTags.json +1 -1
- package/test/getUserRules.test.mjs +899 -0
- package/dist/css/app.5eabcb89.css +0 -1
- package/dist/js/app-legacy.d506ca61.js +0 -1
- package/dist/js/app.d506ca61.js +0 -1
- package/dist/js/chunk-vendors-legacy.18b85e4c.js +0 -14
- package/dist/js/chunk-vendors.18b85e4c.js +0 -14
- package/test/all.test.mjs +0 -10
|
@@ -201,13 +201,33 @@
|
|
|
201
201
|
>
|
|
202
202
|
|
|
203
203
|
<template v-if="items">
|
|
204
|
-
<
|
|
204
|
+
<WAggridVue
|
|
205
205
|
ref="rftable"
|
|
206
206
|
:style="`width:100%;`"
|
|
207
207
|
:height="contentHeight"
|
|
208
208
|
:opt="opt"
|
|
209
209
|
>
|
|
210
|
-
|
|
210
|
+
<template v-slot:cell-render="props">
|
|
211
|
+
<template v-if="props.key==='name'">
|
|
212
|
+
<span v-if="errItemsByName[props.value]" :title="errItemsByName[props.value]">
|
|
213
|
+
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
214
|
+
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
215
|
+
</span>
|
|
216
|
+
<span v-else>{{ props.value }}</span>
|
|
217
|
+
</template>
|
|
218
|
+
<template v-else-if="props.key==='belongUsers'">
|
|
219
|
+
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
220
|
+
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeGrupBlngUsersById(props.row.id)">{{ props.value }}</button>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
<template v-else-if="props.key==='cpemis'">
|
|
224
|
+
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
225
|
+
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeCpemisById(props.row.id)">{{ getCpemisText(props.value) }}</button>
|
|
226
|
+
</div>
|
|
227
|
+
</template>
|
|
228
|
+
<span v-else>{{ props.value }}</span>
|
|
229
|
+
</template>
|
|
230
|
+
</WAggridVue>
|
|
211
231
|
</template>
|
|
212
232
|
|
|
213
233
|
</template>
|
|
@@ -238,14 +258,13 @@ import isestr from 'wsemi/src/isestr.mjs'
|
|
|
238
258
|
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
239
259
|
import isnum from 'wsemi/src/isnum.mjs'
|
|
240
260
|
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
241
|
-
import cstr from 'wsemi/src/cstr.mjs'
|
|
242
261
|
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
243
262
|
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
244
263
|
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
245
264
|
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
246
265
|
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
247
266
|
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
248
|
-
import
|
|
267
|
+
import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
|
|
249
268
|
|
|
250
269
|
|
|
251
270
|
export default {
|
|
@@ -255,7 +274,7 @@ export default {
|
|
|
255
274
|
WButtonCircle,
|
|
256
275
|
WPopup,
|
|
257
276
|
WInputCheckbox,
|
|
258
|
-
|
|
277
|
+
WAggridVue,
|
|
259
278
|
},
|
|
260
279
|
props: {
|
|
261
280
|
drawer: {
|
|
@@ -716,61 +735,6 @@ export default {
|
|
|
716
735
|
'belongUsers': false,
|
|
717
736
|
'cpemis': false,
|
|
718
737
|
},
|
|
719
|
-
kpCellRender: {
|
|
720
|
-
'name': (v) => {
|
|
721
|
-
// console.log('kpCellRender name', v)
|
|
722
|
-
|
|
723
|
-
//err
|
|
724
|
-
let err = get(vo.errItemsByName, v, '')
|
|
725
|
-
// console.log(v, err)
|
|
726
|
-
|
|
727
|
-
//check
|
|
728
|
-
if (isestr(err)) {
|
|
729
|
-
v = `
|
|
730
|
-
<span title="${err}">
|
|
731
|
-
<span style="color:#F57C00;">${cstr(v)}</span>
|
|
732
|
-
<img style="vertical-align:sub; width:16px; height:16px;" src="${vo.$ui.getIcon('warning')}" />
|
|
733
|
-
</span>
|
|
734
|
-
`
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
return v
|
|
738
|
-
},
|
|
739
|
-
'belongUsers': (v, k, r) => {
|
|
740
|
-
// console.log('kpCellRender belongUsers', v, k, r)
|
|
741
|
-
|
|
742
|
-
//id
|
|
743
|
-
let id = get(r, 'id', '')
|
|
744
|
-
// console.log('id', id, k, r)
|
|
745
|
-
|
|
746
|
-
//因kpHeadFocusHighlight設定false時, 仍會於點擊其他可focus的cell, 再點回時依然出現highlight的focus邊框, 故改使用stopPropagation強制吃掉點擊訊息
|
|
747
|
-
//因stopPropagation只吃掉訊息, 原本focus會處於原本可focus的cell, 再重複點時會於前個focus的cell出現highlight邊框, 故再多使用preventDefault阻止瀏覽器預設行為, 此等同於return false
|
|
748
|
-
let t = `
|
|
749
|
-
<div onclick="event.stopPropagation();event.preventDefault();" onmousedown="event.stopPropagation();event.preventDefault();">
|
|
750
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" onclick="$vo.$dg.showVeGrupBlngUsersById('${id}')">${v}</button>
|
|
751
|
-
</div>
|
|
752
|
-
`
|
|
753
|
-
|
|
754
|
-
return t
|
|
755
|
-
},
|
|
756
|
-
'cpemis': (v, k, r) => {
|
|
757
|
-
// console.log('kpCellRender cpemis', v, k, r)
|
|
758
|
-
|
|
759
|
-
//id
|
|
760
|
-
let id = get(r, 'id', '')
|
|
761
|
-
// console.log('id', id, k, r)
|
|
762
|
-
|
|
763
|
-
//因kpHeadFocusHighlight設定false時, 仍會於點擊其他可focus的cell, 再點回時依然出現highlight的focus邊框, 故改使用stopPropagation強制吃掉點擊訊息
|
|
764
|
-
//因stopPropagation只吃掉訊息, 原本focus會處於原本可focus的cell, 再重複點時會於前個focus的cell出現highlight邊框, 故再多使用preventDefault阻止瀏覽器預設行為, 此等同於return false
|
|
765
|
-
let t = `
|
|
766
|
-
<div onclick="event.stopPropagation();event.preventDefault();" onmousedown="event.stopPropagation();event.preventDefault();">
|
|
767
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" onclick="$vo.$dg.showVeCpemisById('${id}')">${vo.getCpemisText(v)}</button>
|
|
768
|
-
</div>
|
|
769
|
-
`
|
|
770
|
-
|
|
771
|
-
return t
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
738
|
rowsChange: (rs) => {
|
|
775
739
|
// console.log('rowsChange', rs)
|
|
776
740
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
@@ -801,7 +765,7 @@ export default {
|
|
|
801
765
|
let vo = this
|
|
802
766
|
|
|
803
767
|
//cmp
|
|
804
|
-
let cmp = get(vo, '$refs.rftable
|
|
768
|
+
let cmp = get(vo, '$refs.rftable')
|
|
805
769
|
// console.log('cmp', cmp)
|
|
806
770
|
|
|
807
771
|
//refresh, 因set不會觸發kpCellRender, 故須另外調用組件函數refresh, 進而觸發kpCellRender, 使能更新數據
|
|
@@ -813,7 +777,7 @@ export default {
|
|
|
813
777
|
let vo = this
|
|
814
778
|
|
|
815
779
|
//cmp
|
|
816
|
-
let cmp = get(vo, '$refs.rftable
|
|
780
|
+
let cmp = get(vo, '$refs.rftable')
|
|
817
781
|
// console.log('cmp', cmp)
|
|
818
782
|
|
|
819
783
|
//showKeys
|
|
@@ -201,13 +201,33 @@
|
|
|
201
201
|
>
|
|
202
202
|
|
|
203
203
|
<template v-if="items">
|
|
204
|
-
<
|
|
204
|
+
<WAggridVue
|
|
205
205
|
ref="rftable"
|
|
206
206
|
:style="`width:100%;`"
|
|
207
207
|
:height="contentHeight"
|
|
208
208
|
:opt="opt"
|
|
209
209
|
>
|
|
210
|
-
|
|
210
|
+
<template v-slot:cell-render="props">
|
|
211
|
+
<template v-if="props.key==='name'">
|
|
212
|
+
<span v-if="errItemsByName[props.value]" :title="errItemsByName[props.value]">
|
|
213
|
+
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
214
|
+
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
215
|
+
</span>
|
|
216
|
+
<span v-else>{{ props.value }}</span>
|
|
217
|
+
</template>
|
|
218
|
+
<template v-else-if="props.key==='belongGrups'">
|
|
219
|
+
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
220
|
+
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVePemiBlngGrupsById(props.row.id)">{{ props.value }}</button>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
<template v-else-if="props.key==='crules'">
|
|
224
|
+
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
225
|
+
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeCrulesById(props.row.id)">{{ getCrulesText(props.value) }}</button>
|
|
226
|
+
</div>
|
|
227
|
+
</template>
|
|
228
|
+
<span v-else>{{ props.value }}</span>
|
|
229
|
+
</template>
|
|
230
|
+
</WAggridVue>
|
|
211
231
|
</template>
|
|
212
232
|
|
|
213
233
|
</template>
|
|
@@ -238,14 +258,13 @@ import isestr from 'wsemi/src/isestr.mjs'
|
|
|
238
258
|
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
239
259
|
import isnum from 'wsemi/src/isnum.mjs'
|
|
240
260
|
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
241
|
-
import cstr from 'wsemi/src/cstr.mjs'
|
|
242
261
|
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
243
262
|
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
244
263
|
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
245
264
|
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
246
265
|
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
247
266
|
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
248
|
-
import
|
|
267
|
+
import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
|
|
249
268
|
|
|
250
269
|
|
|
251
270
|
export default {
|
|
@@ -255,7 +274,7 @@ export default {
|
|
|
255
274
|
WButtonCircle,
|
|
256
275
|
WPopup,
|
|
257
276
|
WInputCheckbox,
|
|
258
|
-
|
|
277
|
+
WAggridVue,
|
|
259
278
|
},
|
|
260
279
|
props: {
|
|
261
280
|
drawer: {
|
|
@@ -716,61 +735,6 @@ export default {
|
|
|
716
735
|
'belongGrups': false,
|
|
717
736
|
'crules': false,
|
|
718
737
|
},
|
|
719
|
-
kpCellRender: {
|
|
720
|
-
'name': (v) => {
|
|
721
|
-
// console.log('kpCellRender name', v)
|
|
722
|
-
|
|
723
|
-
//err
|
|
724
|
-
let err = get(vo.errItemsByName, v, '')
|
|
725
|
-
// console.log(v, err)
|
|
726
|
-
|
|
727
|
-
//check
|
|
728
|
-
if (isestr(err)) {
|
|
729
|
-
v = `
|
|
730
|
-
<span title="${err}">
|
|
731
|
-
<span style="color:#F57C00;">${cstr(v)}</span>
|
|
732
|
-
<img style="vertical-align:sub; width:16px; height:16px;" src="${vo.$ui.getIcon('warning')}" />
|
|
733
|
-
</span>
|
|
734
|
-
`
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
return v
|
|
738
|
-
},
|
|
739
|
-
'belongGrups': (v, k, r) => {
|
|
740
|
-
// console.log('kpCellRender belongGrups', v, k, r)
|
|
741
|
-
|
|
742
|
-
//id
|
|
743
|
-
let id = get(r, 'id', '')
|
|
744
|
-
// console.log('id', id, k, r)
|
|
745
|
-
|
|
746
|
-
//因kpHeadFocusHighlight設定false時, 仍會於點擊其他可focus的cell, 再點回時依然出現highlight的focus邊框, 故改使用stopPropagation強制吃掉點擊訊息
|
|
747
|
-
//因stopPropagation只吃掉訊息, 原本focus會處於原本可focus的cell, 再重複點時會於前個focus的cell出現highlight邊框, 故再多使用preventDefault阻止瀏覽器預設行為, 此等同於return false
|
|
748
|
-
let t = `
|
|
749
|
-
<div onclick="event.stopPropagation();event.preventDefault();" onmousedown="event.stopPropagation();event.preventDefault();">
|
|
750
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" onclick="$vo.$dg.showVePemiBlngGrupsById('${id}')">${v}</button>
|
|
751
|
-
</div>
|
|
752
|
-
`
|
|
753
|
-
|
|
754
|
-
return t
|
|
755
|
-
},
|
|
756
|
-
'crules': (v, k, r) => {
|
|
757
|
-
// console.log('kpCellRender crules', v, k, r)
|
|
758
|
-
|
|
759
|
-
//id
|
|
760
|
-
let id = get(r, 'id', '')
|
|
761
|
-
// console.log('id', id, k, r)
|
|
762
|
-
|
|
763
|
-
//因kpHeadFocusHighlight設定false時, 仍會於點擊其他可focus的cell, 再點回時依然出現highlight的focus邊框, 故改使用stopPropagation強制吃掉點擊訊息
|
|
764
|
-
//因stopPropagation只吃掉訊息, 原本focus會處於原本可focus的cell, 再重複點時會於前個focus的cell出現highlight邊框, 故再多使用preventDefault阻止瀏覽器預設行為, 此等同於return false
|
|
765
|
-
let t = `
|
|
766
|
-
<div onclick="event.stopPropagation();event.preventDefault();" onmousedown="event.stopPropagation();event.preventDefault();">
|
|
767
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" onclick="$vo.$dg.showVeCrulesById('${id}')">${vo.getCrulesText(v)}</button>
|
|
768
|
-
</div>
|
|
769
|
-
`
|
|
770
|
-
|
|
771
|
-
return t
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
738
|
rowsChange: (rs) => {
|
|
775
739
|
// console.log('rowsChange', rs)
|
|
776
740
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
@@ -801,7 +765,7 @@ export default {
|
|
|
801
765
|
let vo = this
|
|
802
766
|
|
|
803
767
|
//cmp
|
|
804
|
-
let cmp = get(vo, '$refs.rftable
|
|
768
|
+
let cmp = get(vo, '$refs.rftable')
|
|
805
769
|
// console.log('cmp', cmp)
|
|
806
770
|
|
|
807
771
|
//refresh, 因set不會觸發kpCellRender, 故須另外調用組件函數refresh, 進而觸發kpCellRender, 使能更新數據
|
|
@@ -813,7 +777,7 @@ export default {
|
|
|
813
777
|
let vo = this
|
|
814
778
|
|
|
815
779
|
//cmp
|
|
816
|
-
let cmp = get(vo, '$refs.rftable
|
|
780
|
+
let cmp = get(vo, '$refs.rftable')
|
|
817
781
|
// console.log('cmp', cmp)
|
|
818
782
|
|
|
819
783
|
//showKeys
|
|
@@ -201,13 +201,23 @@
|
|
|
201
201
|
>
|
|
202
202
|
|
|
203
203
|
<template v-if="items">
|
|
204
|
-
<
|
|
204
|
+
<WAggridVue
|
|
205
205
|
ref="rftable"
|
|
206
206
|
:style="`width:100%;`"
|
|
207
207
|
:height="contentHeight"
|
|
208
208
|
:opt="opt"
|
|
209
209
|
>
|
|
210
|
-
|
|
210
|
+
<template v-slot:cell-render="props">
|
|
211
|
+
<template v-if="props.key==='id'">
|
|
212
|
+
<span v-if="errItemsById[props.value]" :title="errItemsById[props.value]">
|
|
213
|
+
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
214
|
+
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
215
|
+
</span>
|
|
216
|
+
<span v-else>{{ props.value }}</span>
|
|
217
|
+
</template>
|
|
218
|
+
<span v-else>{{ props.value }}</span>
|
|
219
|
+
</template>
|
|
220
|
+
</WAggridVue>
|
|
211
221
|
</template>
|
|
212
222
|
|
|
213
223
|
</template>
|
|
@@ -235,14 +245,13 @@ import isestr from 'wsemi/src/isestr.mjs'
|
|
|
235
245
|
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
236
246
|
import isnum from 'wsemi/src/isnum.mjs'
|
|
237
247
|
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
238
|
-
import cstr from 'wsemi/src/cstr.mjs'
|
|
239
248
|
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
240
249
|
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
241
250
|
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
242
251
|
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
243
252
|
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
244
253
|
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
245
|
-
import
|
|
254
|
+
import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
|
|
246
255
|
|
|
247
256
|
|
|
248
257
|
export default {
|
|
@@ -252,7 +261,7 @@ export default {
|
|
|
252
261
|
WButtonCircle,
|
|
253
262
|
WPopup,
|
|
254
263
|
WInputCheckbox,
|
|
255
|
-
|
|
264
|
+
WAggridVue,
|
|
256
265
|
},
|
|
257
266
|
props: {
|
|
258
267
|
drawer: {
|
|
@@ -605,44 +614,6 @@ export default {
|
|
|
605
614
|
kpCellEditable,
|
|
606
615
|
kpRowDrag,
|
|
607
616
|
kpHeadCheckBox,
|
|
608
|
-
kpCellRender: {
|
|
609
|
-
'id': (v) => {
|
|
610
|
-
// console.log('kpCellRender', v)
|
|
611
|
-
|
|
612
|
-
//err
|
|
613
|
-
let err = get(vo.errItemsById, v, '')
|
|
614
|
-
// console.log(v, err)
|
|
615
|
-
|
|
616
|
-
//check
|
|
617
|
-
if (isestr(err)) {
|
|
618
|
-
v = `
|
|
619
|
-
<span title="${err}">
|
|
620
|
-
<span style="color:#F57C00;">${cstr(v)}</span>
|
|
621
|
-
<img style="vertical-align:sub; width:16px; height:16px;" src="${vo.$ui.getIcon('warning')}" />
|
|
622
|
-
</span>
|
|
623
|
-
`
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
return v
|
|
627
|
-
},
|
|
628
|
-
},
|
|
629
|
-
// kpCellTooltip: {
|
|
630
|
-
// 'id': (v) => {
|
|
631
|
-
// // console.log('kpCellTooltip', v)
|
|
632
|
-
|
|
633
|
-
// //err
|
|
634
|
-
// let err = get(vo.errItemsById, v, '')
|
|
635
|
-
// // console.log(v, err)
|
|
636
|
-
|
|
637
|
-
// //check
|
|
638
|
-
// let t = ''
|
|
639
|
-
// if (isestr(err)) {
|
|
640
|
-
// t = err
|
|
641
|
-
// }
|
|
642
|
-
|
|
643
|
-
// return t
|
|
644
|
-
// },
|
|
645
|
-
// },
|
|
646
617
|
rowsChange: (rs) => {
|
|
647
618
|
// console.log('rowsChange', rs)
|
|
648
619
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
@@ -673,7 +644,7 @@ export default {
|
|
|
673
644
|
let vo = this
|
|
674
645
|
|
|
675
646
|
//cmp
|
|
676
|
-
let cmp = get(vo, '$refs.rftable
|
|
647
|
+
let cmp = get(vo, '$refs.rftable')
|
|
677
648
|
// console.log('cmp', cmp)
|
|
678
649
|
|
|
679
650
|
//refresh, 因set不會觸發kpCellRender, 故須另外調用組件函數refresh, 進而觸發kpCellRender, 使能更新數據
|
|
@@ -685,7 +656,7 @@ export default {
|
|
|
685
656
|
let vo = this
|
|
686
657
|
|
|
687
658
|
//cmp
|
|
688
|
-
let cmp = get(vo, '$refs.rftable
|
|
659
|
+
let cmp = get(vo, '$refs.rftable')
|
|
689
660
|
// console.log('cmp', cmp)
|
|
690
661
|
|
|
691
662
|
//showKeys
|
|
@@ -201,13 +201,37 @@
|
|
|
201
201
|
>
|
|
202
202
|
|
|
203
203
|
<template v-if="items">
|
|
204
|
-
<
|
|
204
|
+
<WAggridVue
|
|
205
205
|
ref="rftable"
|
|
206
206
|
:style="`width:100%;`"
|
|
207
207
|
:height="contentHeight"
|
|
208
208
|
:opt="opt"
|
|
209
209
|
>
|
|
210
|
-
|
|
210
|
+
<template v-slot:cell-render="props">
|
|
211
|
+
<template v-if="props.key==='name'">
|
|
212
|
+
<span v-if="errItemsByName[props.value]" :title="errItemsByName[props.value]">
|
|
213
|
+
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
214
|
+
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
215
|
+
</span>
|
|
216
|
+
<span v-else>{{ props.value }}</span>
|
|
217
|
+
</template>
|
|
218
|
+
<template v-else-if="props.key==='email'">
|
|
219
|
+
<span v-if="errItemsByEmail[props.value]" :title="errItemsByEmail[props.value]">
|
|
220
|
+
<span style="color:#F57C00;">{{ props.value }}</span>
|
|
221
|
+
<img style="vertical-align:sub; width:16px; height:16px;" :src="$ui.getIcon('warning')" />
|
|
222
|
+
</span>
|
|
223
|
+
<span v-else>{{ props.value }}</span>
|
|
224
|
+
</template>
|
|
225
|
+
<template v-else-if="props.key==='cgrups'">
|
|
226
|
+
<div @click.stop.prevent @mousedown.stop.prevent>
|
|
227
|
+
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" @click="$dg.showVeCgrupsById(props.row.id)">{{ getCgrupsText(props.value) }}</button>
|
|
228
|
+
</div>
|
|
229
|
+
</template>
|
|
230
|
+
<input v-else-if="props.key==='isAdmin'" type="checkbox" :checked="props.value === 'y'" @click="toggleItemIsAdminById(props.row.id)" :disabled="!isEditable" />
|
|
231
|
+
<input v-else-if="props.key==='isActive'" type="checkbox" :checked="props.value === 'y'" @click="toggleItemIsActiveById(props.row.id)" :disabled="!isEditable" />
|
|
232
|
+
<span v-else>{{ props.value }}</span>
|
|
233
|
+
</template>
|
|
234
|
+
</WAggridVue>
|
|
211
235
|
</template>
|
|
212
236
|
|
|
213
237
|
</template>
|
|
@@ -238,14 +262,13 @@ import iseobj from 'wsemi/src/iseobj.mjs'
|
|
|
238
262
|
import isnum from 'wsemi/src/isnum.mjs'
|
|
239
263
|
import isEmail from 'wsemi/src/isEmail.mjs'
|
|
240
264
|
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
241
|
-
import cstr from 'wsemi/src/cstr.mjs'
|
|
242
265
|
import arrPull from 'wsemi/src/arrPull.mjs'
|
|
243
266
|
import WIcon from 'w-component-vue/src/components/WIcon.vue'
|
|
244
267
|
import WSwitch from 'w-component-vue/src/components/WSwitch.vue'
|
|
245
268
|
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
246
269
|
import WPopup from 'w-component-vue/src/components/WPopup.vue'
|
|
247
270
|
import WInputCheckbox from 'w-component-vue/src/components/WInputCheckbox.vue'
|
|
248
|
-
import
|
|
271
|
+
import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
|
|
249
272
|
|
|
250
273
|
|
|
251
274
|
export default {
|
|
@@ -255,7 +278,7 @@ export default {
|
|
|
255
278
|
WButtonCircle,
|
|
256
279
|
WPopup,
|
|
257
280
|
WInputCheckbox,
|
|
258
|
-
|
|
281
|
+
WAggridVue,
|
|
259
282
|
},
|
|
260
283
|
props: {
|
|
261
284
|
drawer: {
|
|
@@ -708,89 +731,6 @@ export default {
|
|
|
708
731
|
kpHeadFocusHighlight: { //雖然效果不完全, 但因按鈕與cell有padding可被點擊, 故還是需要開啟
|
|
709
732
|
'cgrups': false,
|
|
710
733
|
},
|
|
711
|
-
kpCellRender: {
|
|
712
|
-
'name': (v) => {
|
|
713
|
-
// console.log('kpCellRender name', v)
|
|
714
|
-
|
|
715
|
-
//err
|
|
716
|
-
let err = get(vo.errItemsByName, v, '')
|
|
717
|
-
// console.log(v, err)
|
|
718
|
-
|
|
719
|
-
//check
|
|
720
|
-
if (isestr(err)) {
|
|
721
|
-
v = `
|
|
722
|
-
<span title="${err}">
|
|
723
|
-
<span style="color:#F57C00;">${cstr(v)}</span>
|
|
724
|
-
<img style="vertical-align:sub; width:16px; height:16px;" src="${vo.$ui.getIcon('warning')}" />
|
|
725
|
-
</span>
|
|
726
|
-
`
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
return v
|
|
730
|
-
},
|
|
731
|
-
'email': (v) => {
|
|
732
|
-
// console.log('kpCellRender email', v)
|
|
733
|
-
|
|
734
|
-
//err
|
|
735
|
-
let err = get(vo.errItemsByEmail, v, '')
|
|
736
|
-
// console.log(v, err)
|
|
737
|
-
|
|
738
|
-
//check
|
|
739
|
-
if (isestr(err)) {
|
|
740
|
-
v = `
|
|
741
|
-
<span title="${err}">
|
|
742
|
-
<span style="color:#F57C00;">${cstr(v)}</span>
|
|
743
|
-
<img style="vertical-align:sub; width:16px; height:16px;" src="${vo.$ui.getIcon('warning')}" />
|
|
744
|
-
</span>
|
|
745
|
-
`
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return v
|
|
749
|
-
},
|
|
750
|
-
'cgrups': (v, k, r) => {
|
|
751
|
-
// console.log('kpCellRender cgrups', v, k, r)
|
|
752
|
-
|
|
753
|
-
//id
|
|
754
|
-
let id = get(r, 'id', '')
|
|
755
|
-
// console.log('id', id, k, r)
|
|
756
|
-
|
|
757
|
-
//因kpHeadFocusHighlight設定false時, 仍會於點擊其他可focus的cell, 再點回時依然出現highlight的focus邊框, 故改使用stopPropagation強制吃掉點擊訊息
|
|
758
|
-
//因stopPropagation只吃掉訊息, 原本focus會處於原本可focus的cell, 再重複點時會於前個focus的cell出現highlight邊框, 故再多使用preventDefault阻止瀏覽器預設行為, 此等同於return false
|
|
759
|
-
let t = `
|
|
760
|
-
<div onclick="event.stopPropagation();event.preventDefault();" onmousedown="event.stopPropagation();event.preventDefault();">
|
|
761
|
-
<button style="width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" onclick="$vo.$dg.showVeCgrupsById('${id}')">${vo.getCgrupsText(v)}</button>
|
|
762
|
-
</div>
|
|
763
|
-
`
|
|
764
|
-
|
|
765
|
-
return t
|
|
766
|
-
},
|
|
767
|
-
'isAdmin': (v, k, r) => {
|
|
768
|
-
// console.log('kpCellRender isAdmin', v, k, r)
|
|
769
|
-
|
|
770
|
-
//id
|
|
771
|
-
let id = get(r, 'id', '')
|
|
772
|
-
// console.log('id', id, k, r)
|
|
773
|
-
|
|
774
|
-
let t = `
|
|
775
|
-
<input type="checkbox" ${v === 'y' ? 'checked' : ''} onclick="$vo.$dg.toggleItemIsAdminById('${id}')" ${vo.isEditable ? '' : 'disabled'} />
|
|
776
|
-
`
|
|
777
|
-
|
|
778
|
-
return t
|
|
779
|
-
},
|
|
780
|
-
'isActive': (v, k, r) => {
|
|
781
|
-
// console.log('kpCellRender isActive', v, k, r)
|
|
782
|
-
|
|
783
|
-
//id
|
|
784
|
-
let id = get(r, 'id', '')
|
|
785
|
-
// console.log('id', id, k, r)
|
|
786
|
-
|
|
787
|
-
let t = `
|
|
788
|
-
<input type="checkbox" ${v === 'y' ? 'checked' : ''} onclick="$vo.$dg.toggleItemIsActiveById('${id}')" ${vo.isEditable ? '' : 'disabled'} />
|
|
789
|
-
`
|
|
790
|
-
|
|
791
|
-
return t
|
|
792
|
-
},
|
|
793
|
-
},
|
|
794
734
|
rowsChange: (rs) => {
|
|
795
735
|
// console.log('rowsChange', rs)
|
|
796
736
|
// console.log('rowsChange cloneDeep(vo.opt.rows)', cloneDeep(vo.opt.rows))
|
|
@@ -821,7 +761,7 @@ export default {
|
|
|
821
761
|
let vo = this
|
|
822
762
|
|
|
823
763
|
//cmp
|
|
824
|
-
let cmp = get(vo, '$refs.rftable
|
|
764
|
+
let cmp = get(vo, '$refs.rftable')
|
|
825
765
|
// console.log('cmp', cmp)
|
|
826
766
|
|
|
827
767
|
//refresh, 因set不會觸發kpCellRender, 故須另外調用組件函數refresh, 進而觸發kpCellRender, 使能更新數據
|
|
@@ -833,7 +773,7 @@ export default {
|
|
|
833
773
|
let vo = this
|
|
834
774
|
|
|
835
775
|
//cmp
|
|
836
|
-
let cmp = get(vo, '$refs.rftable
|
|
776
|
+
let cmp = get(vo, '$refs.rftable')
|
|
837
777
|
// console.log('cmp', cmp)
|
|
838
778
|
|
|
839
779
|
//showKeys
|