@lambo-design/shared 1.0.0-beta.30 → 1.0.0-beta.301

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 (227) hide show
  1. package/config/config.js +20 -3
  2. package/config/index.js +7 -2
  3. package/config/locale.js +61 -0
  4. package/config/themes/atrovirens/atrovirens.css +589 -0
  5. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  6. package/config/themes/atrovirens/atrovirens.less +680 -0
  7. package/config/themes/atrovirens/var.less +688 -0
  8. package/config/themes/blue/blue.css +589 -0
  9. package/config/themes/blue/blue.css.map +1 -0
  10. package/config/themes/blue/blue.less +683 -0
  11. package/config/themes/blue/var.less +691 -0
  12. package/config/themes/blue-white/blue-white.css +589 -0
  13. package/config/themes/blue-white/blue-white.css.map +1 -0
  14. package/config/themes/blue-white/blue-white.less +684 -0
  15. package/config/themes/blue-white/var.less +690 -0
  16. package/config/themes/blue-white-big/blue-white-big.css +589 -0
  17. package/config/themes/blue-white-big/blue-white-big.css.map +1 -0
  18. package/config/themes/blue-white-big/blue-white-big.less +684 -0
  19. package/config/themes/blue-white-big/var.less +690 -0
  20. package/config/themes/blue-white-tight/blue-white-tight.css +590 -0
  21. package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
  22. package/config/themes/blue-white-tight/blue-white-tight.less +684 -0
  23. package/config/themes/blue-white-tight/var.less +692 -0
  24. package/config/themes/canglan/canglan.css +588 -0
  25. package/config/themes/canglan/canglan.css.map +1 -0
  26. package/config/themes/canglan/canglan.less +681 -0
  27. package/config/themes/canglan/var.less +692 -0
  28. package/config/themes/cuiwei/cuiwei.css +589 -0
  29. package/config/themes/cuiwei/cuiwei.css.map +1 -0
  30. package/config/themes/cuiwei/cuiwei.less +681 -0
  31. package/config/themes/cuiwei/var.less +690 -0
  32. package/config/themes/danqing/danqing.css +589 -0
  33. package/config/themes/danqing/danqing.css.map +1 -0
  34. package/config/themes/danqing/danqing.less +681 -0
  35. package/config/themes/danqing/danqing.wxss +576 -0
  36. package/config/themes/danqing/var.less +695 -0
  37. package/config/themes/deep/deep.css +589 -0
  38. package/config/themes/deep/deep.css.map +1 -0
  39. package/config/themes/deep/deep.less +681 -0
  40. package/config/themes/deep/var.less +693 -0
  41. package/config/themes/default/default.css +403 -57
  42. package/config/themes/default/default.css.map +1 -1
  43. package/config/themes/default/default.less +380 -16
  44. package/config/themes/default/var.less +389 -11
  45. package/config/themes/eap/eap.css +589 -0
  46. package/config/themes/eap/eap.css.map +1 -0
  47. package/config/themes/eap/eap.less +684 -0
  48. package/config/themes/eap/var.less +692 -0
  49. package/config/themes/gold/gold.css +589 -0
  50. package/config/themes/gold/gold.css.map +1 -0
  51. package/config/themes/gold/gold.less +684 -0
  52. package/config/themes/gold/var.less +385 -5
  53. package/config/themes/index.js +24 -4
  54. package/config/themes/lime/lime.css +589 -0
  55. package/config/themes/lime/lime.css.map +1 -0
  56. package/config/themes/lime/lime.less +684 -0
  57. package/config/themes/lime/var.less +384 -5
  58. package/config/themes/orange/orange.css +353 -7
  59. package/config/themes/orange/orange.css.map +1 -1
  60. package/config/themes/orange/orange.less +365 -0
  61. package/config/themes/orange/var.less +385 -5
  62. package/config/themes/red/red.css +353 -7
  63. package/config/themes/red/red.css.map +1 -1
  64. package/config/themes/red/red.less +365 -0
  65. package/config/themes/red/var.less +385 -5
  66. package/config/themes/theme-atrovirens.js +571 -0
  67. package/config/themes/theme-blue.js +571 -0
  68. package/config/themes/theme-bw.js +571 -0
  69. package/config/themes/theme-bwb.js +571 -0
  70. package/config/themes/theme-bwt.js +572 -0
  71. package/config/themes/theme-canglan.js +573 -0
  72. package/config/themes/theme-cuiwei.js +573 -0
  73. package/config/themes/theme-danqing.js +574 -0
  74. package/config/themes/theme-deep.js +571 -0
  75. package/config/themes/theme-default.js +378 -60
  76. package/config/themes/theme-eap.js +571 -0
  77. package/config/themes/theme-gold.js +326 -8
  78. package/config/themes/theme-lime.js +326 -8
  79. package/config/themes/theme-orange.js +560 -29
  80. package/config/themes/theme-red.js +563 -33
  81. package/config/themes/theme-white.js +571 -0
  82. package/config/themes/white/var.less +691 -0
  83. package/config/themes/white/white.css +589 -0
  84. package/config/themes/white/white.css.map +1 -0
  85. package/config/themes/white/white.less +684 -0
  86. package/directives/module/print.js +1 -0
  87. package/directives/module/vue-print-nb/README.md +63 -0
  88. package/directives/module/vue-print-nb/print.js +94 -0
  89. package/directives/module/vue-print-nb/printarea.js +532 -0
  90. package/index.js +7 -1
  91. package/nstyles/common.less +197 -0
  92. package/nstyles/components/404.less +46 -0
  93. package/nstyles/components/button.less +34 -0
  94. package/nstyles/components/date-picker.less +41 -0
  95. package/nstyles/components/drawer.less +20 -0
  96. package/nstyles/components/dropdown.less +18 -0
  97. package/nstyles/components/excel-flow.less +72 -0
  98. package/nstyles/components/form.less +313 -0
  99. package/nstyles/components/index.less +23 -0
  100. package/nstyles/components/layout/collect.less +10 -0
  101. package/nstyles/components/layout/detail-view.less +107 -0
  102. package/nstyles/components/layout/full-screen.less +7 -0
  103. package/nstyles/components/layout/index.less +7 -0
  104. package/nstyles/components/layout/other-menu.less +142 -0
  105. package/nstyles/components/layout/page-view.less +101 -0
  106. package/nstyles/components/layout/sider-trigger.less +41 -0
  107. package/nstyles/components/layout/tags-nav.less +113 -0
  108. package/nstyles/components/modal.less +90 -0
  109. package/nstyles/components/n-button.less +131 -0
  110. package/nstyles/components/n-image-preview.less +131 -0
  111. package/nstyles/components/n-model/index.less +19 -0
  112. package/nstyles/components/n-model/report-index.less +43 -0
  113. package/nstyles/components/n-panel.less +41 -0
  114. package/nstyles/components/n-picker.less +37 -0
  115. package/nstyles/components/n-sign.less +17 -0
  116. package/nstyles/components/n-tooltip.less +10 -0
  117. package/nstyles/components/panel.less +31 -0
  118. package/nstyles/components/select.less +3 -0
  119. package/nstyles/components/sign.less +27 -0
  120. package/nstyles/components/table.less +412 -0
  121. package/nstyles/components/tree.less +166 -0
  122. package/nstyles/components/upload.less +174 -0
  123. package/nstyles/index.less +5 -0
  124. package/nstyles/reset.less +73 -0
  125. package/nstyles/third/ag.less +206 -0
  126. package/nstyles/third/icons/sort-desc.svg +1 -0
  127. package/nstyles/third/icons/sort-up.svg +1 -0
  128. package/nstyles/third/icons/sorting.svg +1 -0
  129. package/nstyles/third/index.less +11 -0
  130. package/nstyles/third/view-design.less +378 -0
  131. package/nstyles/variables/base.less +143 -0
  132. package/nstyles/variables/index.less +4 -0
  133. package/nstyles/variables/theme/default/button.less +7 -0
  134. package/nstyles/variables/theme/default/common.less +60 -0
  135. package/nstyles/variables/theme/default/index.less +7 -0
  136. package/nstyles/variables/theme/default/layout.less +40 -0
  137. package/nstyles/variables/theme/default/table.less +37 -0
  138. package/nstyles/variables/theme/default/tag.less +3 -0
  139. package/nstyles/variables/theme/default/upload.less +3 -0
  140. package/nstyles/variables/theme/index.less +13 -0
  141. package/nstyles/variables/theme/lsv/button.less +7 -0
  142. package/nstyles/variables/theme/lsv/common.less +39 -0
  143. package/nstyles/variables/theme/lsv/index.less +5 -0
  144. package/nstyles/variables/theme/lsv/layout.less +21 -0
  145. package/nstyles/variables/theme/lsv/table.less +20 -0
  146. package/nstyles/variables/theme/lsv/tag.less +3 -0
  147. package/nstyles/variables/theme/small/button.less +7 -0
  148. package/nstyles/variables/theme/small/common.less +41 -0
  149. package/nstyles/variables/theme/small/index.less +5 -0
  150. package/nstyles/variables/theme/small/layout.less +21 -0
  151. package/nstyles/variables/theme/small/table.less +17 -0
  152. package/nstyles/variables/theme/small/tag.less +3 -0
  153. package/package.json +28 -7
  154. package/plugin/index.js +12 -0
  155. package/plugin/module/date-format.js +30 -0
  156. package/plugin/module/loading.js +26 -0
  157. package/plugin/module/warn-handler.js +11 -0
  158. package/styles/image/indicator-card-header.png +0 -0
  159. package/styles/image/inspur.png +0 -0
  160. package/styles/image/lan_navigator.png +0 -0
  161. package/styles/image/layout-header-bg-canglan.png +0 -0
  162. package/styles/image/layout-header-bg-cuiwei.png +0 -0
  163. package/styles/image/lv_navigator.png +0 -0
  164. package/utils/ajax/content-type.js +30 -0
  165. package/utils/ajax/headers.js +11 -0
  166. package/utils/ajax/interceptors.js +12 -4
  167. package/utils/ajax/sseFetchUtil.js +118 -0
  168. package/utils/assist.js +155 -27
  169. package/utils/base64.js +126 -0
  170. package/utils/blob.js +47 -0
  171. package/utils/context-menu.js +65 -0
  172. package/utils/crypto/aes.js +23 -0
  173. package/utils/crypto/index.js +10 -0
  174. package/utils/crypto/rsa.js +23 -0
  175. package/utils/date.js +334 -305
  176. package/utils/dict/built-in-dict.js +20 -0
  177. package/utils/dict/index.js +191 -0
  178. package/utils/event.js +72 -0
  179. package/utils/excel.js +373 -241
  180. package/utils/file.js +19 -0
  181. package/utils/form/validate.js +29 -0
  182. package/utils/half-year.js +68 -0
  183. package/utils/index.js +37 -0
  184. package/utils/json.js +44 -0
  185. package/utils/locale/en-US.js +171 -0
  186. package/utils/locale/zh-CN.js +171 -0
  187. package/utils/lodop.js +5 -0
  188. package/utils/menu/index.js +292 -15
  189. package/utils/mime_type.js +67 -0
  190. package/utils/modelerUtil.js +4 -1
  191. package/utils/n/api.js +38 -0
  192. package/utils/n/date.js +57 -0
  193. package/utils/n/index.js +10 -0
  194. package/utils/n/is-type.js +176 -0
  195. package/utils/n/number.js +144 -0
  196. package/utils/n/permission-cache.js +11 -0
  197. package/utils/n/reuqest/axiosN.js +17 -0
  198. package/utils/n/reuqest/content-type.js +19 -0
  199. package/utils/n/reuqest/interceptors.js +95 -0
  200. package/utils/n/reuqest/url-params.js +12 -0
  201. package/utils/n/storage.js +51 -0
  202. package/utils/n/token.js +51 -0
  203. package/utils/n/user-cache.js +11 -0
  204. package/utils/n/user.js +34 -0
  205. package/utils/n/uuid.js +16 -0
  206. package/utils/n-generator-routers.js +208 -0
  207. package/utils/n-router.js +205 -0
  208. package/utils/n-theme.js +30 -0
  209. package/utils/number.js +72 -15
  210. package/utils/oss.js +57 -0
  211. package/utils/platform.js +824 -31
  212. package/utils/quarter.js +58 -0
  213. package/utils/storage.js +198 -0
  214. package/utils/style.js +24 -0
  215. package/utils/theme.js +98 -3
  216. package/utils/transfer-queue.js +7 -0
  217. package/utils/transform.js +205 -0
  218. package/utils/type.js +102 -0
  219. package/utils/util.js +795 -0
  220. package/utils/vForm.js +349 -0
  221. package/utils/validator.js +181 -0
  222. package/config/themes/gold/default.css +0 -243
  223. package/config/themes/gold/default.css.map +0 -1
  224. package/config/themes/gold/default.less +0 -320
  225. package/config/themes/lime/default.css +0 -243
  226. package/config/themes/lime/default.css.map +0 -1
  227. package/config/themes/lime/default.less +0 -320
