@lambo-design/shared 1.0.0-beta.21 → 1.0.0-beta.210

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 (183) hide show
  1. package/config/config.js +16 -2
  2. package/config/index.js +7 -2
  3. package/config/themes/atrovirens/atrovirens.css +571 -0
  4. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  5. package/config/themes/atrovirens/atrovirens.less +660 -0
  6. package/config/themes/atrovirens/var.less +666 -0
  7. package/config/themes/blue/blue.css +571 -0
  8. package/config/themes/blue/blue.css.map +1 -0
  9. package/config/themes/blue/blue.less +663 -0
  10. package/config/themes/blue/var.less +669 -0
  11. package/config/themes/blue-white/blue-white.css +571 -0
  12. package/config/themes/blue-white/blue-white.css.map +1 -0
  13. package/config/themes/blue-white/blue-white.less +663 -0
  14. package/config/themes/blue-white/var.less +669 -0
  15. package/config/themes/blue-white-tight/blue-white-tight.css +572 -0
  16. package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
  17. package/config/themes/blue-white-tight/blue-white-tight.less +664 -0
  18. package/config/themes/blue-white-tight/var.less +670 -0
  19. package/config/themes/deep/deep.css +571 -0
  20. package/config/themes/deep/deep.css.map +1 -0
  21. package/config/themes/deep/deep.less +662 -0
  22. package/config/themes/deep/var.less +669 -0
  23. package/config/themes/default/default.css +387 -57
  24. package/config/themes/default/default.css.map +1 -0
  25. package/config/themes/default/default.less +432 -88
  26. package/config/themes/default/var.less +368 -12
  27. package/config/themes/eap/eap.css +571 -0
  28. package/config/themes/eap/eap.css.map +1 -0
  29. package/config/themes/eap/eap.less +663 -0
  30. package/config/themes/eap/var.less +670 -0
  31. package/config/themes/gold/gold.css +571 -0
  32. package/config/themes/gold/gold.css.map +1 -0
  33. package/config/themes/gold/gold.less +663 -0
  34. package/config/themes/gold/var.less +363 -7
  35. package/config/themes/green-tobacco/greentobacco.css +571 -0
  36. package/config/themes/green-tobacco/greentobacco.less +661 -0
  37. package/config/themes/green-tobacco/var.less +669 -0
  38. package/config/themes/index.js +16 -4
  39. package/config/themes/lime/lime.css +571 -0
  40. package/config/themes/lime/lime.css.map +1 -0
  41. package/config/themes/lime/lime.less +663 -0
  42. package/config/themes/lime/var.less +363 -7
  43. package/config/themes/orange/orange.css +571 -0
  44. package/config/themes/orange/orange.css.map +1 -0
  45. package/config/themes/orange/orange.less +663 -0
  46. package/config/themes/orange/var.less +671 -0
  47. package/config/themes/red/red.css +571 -0
  48. package/config/themes/red/red.css.map +1 -0
  49. package/config/themes/red/red.less +663 -0
  50. package/config/themes/red/var.less +670 -0
  51. package/config/themes/theme-atrovirens.js +554 -0
  52. package/config/themes/theme-blue.js +554 -0
  53. package/config/themes/theme-bw.js +554 -0
  54. package/config/themes/theme-bwt.js +555 -0
  55. package/config/themes/theme-deep.js +554 -0
  56. package/config/themes/theme-default.js +361 -59
  57. package/config/themes/theme-eap.js +554 -0
  58. package/config/themes/theme-gold.js +313 -11
  59. package/config/themes/theme-greentobacco.js +554 -0
  60. package/config/themes/theme-lime.js +313 -11
  61. package/config/themes/theme-orange.js +542 -27
  62. package/config/themes/theme-red.js +546 -32
  63. package/directives/module/print.js +1 -0
  64. package/directives/module/vue-print-nb/README.md +63 -0
  65. package/directives/module/vue-print-nb/print.js +94 -0
  66. package/directives/module/vue-print-nb/printarea.js +532 -0
  67. package/index.js +7 -1
  68. package/nstyles/common.less +197 -0
  69. package/nstyles/components/404.less +46 -0
  70. package/nstyles/components/button.less +34 -0
  71. package/nstyles/components/date-picker.less +37 -0
  72. package/nstyles/components/drawer.less +20 -0
  73. package/nstyles/components/dropdown.less +18 -0
  74. package/nstyles/components/excel-flow.less +72 -0
  75. package/nstyles/components/form.less +303 -0
  76. package/nstyles/components/index.less +23 -0
  77. package/nstyles/components/layout/collect.less +10 -0
  78. package/nstyles/components/layout/detail-view.less +107 -0
  79. package/nstyles/components/layout/full-screen.less +7 -0
  80. package/nstyles/components/layout/index.less +7 -0
  81. package/nstyles/components/layout/other-menu.less +142 -0
  82. package/nstyles/components/layout/page-view.less +101 -0
  83. package/nstyles/components/layout/sider-trigger.less +41 -0
  84. package/nstyles/components/layout/tags-nav.less +113 -0
  85. package/nstyles/components/modal.less +85 -0
  86. package/nstyles/components/n-button.less +131 -0
  87. package/nstyles/components/n-image-preview.less +131 -0
  88. package/nstyles/components/n-model/index.less +19 -0
  89. package/nstyles/components/n-model/report-index.less +43 -0
  90. package/nstyles/components/n-panel.less +41 -0
  91. package/nstyles/components/n-picker.less +37 -0
  92. package/nstyles/components/n-sign.less +17 -0
  93. package/nstyles/components/n-tooltip.less +10 -0
  94. package/nstyles/components/panel.less +31 -0
  95. package/nstyles/components/select.less +3 -0
  96. package/nstyles/components/sign.less +27 -0
  97. package/nstyles/components/table.less +315 -0
  98. package/nstyles/components/tree.less +159 -0
  99. package/nstyles/components/upload.less +164 -0
  100. package/nstyles/index.less +5 -0
  101. package/nstyles/reset.less +65 -0
  102. package/nstyles/third/ag.less +174 -0
  103. package/nstyles/third/icons/sort-desc.svg +1 -0
  104. package/nstyles/third/icons/sort-up.svg +1 -0
  105. package/nstyles/third/icons/sorting.svg +1 -0
  106. package/nstyles/third/index.less +11 -0
  107. package/nstyles/third/view-design.less +363 -0
  108. package/nstyles/variables/base.less +143 -0
  109. package/nstyles/variables/index.less +4 -0
  110. package/nstyles/variables/theme/default/button.less +7 -0
  111. package/nstyles/variables/theme/default/common.less +57 -0
  112. package/nstyles/variables/theme/default/index.less +7 -0
  113. package/nstyles/variables/theme/default/layout.less +40 -0
  114. package/nstyles/variables/theme/default/table.less +37 -0
  115. package/nstyles/variables/theme/default/tag.less +3 -0
  116. package/nstyles/variables/theme/default/upload.less +3 -0
  117. package/nstyles/variables/theme/index.less +13 -0
  118. package/nstyles/variables/theme/small/button.less +7 -0
  119. package/nstyles/variables/theme/small/common.less +39 -0
  120. package/nstyles/variables/theme/small/index.less +5 -0
  121. package/nstyles/variables/theme/small/layout.less +21 -0
  122. package/nstyles/variables/theme/small/table.less +17 -0
  123. package/nstyles/variables/theme/small/tag.less +3 -0
  124. package/package.json +27 -7
  125. package/plugin/index.js +12 -0
  126. package/plugin/module/date-format.js +30 -0
  127. package/plugin/module/loading.js +26 -0
  128. package/plugin/module/warn-handler.js +11 -0
  129. package/styles/image/inspur.png +0 -0
  130. package/styles/image/lan_navigator.png +0 -0
  131. package/styles/image/lv_navigator.png +0 -0
  132. package/utils/ajax/content-type.js +30 -0
  133. package/utils/assist.js +88 -25
  134. package/utils/base64.js +126 -0
  135. package/utils/blob.js +47 -0
  136. package/utils/crypto/index.js +10 -0
  137. package/utils/date.js +334 -305
  138. package/utils/dict/built-in-dict.js +20 -0
  139. package/utils/dict/index.js +133 -0
  140. package/utils/event.js +72 -0
  141. package/utils/excel.js +369 -237
  142. package/utils/file.js +19 -0
  143. package/utils/form/validate.js +29 -0
  144. package/utils/half-year.js +68 -0
  145. package/utils/index.js +37 -0
  146. package/utils/json.js +29 -0
  147. package/utils/lodop.js +5 -0
  148. package/utils/menu/index.js +267 -11
  149. package/utils/mime_type.js +67 -0
  150. package/utils/modelerUtil.js +4 -1
  151. package/utils/n/api.js +22 -0
  152. package/utils/n/date.js +57 -0
  153. package/utils/n/index.js +10 -0
  154. package/utils/n/is-type.js +176 -0
  155. package/utils/n/number.js +144 -0
  156. package/utils/n/permission-cache.js +11 -0
  157. package/utils/n/reuqest/axiosN.js +17 -0
  158. package/utils/n/reuqest/content-type.js +19 -0
  159. package/utils/n/reuqest/interceptors.js +95 -0
  160. package/utils/n/reuqest/url-params.js +12 -0
  161. package/utils/n/storage.js +51 -0
  162. package/utils/n/token.js +51 -0
  163. package/utils/n/user-cache.js +11 -0
  164. package/utils/n/user.js +34 -0
  165. package/utils/n/uuid.js +16 -0
  166. package/utils/n-generator-routers.js +208 -0
  167. package/utils/n-router.js +205 -0
  168. package/utils/n-theme.js +30 -0
  169. package/utils/number.js +72 -15
  170. package/utils/oss.js +57 -0
  171. package/utils/platform.js +719 -22
  172. package/utils/quarter.js +58 -0
  173. package/utils/storage.js +198 -0
  174. package/utils/style.js +24 -0
  175. package/utils/theme.js +97 -3
  176. package/utils/transfer-queue.js +7 -0
  177. package/utils/type.js +102 -0
  178. package/utils/util.js +795 -0
  179. package/utils/validator.js +181 -0
  180. package/config/themes/gold/default.css +0 -241
  181. package/config/themes/gold/default.less +0 -319
  182. package/config/themes/lime/default.css +0 -241
  183. package/config/themes/lime/default.less +0 -319
