gcs-ui-lib 1.1.433

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 (154) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +7 -0
  3. package/.eslintrc.js +5 -0
  4. package/README.md +97 -0
  5. package/_webpack.config.js +135 -0
  6. package/babel.config.js +17 -0
  7. package/lib/demo.html +10 -0
  8. package/lib/fonts/SIMSUN.5e0c362c.5e0c362c.ttf +0 -0
  9. package/lib/fonts/element-icons.535877f5.535877f5.woff +0 -0
  10. package/lib/fonts/element-icons.732389de.732389de.ttf +0 -0
  11. package/lib/fonts/iconfont.09d221ee.09d221ee.woff +0 -0
  12. package/lib/fonts/iconfont.1c4bfacc.1c4bfacc.ttf +0 -0
  13. package/lib/fonts/iconfont.a6f34dc7.a6f34dc7.woff2 +0 -0
  14. package/lib/fonts/iconfont.f4c32765.f4c32765.ttf +0 -0
  15. package/lib/gcs-ui-lib.common.js +40576 -0
  16. package/lib/gcs-ui-lib.css +3 -0
  17. package/lib/gcs-ui-lib.umd.js +40586 -0
  18. package/lib/gcs-ui-lib.umd.min.js +40 -0
  19. package/lib/img/bankbackground(1).e1f6e40f.jpg +0 -0
  20. package/lib/img/busibackground(2).7e09bf1f.jpg +0 -0
  21. package/lib/img/document.193a282d.svg +8 -0
  22. package/lib/img/folder.8e019792.svg +9 -0
  23. package/lib/img/icon.fc86764f.gif +0 -0
  24. package/npm +1 -0
  25. package/package.json +100 -0
  26. package/packages/DynamicForm/index.js +7 -0
  27. package/packages/DynamicForm/src/components/Amount.vue +51 -0
  28. package/packages/DynamicForm/src/components/AmountRange.vue +76 -0
  29. package/packages/DynamicForm/src/components/CheckboxGroup.vue +63 -0
  30. package/packages/DynamicForm/src/components/DMY.vue +126 -0
  31. package/packages/DynamicForm/src/components/Date.vue +51 -0
  32. package/packages/DynamicForm/src/components/DateRange.vue +51 -0
  33. package/packages/DynamicForm/src/components/Dialog.vue +247 -0
  34. package/packages/DynamicForm/src/components/Input.vue +48 -0
  35. package/packages/DynamicForm/src/components/InputNumber.vue +69 -0
  36. package/packages/DynamicForm/src/components/InputNumberRange.vue +47 -0
  37. package/packages/DynamicForm/src/components/LazySelect.vue +311 -0
  38. package/packages/DynamicForm/src/components/RadioGroup.vue +43 -0
  39. package/packages/DynamicForm/src/components/Rate.vue +57 -0
  40. package/packages/DynamicForm/src/components/Select.vue +307 -0
  41. package/packages/DynamicForm/src/components/Switch.vue +32 -0
  42. package/packages/DynamicForm/src/components/Textarea.vue +58 -0
  43. package/packages/DynamicForm/src/components/TimeSelect.vue +61 -0
  44. package/packages/DynamicForm/src/components/unitTreeSelect.vue +141 -0
  45. package/packages/DynamicForm/src/components/urlLinkInput.vue +100 -0
  46. package/packages/DynamicForm/src/demo/index.vue +486 -0
  47. package/packages/DynamicForm/src/fileUpload.js +232 -0
  48. package/packages/DynamicForm/src/formConfig.js +2910 -0
  49. package/packages/DynamicForm/src/helpers.js +18 -0
  50. package/packages/DynamicForm/src/main.vue +1095 -0
  51. package/packages/FileImport/index.js +7 -0
  52. package/packages/FileImport/src/demo/index.vue +29 -0
  53. package/packages/FileImport/src/main.vue +306 -0
  54. package/packages/SelectTicket/index.js +7 -0
  55. package/packages/SelectTicket/src/Tree/index.vue +13 -0
  56. package/packages/SelectTicket/src/demo/index.vue +139 -0
  57. package/packages/SelectTicket/src/header.js +276 -0
  58. package/packages/SelectTicket/src/main.vue +581 -0
  59. package/packages/SelectTicket/src/printDialog/dialogO.vue +116 -0
  60. package/packages/SelectTicket/src/printDialog/index.vue +69 -0
  61. package/packages/SelectTicket/src/ticketDetail/billInformation/README.MD +6 -0
  62. package/packages/SelectTicket/src/ticketDetail/billInformation/mixins/index.js +35 -0
  63. package/packages/SelectTicket/src/ticketDetail/billInformation/obverse.vue +768 -0
  64. package/packages/SelectTicket/src/ticketDetail/billInformation/overview.vue +115 -0
  65. package/packages/SelectTicket/src/ticketDetail/billInformation/printList.vue +127 -0
  66. package/packages/SelectTicket/src/ticketDetail/billInformation/reverse.vue +205 -0
  67. package/packages/SelectTicket/src/ticketDetail/billInformation//351/231/204/345/212/240/344/277/235/350/257/201/344/277/241/346/201/257/345/255/227/346/256/265/345/257/271/347/205/247.md +246 -0
  68. package/packages/SelectTicket/src/ticketDetail/dialog.vue +73 -0
  69. package/packages/SelectTicket/src/ticketDetail/img/bankbackground(1).jpg +0 -0
  70. package/packages/SelectTicket/src/ticketDetail/img/busibackground(2).jpg +0 -0
  71. package/packages/SelectTicket/src/ticketDetail/img/icon.gif +0 -0
  72. package/packages/SelectTicket/src/ticketDetail/img/icon2.png +0 -0
  73. package/packages/SelectTicket/src/ticketDetail/img/noData.png +0 -0
  74. package/packages/SelectTicket/src/ticketDetail/index.vue +188 -0
  75. package/packages/SelectTreeUnit/index.js +7 -0
  76. package/packages/SelectTreeUnit/src/Tree/document.svg +8 -0
  77. package/packages/SelectTreeUnit/src/Tree/folder.svg +9 -0
  78. package/packages/SelectTreeUnit/src/Tree/index.vue +239 -0
  79. package/packages/SelectTreeUnit/src/demo/index.vue +219 -0
  80. package/packages/SelectTreeUnit/src/forEachs.js +16 -0
  81. package/packages/SelectTreeUnit/src/main.vue +1136 -0
  82. package/packages/SelectTreeUnitForm/index.js +7 -0
  83. package/packages/SelectTreeUnitForm/src/Tree/document.svg +8 -0
  84. package/packages/SelectTreeUnitForm/src/Tree/folder.svg +9 -0
  85. package/packages/SelectTreeUnitForm/src/Tree/index.vue +254 -0
  86. package/packages/SelectTreeUnitForm/src/demo/index.vue +230 -0
  87. package/packages/SelectTreeUnitForm/src/forEachs.js +16 -0
  88. package/packages/SelectTreeUnitForm/src/main.vue +1065 -0
  89. package/packages/Trade/index.js +7 -0
  90. package/packages/Trade/src/components/all/index.vue +891 -0
  91. package/packages/Trade/src/components/dynamicColumnMixin.js +69 -0
  92. package/packages/Trade/src/components/getDCloumn.js +15 -0
  93. package/packages/Trade/src/components/i18n.json +3337 -0
  94. package/packages/Trade/src/components/pendingEvent/index.vue +909 -0
  95. package/packages/Trade/src/components/server-config.js +60 -0
  96. package/packages/Trade/src/components/setUnitName.js +10 -0
  97. package/packages/Trade/src/components/specialHandle.js +171 -0
  98. package/packages/Trade/src/components/topendingTabs.js +21 -0
  99. package/packages/Trade/src/demo/index.vue +42 -0
  100. package/packages/Trade/src/main.vue +86 -0
  101. package/packages/ZipImport/index.js +7 -0
  102. package/packages/ZipImport/src/demo/index.vue +139 -0
  103. package/packages/ZipImport/src/main.vue +303 -0
  104. package/packages/approvel/index.js +8 -0
  105. package/packages/approvel/src/demo/index.vue +28 -0
  106. package/packages/approvel/src/main.vue +26 -0
  107. package/packages/approvel/src/progress.vue +167 -0
  108. package/packages/approvel/src/url.json +29 -0
  109. package/packages/extends/ElSelect.vue +180 -0
  110. package/packages/imgs/list-select.png +0 -0
  111. package/packages/imgs/list-unselect.png +0 -0
  112. package/packages/imgs/list.png +0 -0
  113. package/packages/imgs/tree-select.png +0 -0
  114. package/packages/imgs/tree-unselect.png +0 -0
  115. package/packages/imgs/tree.png +0 -0
  116. package/public/favicon.ico +0 -0
  117. package/public/index.html +19 -0
  118. package/src/App.vue +61 -0
  119. package/src/api/aims.js +8 -0
  120. package/src/api/common.js +103 -0
  121. package/src/api/fileApi.js +22 -0
  122. package/src/config/appSettings.js +12 -0
  123. package/src/config/favicon.ico +0 -0
  124. package/src/css/selectTreeUnit.scss +247 -0
  125. package/src/filter/filter.js +1 -0
  126. package/src/filter/index.js +274 -0
  127. package/src/fonts/demo.css +539 -0
  128. package/src/fonts/iconfont.css +21 -0
  129. package/src/fonts/iconfont.js +1 -0
  130. package/src/fonts/iconfont.json +23 -0
  131. package/src/fonts/iconfont.ttf +0 -0
  132. package/src/index.js +109 -0
  133. package/src/locale/format.js +47 -0
  134. package/src/locale/index.js +48 -0
  135. package/src/locale/lang/cn2hk.json +1270 -0
  136. package/src/locale/lang/en.js +73 -0
  137. package/src/locale/lang/es.js +7 -0
  138. package/src/locale/lang/index.js +66 -0
  139. package/src/locale/lang/ja.js +7 -0
  140. package/src/locale/lang/zh.js +74 -0
  141. package/src/locale/lang/zht.js +28 -0
  142. package/src/main.js +44 -0
  143. package/src/preview/page/Aside/index.vue +60 -0
  144. package/src/preview/router.js +46 -0
  145. package/src/utils/auth.js +12 -0
  146. package/src/utils/directive/asciiWidth.js +107 -0
  147. package/src/utils/directive/clickOutside.js +21 -0
  148. package/src/utils/directive/vtitle.js +140 -0
  149. package/src/utils/index.js +545 -0
  150. package/src/utils/request.js +191 -0
  151. package/src/utils/requestCache.js +68 -0
  152. package/src/utils/thems.js +62 -0
  153. package/types/favicon.ico +0 -0
  154. package/vue.config.js +45 -0
