w-web-api 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.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +54 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +14 -0
- package/dist/w-web-api.umd.js +7 -0
- package/dist/w-web-api.umd.js.map +1 -0
- package/docs/WWebApi.html +551 -0
- package/docs/WWebApi.mjs.html +335 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/index.html +81 -0
- package/docs/scripts/collapse.js +20 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +83 -0
- package/docs/styles/jsdoc.css +765 -0
- package/docs/styles/prettify.css +79 -0
- package/package.json +81 -0
- package/public/connecting.svg +10 -0
- package/public/deny.png +0 -0
- package/public/disconnect.png +0 -0
- package/public/index.html +23 -0
- package/public/logout.png +0 -0
- package/server/WWebApi.mjs +283 -0
- package/server/getSettings.mjs +17 -0
- package/server/mDb.mjs +76 -0
- package/server/mInitialTestData.mjs +40 -0
- package/server/mOrm.mjs +22 -0
- package/src/App.vue +91 -0
- package/src/components/Layout.vue +131 -0
- package/src/components/LayoutContent.vue +67 -0
- package/src/components/LayoutContentList.vue +573 -0
- package/src/components/MdPanel.vue +152 -0
- package/src/main.js +98 -0
- package/src/plugins/mDataSelectorSchema.mjs +30 -0
- package/src/plugins/mDataSupport.mjs +78 -0
- package/src/plugins/mShare.mjs +235 -0
- package/src/plugins/mUI.mjs +141 -0
- package/src/plugins/mVuetify.mjs +12 -0
- package/src/schema/gi.mjs +8 -0
- package/src/schema/index.mjs +16 -0
- package/src/schema/tables/apis.mjs +918 -0
- package/src/store/actions.mjs +1 -0
- package/src/store/getters.mjs +1 -0
- package/src/store/index.mjs +25 -0
- package/src/store/mutations.mjs +185 -0
- package/src/store/types.mjs +14 -0
- package/srv.mjs +33 -0
- package/tableTags.json +1 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +4 -0
- package/toolg/gDistRollup.mjs +34 -0
- package/toolg/modifyReadme.mjs +4 -0
- package/vue.config.js +15 -0
package/src/App.vue
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-domresize
|
|
4
|
+
@domresize="resize"
|
|
5
|
+
>
|
|
6
|
+
|
|
7
|
+
<transition enter-active-class="fade-enter-active" leave-active-class="fade-leave-active">
|
|
8
|
+
<Layout v-if="ready"></Layout>
|
|
9
|
+
</transition>
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
// import get from 'lodash/get'
|
|
16
|
+
// import find from 'lodash/find'
|
|
17
|
+
import Layout from './components/Layout.vue'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
components: {
|
|
22
|
+
Layout,
|
|
23
|
+
},
|
|
24
|
+
data: function() {
|
|
25
|
+
return {
|
|
26
|
+
|
|
27
|
+
ready: true,
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
|
|
33
|
+
resize: function(msg) {
|
|
34
|
+
// console.log('methods resize', msg)
|
|
35
|
+
|
|
36
|
+
let vo = this
|
|
37
|
+
|
|
38
|
+
//syncHeight
|
|
39
|
+
vo.$ui.syncHeight()
|
|
40
|
+
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
html,
|
|
49
|
+
body {
|
|
50
|
+
font-family: '微軟正黑體', 'Microsoft JhengHei', 'MicrosoftJhengHeiRegular', 'Avenir', Helvetica, Arial, sans-serif;
|
|
51
|
+
overflow-y: hidden;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
div,
|
|
55
|
+
p,
|
|
56
|
+
span,
|
|
57
|
+
a,
|
|
58
|
+
pre,
|
|
59
|
+
input,
|
|
60
|
+
textarea,
|
|
61
|
+
button {
|
|
62
|
+
font-family: inherit;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.v-application, .v-application--wrap {
|
|
66
|
+
font-family: inherit;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.v-chip {
|
|
70
|
+
cursor: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.fade-enter-active {
|
|
74
|
+
animation: go 1s;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.fade-leave-active {
|
|
78
|
+
animation: back 1s;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes go {
|
|
82
|
+
from { opacity: 0; }
|
|
83
|
+
to {opacity: 1;}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes back {
|
|
87
|
+
from { opacity: 1; }
|
|
88
|
+
to { opacity: 0; }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="height:100vh; background:#f5f5f5;">
|
|
3
|
+
|
|
4
|
+
<div :style="`height:${heightToolbar}px; padding:0px 10px; display:flex; align-items:center; background:#fff; border-bottom:1px solid #ccc;`">
|
|
5
|
+
|
|
6
|
+
<WButtonCircle
|
|
7
|
+
:icon="'mdi-menu'"
|
|
8
|
+
:tooltip="'左側選單'"
|
|
9
|
+
:shadow="false"
|
|
10
|
+
@click="drawer = !drawer"
|
|
11
|
+
v-if="false"
|
|
12
|
+
></WButtonCircle>
|
|
13
|
+
|
|
14
|
+
<WButtonCircle
|
|
15
|
+
:icon="'mdi-menu'"
|
|
16
|
+
:tooltip="'cht'"
|
|
17
|
+
:shadow="false"
|
|
18
|
+
@click="$store.commit($store.types.UpdateLang, 'cht')"
|
|
19
|
+
v-if="false"
|
|
20
|
+
></WButtonCircle>
|
|
21
|
+
|
|
22
|
+
<WButtonCircle
|
|
23
|
+
:icon="'mdi-menu'"
|
|
24
|
+
:tooltip="'eng'"
|
|
25
|
+
:shadow="false"
|
|
26
|
+
@click="$store.commit($store.types.UpdateLang, 'eng')"
|
|
27
|
+
v-if="false"
|
|
28
|
+
></WButtonCircle>
|
|
29
|
+
|
|
30
|
+
<div style="padding-left:10px; font-size:1.2rem; color:#000; white-space:nowrap">
|
|
31
|
+
<div>{{webName}}</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div style="width:100%;"></div>
|
|
35
|
+
|
|
36
|
+
<div style="padding-right:10px; white-space:nowrap">
|
|
37
|
+
<WTextSelect
|
|
38
|
+
:items="tgLangs"
|
|
39
|
+
v-model="tgLangSelect"
|
|
40
|
+
@input="changeLang"
|
|
41
|
+
></WTextSelect>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div :style="`height:calc( 100% - ${heightToolbar}px );`">
|
|
47
|
+
<LayoutContent
|
|
48
|
+
></LayoutContent>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
import get from 'lodash/get'
|
|
56
|
+
// import cloneDeep from 'lodash/cloneDeep'
|
|
57
|
+
import WButtonCircle from 'w-component-vue/src/components/WButtonCircle.vue'
|
|
58
|
+
import WTextSelect from 'w-component-vue/src/components/WTextSelect.vue'
|
|
59
|
+
import LayoutContent from './LayoutContent.vue'
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
components: {
|
|
64
|
+
WButtonCircle,
|
|
65
|
+
WTextSelect,
|
|
66
|
+
LayoutContent,
|
|
67
|
+
},
|
|
68
|
+
props: {
|
|
69
|
+
},
|
|
70
|
+
data: function() {
|
|
71
|
+
return {
|
|
72
|
+
|
|
73
|
+
drawer: false, //null,
|
|
74
|
+
|
|
75
|
+
tgLangs: [
|
|
76
|
+
{
|
|
77
|
+
id: 'cht',
|
|
78
|
+
text: '中文',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'eng',
|
|
82
|
+
text: 'English',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
tgLangSelect: {
|
|
86
|
+
id: 'cht',
|
|
87
|
+
text: '中文',
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
computed: {
|
|
93
|
+
|
|
94
|
+
heightToolbar: function() {
|
|
95
|
+
return get(this, `$store.state.heightToolbar`)
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
kpTexts: function() {
|
|
99
|
+
return this.$ui.getKpLang()
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
webName: function() {
|
|
103
|
+
let name = get(this, 'kpTexts.webName', this.kpTexts.waitingData)
|
|
104
|
+
document.title = name //更換網頁title
|
|
105
|
+
return name
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
lang: function() {
|
|
109
|
+
return get(this, `$store.state.lang`)
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
viewState: function() {
|
|
113
|
+
return get(this, `$store.state.viewState`)
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
},
|
|
117
|
+
methods: {
|
|
118
|
+
|
|
119
|
+
changeLang: function(msg) {
|
|
120
|
+
// console.log('methods changeLang', msg)
|
|
121
|
+
let vo = this
|
|
122
|
+
let lang = msg.id
|
|
123
|
+
vo.$store.commit(vo.$store.types.UpdateLang, lang)
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style scoped>
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="height:100%;">
|
|
3
|
+
|
|
4
|
+
<template v-if="syncState">
|
|
5
|
+
|
|
6
|
+
<LayoutContentList></LayoutContentList>
|
|
7
|
+
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
style="padding:20px; font-size:0.9rem;"
|
|
12
|
+
v-else
|
|
13
|
+
>
|
|
14
|
+
{{kpTexts.waitingData}}
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import get from 'lodash/get'
|
|
22
|
+
// import map from 'lodash/map'
|
|
23
|
+
// import each from 'lodash/each'
|
|
24
|
+
// import size from 'lodash/size'
|
|
25
|
+
// import cloneDeep from 'lodash/cloneDeep'
|
|
26
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
27
|
+
// import isnum from 'wsemi/src/isnum.mjs'
|
|
28
|
+
// import cdbl from 'wsemi/src/cdbl.mjs'
|
|
29
|
+
// import WPanelBulge from 'w-component-vue/src/components/WPanelBulge.vue'
|
|
30
|
+
// import WButtonChip from 'w-component-vue/src/components/WButtonChip.vue'
|
|
31
|
+
// import WGroupCheck from 'w-component-vue/src/components/WGroupCheck.vue'
|
|
32
|
+
// import WTree from 'w-component-vue/src/components/WTree.vue'
|
|
33
|
+
import LayoutContentList from './LayoutContentList.vue'
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
components: {
|
|
38
|
+
// WPanelBulge,
|
|
39
|
+
// WButtonChip,
|
|
40
|
+
// WGroupCheck,
|
|
41
|
+
// WTree,
|
|
42
|
+
LayoutContentList,
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
},
|
|
46
|
+
data: function() {
|
|
47
|
+
return {
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
|
|
52
|
+
kpTexts: function() {
|
|
53
|
+
return this.$ui.getKpLang()
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
syncState: function() {
|
|
57
|
+
return get(this, '$store.state.syncState')
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
},
|
|
61
|
+
methods: {
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style scoped>
|
|
67
|
+
</style>
|