package/utils/file.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 文件大小计算
3
+ * @param size
4
+ * @returns {string}
5
+ */
6
+ export const formatterSizeUnit = function (size) {
7
+ if (size) {
8
+ let result = parseInt(size);
9
+ if (result < 1024) {
10
+ return result + " B";
11
+ } else if (result < 1024 * 1024) {
12
+ return parseInt(result / 1024) + " KB";
13
+ } else if (result < 1024 * 1024 * 1024) {
14
+ return parseInt(result / (1024 * 1024)) + " MB";
15
+ } else {
16
+ return parseInt(result / (1024 * 1024 * 1024)) + " GB";
17
+ }
18
+ }
19
+ };
@@ -0,0 +1,29 @@
1
+ import ajax from '../ajax'
2
+
3
+ export const checkSingle = async (rule, value, callback, {url, formKey, formName}) => {
4
+ if (!formName) {
5
+ formName = "参数";
6
+ }
7
+ if (value) {
8
+ if (url) {
9
+ let params = {};
10
+ if (formKey) {
11
+ params[formKey] = value
12
+ }
13
+ const { data } = await ajax.get(url, {params: params});
14
+ if (data.code == 1 && data.data) {
15
+ callback(formName + "已存在");
16
+ } else {
17
+ callback();
18
+ }
19
+ } else {
20
+ callback();
21
+ }
22
+ } else {
23
+ callback(formName + "不能为空");
24
+ }
25
+ }
26
+
27
+ export default {
28
+ checkSingle
29
+ }
@@ -0,0 +1,68 @@
1
+ // 获取半年
2
+ export function getHalfYear(date) {
3
+ if (!date || date.length < 4) {
4
+ return ''
5
+ }
6
+
7
+ const year = date.substring(0, 4)
8
+ const month = date.substring(4, 6)
9
+ const halfYear = getHalfYearNum(parseInt(month))
10
+ if (!month) {
11
+ return `${year}`
12
+ }
13
+ return `${year}H${halfYear}`
14
+ }
15
+
16
+ export function getHalfYearNum(month) {
17
+ if (typeof month === 'string') {
18
+ if (isNaN(parseInt(month))) return 0
19
+ month = parseInt(month)
20
+ }
21
+
22
+ return month <= 6 ? 1 : 2
23
+ }
24
+
25
+ export function formatHalfYear(halfYear) {
26
+ if (!halfYear || halfYear.length < 4) {
27
+ return halfYear
28
+ }
29
+
30
+ const year = halfYear.substring(0, 4)
31
+ const month = halfYear.substring(4, 6)
32
+ if (!month) {
33
+ return `${year}全年`
34
+ }
35
+ const halfYearNum = parseInt(halfYear.substring(5))
36
+ const halfStr = halfYearNum === 1 ? '上半年' : '下半年'
37
+ return `${year}${halfStr}`
38
+ }
39
+
40
+ export function getHalfYearBeginMonth(halfYear) {
41
+ if (!halfYear || halfYear.length < 4) {
42
+ return halfYear
43
+ }
44
+ const year = halfYear.substring(0, 4)
45
+ const month = halfYear.substring(4, 6)
46
+ if (!month) {
47
+ return `${year}01`
48
+ }
49
+ const halfYearNum = parseInt(halfYear.substring(5))
50
+ const beginMonth = halfYearNum * 6 - 5
51
+ const monthStr = beginMonth < 10 ? `0${beginMonth}` : `${beginMonth}`
52
+ return `${year}${monthStr}`
53
+ }
54
+
55
+ export function getHalfYearEndMonth(halfYear) {
56
+ if (!halfYear || halfYear.length < 4) {
57
+ return halfYear
58
+ }
59
+ const year = halfYear.substring(0, 4)
60
+ const month = halfYear.substring(4, 6)
61
+ if (!month) {
62
+ return `${year}12`
63
+ }
64
+ const halfYearNum = parseInt(halfYear.substring(5))
65
+ const endMonth = halfYearNum * 2
66
+ const monthStr = endMonth < 10 ? `0${endMonth}` : `${endMonth}`
67
+ return `${year}${monthStr}`
68
+ }
package/utils/index.js CHANGED
@@ -3,3 +3,40 @@ const sum = (a, b) => {
3
3
  };
