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.
Files changed (78) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +54 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +62 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +14 -0
  9. package/dist/w-web-api.umd.js +7 -0
  10. package/dist/w-web-api.umd.js.map +1 -0
  11. package/docs/WWebApi.html +551 -0
  12. package/docs/WWebApi.mjs.html +335 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  20. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  30. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  31. package/docs/index.html +81 -0
  32. package/docs/scripts/collapse.js +20 -0
  33. package/docs/scripts/linenumber.js +25 -0
  34. package/docs/scripts/nav.js +12 -0
  35. package/docs/scripts/polyfill.js +4 -0
  36. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  37. package/docs/scripts/prettify/lang-css.js +2 -0
  38. package/docs/scripts/prettify/prettify.js +28 -0
  39. package/docs/scripts/search.js +83 -0
  40. package/docs/styles/jsdoc.css +765 -0
  41. package/docs/styles/prettify.css +79 -0
  42. package/package.json +81 -0
  43. package/public/connecting.svg +10 -0
  44. package/public/deny.png +0 -0
  45. package/public/disconnect.png +0 -0
  46. package/public/index.html +23 -0
  47. package/public/logout.png +0 -0
  48. package/server/WWebApi.mjs +283 -0
  49. package/server/getSettings.mjs +17 -0
  50. package/server/mDb.mjs +76 -0
  51. package/server/mInitialTestData.mjs +40 -0
  52. package/server/mOrm.mjs +22 -0
  53. package/src/App.vue +91 -0
  54. package/src/components/Layout.vue +131 -0
  55. package/src/components/LayoutContent.vue +67 -0
  56. package/src/components/LayoutContentList.vue +573 -0
  57. package/src/components/MdPanel.vue +152 -0
  58. package/src/main.js +98 -0
  59. package/src/plugins/mDataSelectorSchema.mjs +30 -0
  60. package/src/plugins/mDataSupport.mjs +78 -0
  61. package/src/plugins/mShare.mjs +235 -0
  62. package/src/plugins/mUI.mjs +141 -0
  63. package/src/plugins/mVuetify.mjs +12 -0
  64. package/src/schema/gi.mjs +8 -0
  65. package/src/schema/index.mjs +16 -0
  66. package/src/schema/tables/apis.mjs +918 -0
  67. package/src/store/actions.mjs +1 -0
  68. package/src/store/getters.mjs +1 -0
  69. package/src/store/index.mjs +25 -0
  70. package/src/store/mutations.mjs +185 -0
  71. package/src/store/types.mjs +14 -0
  72. package/srv.mjs +33 -0
  73. package/tableTags.json +1 -0
  74. package/toolg/addVersion.mjs +4 -0
  75. package/toolg/cleanFolder.mjs +4 -0
  76. package/toolg/gDistRollup.mjs +34 -0
  77. package/toolg/modifyReadme.mjs +4 -0
  78. package/vue.config.js +15 -0
