w-web-perm 1.0.0

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 (101) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.github/workflows/ci-test.yml +24 -0
  5. package/.jsdoc +25 -0
  6. package/.vscode/launch.json +21 -0
  7. package/LICENSE +21 -0
  8. package/README.md +24 -0
  9. package/SECURITY.md +5 -0
  10. package/babel.config.js +15 -0
  11. package/dist/css/app.79b4b59b.css +1 -0
  12. package/dist/css/chunk-vendors.65775501.css +5 -0
  13. package/dist/index.tmp +1 -0
  14. package/dist/js/app-legacy.954e168c.js +2 -0
  15. package/dist/js/app-legacy.954e168c.js.map +1 -0
  16. package/dist/js/app.954e168c.js +2 -0
  17. package/dist/js/app.954e168c.js.map +1 -0
  18. package/dist/js/chunk-vendors-legacy.f5f1a231.js +13 -0
  19. package/dist/js/chunk-vendors-legacy.f5f1a231.js.map +1 -0
  20. package/dist/js/chunk-vendors.f5f1a231.js +13 -0
  21. package/dist/js/chunk-vendors.f5f1a231.js.map +1 -0
  22. package/dist/w-web-perm.umd.js +7 -0
  23. package/dist/w-web-perm.umd.js.map +1 -0
  24. package/docs/WWebPerm.html +826 -0
  25. package/docs/WWebPerm.mjs.html +558 -0
  26. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  27. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  28. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  29. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  30. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  31. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  32. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  33. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  34. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  35. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  36. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  37. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  38. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  39. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  40. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  41. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  42. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  43. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  44. package/docs/index.html +84 -0
  45. package/docs/scripts/collapse.js +39 -0
  46. package/docs/scripts/commonNav.js +28 -0
  47. package/docs/scripts/linenumber.js +25 -0
  48. package/docs/scripts/nav.js +12 -0
  49. package/docs/scripts/polyfill.js +4 -0
  50. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  51. package/docs/scripts/prettify/lang-css.js +2 -0
  52. package/docs/scripts/prettify/prettify.js +28 -0
  53. package/docs/scripts/search.js +99 -0
  54. package/docs/styles/jsdoc.css +776 -0
  55. package/docs/styles/prettify.css +80 -0
  56. package/g.getSettings.mjs +17 -0
  57. package/g.mDb.mjs +10 -0
  58. package/g.mInitialTestData.mjs +20 -0
  59. package/g.mOrm.mjs +24 -0
  60. package/package.json +75 -0
  61. package/public/index.html +23 -0
  62. package/server/WWebPerm.mjs +486 -0
  63. package/src/App.vue +153 -0
  64. package/src/components/Common/CheckYes.vue +85 -0
  65. package/src/components/Common/CheckYesNo.vue +91 -0
  66. package/src/components/Common/LabelItem.vue +106 -0
  67. package/src/components/Common/LoadingWinBar.vue +87 -0
  68. package/src/components/Layout.vue +152 -0
  69. package/src/components/LayoutContent.vue +246 -0
  70. package/src/components/LayoutContentGroups.vue +664 -0
  71. package/src/components/LayoutContentTargets.vue +538 -0
  72. package/src/components/LayoutContentUsers.vue +493 -0
  73. package/src/components/LayoutState.vue +91 -0
  74. package/src/components/VeUser.vue +453 -0
  75. package/src/components/ruleGroup.vue +667 -0
  76. package/src/main.js +103 -0
  77. package/src/perm.mjs +61 -0
  78. package/src/plugins/mDataSelectorSchema.mjs +30 -0
  79. package/src/plugins/mDataSupport.mjs +66 -0
  80. package/src/plugins/mShare.mjs +366 -0
  81. package/src/plugins/mUI.mjs +229 -0
  82. package/src/plugins/mVuetify.mjs +12 -0
  83. package/src/schema/gi.mjs +8 -0
  84. package/src/schema/index.mjs +20 -0
  85. package/src/schema/tables/ruleGroups.mjs +100 -0
  86. package/src/schema/tables/targets.mjs +100 -0
  87. package/src/schema/tables/users.mjs +125 -0
  88. package/src/store/actions.mjs +1 -0
  89. package/src/store/getters.mjs +1 -0
  90. package/src/store/index.mjs +25 -0
  91. package/src/store/mutations.mjs +201 -0
  92. package/src/store/types.mjs +15 -0
  93. package/srv.mjs +52 -0
  94. package/tableTags-web-perm.json +1 -0
  95. package/test/all.test.mjs +10 -0
  96. package/toolg/addVersion.mjs +4 -0
  97. package/toolg/cleanFolder.mjs +4 -0
  98. package/toolg/gDistRollup.mjs +36 -0
  99. package/toolg/genEntry.mjs +23 -0
  100. package/toolg/modifyReadme.mjs +4 -0
  101. package/vue.config.js +15 -0
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <WConfirm
3
+ :show.sync="bShow"
4
+ :title="'系統確認訊息'"
5
+ :content="content"
6
+ :_contentColor="'white'"
7
+ :_contentIconColor="'white'"
8
+ :_contentBackgroundColor="'orange lighten-5'"
9
+ :headerBackgroundColor="'grey lighten-3'"
10
+ :hasNoBtn="false"
11
+ :yesBtnText="'確認'"
12
+ @click-yes="clickUnit()"
13
+ ></WConfirm>
14
+ </template>
15
+
16
+ <script>
17
+ import Vue from 'vue'
18
+ import genPm from 'wsemi/src/genPm.mjs'
19
+ import WConfirm from 'w-component-vue/src/components/WConfirm.vue'
20
+
21
+ export default {
22
+ components: {
23
+ WConfirm,
24
+ },
25
+ props: {
26
+ },
27
+ data: function() {
28
+ return {
29
+
30
+ bShow: false,
31
+ pm: null,
32
+
33
+ content: '',
34
+
35
+ }
36
+ },
37
+ mounted: function() {
38
+ //console.log('mounted')
39
+
40
+ let vo = this
41
+
42
+ //set
43
+ Vue.prototype.$dg.showCheckYes = vo.show
44
+
45
+ },
46
+ computed: {
47
+ },
48
+ methods: {
49
+
50
+ show: function (content) {
51
+ //console.log('methods show', content)
52
+
53
+ let vo = this
54
+
55
+ //pm
56
+ vo.pm = genPm()
57
+
58
+ //save
59
+ vo.content = content
60
+
61
+ //show
62
+ vo.bShow = true
63
+
64
+ return vo.pm
65
+ },
66
+
67
+ clickUnit: function() {
68
+ //console.log('methods clickUnit')
69
+
70
+ let vo = this
71
+
72
+ //resolve
73
+ vo.pm.resolve()
74
+
75
+ //hide
76
+ vo.bShow = false
77
+
78
+ },
79
+
80
+ }
81
+ }
82
+ </script>
83
+
84
+ <style scoped>
85
+ </style>
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <WConfirm
3
+ :show.sync="bShow"
4
+ :title="'系統確認訊息'"
5
+ :content="content"
6
+ :_contentColor="'white'"
7
+ :_contentIconColor="'white'"
8
+ :_contentBackgroundColor="'orange lighten-5'"
9
+ :_titleColor="'white'"
10
+ :headerBackgroundColor="'grey lighten-3'"
11
+ :noBtnText="'取消'"
12
+ :yesBtnText="'確定'"
13
+ @click-no="clickBtn(false)"
14
+ @click-yes="clickBtn(true)"
15
+ ></WConfirm>
16
+ </template>
17
+
18
+ <script>
19
+ import Vue from 'vue'
20
+ import genPm from 'wsemi/src/genPm.mjs'
21
+ import WConfirm from 'w-component-vue/src/components/WConfirm.vue'
22
+
23
+ export default {
24
+ components: {
25
+ WConfirm,
26
+ },
27
+ props: {
28
+ },
29
+ data: function() {
30
+ return {
31
+
32
+ bShow: false,
33
+ pm: null,
34
+
35
+ content: '',
36
+
37
+ }
38
+ },
39
+ mounted: function() {
40
+ //console.log('mounted')
41
+
42
+ let vo = this
43
+
44
+ //set
45
+ Vue.prototype.$dg.showCheckYesNo = vo.show
46
+
47
+ },
48
+ computed: {
49
+ },
50
+ methods: {
51
+
52
+ show: function (content) {
53
+ //console.log('methods show', content)
54
+
55
+ let vo = this
56
+
57
+ //pm
58
+ vo.pm = genPm()
59
+
60
+ //save
61
+ vo.content = content
62
+
63
+ //show
64
+ vo.bShow = true
65
+
66
+ return vo.pm
67
+ },
68
+
69
+ clickBtn: function(mode) {
70
+ //console.log('methods clickBtn', mode)
71
+
72
+ let vo = this
73
+
74
+ if (mode) {
75
+ vo.pm.resolve()
76
+ }
77
+ else {
78
+ vo.pm.reject('close')
79
+ }
80
+
81
+ //hide
82
+ vo.bShow = false
83
+
84
+ },
85
+
86
+ }
87
+ }
88
+ </script>
89
+
90
+ <style scoped>
91
+ </style>
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div
3
+ :style="`vertical-align:top;`"
4
+ >
5
+
6
+ <div style="display:table; width:100%;" v-if="inline">
7
+
8
+ <div style="display:table-cell; vertical-align:top; white-space:nowrap; padding-right:5px;">
9
+
10
+ <div :style="[{display:'inline-block'},useTitleHeight,useTitleWidth,titleStyle]">{{title}}</div>
11
+
12
+ </div>
13
+
14
+ <div style="display:table-cell; vertical-align:top; width:100%;">
15
+
16
+ <slot></slot>
17
+
18
+ </div>
19
+
20
+ </div>
21
+
22
+ <div style="" v-else>
23
+
24
+ <div style="">
25
+
26
+ <span style="font-size:0.9rem;">{{title}}</span>
27
+
28
+ </div>
29
+
30
+ <div style="">
31
+
32
+ <slot></slot>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+
43
+
44
+ export default {
45
+ components: {
46
+ },
47
+ props: {
48
+ title: {
49
+ type: String,
50
+ default: '',
51
+ },
52
+ titleHeight: {
53
+ type: Number,
54
+ default: null,
55
+ },
56
+ titleWidth: {
57
+ type: Number,
58
+ default: null,
59
+ },
60
+ titleStyle: {
61
+ type: Object,
62
+ default: () => {},
63
+ },
64
+ inline: {
65
+ type: Boolean,
66
+ default: true,
67
+ },
68
+ },
69
+ data: function() {
70
+ return {
71
+ }
72
+ },
73
+ computed: {
74
+
75
+ useTitleHeight: function() {
76
+ //console.log('computed useTitleHeight')
77
+
78
+ let vo = this
79
+
80
+ if (vo.titleHeight) {
81
+ return { height: `${vo.titleHeight}px`, lineHeight: `${vo.titleHeight}px` }
82
+ }
83
+
84
+ return {}
85
+ },
86
+
87
+ useTitleWidth: function() {
88
+ //console.log('computed useTitleWidth')
89
+
90
+ let vo = this
91
+
92
+ if (vo.titleWidth) {
93
+ return { width: `${vo.titleWidth}px` }
94
+ }
95
+
96
+ return {}
97
+ },
98
+
99
+ },
100
+ methods: {
101
+ }
102
+ }
103
+ </script>
104
+
105
+ <style scoped>
106
+ </style>
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <WDialog
3
+ :show.sync="loading"
4
+ :maxWidth="barWidth+barPadding*2"
5
+ >
6
+
7
+ <template v-slot:panel>
8
+
9
+ <div :style="`padding:${barPadding-5}px ${barPadding}px ${barPadding}px ${barPadding}px;`">
10
+
11
+
12
+ <div style="padding-bottom:3px; font-size:0.9rem; color:#666;">
13
+
14
+ <span v-if="msg!==''">{{msg}}</span>
15
+
16
+ <span v-else>處理中請稍後...</span>
17
+
18
+ </div>
19
+
20
+ <WProgressBar
21
+ :style="`width:${barWidth}px;`"
22
+ :height="3"
23
+ :enableContinuous="true"
24
+ :progColor="'deep-purple lighten-1'"
25
+ :progBackgroundColor="'deep-purple lighten-4'"
26
+ ></WProgressBar>
27
+
28
+ </div>
29
+
30
+ </template>
31
+
32
+ </WDialog>
33
+ </template>
34
+
35
+ <script>
36
+ import Vue from 'vue'
37
+ import get from 'lodash/get'
38
+ import WDialog from 'w-component-vue/src/components/WDialog.vue'
39
+ import WProgressBar from 'w-component-vue/src/components/WProgressBar.vue'
40
+
41
+
42
+ export default {
43
+ components: {
44
+ WDialog,
45
+ WProgressBar,
46
+ },
47
+ props: {
48
+ },
49
+ data: function() {
50
+ return {
51
+ barPadding: 20,
52
+ barWidth: 600,
53
+ msg: '',
54
+ }
55
+ },
56
+ mounted: function() {
57
+ //console.log('mounted')
58
+
59
+ let vo = this
60
+
61
+ //set
62
+ Vue.prototype.$dg.setLoadingWinBarMessage = vo.setMessage
63
+
64
+ },
65
+ computed: {
66
+
67
+ loading: function() {
68
+ //console.log('computed loading')
69
+
70
+ let vo = this
71
+
72
+ return get(vo, `$store.state.loading`)
73
+ },
74
+
75
+ },
76
+ methods: {
77
+
78
+ setMessage: function(msg) {
79
+ this.msg = msg
80
+ },
81
+
82
+ }
83
+ }
84
+ </script>
85
+
86
+ <style scoped>
87
+ </style>
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div style="height:100vh; background:#f5f5f5;">
3
+
4
+ <!-- menu top, 因窄版導致名稱換行故須使用overflow-y:hidden -->
5
+ <div :style="`height:${heightToolbar}px; overflow-y:hidden; padding:0px 10px; background:#fff; border-bottom:1px solid #ccc; display:flex; align-items:center;`">
6
+
7
+ <WButtonCircle
8
+ :icon="'mdi-menu'"
9
+ :tooltip="'左側選單'"
10
+ :shadow="false"
11
+ @click="drawer=!drawer"
12
+ v-if="false"
13
+ ></WButtonCircle>
14
+
15
+ <div style="padding-left:5px; white-space:nowrap">
16
+ <div style="display:flex; align-items:center;">
17
+
18
+ <div style="padding-right:10px; display:flex; align-items:center;" v-if="webLogo">
19
+ <img style="width:36px; height:36px;" :src="webLogo" />
20
+ </div>
21
+
22
+ <div>
23
+ <div style="font-size:1.2rem; color:#000;">{{webName}}</div>
24
+ <div style="font-size:0.8rem; color:#666;">{{$t('webDescription')}}</div>
25
+ </div>
26
+
27
+ </div>
28
+ </div>
29
+
30
+ <div style="width:100%;"></div>
31
+
32
+ <div style="padding-right:10px; white-space:nowrap">
33
+ <WTextSelect
34
+ style="width:100px;"
35
+ :items="tgLangs"
36
+ v-model="tgLangSelect"
37
+ @input="changeLang"
38
+ ></WTextSelect>
39
+ </div>
40
+
41
+ </div>
42
+
43
+ <div :style="`height:calc( 100% - ${heightToolbar}px );`">
44
+ <LayoutContent
45
+ ></LayoutContent>
46
+ </div>
47
+
48
+
49
+ </div>
50
+ </template>
51
+
52
+ <script>
53
+ import { mdiMenu } from '@mdi/js/mdi.js'
54
+ import get from 'lodash/get'
55
+ // import cloneDeep from 'lodash/cloneDeep'
56
+ import isestr from 'wsemi/src/isestr.mjs'
57
+ import WTextSelect from 'w-component-vue/src/components/WTextSelect.vue'
58
+ import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
59
+ import LayoutContent from './LayoutContent.vue'
60
+
61
+
62
+ export default {
63
+ components: {
64
+ WTextSelect,
65
+ WButtonCircle,
66
+ LayoutContent,
67
+ },
68
+ props: {
69
+ },
70
+ data: function() {
71
+ return {
72
+
73
+ mdiMenu,
74
+ // drawer: null, //null false
75
+ // menuKey: 'blocks',
76
+ userName: 'tester',
77
+
78
+ drawer: true, //null,
79
+
80
+ tgLangs: [
81
+ {
82
+ id: 'cht',
83
+ text: '中文',
84
+ },
85
+ {
86
+ id: 'eng',
87
+ text: 'English',
88
+ },
89
+ ],
90
+ tgLangSelect: {
91
+ id: 'cht',
92
+ text: '中文',
93
+ },
94
+
95
+ }
96
+ },
97
+ beforeMount: function() {
98
+ // console.log('beforeMount')
99
+
100
+ let vo = this
101
+
102
+ //setLang
103
+ vo.$ui.setLang(vo.tgLangSelect.id)
104
+
105
+ },
106
+ computed: {
107
+
108
+ viewState: function() {
109
+ return get(this, `$store.state.viewState`)
110
+ },
111
+
112
+ heightToolbar: function() {
113
+ return get(this, `$store.state.heightToolbar`)
114
+ },
115
+
116
+ webName: {
117
+ get() {
118
+ let vo = this
119
+ let c = vo.$t('webName')
120
+ // console.log('get webName1', c)
121
+ if (!isestr(c)) {
122
+ c = vo.$t('waitingData')
123
+ }
124
+ // console.log('get webName2', c)
125
+ document.title = c //更換網頁title
126
+ return c
127
+ },
128
+ // set(value) {
129
+ // return value
130
+ // },
131
+ },
132
+
133
+ webLogo: function() {
134
+ return get(this, `$store.state.webInfor.webLogo`)
135
+ },
136
+
137
+ },
138
+ methods: {
139
+
140
+ changeLang: function(msg) {
141
+ // console.log('methods changeLang', msg)
142
+ let vo = this
143
+ let lang = msg.id
144
+ vo.$ui.setLang(lang)
145
+ },
146
+
147
+ }
148
+ }
149
+ </script>
150
+
151
+ <style scoped>
152
+ </style>