@@ -0,0 +1,191 @@
1
+ import axios from 'axios'
2
+ import {
3
+ Message,
4
+ Loading
5
+ } from 'element-ui'
6
+ import {
7
+ getToken
8
+ } from '@/utils/auth'
9
+ import {
10
+ getLanguage
11
+ } from '@/locale/lang'
12
+ import {
13
+ randomString
14
+ } from './index'
15
+ import { cache, cacheAdapterEnhancer } from "@/utils/requestCache";
16
+ // create an axios instance
17
+ const service = axios.create({
18
+ method: 'post',
19
+ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
20
+ // withCredentials: true, // send cookies when cross-domain requests
21
+ timeout: 50000,// request timeout, // request timeout
22
+ adapter: cacheAdapterEnhancer(axios.defaults.adapter, {
23
+ enabledByDefault: false, // 默认禁用缓存
24
+ maxAge: 500 * 1000, // 缓存时间为60ms
25
+ }),
26
+ })
27
+
28
+ console.log('axios.defaults.adapter', cacheAdapterEnhancer)
29
+
30
+ const codeEnum = {
31
+ zh: 'zh_CN',
32
+ en: 'en_US',
33
+ zht: 'zh_TW'
34
+ }
35
+
36
+ let loadingInstance = {}
37
+ let isLoading = false
38
+ let requestQueue = new Array(0) // 请求队列
39
+ async function handleResponse() {
40
+ requestQueue.length--
41
+
42
+ if (!requestQueue.length) {
43
+ // loadingInstance.close && await loadingInstance.close()
44
+ // isLoading = false
45
+ }
46
+ }
47
+
48
+ // request interceptor
49
+ service.interceptors.request.use(
50
+ config => {
51
+ // do something before request is sent
52
+ if (!config.data) {
53
+ config.data = {}
54
+ }
55
+ requestQueue.length++
56
+
57
+ if ((config.loading === undefined || config.loading) && !isLoading) {
58
+ isLoading = true
59
+ // loadingInstance = Loading.service({
60
+ // lock: true,
61
+ // text: '加载中...',
62
+ // spinner: 'el-icon-loading',
63
+ // background: 'rgba(0, 0, 0, 0.35)',
64
+ // fullscreen: false,
65
+ // customClass: 'global-loading-box'
66
+ // })
67
+ }
68
+
69
+ config.headers = {
70
+ ...config.headers,
71
+ charset: 'utf-8',
72
+ lang: codeEnum[getLanguage()],
73
+ timestamp: Date.now(),
74
+ requestKey: randomString(16),
75
+ OperationDesc: 'yYarJp'
76
+ }
77
+ config.headers.Authorization = `Bearer ${getToken()}`
78
+ // console.log('Authorization===>',config.headers.Authorization)
79
+ return config
80
+ },
81
+ error => {
82
+ // do something with request error
83
+ return Promise.reject(error)
84
+ }
85
+ )
86
+
87
+ // response interceptor
88
+ service.interceptors.response.use(
89
+ /**
90
+ * If you want to get http information such as headers or status
91
+ * Please return response => response
92
+ */
93
+
94
+ /**
95
+ * Determine the request status by custom code
96
+ * Here is just an example
97
+ * You can also judge the status by HTTP Status Code
98
+ */
99
+ async response => {
100
+ const resData = response.data || response
101
+ const {
102
+ code,
103
+ msg,
104
+ data,
105
+ total
106
+ } = resData
107
+
108
+ await handleResponse()
109
+ if (response.config.responseType == 'blob') {
110
+ return data || resData;
111
+ }
112
+ // if the custom code is not 20000, it is judged as an error.
113
+ if (code !== 200 && code !== 0) {
114
+ Message({
115
+ message: msg || 'Error',
116
+ type: 'error',
117
+ [`duration${process.env.NODE_ENV === 'development' ? '_close' : ''}`]: 0,
118
+ showClose: true
119
+ })
120
+
121
+ // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
122
+ if (code === 10001 || code === 50012 || code === 50014) {
123
+ // to re-login
124
+ }
125
+
126
+ return Promise.reject({
127
+ code,
128
+ msg
129
+ })
130
+ } else {
131
+ if (data && data.failList && data.failList.length > 0) {
132
+ let keys = Object.keys(data.failList[0])
133
+ console.log(keys, data.failList[0][keys[0]], 'keys');
134
+ Message({
135
+ message: data.failList[0][keys[0]],
136
+ type: 'error',
137
+ duration: 5000
138
+ })
139
+ }
140
+ return total === undefined || total === null ?
141
+ data : {
142
+ list: data,
143
+ total
144
+ }
145
+ }
146
+ },
147
+ async error => {
148
+ await handleResponse()
149
+
150
+ if (error.message.includes('timeout')) {
151
+ error.message = '请求超时'
152
+ }
153
+
154
+ const {
155
+ response: {
156
+ data: {
157
+ code,
158
+ msg
159
+ } = {},
160
+ status
161
+ } = {}
162
+ } = error
163
+ const message = msg || error.message
164
+
165
+ console.trace('-----err', {
166
+ code, msg, status, message
167
+ })
168
+ // for debug
169
+
170
+ // if (status >= 400 && status < 500 && code !== 401) {
171
+ // 400开头的http状态码 to re-login
172
+ // code === 401 为用户名或密码错误,不应该reload重载,以优化用户体验
173
+ if (status === 401) {
174
+ //
175
+ } else {
176
+ // Message({
177
+ // message,
178
+ // type: 'error',
179
+ // [`duration${process.env.NODE_ENV === 'development' ? '_close' : ''}`]: 0,
180
+ // showClose: true
181
+ // })
182
+ }
183
+
184
+ return Promise.reject({
185
+ code,
186
+ msg: message
187
+ })
188
+ }
189
+ )
190
+
191
+ export default service
@@ -0,0 +1,68 @@
1
+ import qs from "qs";
2
+
3
+ const MemoryCache = {
4
+ data: {},
5
+ set(key, value, maxAge) { // 保存数据
6
+ this.data[key] = {
7
+ maxAge: maxAge || 0,
8
+ value,
9
+ now: Date.now(),
10
+ };
11
+ },
12
+ get(key) { // 从缓存中获取指定 key 对应的值。
13
+ const cachedItem = this.data[key];
14
+ if (!cachedItem) return null;
15
+ const isExpired = Date.now() - cachedItem.now > cachedItem.maxAge;
16
+ isExpired && this.delete(key);
17
+ return isExpired ? null : cachedItem.value;
18
+ },
19
+ delete(key) { // 从缓存中删除指定 key 对应的值。
20
+ return delete this.data[key];
21
+ },
22
+ clear() { // 清空已缓存的数据。
23
+ this.data = {};
24
+ },
25
+ };
26
+
27
+ function generateReqKey(config) {
28
+ const {method, url, params, data} = config;
29
+ return [method, url, JSON.stringify(params), JSON.stringify(data)].join("&");
30
+ }
31
+
32
+ function isCacheLike(cache) {
33
+ return !!(cache.set && cache.get && cache.delete && cache.clear
34
+ && typeof cache.get === 'function' && typeof cache.set === 'function'
35
+ && typeof cache.delete === 'function' && typeof cache.clear === 'function'
36
+ );
37
+ }
38
+
39
+ export function cacheAdapterEnhancer(adapter, options) {
40
+ const {maxAge, enabledByDefault = true, cacheFlag = "cache",
41
+ defaultCache = MemoryCache,} = options;
42
+
43
+ return (config) => {
44
+ const {url, method, params, forceUpdate} = config;
45
+ let useCache = config[cacheFlag] !== undefined && config[cacheFlag] !== null
46
+ ? config[cacheFlag]
47
+ : enabledByDefault;
48
+ if (useCache) {
49
+ const cache = isCacheLike(useCache) ? useCache : defaultCache;
50
+ let requestKey = generateReqKey(config); // 生成请求Key
51
+ let responsePromise = cache.get(requestKey); // 从缓存中获取请求key对应的响应对象
52
+ if (!responsePromise || forceUpdate) { // 缓存未命中/失效或强制更新时,则重新请求数据
53
+ responsePromise = (async () => {
54
+ try {
55
+ return await adapter(config); // 使用默认的xhrAdapter发送请求
56
+ } catch (reason) {
57
+ cache.delete(requestKey);
58
+ throw reason;
59
+ }
60
+ })();
61
+ cache.set(requestKey, responsePromise, maxAge); // 保存请求返回的响应对象
62
+ return responsePromise; // 返回已保存的响应对象
63
+ }
64
+ return responsePromise;
65
+ }
66
+ return adapter(config); // 使用默认的xhrAdapter发送请求
67
+ };
68
+ }
@@ -0,0 +1,62 @@
1
+ /*
2
+ * @Author: maoliqiong maoliqiong@nstc.com.cn
3
+ * @Date: 2022-09-01 11:14:01
4
+ * @LastEditors: maoliqiong maoliqiong@nstc.com.cn
5
+ * @LastEditTime: 2022-10-14 09:57:15
6
+ * @FilePath: \portal-webe:\nstc\新一代票据\gts-bill_web\src\main.js
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
9
+ // import 'n20-common-lib/style/index.css'
10
+ // import {
11
+ // setVueParameters
12
+ // } from 'n20-common-lib/src/_qiankun/index.js'
13
+ // import {
14
+ // closeTagsForBackPage,
15
+ // setTabsForSub,
16
+ // linkGo,
17
+ // linkPush
18
+ // } from 'n20-common-lib/src/plugins/CompatibleOld'
19
+ // import n20, {
20
+ // repairEl
21
+ // } from 'n20-common-lib'
22
+
23
+ // export const initCommon = (Vue, elementui, i18n, store, router, App) => {
24
+ // repairEl(elementui)
25
+ // Vue.use(n20, {
26
+ // prefix: 'cl',
27
+ // i18nConfig: i18n
28
+ // })
29
+ // Vue.prototype.$closeTagsForBackPage = closeTagsForBackPage;
30
+ // Vue.prototype.$linkGo = linkGo;
31
+ // Vue.prototype.$setTabsForSub = setTabsForSub;
32
+ // Vue.prototype.$linkPush = linkPush;
33
+
34
+ // Vue.use(elementui, {
35
+ // size: 'small', // set element-ui default size
36
+ // i18n: (key, value) => i18n.t(key, value) // 如果使用中文,无需设置,请删除
37
+ // })
38
+
39
+ // if (!window.__POWERED_BY_QIANKUN__) {
40
+ // new Vue({
41
+ // store,
42
+ // router,
43
+ // i18n,
44
+ // render: h => h(App)
45
+ // }).$mount('#app')
46
+ // }
47
+
48
+ // setVueParameters({
49
+ // store,
50
+ // router,
51
+ // i18n,
52
+ // render: h => h(App)
53
+ // })
54
+ // }
55
+
56
+
57
+ // export {
58
+ // bootstrap,
59
+ // mount,
60
+ // unmount
61
+ // }
62
+ // from 'n20-common-lib/src/_qiankun/index.js'
Binary file
package/vue.config.js ADDED
@@ -0,0 +1,45 @@
1
+ const { ureConfig, chainConfig } = require('./_webpack.config')
2
+
3
+ const path = require('path')
4
+
5
+ const resolve = (dir) => {
6
+ if (!dir) throw new Error('Directory parameter is required')
7
+ return path.join(__dirname, dir)
8
+ }
9
+ // 反向代理地址
10
+ const developURL = 'http://192.168.20.244'
11
+
12
+ module.exports = {
13
+ lintOnSave: false,
14
+ runtimeCompiler: true,
15
+ filenameHashing: true, // 生产文件名带hash
16
+ productionSourceMap: false,
17
+ transpileDependencies: [
18
+ "n20-common-lib",
19
+ "element-ui"
20
+ ],
21
+ devServer: {
22
+ proxy: {
23
+ '/api': {
24
+ target: developURL,
25
+ changeOrigin: true
26
+ },
27
+ '/bems': { //计划
28
+ target: developURL,
29
+ changeOrigin: true,
30
+ },
31
+ },
32
+ },
33
+ configureWebpack: config => {
34
+ return ureConfig
35
+ },
36
+ css: {
37
+ // extract: true,
38
+ sourceMap: true
39
+ },
40
+ chainWebpack: config => {
41
+ /* https://github.com/neutrinojs/webpack-chain */
42
+ config.merge(chainConfig)
43
+ },
44
+
45
+ }