4
4
 
5
5
  export { sum };
6
+ import ajax from './ajax'
7
+
8
+ export {ajax as axios}
9
+ // export * from './crypto'
10
+ // export * from './dict'
11
+ // export * from './form/validate'
12
+ // export * from './menu'
13
+ // export * from './vxetable'
14
+ // export * from './n'
15
+ // export * from './date'
16
+ // export * from './assist'
17
+ // export * from './base64'
18
+ // export * from './bus'
19
+ // export * from './dom'
20
+ // export * from './event'
21
+ // export * from './excel'
22
+ // export * from './file'
23
+ // export * from './half-year'
24
+ // export * from './json'
25
+ // export * from './lodop'
26
+ // export * from './mime_type'
27
+ // export * from './modelerUtil'
28
+ // export * from './n-generator-routers'
29
+ // export * from './n-router'
30
+ // export * from './n-theme'
31
+ // export * from './number'
32
+ // export * from './oss'
33
+ // export * from './platform'
34
+ // export * from './quarter'
35
+ // export * from './storage'
36
+ // export * from './style'
37
+ // export * from './theme'
38
+ // export * from './transfer-queue'
39
+ // export * from './type'
40
+ // export * from './util'
41
+ // export * from './validator'
42
+ // export * from './zoomScroll'
package/utils/json.js ADDED
@@ -0,0 +1,29 @@
1
+ let json = {};
2
+ /**
3
+ * Json(带函数)转字符串
4
+ * @param value Json对象
5
+ * @returns {string} 字符串
6
+ */
7
+ json.stringify = function (value) {
8
+ return JSON.stringify(value, function(key, val) {
9
+ if (typeof val === 'function') {
10
+ return val + '';
11
+ }
12
+ return val;
13
+ });
14
+ }
15
+ /**
16
+ * 字符串(带函数)转Object(函数可调用)
17
+ * @param value
18
+ * @returns {any}
19
+ */
20
+ json.parse = function (value) {
21
+ return JSON.parse(value,function(k,v){
22
+ if(v.indexOf&&v.indexOf('function')>-1){
23
+ return eval("(function(){return "+v+" })()")
24
+ }
25
+ return v;
26
+ });
27
+ }
28
+
29
+ export default json;
package/utils/lodop.js CHANGED
@@ -1,5 +1,10 @@
1
1
  var CreatedOKLodop7766 = null, CLodopIsLocal;