@@ -0,0 +1,152 @@
1
+ <template>
2
+ <div>
3
+ <div class="md" v-html="mdh"></div>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ // import get from 'lodash/get'
9
+ // import find from 'lodash/find'
10
+ // import each from 'lodash/each'
11
+ // import map from 'lodash/map'
12
+ // import size from 'lodash/size'
13
+ // import sortBy from 'lodash/sortBy'
14
+ // import isNumber from 'lodash/isNumber'
15
+ // import cloneDeep from 'lodash/cloneDeep'
16
+ // import sep from 'wsemi/src/sep.mjs'
17
+ // import isobj from 'wsemi/src/isobj.mjs'
18
+ // import iseobj from 'wsemi/src/iseobj.mjs'
19
+ // import isestr from 'wsemi/src/isestr.mjs'
20
+ // import isearr from 'wsemi/src/isearr.mjs'
21
+ // import pmSeries from 'wsemi/src/pmSeries.mjs'
22
+ // import waitFun from 'wsemi/src/waitFun.mjs'
23
+ // import strleft from 'wsemi/src/strleft.mjs'
24
+ // import strdelleft from 'wsemi/src/strdelleft.mjs'
25
+ // import str2aes from 'wsemi/src/str2aes.mjs'
26
+ // import timeTZ2past from 'wsemi/src/timeTZ2past.mjs'
27
+ import Showdown from 'showdown'
28
+ // import MarkdownIt from 'markdown-it'
29
+
30
+
31
+ export default {
32
+ components: {
33
+ },
34
+ props: {
35
+ md: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ },
40
+ data: function() {
41
+ return {
42
+ }
43
+ },
44
+ computed: {
45
+
46
+ mdh: function() {
47
+ let vo = this
48
+
49
+ // md = `| 參數 | 型別 | 範例 |
50
+ // | -- | -- | -- |
51
+ // | token | STRING | key-for-token |
52
+ // | id | STRING | id-for-test |
53
+ // | paramA | INTEGER | 123 |
54
+ // | paramB | DOUBLE | 123.456 |
55
+ // `
56
+
57
+ let cv = new Showdown.Converter()
58
+ cv.setOption('tables', true)
59
+ let html = cv.makeHtml(vo.md)
60
+
61
+ // let cv = new MarkdownIt()
62
+ // let html = cv.render(vo.md)
63
+
64
+ // console.log('md', md)
65
+ // console.log('html', html)
66
+ return html
67
+ },
68
+
69
+ },
70
+ methods: {
71
+ }
72
+ }
73
+ </script>
74
+
75
+ <style scoped>
76
+
77
+ .md >>> table {
78
+ border-collapse: collapse;
79
+ margin: 0;
80
+ padding: 0;
81
+ word-break: initial;
82
+ }
83
+
84
+ .md >>> tr {
85
+ margin: 0;
86
+ padding: 0;
87
+ }
88
+
89
+ .md >>> table tr th {
90
+ font-weight: bold;
91
+ background: #eee;
92
+ border: 1px solid #ddd;
93
+ border-bottom: 0;
94
+ margin: 0;
95
+ padding: 6px 13px;
96
+ }
97
+
98
+ .md >>> table tr td {
99
+ border: 1px solid #ddd;
100
+ margin: 0;
101
+ padding: 6px 13px;
102
+ }
103
+
104
+ .md >>> h1 {
105
+ font-weight: bold;
106
+ font-size: 1.2rem;
107
+ line-height: 1.2rem;
108
+ margin-top: 0.5rem;
109
+ margin-bottom: 0.5rem;
110
+ }
111
+
112
+ .md >>> h2 {
113
+ font-weight: bold;
114
+ font-size: 1.1rem;
115
+ line-height: 1.1rem;
116
+ margin-top: 0.5rem;
117
+ margin-bottom: 0.5rem;
118
+ }
119
+
120
+ .md >>> h3 {
121
+ font-weight: bold;
122
+ font-size: 1rem;
123
+ line-height: 1rem;
124
+ margin-top: 0.5rem;
125
+ margin-bottom: 0.5rem;
126
+ }
127
+
128
+ .md >>> h4 {
129
+ font-weight: bold;
130
+ font-size: 1rem;
131
+ line-height: 1rem;
132
+ margin-top: 0.5rem;
133
+ margin-bottom: 0.5rem;
134
+ }
135
+
136
+ .md >>> h5 {
137
+ font-weight: bold;
138
+ font-size: 1rem;
139
+ line-height: 1rem;
140
+ margin-top: 0.5rem;
141
+ margin-bottom: 0.5rem;
142
+ }
143
+
144
+ .md >>> h6 {
145
+ font-weight: bold;
146
+ font-size: 1rem;
147
+ line-height: 1rem;
148
+ margin-top: 0.5rem;
149
+ margin-bottom: 0.5rem;
150
+ }
151
+
152
+ </style>
package/src/main.js ADDED
@@ -0,0 +1,98 @@
1
+ import get from 'lodash/get'
2
+ // import '@babel/polyfill' //需提供Vuetify的Symbol等API
3
+ // import 'core-js/stable' //需提供Vuetify的Symbol等API, 官網說使用transpileDependencies但不夠, 改用之前提到的@babel/polyfill會被提示已廢棄, 改使用給webpack的polyfill方式才行
4
+ // import 'regenerator-runtime/runtime'
5
+ // import 'intersection-observer' //需供Vuetify的Intersection Observer, 專案內有使用v-intersect才需引入, 而w-component-vue沒用v-intersect
6
+ import Vue from 'vue'
7
+ import WServHapiClient from 'w-serv-hapi/src/WServHapiClient.mjs'
8
+ import WAlert from 'w-component-vue/src/components/WAlert.mjs'
9
+ import domMutation from 'w-component-vue/src/js/domMutation.mjs'
10
+ import domResize from 'w-component-vue/src/js/domResize.mjs'
11
+ import domDragDrop from 'w-component-vue/src/js/domDragDrop.mjs'
12
+ import App from './App.vue'
13
+ import store from './store/index.mjs'
14
+ import mVuetify from './plugins/mVuetify.mjs'
15
+ import ui from './plugins/mUI.mjs'
16
+ import mDataSelectorSchema from './plugins/mDataSelectorSchema.mjs'
17
+ import mDataSupport from './plugins/mDataSupport.mjs'
18
+ import * as s from './plugins/mShare.mjs'
19
+ import ds from './schema/index.mjs'
20
+ // console.log('globalState', globalState)
21
+ // console.log('ds', ds)
22
+
23
+
24
+ //不提示vue產品
25
+ Vue.config.productionTip = false
26
+
27
+ //$alert
28
+ Vue.prototype.$alert = function() {
29
+ let [msg, type] = arguments
30
+ console.log(msg, type)
31
+ if (msg !== 'close') {
32
+ WAlert(msg, type)
33
+ }
34
+ }
35
+
36
+ //dssm
37
+ let dssm = mDataSelectorSchema(ds)
38
+
39
+ //dspt
40
+ let dspt = mDataSupport(Vue.prototype)
41
+
42
+ //prototype
43
+ Vue.prototype.$ui = ui
44
+ Vue.prototype.$s = s
45
+ Vue.prototype.$dssm = dssm
46
+ Vue.prototype.$dspt = dspt
47
+ // Vue.prototype.$ds = ds
48
+ Vue.prototype.$dg = {}
49
+
50
+ //directive
51
+ Vue.directive('domresize', domResize())
52
+ Vue.directive('dommutation', domMutation())
53
+ Vue.directive('domdragdrop', domDragDrop())
54
+
55
+ //WServHapiClient
56
+ let bFirstSync = false
57
+ WServHapiClient({
58
+ getUrl: () => {
59
+ return window.location.origin + window.location.pathname
60
+ },
61
+ useWaitToken: false,
62
+ getToken: () => {
63
+ return get(Vue.prototype, `$store.state.userToken`, '')
64
+ },
65
+ getServerMethods: (_fapi) => {
66
+ console.log('$fapi', _fapi)
67
+ Vue.prototype.$fapi = _fapi
68
+ _fapi.getWebInfor() //已有fapi時優先取得web資訊
69
+ .then((wi) => {
70
+ // console.log('$fapi wi', wi)
71
+ Vue.prototype.$store.commit(Vue.prototype.$store.types.UpdateWebInfor, wi)
72
+ })
73
+ .catch((err) => {
74
+ console.log(err)
75
+ })
76
+ },
77
+ recvData: (r) => {
78
+ console.log('sync data', r.tableName, r.data)
79
+ Vue.prototype.$store.commit(Vue.prototype.$store.types.UpdateTableData, r)
80
+ },
81
+ getAfterUpdateTableTags: (r) => {
82
+ // console.log('getAfterUpdateTableTags', r, 'needToRefresh', JSON.stringify(r.oldTableTags) !== JSON.stringify(r.newTableTags))
83
+ if (bFirstSync) {
84
+ return
85
+ }
86
+ bFirstSync = true
87
+ console.log('first-sync')
88
+ Vue.prototype.$store.commit(Vue.prototype.$store.types.UpdateSyncState, true)
89
+ },
90
+ })
91
+
92
+ //new
93
+ new Vue({
94
+ vuetify: mVuetify,
95
+ store,
96
+ render: h => h(App)
97
+ }).$mount('#app')
98
+
@@ -0,0 +1,30 @@
1
+ import get from 'lodash/get'
2
+ import find from 'lodash/find'
3
+ import isestr from 'wsemi/src/isestr.mjs'
4
+
5
+
6
+ function mDataSelectorSchema(ds, opt = {}) {
7
+
8
+ function getTableInforBy(keyFind, valueFind, keyPick) {
9
+ let r = find(ds, { [keyFind]: valueFind })
10
+ if (!r) {
11
+ r = ''
12
+ }
13
+ if (isestr(keyPick)) {
14
+ r = get(r, keyPick, '')
15
+ }
16
+ return r
17
+ }
18
+
19
+ function getTableChtByKey(valueFind) {
20
+ return getTableInforBy('keyTable', valueFind, 'tableNameCht')
21
+ }
22
+
23
+ return {
24
+ getTableInforBy,
25
+ getTableChtByKey,
26
+ }
27
+ }
28
+
29
+
30
+ export default mDataSelectorSchema
@@ -0,0 +1,78 @@
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
+
52
+
53
+ function mDataSupport(vo, opt = {}) {
54
+
55
+
56
+ return {
57
+
58
+ // getMetadataByTablenameAndId,
59
+
60
+ // getProjectBasic,
61
+ // getProjectsBasic,
62
+
63
+ // treeMds,
64
+ // treeProjectsBasicAndMds,
65
+
66
+ // mdCheckKeyInd,
67
+ // mdGetTItemsByKeyInd,
68
+ // mdGetSizeByKeyInd,
69
+ // mdGetTItemsLast,
70
+ // mdGetTableChtByKeyInd,
71
+ // mdGetTextByKey,
72
+ // mdGetTextByKeyIndAndKey,
73
+
74
+ }
75
+ }
76
+
77
+
78
+ export default mDataSupport
@@ -0,0 +1,235 @@
1
+ //前後端共用函數區
2
+ // import min from 'lodash/min'
3
+ import max from 'lodash/max'
4
+ import trim from 'lodash/trim'
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'
39
+ import at from 'wsemi/src/attstr.mjs'
40
+
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
+ export {
229
+ at,
230
+ gv,
231
+ parseNameByVersion,
232
+ // parseSerialNumberByVersion,
233
+ dtAddAndLtdtFind,
234
+ timeFormaterPast
235
+ }