@lambo-design/shared 1.0.0-beta.22 → 1.0.0-beta.220

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 (185) hide show
  1. package/config/config.js +16 -2
  2. package/config/index.js +7 -2
  3. package/config/themes/atrovirens/atrovirens.css +574 -0
  4. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  5. package/config/themes/atrovirens/atrovirens.less +666 -0
  6. package/config/themes/atrovirens/var.less +673 -0
  7. package/config/themes/blue/blue.css +574 -0
  8. package/config/themes/blue/blue.css.map +1 -0
  9. package/config/themes/blue/blue.less +668 -0
  10. package/config/themes/blue/var.less +675 -0
  11. package/config/themes/blue-white/blue-white.css +574 -0
  12. package/config/themes/blue-white/blue-white.css.map +1 -0
  13. package/config/themes/blue-white/blue-white.less +668 -0
  14. package/config/themes/blue-white/var.less +674 -0
  15. package/config/themes/blue-white-tight/blue-white-tight.css +575 -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 +670 -0
  18. package/config/themes/blue-white-tight/var.less +675 -0
  19. package/config/themes/danqing/danqing.css +574 -0
  20. package/config/themes/danqing/danqing.css.map +1 -0
  21. package/config/themes/danqing/danqing.less +666 -0
  22. package/config/themes/danqing/danqing.wxss +572 -0
  23. package/config/themes/danqing/var.less +677 -0
  24. package/config/themes/deep/deep.css +574 -0
  25. package/config/themes/deep/deep.css.map +1 -0
  26. package/config/themes/deep/deep.less +667 -0
  27. package/config/themes/deep/var.less +675 -0
  28. package/config/themes/default/default.css +574 -241
  29. package/config/themes/default/default.css.map +1 -0
  30. package/config/themes/default/default.less +438 -88
  31. package/config/themes/default/var.less +373 -12
  32. package/config/themes/eap/eap.css +574 -0
  33. package/config/themes/eap/eap.css.map +1 -0
  34. package/config/themes/eap/eap.less +669 -0
  35. package/config/themes/eap/var.less +675 -0
  36. package/config/themes/gold/gold.css +574 -0
  37. package/config/themes/gold/gold.css.map +1 -0
  38. package/config/themes/gold/gold.less +669 -0
  39. package/config/themes/gold/var.less +368 -7
  40. package/config/themes/index.js +16 -4
  41. package/config/themes/lime/lime.css +574 -0
  42. package/config/themes/lime/lime.css.map +1 -0
  43. package/config/themes/lime/lime.less +669 -0
  44. package/config/themes/lime/var.less +369 -7
  45. package/config/themes/orange/orange.css +574 -0
  46. package/config/themes/orange/orange.css.map +1 -0
  47. package/config/themes/orange/orange.less +669 -0
  48. package/config/themes/orange/var.less +676 -0
  49. package/config/themes/red/red.css +574 -0
  50. package/config/themes/red/red.css.map +1 -0
  51. package/config/themes/red/red.less +669 -0
  52. package/config/themes/red/var.less +675 -0
  53. package/config/themes/theme-atrovirens.js +556 -0
  54. package/config/themes/theme-blue.js +556 -0
  55. package/config/themes/theme-bw.js +556 -0
  56. package/config/themes/theme-bwt.js +557 -0
  57. package/config/themes/theme-danqing.js +556 -0
  58. package/config/themes/theme-deep.js +556 -0
  59. package/config/themes/theme-default.js +363 -59
  60. package/config/themes/theme-eap.js +556 -0
  61. package/config/themes/theme-gold.js +315 -11
  62. package/config/themes/theme-lime.js +315 -11
  63. package/config/themes/theme-orange.js +544 -27
  64. package/config/themes/theme-red.js +548 -32
  65. package/directives/module/print.js +1 -0
  66. package/directives/module/vue-print-nb/README.md +63 -0
  67. package/directives/module/vue-print-nb/print.js +94 -0
  68. package/directives/module/vue-print-nb/printarea.js +532 -0
  69. package/index.js +7 -1
  70. package/nstyles/common.less +197 -0
  71. package/nstyles/components/404.less +46 -0
  72. package/nstyles/components/button.less +34 -0
  73. package/nstyles/components/date-picker.less +37 -0
  74. package/nstyles/components/drawer.less +20 -0
  75. package/nstyles/components/dropdown.less +18 -0
  76. package/nstyles/components/excel-flow.less +72 -0
  77. package/nstyles/components/form.less +303 -0
  78. package/nstyles/components/index.less +23 -0
  79. package/nstyles/components/layout/collect.less +10 -0
  80. package/nstyles/components/layout/detail-view.less +107 -0
  81. package/nstyles/components/layout/full-screen.less +7 -0
  82. package/nstyles/components/layout/index.less +7 -0
  83. package/nstyles/components/layout/other-menu.less +142 -0
  84. package/nstyles/components/layout/page-view.less +101 -0
  85. package/nstyles/components/layout/sider-trigger.less +41 -0
  86. package/nstyles/components/layout/tags-nav.less +113 -0
  87. package/nstyles/components/modal.less +85 -0
  88. package/nstyles/components/n-button.less +131 -0
  89. package/nstyles/components/n-image-preview.less +131 -0
  90. package/nstyles/components/n-model/index.less +19 -0
  91. package/nstyles/components/n-model/report-index.less +43 -0
  92. package/nstyles/components/n-panel.less +41 -0
  93. package/nstyles/components/n-picker.less +37 -0
  94. package/nstyles/components/n-sign.less +17 -0
  95. package/nstyles/components/n-tooltip.less +10 -0
  96. package/nstyles/components/panel.less +31 -0
  97. package/nstyles/components/select.less +3 -0
  98. package/nstyles/components/sign.less +27 -0
  99. package/nstyles/components/table.less +315 -0
  100. package/nstyles/components/tree.less +159 -0
  101. package/nstyles/components/upload.less +164 -0
  102. package/nstyles/index.less +5 -0
  103. package/nstyles/reset.less +65 -0
  104. package/nstyles/third/ag.less +174 -0
  105. package/nstyles/third/icons/sort-desc.svg +1 -0
  106. package/nstyles/third/icons/sort-up.svg +1 -0
  107. package/nstyles/third/icons/sorting.svg +1 -0
  108. package/nstyles/third/index.less +11 -0
  109. package/nstyles/third/view-design.less +367 -0
  110. package/nstyles/variables/base.less +143 -0
  111. package/nstyles/variables/index.less +4 -0
  112. package/nstyles/variables/theme/default/button.less +7 -0
  113. package/nstyles/variables/theme/default/common.less +57 -0
  114. package/nstyles/variables/theme/default/index.less +7 -0
  115. package/nstyles/variables/theme/default/layout.less +40 -0
  116. package/nstyles/variables/theme/default/table.less +37 -0
  117. package/nstyles/variables/theme/default/tag.less +3 -0
  118. package/nstyles/variables/theme/default/upload.less +3 -0
  119. package/nstyles/variables/theme/index.less +13 -0
  120. package/nstyles/variables/theme/small/button.less +7 -0
  121. package/nstyles/variables/theme/small/common.less +39 -0
  122. package/nstyles/variables/theme/small/index.less +5 -0
  123. package/nstyles/variables/theme/small/layout.less +21 -0
  124. package/nstyles/variables/theme/small/table.less +17 -0
  125. package/nstyles/variables/theme/small/tag.less +3 -0
  126. package/package.json +26 -6
  127. package/plugin/index.js +12 -0
  128. package/plugin/module/date-format.js +30 -0
  129. package/plugin/module/loading.js +26 -0
  130. package/plugin/module/warn-handler.js +11 -0
  131. package/styles/image/inspur.png +0 -0
  132. package/styles/image/lan_navigator.png +0 -0
  133. package/styles/image/lv_navigator.png +0 -0
  134. package/utils/ajax/content-type.js +30 -0
  135. package/utils/assist.js +88 -25
  136. package/utils/base64.js +126 -0
  137. package/utils/blob.js +47 -0
  138. package/utils/crypto/index.js +10 -0
  139. package/utils/date.js +334 -305
  140. package/utils/dict/built-in-dict.js +20 -0
  141. package/utils/dict/index.js +133 -0
  142. package/utils/event.js +72 -0
  143. package/utils/excel.js +369 -237
  144. package/utils/file.js +19 -0
  145. package/utils/form/validate.js +29 -0
  146. package/utils/half-year.js +68 -0
  147. package/utils/index.js +37 -0
  148. package/utils/json.js +29 -0
  149. package/utils/lodop.js +5 -0
  150. package/utils/menu/index.js +270 -11
  151. package/utils/mime_type.js +67 -0
  152. package/utils/modelerUtil.js +4 -1
  153. package/utils/n/api.js +22 -0
  154. package/utils/n/date.js +57 -0
  155. package/utils/n/index.js +10 -0
  156. package/utils/n/is-type.js +176 -0
  157. package/utils/n/number.js +144 -0
  158. package/utils/n/permission-cache.js +11 -0
  159. package/utils/n/reuqest/axiosN.js +17 -0
  160. package/utils/n/reuqest/content-type.js +19 -0
  161. package/utils/n/reuqest/interceptors.js +95 -0
  162. package/utils/n/reuqest/url-params.js +12 -0
  163. package/utils/n/storage.js +51 -0
  164. package/utils/n/token.js +51 -0
  165. package/utils/n/user-cache.js +11 -0
  166. package/utils/n/user.js +34 -0
  167. package/utils/n/uuid.js +16 -0
  168. package/utils/n-generator-routers.js +208 -0
  169. package/utils/n-router.js +205 -0
  170. package/utils/n-theme.js +30 -0
  171. package/utils/number.js +72 -15
  172. package/utils/oss.js +57 -0
  173. package/utils/platform.js +760 -22
  174. package/utils/quarter.js +58 -0
  175. package/utils/storage.js +198 -0
  176. package/utils/style.js +24 -0
  177. package/utils/theme.js +98 -3
  178. package/utils/transfer-queue.js +7 -0
  179. package/utils/type.js +102 -0
  180. package/utils/util.js +795 -0
  181. package/utils/validator.js +181 -0
  182. package/config/themes/gold/default.css +0 -241
  183. package/config/themes/gold/default.less +0 -319
  184. package/config/themes/lime/default.css +0 -241
  185. 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,25 @@ 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 //没有appId表示渲染全部菜单
