yks-element 1.0.799 → 1.1.1

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/README.md CHANGED
@@ -119,6 +119,18 @@ npm unpublish yks-element@0.0.1 --force
119
119
  * 阻止事件冒泡
120
120
  ```
121
121
 
122
+ ### 1.0.8
123
+
124
+ ```text
125
+ * 防双击
126
+ ```
127
+
128
+ ### 1.0.83
129
+
130
+ ```text
131
+ * Message重写
132
+ ```
133
+
122
134
  ### LICENSE
123
135
 
124
136
  [MIT](LICENSE)
@@ -0,0 +1,126 @@
1
+ /**
2
+ * 打包配置参数
3
+ * @String NPM_APP_CDN_URL 静态资源地址
4
+ * @String NPM_APP_DEV_URL 开发环境地址
5
+ * @String NPM_APP_TEST_URL 测试环境地址
6
+ * @String NPM_APP_PRE_URL 预发布环境地址
7
+ * @String NPM_APP_PROD_URL 线上环境地址
8
+ * @Array cdnConfig 排除打包文件集合
9
+ * @Object cdn 引入文件 cdn 链接
10
+ * @function setPackParams 设置打包参数
11
+ * @function proxy 代理
12
+ */
13
+ const NPM_APP_CDN_URL = 'https://pub-static.yks365.net/assets'
14
+ const NPM_APP_DEV_URL = 'https://gldev.cetset.com'
15
+ const NPM_APP_TEST_URL = 'https://gltest.cetset.com'
16
+ const NPM_APP_PRE_URL = 'https://glpre.yks365.net'
17
+ const NPM_APP_PROD_URL = 'https://gl.yks365.net'
18
+
19
+ const getConfig = () => {
20
+ let cdnConfigs = [
21
+ {
22
+ name: 'kityformula',
23
+ library: 'kityformula',
24
+ js: [
25
+ `${NPM_APP_CDN_URL}/tinymce/kityformula-editor/kityformula/js/jquery-3.6.0.min.js`,
26
+ `${NPM_APP_CDN_URL}/tinymce/kityformula-editor/kityformula/js/kitygraph.all.js`,
27
+ `${NPM_APP_CDN_URL}/tinymce/kityformula-editor/kityformula/js/kity-formula-render.all.js`,
28
+ `${NPM_APP_CDN_URL}/tinymce/kityformula-editor/kityformula/js/kity-formula-parser.all.min.js`,
29
+ `${NPM_APP_CDN_URL}/tinymce/kityformula-editor/kityformula/js/kityformula-editor.all.min.js`
30
+ ],
31
+ css: []
32
+ }
33
+ ]
34
+ return cdnConfigs
35
+ }
36
+
37
+ const cdn = () => {
38
+ const cdnConfig = getConfig()
39
+ const js = []
40
+ const css = []
41
+ cdnConfig.forEach((v) => {
42
+ js.push(...v.js)
43
+ css.push(...v.css)
44
+ })
45
+ return {
46
+ css,
47
+ js
48
+ }
49
+ }
50
+
51
+ const setPackParams = (config) => {
52
+ config.plugin('html').tap((args) => {
53
+ let cdns = cdn()
54
+ args[0].cdn = cdns
55
+ return args
56
+ })
57
+ }
58
+
59
+ const proxy = (pro, env, targets) => {
60
+ if (!pro || !env) {
61
+ return new Error('pro or env is not difine !')
62
+ }
63
+ const params = {
64
+ dev: NPM_APP_DEV_URL,
65
+ test: NPM_APP_TEST_URL,
66
+ pre: NPM_APP_PRE_URL,
67
+ prod: NPM_APP_PROD_URL
68
+ }
69
+ const target = params[env] ? params[env] : targets
70
+ return {
71
+ ['/' + pro + '/bm']: {
72
+ target: target,
73
+ pathRewrite: { ['^/' + pro + '/bm']: `/${pro}/bm` }
74
+ },
75
+ ['/' + pro + '/pj']: {
76
+ target: target,
77
+ pathRewrite: { ['^/' + pro + '/pj']: `/${pro}/pj` }
78
+ },
79
+ ['/' + pro + '/ua']: {
80
+ target: target,
81
+ pathRewrite: { ['^/' + pro + '/ua']: `/${pro}/ua` }
82
+ },
83
+ ['/' + pro + '/gov']: {
84
+ target: target,
85
+ pathRewrite: { ['^/' + pro + '/gov']: `/${pro}/gov` }
86
+ },
87
+ ['/' + pro + '/kw']: {
88
+ target: target,
89
+ pathRewrite: { ['^/' + pro + '/kw']: `/${pro}/kw` }
90
+ },
91
+ ['/' + pro + '/pt']: {
92
+ target: target,
93
+ pathRewrite: { ['^/' + pro + '/pt']: `/${pro}/pt` }
94
+ },
95
+ ['/' + pro + '/cj']: {
96
+ target: target,
97
+ pathRewrite: { ['^/' + pro + '/cj']: `/${pro}/cj` }
98
+ },
99
+ ['/' + pro + '/api']: {
100
+ target: target,
101
+ pathRewrite: { ['^/' + pro + '/api']: `/${pro}/api` }
102
+ },
103
+ ['/' + pro + '/login']: {
104
+ target: target,
105
+ pathRewrite: { ['^/' + pro + '/login']: `/${pro}/login` }
106
+ },
107
+ ['/' + pro + '/tps']: {
108
+ target: target,
109
+ pathRewrite: { ['^/' + pro + '/tps']: `/${pro}/tps` }
110
+ },
111
+ ['/' + pro + '/tk']: {
112
+ target: target,
113
+ pathRewrite: { ['^/' + pro + '/tk']: `/${pro}/tk` }
114
+ },
115
+ ['/' + pro + '/ks']: {
116
+ target: target,
117
+ pathRewrite: { ['^/' + pro + '/ks']: `/${pro}/ks` }
118
+ }
119
+ }
120
+ }
121
+
122
+ module.exports = {
123
+ proxy,
124
+ setPackParams
125
+ }
126
+