@@ -1,3 +1,6 @@
1
+ import config from "../../config/config"
2
+ import {deepCopy} from "../assist";
3
+ import {getLocalStorage, getUrlParams} from "../platform"
1
4
  /**
2
5
  * 判断是否存在路由
3
6
  * @param $router
@@ -16,16 +19,58 @@ export const hasRoute = ($router, name) => {
16
19
  * @returns {*|boolean}
17
20
  */
18
21
  export const hasRoutePath = ($router, path) => {
19
- let routes = $router.getRoutes();
20
- let res = routes.filter(item => item.path === path)
21
- return res && res.length > 0
22
+ if ($router && path) {
23
+ let routes = $router.getRoutes();
24
+ if (path.trim().startsWith("dida/")) {
25
+ path = path.trim().replace("dida/","");
26
+ if (!path.startsWith("/")) {
27
+ path = "/" + path;
28
+ }
29
+ } else if (path.trim().startsWith("dareport/")) {
30
+ path = path.trim().replace("dareport/","");
31
+ if (!path.startsWith("/")) {
32
+ path = "/" + path;
33
+ }
34
+ } else if (path.trim().startsWith("/" + config.routerBase + "/")) {
35
+ path = "/" + path.replace("/" + config.routerBase + "/","")
36
+ }
37
+ let res = routes.filter(item => item.path === path)
38
+ return res && res.length > 0
39
+ }
40
+ return false
22
41
  }