2
2
 
3
+ /**
4
+ * 套打插件
5
+ * @returns {boolean}
6
+ */
7
+
3
8
  //====判断是否需要 Web打印服务CLodop:===
4
9
  //===(不支持插件的浏览器版本需要用它)===
5
10
  function needCLodop() {
@@ -1,3 +1,6 @@
1
+ import config from "../../config/config"
2
+ import {deepCopy} from "../assist";
3
+ import {getUrlParams} from "../platform"
1
4
  /**
2
5
  * 判断是否存在路由
3
6
  * @param $router
@@ -16,9 +19,25 @@ 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
  * 动态生成菜单
@@ -26,6 +45,15 @@ export const hasRoutePath = ($router, path) => {
26
45
  * @returns []
27
46
  */
28
47
  export const generatorMenuList = (permissionList,appId) => {
48
+ let menuRouter = generatorMenuRouter(permissionList,appId);
49
+ return menuRouter && menuRouter.menuData ? menuRouter.menuData : [];
50
+ };
51
+ /**
52
+ * 动态生成菜单
53
+ * @param generatorMenuRouter
54
+ * @returns []
55
+ */
56
+ export const generatorMenuRouter = (permissionList,appId) => {
29
57
  let menuData = [],
30
58
  pageNode = {
31
59
  path: "/page",
@@ -38,15 +66,10 @@ export const generatorMenuList = (permissionList,appId) => {
38
66
  children: []
39
67
  };
40
68
  listToMenuTree(permissionList, menuData, pageNode, "0", [], true,appId);
41
-
42
- /*if (pageNode.children.length > 0) {
43
- menuData.push(pageNode);
44
- }*/
45
- return menuData;
69
+ return {menuData,pageNode};
46
70
  };
47
71
 
48
72
 
49
-
50
73
  /**
51
74
  * 数组转树形结构
52
75
  */
@@ -55,18 +78,22 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
55
78
  return;
56
79
  }
57
80
  list.forEach(item => {
58
- if (item.appId == appId) {
81
+ if (!appId || item.appId == appId && (!item.hasOwnProperty("hideInMenu") || (item.hasOwnProperty("hideInMenu") && !item.hideInMenu))) {
59
82
  // 判断是否为父级菜单
60
83
  if (item.pid === parentId) {
61
84
  if (item.type === 1 || item.type === 2) {
62
85
  let node = {
63
86
  meta: {
87
+ data: deepCopy(item),
64
88
  appId: item.appId,
65
89
  title: item.label,
66
90
  icon: item.icon,
67
91
  crumbs: [...crumbs],
68
- activeName: item.name
92
+ activeName: item.name,
93
+ notCache: item.notCache ? true : false,
94
+ hideInMenu: item.hideInMenu ? true : false
69
95
  },
96
+ permissionId: item.permissionId,
70
97
  type: item.type,
71
98
  pid: item.pid,
72
99
  component: item.name,
@@ -108,12 +135,15 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
108
135
  if (item.type === 4) {
109
136
  let child = {
110
137
  meta: {
138
+ data: deepCopy(item),
139
+ appId: item.appId,
111
140
  title: item.label,
112
141
  hideInMenu: true,
113
142
  notCache: true,
114
143
  crumbs: [...crumbs],
115
144
  type: item.type
116
145
  },
146
+ permissionId: item.permissionId,
117
147
  type: item.type,
118
148
  pid: item.pid,
119
149
  component: item.name,
@@ -132,4 +162,230 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
132
162
  }
133
163
  });
134
164
  };
165
+
166
+ /**
167
+ * 动态生成路由
168
+ * @param generatorMenuRouter
169
+ * @returns []
170
+ */
171
+ export const generatorDynamicRouter = (permissionList,constantRouterComponents) => {
172
+ let allMenu = generatorMenuRouter(permissionList, null);
173
+ let menuData = allMenu.menuData;
174
+ let pageNode = allMenu.pageNode;
175
+ if (menuData && pageNode && pageNode.children.length > 0) {
176
+ menuData.push(pageNode);
177
+ }
178
+ //给路由添加面包屑属性,解决示例页面左侧菜单点击不选中的问题
179
+ //routesAddCrumbs(exampleMenuData,[]);
180
+ //menuData = menuData.concat(exampleMenuData)
181
+ let dynamicRouter = generator(menuData,constantRouterComponents);
182
+
183
+ return dynamicRouter;
184
+ }
185
+ /**
186
+ * 路由添加面包屑属性
187
+ */
188
+ export const routesAddCrumbs = (routes ,crumbs) => {
189
+ routes.forEach(item => {
190
+ if (item.meta.hasOwnProperty('crumbs')){
191
+ item.meta.crumbs.push({
192
+ icon: item.meta.icon,
193
+ name: item.name,
194
+ title: item.meta.title,
195
+ type: item.type
196
+ });
197
+ }else{
198
+ item.meta['crumbs'] = [...crumbs];
199
+ item.meta.crumbs.push({
200
+ icon: item.meta.icon,
201
+ name: item.name,
202
+ title: item.meta.title,
203
+ type: item.type
204
+ });
205
+ }
206
+ if (item.hasOwnProperty("children")){
207
+ routesAddCrumbs(item.children,item.meta.crumbs)
208
+ }
209
+ });
210
+ }
211
+
212
+ /*
213
+ 生成 vue-router 层级路由表
214
+ */
215
+ const generator = (menuData,constantRouterComponents) => {
216
+ for (let item of menuData) {
217
+ if (item.component && typeof item.component == "string") {
218
+ const target = constantRouterComponents[item.component];
219
+ if (target) {
220
+ if (target.component) {
221
+ if (typeof target.component == "string") {
222
+ // 解决路由name与组件name不一致导致的keeplive不生效的问题
223
+ try {
224
+ //let componentPath = '@/view/' + target.component;
225
+ item.component = resolve =>
226
+ require(['@/view/'+ target.component], data => {
227
+ data.default.name = item.name;
228
+ resolve(data);
229
+ });
230
+ }catch (e) {
231
+ delete item.component
232
+ }
233
+ } else {
234
+ item.component = target.component;
235
+ }
236
+ }
237
+ if (target.url) {
238
+ let path = target.url;
239
+ let query = {};
240
+ if (path.indexOf("?") > -1) {
241
+ query = getUrlParams(path.substr(path.indexOf("?")));
242
+ item.query = query;
243
+ path = path.substr(0,path.indexOf("?"));
244
+ }
245
+ item.path = path;
246
+ }
247
+ if (item.uri) {
248
+ item.meta.uriParam = item.uri;
249
+ }
250
+ if (target.notCache) {
251
+ item.meta.notCache = target.notCache;
252
+ }
253
+ if (target.hideInMenu) {
254
+ item.meta.hideInMenu = target.hideInMenu;
255
+ }
256
+ }
257
+ if (item.uri) {
258
+ if (item.uri.startsWith("/")) {
259
+ item.uri = item.uri.substr(1);
260
+ }
261
+ let uri = item.uri;
262
+ if (uri.startsWith(config.routerBase + "/")) {
263
+ uri = uri.replace(config.routerBase + "/","")
264
+ }
265
+ if (uri.startsWith("dida/")) {
266
+ item.meta.notCache = true;
267
+ let path = uri;
268
+ let query = {};
269
+ if (path.indexOf("?") > -1) {
270
+ query = getUrlParams(path.substr(path.indexOf("?")));
271
+ item.query = query;
272
+ path = path.substr(0,path.indexOf("?"));
273
+ }
274
+ try{
275
+ //let path = '@/view/dida/dida-page';
276
+ item.component = resolve => {
277
+ require(['@/view/dida/dida-page'], data => {
278
+ data.default.name = item.name;
279
+ resolve(data);
280
+ });
281
+ };
282
+ }catch (e){
283
+ delete item.component
284
+ }
285
+ item.path = "/" + path;
286
+ } else if(uri.startsWith("dareport/")){
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
+ item.component = resolve => {
297
+ require(['@/view/dida/dida-page'], data => {
298
+ data.default.name = item.name;
299
+ resolve(data);
300
+ });
301
+ };
302
+ }catch (e){
303
+ delete item.component
304
+ }
305
+ item.path = "/" + path;
306
+ } else {
307
+ try{
308
+ let path = item.uri;
309
+ if (item.uri.startsWith(config.routerBase + "/")) {
310
+ path = path.replace(config.routerBase + "/","")
311
+ }
312
+ let query = {};
313
+ if (path.indexOf("?") > -1) {
314
+ query = getUrlParams(path.substr(path.indexOf("?")));
315
+ path = path.substr(0,path.indexOf("?"));
316
+ }
317
+ if (target && target.component) {
318
+
319
+ } else {
320
+ let component = require('@/view/' + path);
321
+ if (component) {
322
+ item.component = resolve => {
323
+ require(['@/view/' + path], data => {
324
+ data.default.name = item.name;
325
+ resolve(data);
326
+ });
327
+ };
328
+ } else {
329
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
330
+ delete item.component;
331
+ }
332
+ }
333
+ if (target && target.url) {
334
+
335
+ } else {
336
+ item.path = "/" + path;
337
+ item.query = query;
338
+ }
339
+ }catch (e){
340
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
341
+ delete item.component;
342
+ }
343
+ }
344
+ }
345
+ if (item.path == null) {
346
+ item.path = "";
347
+ }
348
+ if (item.component && typeof item.component == "string") {
349
+ delete item.component;
350
+ }
351
+ if (item.children && item.children.length > 0) {
352
+ generator(item.children,constantRouterComponents);
353
+ }
354
+ }
355
+ }
356
+ return menuData;
357
+ };
358
+
359
+ /**
360
+ * 根据权限组织tab数据
361
+ * @param originMenuList
362
+ * @param name
363
+ * @param appId
364
+ * @returns {{}}
365
+ */
366
+ export const generateTabDataFromPermission = (originMenuList,name,appId) => {
367
+ let menuItem = {};
368
+ if (name && originMenuList) {
369
+ let originalMenu = originMenuList.find(item => item.name == name && item.type && item.type == '2' && (appId && item.appId == appId || !appId));
370
+ if (originalMenu && originalMenu.name) {
371
+ menuItem = {
372
+ meta: {
373
+ data: originalMenu,
374
+ appId: originalMenu.appId,
375
+ title: originalMenu.label,
376
+ icon: originalMenu.icon,
377
+ crumbs: [],
378
+ activeName: originalMenu.name
379
+ },
380
+ permissionId: originalMenu.permissionId,
381
+ pid: originalMenu.pid,
382
+ type: originalMenu.type,
383
+ name: originalMenu.name,
384
+ uri: originalMenu.uri
385
+ }
386
+ }
387
+ }
388
+ return menuItem;
389
+ }
390
+
135
391
  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,22 @@
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 axiosConfig = {}
18
+ return axiosN.get(
19
+ `${location.protocol}//${location.host}${config.ucExtServerContext}/api/wps/getPreviewUrl/${fileId}?previewMode=high_definition`,
20
+ axiosConfig,
21
+ )
22
+ }