82
+ || (item.appId == appId && (!item.hasOwnProperty("hideInMenu") || (item.hasOwnProperty("hideInMenu") && !item.hideInMenu))) //默认加载某一个app的菜单
83
+ || appId.indexOf(item.appId) > -1 // 渲染指定appId的菜单
84
+ ){
59
85
  // 判断是否为父级菜单
60
86
  if (item.pid === parentId) {
61
87
  if (item.type === 1 || item.type === 2) {
62
88
  let node = {
63
89
  meta: {
90
+ data: deepCopy(item),
64
91
  appId: item.appId,
65
92
  title: item.label,
66
93
  icon: item.icon,
67
94
  crumbs: [...crumbs],
68
- activeName: item.name
95
+ activeName: item.name,
96
+ notCache: item.notCache ? true : false,
97
+ hideInMenu: item.hideInMenu ? true : false
69
98
  },
99
+ permissionId: item.permissionId,
70
100
  type: item.type,
71
101
  pid: item.pid,
72
102
  component: item.name,
@@ -108,12 +138,15 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
108
138
  if (item.type === 4) {
109
139
  let child = {
110
140
  meta: {
141
+ data: deepCopy(item),
142
+ appId: item.appId,
111
143
  title: item.label,
112
144
  hideInMenu: true,
113
145
  notCache: true,
114
146
  crumbs: [...crumbs],
115
147
  type: item.type
116
148
  },
149
+ permissionId: item.permissionId,
117
150
  type: item.type,
118
151
  pid: item.pid,
119
152
  component: item.name,
@@ -132,4 +165,230 @@ const listToMenuTree = (list, menuTree, pageNode, parentId, crumbs, root, appId)
132
165
  }
133
166
  });
134
167
  };
168
+
169
+ /**
170
+ * 动态生成路由
171
+ * @param generatorMenuRouter
172
+ * @returns []
173
+ */
174
+ export const generatorDynamicRouter = (permissionList,constantRouterComponents,appIds = null) => {
175
+ let allMenu = generatorMenuRouter(permissionList, appIds);
176
+ let menuData = allMenu.menuData;
177
+ let pageNode = allMenu.pageNode;
178
+ if (menuData && pageNode && pageNode.children.length > 0) {
179
+ menuData.push(pageNode);
180
+ }
181
+ //给路由添加面包屑属性,解决示例页面左侧菜单点击不选中的问题
182
+ //routesAddCrumbs(exampleMenuData,[]);
183
+ //menuData = menuData.concat(exampleMenuData)
184
+ let dynamicRouter = generator(menuData,constantRouterComponents);
185
+
186
+ return dynamicRouter;
187
+ }
188
+ /**
189
+ * 路由添加面包屑属性
190
+ */
191
+ export const routesAddCrumbs = (routes ,crumbs) => {
192
+ routes.forEach(item => {
193
+ if (item.meta.hasOwnProperty('crumbs')){
194
+ item.meta.crumbs.push({
195
+ icon: item.meta.icon,
196
+ name: item.name,
197
+ title: item.meta.title,
198
+ type: item.type
199
+ });
200
+ }else{
201
+ item.meta['crumbs'] = [...crumbs];
202
+ item.meta.crumbs.push({
203
+ icon: item.meta.icon,
204
+ name: item.name,
205
+ title: item.meta.title,
206
+ type: item.type
207
+ });
208
+ }
209
+ if (item.hasOwnProperty("children")){
210
+ routesAddCrumbs(item.children,item.meta.crumbs)
211
+ }
212
+ });
213
+ }
214
+
215
+ /*
216
+ 生成 vue-router 层级路由表
217
+ */
218
+ const generator = (menuData,constantRouterComponents) => {
219
+ for (let item of menuData) {
220
+ if (item.component && typeof item.component == "string") {
221
+ const target = constantRouterComponents[item.component];
222
+ if (target) {
223
+ if (target.component) {
224
+ if (typeof target.component == "string") {
225
+ // 解决路由name与组件name不一致导致的keeplive不生效的问题
226
+ try {
227
+ //let componentPath = '@/view/' + target.component;
228
+ item.component = resolve =>
229
+ require(['@/view/'+ target.component], data => {
230
+ data.default.name = item.name;
231
+ resolve(data);
232
+ });
233
+ }catch (e) {
234
+ delete item.component
235
+ }
236
+ } else {
237
+ item.component = target.component;
238
+ }
239
+ }
240
+ if (target.url) {
241
+ let path = target.url;
242
+ let query = {};
243
+ if (path.indexOf("?") > -1) {
244
+ query = getUrlParams(path.substr(path.indexOf("?")));
245
+ item.query = query;
246
+ path = path.substr(0,path.indexOf("?"));
247
+ }
248
+ item.path = path;
249
+ }
250
+ if (item.uri) {
251
+ item.meta.uriParam = item.uri;
252
+ }
253
+ if (target.notCache) {
254
+ item.meta.notCache = target.notCache;
255
+ }
256
+ if (target.hideInMenu) {
257
+ item.meta.hideInMenu = target.hideInMenu;
258
+ }
259
+ }
260
+ if (item.uri) {
261
+ if (item.uri.startsWith("/")) {
262
+ item.uri = item.uri.substr(1);
263
+ }
264
+ let uri = item.uri;
265
+ if (uri.startsWith(config.routerBase + "/")) {
266
+ uri = uri.replace(config.routerBase + "/","")
267
+ }
268
+ if (uri.startsWith("dida/")) {
269
+ item.meta.notCache = true;
270
+ let path = uri;
271
+ let query = {};
272
+ if (path.indexOf("?") > -1) {
273
+ query = getUrlParams(path.substr(path.indexOf("?")));
274
+ item.query = query;
275
+ path = path.substr(0,path.indexOf("?"));
276
+ }
277
+ try{
278
+ //let path = '@/view/dida/dida-page';
279
+ item.component = resolve => {
280
+ require(['@/view/dida/dida-page'], data => {
281
+ data.default.name = item.name;
282
+ resolve(data);
283
+ });
284
+ };
285
+ }catch (e){
286
+ delete item.component
287
+ }
288
+ item.path = "/" + path;
289
+ } else if(uri.startsWith("dareport/")){
290
+ item.meta.notCache = true;
291
+ let path = uri;
292
+ let query = {};
293
+ if (path.indexOf("?") > -1) {
294
+ query = getUrlParams(path.substr(path.indexOf("?")));
295
+ item.query = query;
296
+ path = path.substr(0,path.indexOf("?"));
297
+ }
298
+ try{
299
+ item.component = resolve => {
300
+ require(['@/view/dida/dida-page'], data => {
301
+ data.default.name = item.name;
302
+ resolve(data);
303
+ });
304
+ };
305
+ }catch (e){
306
+ delete item.component
307
+ }
308
+ item.path = "/" + path;
309
+ } else {
310
+ try{
311
+ let path = item.uri;
312
+ if (item.uri.startsWith(config.routerBase + "/")) {
313
+ path = path.replace(config.routerBase + "/","")
314
+ }
315
+ let query = {};
316
+ if (path.indexOf("?") > -1) {
317
+ query = getUrlParams(path.substr(path.indexOf("?")));
318
+ path = path.substr(0,path.indexOf("?"));
319
+ }
320
+ if (target && target.component) {
321
+
322
+ } else {
323
+ let component = require('@/view/' + path);
324
+ if (component) {
325
+ item.component = resolve => {
326
+ require(['@/view/' + path], data => {
327
+ data.default.name = item.name;
328
+ resolve(data);
329
+ });
330
+ };
331
+ } else {
332
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
333
+ delete item.component;
334
+ }
335
+ }
336
+ if (target && target.url) {
337
+
338
+ } else {
339
+ item.path = "/" + path;
340
+ item.query = query;
341
+ }
342
+ }catch (e){
343
+ //console.warn(`${item.name}(${item.uri})页面不存在`)
344
+ delete item.component;
345
+ }
346
+ }
347
+ }
348
+ if (item.path == null) {
349
+ item.path = "";
350
+ }
351
+ if (item.component && typeof item.component == "string") {
352
+ delete item.component;
353
+ }
354
+ if (item.children && item.children.length > 0) {
355
+ generator(item.children,constantRouterComponents);
356
+ }
357
+ }
358
+ }
359
+ return menuData;
360
+ };
361
+
362
+ /**
363
+ * 根据权限组织tab数据
364
+ * @param originMenuList
365
+ * @param name
366
+ * @param appId
367
+ * @returns {{}}
368
+ */
369
+ export const generateTabDataFromPermission = (originMenuList,name,appId) => {
370
+ let menuItem = {};
371
+ if (name && originMenuList) {
372
+ let originalMenu = originMenuList.find(item => item.name == name && item.type && item.type == '2' && (appId && item.appId == appId || !appId));
373
+ if (originalMenu && originalMenu.name) {
374
+ menuItem = {
375
+ meta: {
376
+ data: originalMenu,
377
+ appId: originalMenu.appId,
378
+ title: originalMenu.label,
379
+ icon: originalMenu.icon,
380
+ crumbs: [],
381
+ activeName: originalMenu.name
382
+ },
383
+ permissionId: originalMenu.permissionId,
384
+ pid: originalMenu.pid,
385
+ type: originalMenu.type,
386
+ name: originalMenu.name,
387
+ uri: originalMenu.uri
388
+ }
389
+ }
390
+ }
391
+ return menuItem;
392
+ }
393
+
135
394
  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
+ }