23
42
  /**
24
43
  * 动态生成菜单
25
44
  * @param permissionList
26
45
  * @returns []
27
46
  */
28
- export const generatorMenuList = (permissionList,appId) => {
47
+ export const generatorMenuList = (permissionList,appId,generateType = 'router') => {
48
+ let menuRouter = generatorMenuRouter(permissionList,appId,generateType);
49
+ return menuRouter && menuRouter.menuData ? menuRouter.menuData : [];
50
+ };
51
+
52
+ /**
53
+ * 生成租户路由参数
54
+ * @returns {*|object}
55
+ */
56
+ export const generateTenantQuery = () => {
57
+ let systemType = getLocalStorage('systemType')
58
+ let tenantCode = getLocalStorage('tenantCode')
59
+ let query = {}
60
+ if (systemType && tenantCode) {
61
+ query = {
62
+ systemType: systemType,
63
+ tenantCode: tenantCode
64
+ }
65
+ }
66
+ return query
67
+ }
68
+ /**
69
+ * 动态生成菜单
70
+ * @param generatorMenuRouter
71
+ * @returns []
72
+ */
73
+ export const generatorMenuRouter = (permissionList,appId,generateType = 'router') => {
29
74
  let menuData = [],
30
75
  pageNode = {
31
76
  path: "/page",
@@ -37,36 +82,38 @@ export const generatorMenuList = (permissionList,appId) => {
37
82
  component: "Main",
38
83
  children: []
39
84
  };
40
- listToMenuTree(permissionList, menuData, pageNode, "0", [], true,appId);
41
-
42
- /*if (pageNode.children.length > 0) {
43
- menuData.push(pageNode);
44
- }*/
45
- return menuData;
85
+ listToMenuTree(permissionList, menuData, pageNode, "0", [], true,appId,generateType);
86
+ return {menuData,pageNode};
46
87
  };
47
88
 
48
89
 
49
-
50
90
  /**
51
91
  * 数组转树形结构
52
92
  */
53
- const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId) => {
93
+ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId,generateType = 'router') => {
54
94
  if (list == null) {
55
95
  return;
56
96
  }
57
97
  list.forEach(item => {
58
- if (item.appId == appId) {
98
+ let appIdCondition = !appId || item.appId == appId || appId.indexOf(item.appId) > -1;//过滤是否要求的应用
99
+ let hideInMenuCondition = !(item.hasOwnProperty("hideInMenu") && item.hideInMenu);//过滤是否隐藏的菜单
100
+ if ((generateType && generateType == 'router' && appIdCondition) ||
101
+ (generateType == 'menu' && appIdCondition && hideInMenuCondition)) {
59
102
  // 判断是否为父级菜单
60
103
  if (item.pid === parentId) {
61
104
  if (item.type === 1 || item.type === 2) {
62
105
  let node = {
63
106
  meta: {
107
+ data: deepCopy(item),
64
108
  appId: item.appId,
65
109
  title: item.label,
66
110
  icon: item.icon,
67
111
  crumbs: [...crumbs],
68
- activeName: item.name
112
+ activeName: item.name,
113
+ notCache: item.notCache ? true : false,
114
+ hideInMenu: item.hideInMenu ? true : false
69
115
  },
116
+ permissionId: item.permissionId,
70
117
  type: item.type,
71
118
  pid: item.pid,
72
119
  component: item.name,
@@ -96,7 +143,8 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
96
143
  item.permissionId,
97
144
  node.meta.crumbs,
98
145
  false,
99
- appId
146
+ appId,
147
+ generateType
100
148
  );
101
149
  // 删掉不存在 children 值的属性
102
150
  if (node.children.length <= 0) {
@@ -108,12 +156,15 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
108
156
  if (item.type === 4) {
109
157
  let child = {
110
158
  meta: {
159
+ data: deepCopy(item),
160
+ appId: item.appId,
111
161
  title: item.label,
112
162
  hideInMenu: true,
113
163
  notCache: true,
114
164
  crumbs: [...crumbs],
115
165
  type: item.type
116
166
  },
167
+ permissionId: item.permissionId,
117
168
  type: item.type,
118
169
  pid: item.pid,
119
170
  component: item.name,
@@ -132,4 +183,230 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
132
183
  }
133
184
  });
134
185
  };
186
+
187
+ /**
188
+ * 动态生成路由
189
+ * @param generatorMenuRouter
190
+ * @returns []
191
+ */
192
+ export const generatorDynamicRouter = (permissionList,constantRouterComponents,appIds = null,generateType = 'router') => {
193
+ let allMenu = generatorMenuRouter(permissionList, appIds,generateType);
194
+ let menuData = allMenu.menuData;
195
+ let pageNode = allMenu.pageNode;
196
+ if (menuData && pageNode && pageNode.children.length > 0) {
197
+ menuData.push(pageNode);
198
+ }
199
+ //给路由添加面包屑属性,解决示例页面左侧菜单点击不选中的问题
200
+ //routesAddCrumbs(exampleMenuData,[]);
201
+ //menuData = menuData.concat(exampleMenuData)
202
+ let dynamicRouter = generator(menuData,constantRouterComponents);
203
+
204
+ return dynamicRouter;
205
+ }
206
+ /**
207
+ * 路由添加面包屑属性
208
+ */
209
+ export const routesAddCrumbs = (routes ,crumbs) => {
210
+ routes.forEach(item => {
211
+ if (item.meta.hasOwnProperty('crumbs')){
212
+ item.meta.crumbs.push({
213
+ icon: item.meta.icon,
214
+ name: item.name,
215
+ title: item.meta.title,
216
+ type: item.type
217
+ });
218
+ }else{
219
+ item.meta['crumbs'] = [...crumbs];
220
+ item.meta.crumbs.push({
221
+ icon: item.meta.icon,
222
+ name: item.name,
223
+ title: item.meta.title,
224
+ type: item.type
225
+ });
226
+ }
227
+ if (item.hasOwnProperty("children")){
228
+ routesAddCrumbs(item.children,item.meta.crumbs)
229
+ }
230
+ });
231
+ }
232
+
233
+ /*
234
+ 生成 vue-router 层级路由表
235
+ */
236
+ const generator = (menuData,constantRouterComponents) => {
237
+ for (let item of menuData) {
238
+ if (item.component && typeof item.component == "string") {
239
+ const target = constantRouterComponents[item.component];
240
+ if (target) {
241
+ if (target.component) {
242
+ if (typeof target.component == "string") {
243
+ // 解决路由name与组件name不一致导致的keeplive不生效的问题
244
+ try {
245
+ //let componentPath = '@/view/' + target.component;
246
+ item.component = resolve =>
247
+ require(['@/view/'+ target.component], data => {
248
+ data.default.name = item.name;
249
+ resolve(data);
250
+ });
251
+ }catch (e) {
252
+ delete item.component
253
+ }
254
+ } else {
255
+ item.component = target.component;
256
+ }
257
+ }
258
+ if (target.url) {
259
+ let path = target.url;
260
+ let query = {};
261
+ if (path.indexOf("?") > -1) {
262
+ query = getUrlParams(path.substr(path.indexOf("?")));
263
+ item.query = query;
264
+ path = path.substr(0,path.indexOf("?"));
265
+ }
266
+ item.path = path;
267
+ }
268
+ if (item.uri) {
269
+ item.meta.uriParam = item.uri;
270
+ }
271
+ if (target.notCache) {
272
+ item.meta.notCache = target.notCache;
273
+ }
274
+ if (target.hideInMenu) {
275
+ item.meta.hideInMenu = target.hideInMenu;
276
+ }
277
+ }
278
+ if (item.uri) {
279
+ if (item.uri.startsWith("/")) {
280
+ item.uri = item.uri.substr(1);
281
+ }
282
+ let uri = item.uri;
283
+ if (uri.startsWith(config.routerBase + "/")) {
284
+ uri = uri.replace(config.routerBase + "/","")
285
+ }
286
+ if (uri.startsWith("dida/")) {
287
+ item.meta.notCache = true;
288
+ let path = uri;
289
+ let query = {};
290
+ if (path.indexOf("?") > -1) {
291
+ query = getUrlParams(path.substr(path.indexOf("?")));
292
+ item.query = query;
293
+ path = path.substr(0,path.indexOf("?"));
294
+ }
295
+ try{
296
+ //let path = '@/view/dida/dida-page';
297
+ item.component = resolve => {
298
+ require(['@/view/dida/dida-page'], data => {
299
+ data.default.name = item.name;
300
+ resolve(data);
301
+ });
302
+ };
303
+ }catch (e){
304
+ delete item.component
305
+ }
306
+ item.path = "/" + path;
307
+ } else if(uri.startsWith("dareport/")){
308
+ item.meta.notCache = true;
309
+ let path = uri;
310
+ let query = {};
311
+ if (path.indexOf("?") > -1) {
312
+ query = getUrlParams(path.substr(path.indexOf("?")));
313
+ item.query = query;
314
+ path = path.substr(0,path.indexOf("?"));
315
+ }
316
+ try{
317
+ item.component = resolve => {
318
+ require(['@/view/dida/dida-page'], data => {
319
+ data.default.name = item.name;
320
+ resolve(data);
321
+ });
322
+ };
323
+ }catch (e){
324
+ delete item.component
325
+ }
326
+ item.path = "/" + path;
327
+ } else {
328
+ try{
329
+ let path = item.uri;
330
+ if (item.uri.startsWith(config.routerBase + "/")) {
331
+ path = path.replace(config.routerBase + "/","")
332
+ }
333
+ let query = {};
334
+ if (path.indexOf("?") > -1) {
335
+ query = getUrlParams(path.substr(path.indexOf("?")));
336
+ path = path.substr(0,path.indexOf("?"));
337
+ }
338
+ if (target && target.component) {
339
+
340
+ } else {
341
+ let component = require('@/view/' + path);
342
+ if (component) {
343
+ item.component = resolve => {
344
+ require(['@/view/' + path], data => {
345
+ data.default.name = item.name;
346
+ resolve(data);
347
+ });
348
+ };
349
+ } else {
350
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
351
+ delete item.component;
352
+ }
353
+ }
354
+ if (target && target.url) {
355
+
356
+ } else {
357
+ item.path = "/" + path;
358
+ item.query = query;
359
+ }
360
+ }catch (e){
361
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
362
+ delete item.component;
363
+ }
364
+ }
365
+ }
366
+ if (item.path == null) {
367
+ item.path = "";
368
+ }
369
+ if (item.component && typeof item.component == "string") {
370
+ delete item.component;
371
+ }
372
+ if (item.children && item.children.length > 0) {
373
+ generator(item.children,constantRouterComponents);
374
+ }
375
+ }
376
+ }
377
+ return menuData;
378
+ };
379
+
380
+ /**
381
+ * 根据权限组织tab数据
382
+ * @param originMenuList
383
+ * @param name
384
+ * @param appId
385
+ * @returns {{}}
386
+ */
387
+ export const generateTabDataFromPermission = (originMenuList,name,appId) => {
388
+ let menuItem = {};
389
+ if (name && originMenuList) {
390
+ let originalMenu = originMenuList.find(item => item.name == name && item.type && item.type == '2' && (appId && item.appId == appId || !appId));
391
+ if (originalMenu && originalMenu.name) {
392
+ menuItem = {
393
+ meta: {
394
+ data: originalMenu,
395
+ appId: originalMenu.appId,
396
+ title: originalMenu.label,
397
+ icon: originalMenu.icon,
398
+ crumbs: [],
399
+ activeName: originalMenu.name
400
+ },
401
+ permissionId: originalMenu.permissionId,
402
+ pid: originalMenu.pid,
403
+ type: originalMenu.type,
404
+ name: originalMenu.name,
405
+ uri: originalMenu.uri
406
+ }
407
+ }
408
+ }
409
+ return menuItem;
410
+ }
411
+
135
412
  export default generatorMenuList;
@@ -0,0 +1,67 @@
1
+ export const MIME_TYPE = {
2
+ aac: 'audio/aac',
3
+ abw: 'application/x-abiword',
4
+ arc: 'application/x-freearc',
5
+ avi: 'video/x-msvideo',
6
+ azw: 'application/vnd.amazon.ebook',
7
+ bin: 'application/octet-stream',
8
+ bmp: 'image/bmp',
9
+ bz: 'application/x-bzip',
10
+ bz2: 'application/x-bzip2',
11
+ csh: 'application/x-csh',
12
+ css: 'text/css',
13
+ csv: 'text/csv',
14
+ doc: 'application/msword',
15
+ docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
16
+ eot: 'application/vnd.ms-fontobject',
17
+ epub: 'application/epub+zip',
18
+ gif: 'image/gif',
19
+ html: 'text/html',
20
+ ico: 'image/vnd.microsoft.icon',
21
+ ics: 'text/calendar',
22
+ jar: 'application/java-archive',
23
+ jpg: 'image/jpeg',
24
+ jpeg: 'image/jpeg',
25
+ js: 'text/javascript',
26
+ json: 'application/json',
27
+ jsonld: 'application/ld+json',
28
+ mid: 'audio/midi',
29
+ midi: 'audio/x-midi',
30
+ mjs: 'text/javascript',
31
+ mp3: 'audio/mpeg',
32
+ mpeg: 'video/mpeg',
33
+ mpkg: 'application/vnd.apple.installer+xml',
34
+ odp: 'application/vnd.oasis.opendocument.presentation',
35
+ ods: 'application/vnd.oasis.opendocument.spreadsheet',
36
+ odt: 'application/vnd.oasis.opendocument.text',
37
+ oga: 'audio/ogg',
38
+ ogv: 'video/ogg',
39
+ ogx: 'application/ogg',
40
+ otf: 'font/otf',
41
+ png: 'image/png',
42
+ pdf: 'application/pdf',
43
+ ppt: 'application/vnd.ms-powerpoint',
44
+ pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
45
+ rar: 'application/x-rar-compressed',
46
+ rtf: 'application/rtf',
47
+ sh: 'application/x-sh',
48
+ svg: 'image/svg+xml',
49
+ swf: 'application/x-shockwave-flash',
50
+ tar: 'application/x-tar',
51
+ tiff: 'image/tiff',
52
+ ttf: 'font/ttf',
53
+ txt: 'text/plain',
54
+ vsd: 'application/vnd.visio',
55
+ wav: 'audio/wav',
56
+ weba: 'audio/webm',
57
+ webm: 'video/webm',
58
+ webp: 'image/webp',
59
+ woff: 'font/woff',
60
+ woff2: 'font/woff2',
61
+ xhtml: 'application/xhtml+xml',
62
+ xls: 'application/vnd.ms-excel',
63
+ xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
64
+ xul: 'application/vnd.mozilla.xul+xml',
65
+ zip: 'application/zip',
66
+ '7z': 'application/x-7z-compressed',
67
+ }
@@ -1,6 +1,9 @@
1
1
  import config from "@/config/config"
2
2
  import ajax from '@/utils/ajax'
3
3
 
4
+ /**
5
+ * 工作流工具
6
+ */
4
7
  export const tools = {
5
8
 
6
9
  registerFileDrop(container, callback) {
@@ -10,7 +13,7 @@ export const tools = {
10
13
 
11
14
  /**
12
15
  * 通过xml创建bpmn
13
- * @param {string} xml 创建bpms xml
16
+ * @param {string} xml 创建bpmn xml
14
17
  * @param {object} bpmnModeler bpmn对象
15
18
  * @param {object} container 容器对象
16
19
  */
package/utils/n/api.js ADDED
@@ -0,0 +1,38 @@
1
+ import { axiosN } from './reuqest/axiosN'
2
+ import config from '../../config/config'
3
+
4
+ const CONTEXT = `${config.immServerContext}/manage/pub/dateperiod`
5
+
6
+ export function getWeeksByMonthAPI(params) {
7
+ return axiosN.get(`${CONTEXT}/getWeekByMonth`, { params })
8
+ }
9
+
10
+ /**
11
+ * 获取文档中心预览URL
12
+ *
13
+ * @param fileId 文件Id
14
+ * @returns 文件内容
15
+ */
16
+ export function getPreviewUrlApi(fileId) {
17
+ const isWeb = location.protocol === 'https:' ? '1' : ''
18
+
19
+ const axiosConfig = {}
20
+ return axiosN.get(
21
+ `${location.protocol}//${location.host}${config.ucExtServerContext}/api/wps/getPreviewUrl/${fileId}?isWeb=${isWeb}&previewMode=high_definition`,
22
+ axiosConfig,
23
+ )
24
+ }
25
+
26
+ /**
27
+ * 获取文档中心在线编辑URL
28
+ *
29
+ * @param fileId 文件Id
30
+ * @returns 文件内容
31
+ */
32
+ export function getEditUrlApi(fileId) {
33
+ const axiosConfig = {};
34
+ return axiosN.get(
35
+ `${location.protocol}//${location.host}${config.ucExtServerContext}/api/wps/getEditUrl/${fileId}`,
36
+ axiosConfig
37
+ );
38
+ }
@@ -0,0 +1,57 @@
1
+ import dayjs from 'dayjs'
2
+
3
+ export function str2Date(value) {
4
+ if (value) {
5
+ return dayjs(value, ['YYYYMMDDHHmmss', 'YYYYMMDDHHmm', 'YYYYMMDD', 'YYYYMM', 'YYYY']).toDate()
6
+ } else {
7
+ return null
8
+ }
9
+ }
10
+
11
+ export function formatDate(value) {
12
+ if (value && /^[0-9]+$/.test(value)) {
13
+ switch (value.length) {
14
+ case 14: {
15
+ return dayjs(value, ['YYYYMMDDHHmmss']).format('YYYY-MM-DD HH:mm:ss')
16
+ }
17
+ case 12: {
18
+ return dayjs(value, ['YYYYMMDDHHmmss']).format('YYYY-MM-DD HH:mm')
19
+ }
20
+ case 8: {
21
+ return dayjs(value, ['YYYYMMDD']).format('YYYY-MM-DD')
22
+ }
23
+ case 6: {
24
+ return dayjs(value, ['YYYYMM']).format('YYYY-MM')
25
+ }
26
+ case 4: {
27
+ return value.substring(0, 2) + '-' + value.substring(2, 2)
28
+ }
29
+ }
30
+ } else {
31
+ return value || ''
32
+ }
33
+ }
34
+
35
+ export function formatDateChinese(value) {
36
+ if (value && /^[0-9]+$/.test(value)) {
37
+ switch (value.length) {
38
+ case 14: {
39
+ return dayjs(value, ['YYYYMMDDHHmmss']).format('YYYY年MM月DD日 HH:mm:ss')
40
+ }
41
+ case 12: {
42
+ return dayjs(value, ['YYYYMMDDHHmmss']).format('YYYY年MM月DD日 HH:mm')
43
+ }
44
+ case 8: {
45
+ return dayjs(value, ['YYYYMMDD']).format('YYYY年MM月DD日')
46
+ }
47
+ case 6: {
48
+ return dayjs(value, ['YYYYMM']).format('YYYY年MM月')
49
+ }
50
+ case 4: {
51
+ return value.substring(0, 2) + '年' + value.substring(2, 2) + '月'
52
+ }
53
+ }
54
+ } else {
55
+ return value || ''
56
+ }
57
+ }
@@ -0,0 +1,10 @@
1
+ export * from './date'
2
+ export * from './is-type'
3
+ export * from './number'
4
+ export * from './permission-cache'
5
+ export * from './storage'
6
+ export * from './token'
7
+ export * from './user-cache'
8
+ export * from './user'
9
+ export * from './uuid'
10
+ export * from './reuqest/axiosN'