w-web-api 1.0.7 → 1.0.10
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/dist/css/{app.ff30ea93.css → app.c0e1f74a.css} +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.6ec60f77.js +2 -0
- package/dist/js/app.6ec60f77.js.map +1 -0
- package/dist/js/chunk-vendors.8193f50a.js +24 -0
- package/dist/js/chunk-vendors.8193f50a.js.map +1 -0
- package/dist/w-web-api.umd.js +2 -2
- package/dist/w-web-api.umd.js.map +1 -1
- package/docs/WWebApi.html +1 -1
- package/docs/WWebApi.mjs.html +11 -1
- package/docs/index.html +1 -1
- package/g.mDb.mjs +3 -69
- package/g.mInitialTestData.mjs +3 -23
- package/package.json +2 -2
- package/server/WWebApi.mjs +10 -0
- package/server/provideApis.mjs +1 -1
- package/src/App.vue +9 -0
- package/src/components/Layout.vue +44 -31
- package/src/components/LayoutContent.vue +1 -5
- package/src/components/LayoutContentList.vue +35 -39
- package/src/main.js +3 -1
- package/src/plugins/mDataSupport.mjs +50 -62
- package/src/plugins/mShare.mjs +36 -227
- package/src/plugins/mUI.mjs +87 -11
- package/src/store/mutations.mjs +10 -1
- package/src/store/types.mjs +1 -0
- package/srv.mjs +6 -1
- package/tableTags-web-api.json +1 -1
- package/dist/js/app.462646b9.js +0 -2
- package/dist/js/app.462646b9.js.map +0 -1
- package/dist/js/chunk-vendors.f69911fd.js +0 -28
- package/dist/js/chunk-vendors.f69911fd.js.map +0 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import min from 'lodash/min'
|
|
2
|
-
import size from 'lodash/size'
|
|
3
|
-
import take from 'lodash/take'
|
|
4
|
-
import isEqual from 'lodash/isEqual'
|
|
5
|
-
import uniq from 'lodash/uniq'
|
|
6
|
-
import set from 'lodash/set'
|
|
7
|
-
import get from 'lodash/get'
|
|
8
|
-
import each from 'lodash/each'
|
|
9
|
-
import map from 'lodash/map'
|
|
10
|
-
import filter from 'lodash/filter'
|
|
11
|
-
import last from 'lodash/last'
|
|
12
|
-
import split from 'lodash/split'
|
|
13
|
-
import join from 'lodash/join'
|
|
14
|
-
import drop from 'lodash/drop'
|
|
15
|
-
import dropRight from 'lodash/dropRight'
|
|
16
|
-
import groupBy from 'lodash/groupBy'
|
|
17
|
-
import sortBy from 'lodash/sortBy'
|
|
18
|
-
import cloneDeep from 'lodash/cloneDeep'
|
|
19
|
-
import cint from 'wsemi/src/cint.mjs'
|
|
20
|
-
import delay from 'wsemi/src/delay.mjs'
|
|
21
|
-
import isarr from 'wsemi/src/isarr.mjs'
|
|
22
|
-
import isestr from 'wsemi/src/isestr.mjs'
|
|
23
|
-
import isfun from 'wsemi/src/isfun.mjs'
|
|
24
|
-
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
25
|
-
import isearr from 'wsemi/src/isearr.mjs'
|
|
26
|
-
import isEle from 'wsemi/src/isEle.mjs'
|
|
27
|
-
import strleft from 'wsemi/src/strleft.mjs'
|
|
28
|
-
import strdelleft from 'wsemi/src/strdelleft.mjs'
|
|
29
|
-
import sep from 'wsemi/src/sep.mjs'
|
|
30
|
-
import aes2str from 'wsemi/src/aes2str.mjs'
|
|
31
|
-
import str2aes from 'wsemi/src/str2aes.mjs'
|
|
32
|
-
import haskey from 'wsemi/src/haskey.mjs'
|
|
33
|
-
import genPm from 'wsemi/src/genPm.mjs'
|
|
34
|
-
import pmSeries from 'wsemi/src/pmSeries.mjs'
|
|
35
|
-
import waitFun from 'wsemi/src/waitFun.mjs'
|
|
36
|
-
import browserView from 'wsemi/src/browserView.mjs'
|
|
37
|
-
import arrHas from 'wsemi/src/arrHas.mjs'
|
|
38
|
-
import arrSort from 'wsemi/src/arrSort.mjs'
|
|
39
|
-
import arrInsert from 'wsemi/src/arrInsert.mjs'
|
|
40
|
-
import replace from 'wsemi/src/replace.mjs'
|
|
41
|
-
import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
|
|
42
|
-
import convertToTree from 'wsemi/src/convertToTree.mjs'
|
|
43
|
-
import html2picDyn from 'wsemi/src/html2picDyn.mjs'
|
|
44
|
-
import urlParse from 'wsemi/src/urlParse.mjs'
|
|
45
|
-
import domConvertToPicDyn from 'wsemi/src/domConvertToPicDyn.mjs'
|
|
46
|
-
import ltdtkeysheads2mat from 'wsemi/src/ltdtkeysheads2mat.mjs'
|
|
47
|
-
import downloadFileFromB64 from 'wsemi/src/downloadFileFromB64.mjs'
|
|
48
|
-
import downloadExcelFileFromDataDyn from 'wsemi/src/downloadExcelFileFromDataDyn.mjs'
|
|
49
|
-
import getFileAccept from 'wsemi/src/getFileAccept.mjs'
|
|
50
|
-
import downloadFileFromU8Arr from 'wsemi/src/downloadFileFromU8Arr.mjs'
|
|
1
|
+
// import min from 'lodash/min'
|
|
2
|
+
// import size from 'lodash/size'
|
|
3
|
+
// import take from 'lodash/take'
|
|
4
|
+
// import isEqual from 'lodash/isEqual'
|
|
5
|
+
// import uniq from 'lodash/uniq'
|
|
6
|
+
// import set from 'lodash/set'
|
|
7
|
+
// import get from 'lodash/get'
|
|
8
|
+
// import each from 'lodash/each'
|
|
9
|
+
// import map from 'lodash/map'
|
|
10
|
+
// import filter from 'lodash/filter'
|
|
11
|
+
// import last from 'lodash/last'
|
|
12
|
+
// import split from 'lodash/split'
|
|
13
|
+
// import join from 'lodash/join'
|
|
14
|
+
// import drop from 'lodash/drop'
|
|
15
|
+
// import dropRight from 'lodash/dropRight'
|
|
16
|
+
// import groupBy from 'lodash/groupBy'
|
|
17
|
+
// import sortBy from 'lodash/sortBy'
|
|
18
|
+
// import cloneDeep from 'lodash/cloneDeep'
|
|
19
|
+
// import cint from 'wsemi/src/cint.mjs'
|
|
20
|
+
// import delay from 'wsemi/src/delay.mjs'
|
|
21
|
+
// import isarr from 'wsemi/src/isarr.mjs'
|
|
22
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
23
|
+
// import isfun from 'wsemi/src/isfun.mjs'
|
|
24
|
+
// import iseobj from 'wsemi/src/iseobj.mjs'
|
|
25
|
+
// import isearr from 'wsemi/src/isearr.mjs'
|
|
26
|
+
// import isEle from 'wsemi/src/isEle.mjs'
|
|
27
|
+
// import strleft from 'wsemi/src/strleft.mjs'
|
|
28
|
+
// import strdelleft from 'wsemi/src/strdelleft.mjs'
|
|
29
|
+
// import sep from 'wsemi/src/sep.mjs'
|
|
30
|
+
// import aes2str from 'wsemi/src/aes2str.mjs'
|
|
31
|
+
// import str2aes from 'wsemi/src/str2aes.mjs'
|
|
32
|
+
// import haskey from 'wsemi/src/haskey.mjs'
|
|
33
|
+
// import genPm from 'wsemi/src/genPm.mjs'
|
|
34
|
+
// import pmSeries from 'wsemi/src/pmSeries.mjs'
|
|
35
|
+
// import waitFun from 'wsemi/src/waitFun.mjs'
|
|
36
|
+
// import browserView from 'wsemi/src/browserView.mjs'
|
|
37
|
+
// import arrHas from 'wsemi/src/arrHas.mjs'
|
|
38
|
+
// import arrSort from 'wsemi/src/arrSort.mjs'
|
|
39
|
+
// import arrInsert from 'wsemi/src/arrInsert.mjs'
|
|
40
|
+
// import replace from 'wsemi/src/replace.mjs'
|
|
41
|
+
// import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
|
|
42
|
+
// import convertToTree from 'wsemi/src/convertToTree.mjs'
|
|
43
|
+
// import html2picDyn from 'wsemi/src/html2picDyn.mjs'
|
|
44
|
+
// import urlParse from 'wsemi/src/urlParse.mjs'
|
|
45
|
+
// import domConvertToPicDyn from 'wsemi/src/domConvertToPicDyn.mjs'
|
|
46
|
+
// import ltdtkeysheads2mat from 'wsemi/src/ltdtkeysheads2mat.mjs'
|
|
47
|
+
// import downloadFileFromB64 from 'wsemi/src/downloadFileFromB64.mjs'
|
|
48
|
+
// import downloadExcelFileFromDataDyn from 'wsemi/src/downloadExcelFileFromDataDyn.mjs'
|
|
49
|
+
// import getFileAccept from 'wsemi/src/getFileAccept.mjs'
|
|
50
|
+
// import downloadFileFromU8Arr from 'wsemi/src/downloadFileFromU8Arr.mjs'
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
function mDataSupport(vo, opt = {}) {
|
|
@@ -55,19 +55,7 @@ function mDataSupport(vo, opt = {}) {
|
|
|
55
55
|
|
|
56
56
|
return {
|
|
57
57
|
|
|
58
|
-
// getMetadataByTablenameAndId,
|
|
59
|
-
|
|
60
|
-
// getProjectBasic,
|
|
61
|
-
// getProjectsBasic,
|
|
62
|
-
|
|
63
|
-
// treeMds,
|
|
64
|
-
// treeProjectsBasicAndMds,
|
|
65
|
-
|
|
66
58
|
// mdCheckKeyInd,
|
|
67
|
-
// mdGetTItemsByKeyInd,
|
|
68
|
-
// mdGetSizeByKeyInd,
|
|
69
|
-
// mdGetTItemsLast,
|
|
70
|
-
// mdGetTableChtByKeyInd,
|
|
71
59
|
// mdGetTextByKey,
|
|
72
60
|
// mdGetTextByKeyIndAndKey,
|
|
73
61
|
|
package/src/plugins/mShare.mjs
CHANGED
|
@@ -1,235 +1,44 @@
|
|
|
1
1
|
//前後端共用函數區
|
|
2
2
|
// import min from 'lodash/min'
|
|
3
|
-
import max from 'lodash/max'
|
|
4
|
-
import trim from 'lodash/trim'
|
|
3
|
+
// import max from 'lodash/max'
|
|
4
|
+
// import trim from 'lodash/trim'
|
|
5
5
|
// import isEqual from 'lodash/isEqual'
|
|
6
|
-
import uniq from 'lodash/uniq'
|
|
7
|
-
import set from 'lodash/set'
|
|
8
|
-
import get from 'lodash/get'
|
|
9
|
-
import map from 'lodash/map'
|
|
10
|
-
import each from 'lodash/each'
|
|
11
|
-
import isNumber from 'lodash/isNumber'
|
|
12
|
-
import sortBy from 'lodash/sortBy'
|
|
13
|
-
import find from 'lodash/find'
|
|
14
|
-
import size from 'lodash/size'
|
|
15
|
-
import filter from 'lodash/filter'
|
|
16
|
-
import last from 'lodash/last'
|
|
17
|
-
import split from 'lodash/split'
|
|
18
|
-
import join from 'lodash/join'
|
|
19
|
-
import cloneDeep from 'lodash/cloneDeep'
|
|
20
|
-
import cstr from 'wsemi/src/cstr.mjs'
|
|
21
|
-
import sep from 'wsemi/src/sep.mjs'
|
|
22
|
-
import isarr from 'wsemi/src/isarr.mjs'
|
|
23
|
-
import isearr from 'wsemi/src/isearr.mjs'
|
|
24
|
-
import isstr from 'wsemi/src/isstr.mjs'
|
|
25
|
-
import isestr from 'wsemi/src/isestr.mjs'
|
|
26
|
-
import isbol from 'wsemi/src/isbol.mjs'
|
|
27
|
-
import iseobj from 'wsemi/src/iseobj.mjs'
|
|
28
|
-
import ispint from 'wsemi/src/ispint.mjs'
|
|
29
|
-
import isnum from 'wsemi/src/isnum.mjs'
|
|
30
|
-
import ispnum from 'wsemi/src/ispnum.mjs'
|
|
31
|
-
import isfun from 'wsemi/src/isfun.mjs'
|
|
32
|
-
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
33
|
-
import cint from 'wsemi/src/cint.mjs'
|
|
34
|
-
import strleft from 'wsemi/src/strleft.mjs'
|
|
35
|
-
import strmid from 'wsemi/src/strmid.mjs'
|
|
36
|
-
import haskey from 'wsemi/src/haskey.mjs'
|
|
37
|
-
import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
|
|
38
|
-
import getFileAccept from 'wsemi/src/getFileAccept.mjs'
|
|
6
|
+
// import uniq from 'lodash/uniq'
|
|
7
|
+
// import set from 'lodash/set'
|
|
8
|
+
// import get from 'lodash/get'
|
|
9
|
+
// import map from 'lodash/map'
|
|
10
|
+
// import each from 'lodash/each'
|
|
11
|
+
// import isNumber from 'lodash/isNumber'
|
|
12
|
+
// import sortBy from 'lodash/sortBy'
|
|
13
|
+
// import find from 'lodash/find'
|
|
14
|
+
// import size from 'lodash/size'
|
|
15
|
+
// import filter from 'lodash/filter'
|
|
16
|
+
// import last from 'lodash/last'
|
|
17
|
+
// import split from 'lodash/split'
|
|
18
|
+
// import join from 'lodash/join'
|
|
19
|
+
// import cloneDeep from 'lodash/cloneDeep'
|
|
20
|
+
// import cstr from 'wsemi/src/cstr.mjs'
|
|
21
|
+
// import sep from 'wsemi/src/sep.mjs'
|
|
22
|
+
// import isarr from 'wsemi/src/isarr.mjs'
|
|
23
|
+
// import isearr from 'wsemi/src/isearr.mjs'
|
|
24
|
+
// import isstr from 'wsemi/src/isstr.mjs'
|
|
25
|
+
// import isestr from 'wsemi/src/isestr.mjs'
|
|
26
|
+
// import isbol from 'wsemi/src/isbol.mjs'
|
|
27
|
+
// import iseobj from 'wsemi/src/iseobj.mjs'
|
|
28
|
+
// import ispint from 'wsemi/src/ispint.mjs'
|
|
29
|
+
// import isnum from 'wsemi/src/isnum.mjs'
|
|
30
|
+
// import ispnum from 'wsemi/src/ispnum.mjs'
|
|
31
|
+
// import isfun from 'wsemi/src/isfun.mjs'
|
|
32
|
+
// import cdbl from 'wsemi/src/cdbl.mjs'
|
|
33
|
+
// import cint from 'wsemi/src/cint.mjs'
|
|
34
|
+
// import strleft from 'wsemi/src/strleft.mjs'
|
|
35
|
+
// import strmid from 'wsemi/src/strmid.mjs'
|
|
36
|
+
// import haskey from 'wsemi/src/haskey.mjs'
|
|
37
|
+
// import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
|
|
38
|
+
// import getFileAccept from 'wsemi/src/getFileAccept.mjs'
|
|
39
39
|
import at from 'wsemi/src/attstr.mjs'
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
function dtAddAndLtdtFind(dt, keyDtSrc, keyDtSave, ltdt, keyLtdt = 'id') {
|
|
43
|
-
|
|
44
|
-
//id
|
|
45
|
-
let id = get(dt, keyDtSrc, '')
|
|
46
|
-
// console.log('id', id)
|
|
47
|
-
|
|
48
|
-
//check
|
|
49
|
-
if (!isestr(id)) {
|
|
50
|
-
return {}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//find
|
|
54
|
-
let r = find(ltdt, { [keyLtdt]: id })
|
|
55
|
-
// console.log('find r', r)
|
|
56
|
-
|
|
57
|
-
//check
|
|
58
|
-
if (!iseobj(r)) {
|
|
59
|
-
return {}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//join
|
|
63
|
-
dt[keyDtSave] = r
|
|
64
|
-
// console.log('dt', dt)
|
|
65
|
-
|
|
66
|
-
return dt
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function gv(o, k, def = '無') {
|
|
71
|
-
let r = get(o, k, '')
|
|
72
|
-
if (!isestr(r)) {
|
|
73
|
-
return def
|
|
74
|
-
}
|
|
75
|
-
return r
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function parseNameByVersion(name) {
|
|
80
|
-
|
|
81
|
-
//check
|
|
82
|
-
if (name.indexOf('R') < 0) {
|
|
83
|
-
return {
|
|
84
|
-
name,
|
|
85
|
-
version: null,
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
let s = sep(name, 'R')
|
|
90
|
-
let s0 = get(s, 0, '')
|
|
91
|
-
let s1 = get(s, 1, '')
|
|
92
|
-
let nv = size(s1)
|
|
93
|
-
|
|
94
|
-
//check
|
|
95
|
-
if (nv < 5) { //版本號為R00.00, 不包括R需為5位
|
|
96
|
-
return {
|
|
97
|
-
name,
|
|
98
|
-
version: null,
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else if (nv > 5) { //版本號為R00.00-1091019, 後面可能有其他文字數字
|
|
102
|
-
s1 = strleft(s1, 5)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//check, 提取出版本號為00.00, 需針對各字元檢查
|
|
106
|
-
let c0 = strmid(s1, 0, 1)
|
|
107
|
-
let c1 = strmid(s1, 1, 1)
|
|
108
|
-
let c2 = strmid(s1, 2, 1)
|
|
109
|
-
let c3 = strmid(s1, 3, 1)
|
|
110
|
-
let c4 = strmid(s1, 4, 1)
|
|
111
|
-
if (!isnum(c0) || !isnum(c1) || !isnum(c3) || !isnum(c4) || (c2 !== '.')) {
|
|
112
|
-
return {
|
|
113
|
-
name,
|
|
114
|
-
version: null,
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
//version
|
|
119
|
-
let version = `R${s1}`
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
name: s0,
|
|
123
|
-
version,
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
function timeFormaterPast(t) {
|
|
129
|
-
let c = timemsTZ2past(t)
|
|
130
|
-
c = get(c, 'msg', '無')
|
|
131
|
-
return c
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// function parseSerialNumberByVersion(serialNumber) {
|
|
136
|
-
|
|
137
|
-
// //check
|
|
138
|
-
// if (serialNumber.indexOf('R') < 0) {
|
|
139
|
-
// return {
|
|
140
|
-
// serialNumber,
|
|
141
|
-
// serialNumberBase: serialNumber,
|
|
142
|
-
// version: null,
|
|
143
|
-
// }
|
|
144
|
-
// }
|
|
145
|
-
|
|
146
|
-
// let s = sep(serialNumber, 'R')
|
|
147
|
-
// let s0 = get(s, 0, '')
|
|
148
|
-
// let s1 = get(s, 1, '')
|
|
149
|
-
// let nv = size(s1)
|
|
150
|
-
|
|
151
|
-
// //check
|
|
152
|
-
// if (nv !== 5) { //版本號為R00.00, 不包括R需為5位
|
|
153
|
-
// return {
|
|
154
|
-
// serialNumber,
|
|
155
|
-
// serialNumberBase: serialNumber,
|
|
156
|
-
// version: null,
|
|
157
|
-
// }
|
|
158
|
-
// }
|
|
159
|
-
|
|
160
|
-
// //version
|
|
161
|
-
// let version = `R${s1}`
|
|
162
|
-
|
|
163
|
-
// return {
|
|
164
|
-
// serialNumber,
|
|
165
|
-
// serialNumberBase: s0,
|
|
166
|
-
// version,
|
|
167
|
-
// }
|
|
168
|
-
// }
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// function isNumOrEng(str) {
|
|
172
|
-
// let regExp = /^[\d|a-zA-Z]+$/
|
|
173
|
-
// if (regExp.test(str)) {
|
|
174
|
-
// return true
|
|
175
|
-
// }
|
|
176
|
-
// else {
|
|
177
|
-
// return false
|
|
178
|
-
// }
|
|
179
|
-
// }
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
// function getKpTableData(rows) {
|
|
183
|
-
// rows = filter(rows, (v) => {
|
|
184
|
-
// return v.isActive === 'y'
|
|
185
|
-
// })
|
|
186
|
-
// let kp = {}
|
|
187
|
-
// each(rows, (v) => {
|
|
188
|
-
// kp[v.id] = v
|
|
189
|
-
// })
|
|
190
|
-
// return kp
|
|
191
|
-
// }
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// function getItemsByIds(ids, kp) {
|
|
195
|
-
// let ts = atParse(ids)
|
|
196
|
-
// let rs = []
|
|
197
|
-
// each(ts, (v) => {
|
|
198
|
-
// let r = get(kp, v.id)
|
|
199
|
-
// if (iseobj(r)) {
|
|
200
|
-
// rs.push(r)
|
|
201
|
-
// }
|
|
202
|
-
// })
|
|
203
|
-
// return rs
|
|
204
|
-
// }
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
// function extractFileType(fileName, fileType) {
|
|
208
|
-
// let r = ''
|
|
209
|
-
|
|
210
|
-
// //find
|
|
211
|
-
// let ar = getFileAccept()
|
|
212
|
-
// for (let i = 0; i < ar.length; i++) {
|
|
213
|
-
// if (ar[i].acp === fileType) {
|
|
214
|
-
// return ar[i].name
|
|
215
|
-
// }
|
|
216
|
-
// }
|
|
217
|
-
|
|
218
|
-
// //from name ext
|
|
219
|
-
// let s = split(fileName, '.')
|
|
220
|
-
// if (size(s) > 1) {
|
|
221
|
-
// return last(s)
|
|
222
|
-
// }
|
|
223
|
-
|
|
224
|
-
// return r
|
|
225
|
-
// }
|
|
226
|
-
|
|
227
|
-
|
|
228
42
|
export {
|
|
229
|
-
at
|
|
230
|
-
gv,
|
|
231
|
-
parseNameByVersion,
|
|
232
|
-
// parseSerialNumberByVersion,
|
|
233
|
-
dtAddAndLtdtFind,
|
|
234
|
-
timeFormaterPast
|
|
43
|
+
at
|
|
235
44
|
}
|
package/src/plugins/mUI.mjs
CHANGED
|
@@ -41,20 +41,17 @@ import arrInsert from 'wsemi/src/arrInsert.mjs'
|
|
|
41
41
|
import replace from 'wsemi/src/replace.mjs'
|
|
42
42
|
import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
|
|
43
43
|
import convertToTree from 'wsemi/src/convertToTree.mjs'
|
|
44
|
-
import html2picDyn from 'wsemi/src/html2picDyn.mjs'
|
|
45
|
-
import urlParse from 'wsemi/src/urlParse.mjs'
|
|
46
|
-
import domConvertToPicDyn from 'wsemi/src/domConvertToPicDyn.mjs'
|
|
47
|
-
import ltdtkeysheads2mat from 'wsemi/src/ltdtkeysheads2mat.mjs'
|
|
48
|
-
import downloadFileFromB64 from 'wsemi/src/downloadFileFromB64.mjs'
|
|
49
|
-
import downloadExcelFileFromDataDyn from 'wsemi/src/downloadExcelFileFromDataDyn.mjs'
|
|
50
|
-
import getFileAccept from 'wsemi/src/getFileAccept.mjs'
|
|
51
|
-
import downloadFileFromU8Arr from 'wsemi/src/downloadFileFromU8Arr.mjs'
|
|
52
44
|
// import WUiDwload from 'w-ui-dwload/src/WUiDwload.mjs'
|
|
53
45
|
|
|
54
46
|
|
|
55
47
|
let vo = Vue.prototype
|
|
56
48
|
|
|
57
49
|
|
|
50
|
+
function setVo(vObj) {
|
|
51
|
+
vo = vObj
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
58
55
|
function updateConnState(connState) {
|
|
59
56
|
vo.$store.commit(vo.$store.types.UpdateConnState, connState)
|
|
60
57
|
}
|
|
@@ -70,21 +67,92 @@ function updateViewState(viewState) {
|
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
|
|
70
|
+
function forceUpdate() {
|
|
71
|
+
// console.log('call forceUpdate')
|
|
72
|
+
|
|
73
|
+
function broadcast(chs) {
|
|
74
|
+
each(chs, (v) => {
|
|
75
|
+
// console.log(v.$el)
|
|
76
|
+
v.$forceUpdate()
|
|
77
|
+
if (v.$children) {
|
|
78
|
+
broadcast(v.$children)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//broadcast, 注意此處需使用更換ui內vo為mounted後的vo, 也就是含元素, 才能使用廣播技術
|
|
84
|
+
broadcast(vo.$children)
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
function setLang(lang = null) {
|
|
90
|
+
// console.log('call setLang')
|
|
91
|
+
|
|
92
|
+
//check lang, 若有輸入才commit
|
|
93
|
+
if (isestr(lang)) {
|
|
94
|
+
vo.$store.commit(vo.$store.types.UpdateLang, lang)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//getKpLang, 切換lang得調用getKpLang重算kpText
|
|
98
|
+
getKpLang()
|
|
99
|
+
|
|
100
|
+
//forceUpdate
|
|
101
|
+
forceUpdate()
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
73
106
|
function getKpLang() {
|
|
107
|
+
// console.log('call getKpLang')
|
|
108
|
+
|
|
109
|
+
//merge keyLangs
|
|
74
110
|
let keyLangs = get(vo, '$store.state.keyLangs')
|
|
75
111
|
let webName = get(vo, '$store.state.webInfor.webName')
|
|
112
|
+
let webDescription = get(vo, '$store.state.webInfor.webDescription')
|
|
76
113
|
let kls = {
|
|
77
114
|
...keyLangs,
|
|
78
115
|
webName: {
|
|
79
116
|
...webName,
|
|
80
117
|
},
|
|
118
|
+
webDescription: {
|
|
119
|
+
...webDescription,
|
|
120
|
+
},
|
|
81
121
|
}
|
|
122
|
+
|
|
123
|
+
//lang
|
|
82
124
|
let lang = get(vo, '$store.state.lang')
|
|
83
|
-
|
|
125
|
+
|
|
126
|
+
//kpText
|
|
127
|
+
let kpText = {}
|
|
84
128
|
each(kls, (v, k) => {
|
|
85
|
-
|
|
129
|
+
kpText[k] = v[lang]
|
|
86
130
|
})
|
|
87
|
-
|
|
131
|
+
|
|
132
|
+
//commit
|
|
133
|
+
vo.$store.commit(vo.$store.types.UpdateKpText, kpText)
|
|
134
|
+
|
|
135
|
+
return kpText
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
function getKpText(key) {
|
|
140
|
+
// console.log('call getKpText')
|
|
141
|
+
let kpText = get(vo, '$store.state.kpText')
|
|
142
|
+
return get(kpText, key, '')
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
function gv(o, k, cv = null) {
|
|
147
|
+
let r = get(o, k, '')
|
|
148
|
+
if (!isestr(r)) {
|
|
149
|
+
let def = getKpText('empty')
|
|
150
|
+
return def
|
|
151
|
+
}
|
|
152
|
+
if (isfun(cv)) {
|
|
153
|
+
r = cv(r)
|
|
154
|
+
}
|
|
155
|
+
return r
|
|
88
156
|
}
|
|
89
157
|
|
|
90
158
|
|
|
@@ -127,10 +195,18 @@ async function waitData(t = 0) {
|
|
|
127
195
|
|
|
128
196
|
let mUI = {
|
|
129
197
|
|
|
198
|
+
setVo,
|
|
199
|
+
|
|
130
200
|
updateConnState,
|
|
131
201
|
updateLoading,
|
|
132
202
|
updateViewState,
|
|
203
|
+
forceUpdate,
|
|
204
|
+
|
|
205
|
+
setLang,
|
|
133
206
|
getKpLang,
|
|
207
|
+
getKpText,
|
|
208
|
+
|
|
209
|
+
gv,
|
|
134
210
|
syncHeight,
|
|
135
211
|
|
|
136
212
|
waitData,
|
package/src/store/mutations.mjs
CHANGED
|
@@ -19,7 +19,7 @@ let state = {
|
|
|
19
19
|
|
|
20
20
|
heightApp: 0,
|
|
21
21
|
heightAppEff: 0,
|
|
22
|
-
heightToolbar:
|
|
22
|
+
heightToolbar: 60,
|
|
23
23
|
|
|
24
24
|
menu: {}, //初始值需為物件, 否則LayoutContent會取menu.key出錯
|
|
25
25
|
|
|
@@ -34,6 +34,10 @@ let state = {
|
|
|
34
34
|
lang: 'cht',
|
|
35
35
|
keyLangs: {
|
|
36
36
|
|
|
37
|
+
empty: {
|
|
38
|
+
eng: 'Empty',
|
|
39
|
+
cht: '無',
|
|
40
|
+
},
|
|
37
41
|
noSelectApi: {
|
|
38
42
|
eng: 'No Select',
|
|
39
43
|
cht: '尚未選擇API',
|
|
@@ -109,6 +113,7 @@ let state = {
|
|
|
109
113
|
},
|
|
110
114
|
|
|
111
115
|
},
|
|
116
|
+
kpText: {},
|
|
112
117
|
|
|
113
118
|
}
|
|
114
119
|
|
|
@@ -131,6 +136,10 @@ export let mutations = {
|
|
|
131
136
|
state.lang = lang
|
|
132
137
|
},
|
|
133
138
|
|
|
139
|
+
[types.UpdateKpText] (state, kpText) {
|
|
140
|
+
state.kpText = kpText
|
|
141
|
+
},
|
|
142
|
+
|
|
134
143
|
[types.UpdateConnState] (state, connState) {
|
|
135
144
|
state.connState = connState
|
|
136
145
|
},
|
package/src/store/types.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const UpdateWebInfor = 'UpdateWebInfor'
|
|
2
2
|
export const UpdateLang = 'UpdateLang'
|
|
3
|
+
export const UpdateKpText = 'UpdateKpText'
|
|
3
4
|
export const UpdateConnState = 'UpdateConnState'
|
|
4
5
|
export const UpdateSyncState = 'UpdateSyncState'
|
|
5
6
|
export const UpdateLoading = 'UpdateLoading'
|
package/srv.mjs
CHANGED
|
@@ -18,8 +18,13 @@ let opt = {
|
|
|
18
18
|
|
|
19
19
|
webName: {
|
|
20
20
|
'eng': 'API Service',
|
|
21
|
-
'cht': 'API管理系統'
|
|
21
|
+
'cht': 'API管理系統',
|
|
22
22
|
},
|
|
23
|
+
webDescription: {
|
|
24
|
+
'eng': 'A web service package as methods to send requests to and receive responses from an API.',
|
|
25
|
+
'cht': 'A web service package as methods to send requests to and receive responses from an API.',
|
|
26
|
+
},
|
|
27
|
+
webLogo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHL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