mooho-base-admin-plus 0.1.0

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 (283) hide show
  1. package/.env +5 -0
  2. package/.env.development +0 -0
  3. package/.env.production +0 -0
  4. package/.eslintignore +11 -0
  5. package/.eslintrc.js +47 -0
  6. package/.prettierrc +15 -0
  7. package/README.md +18 -0
  8. package/dist/favicon.ico +0 -0
  9. package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
  10. package/dist/mooho-base-admin-plus.min.js +279 -0
  11. package/dist/setting.js +31 -0
  12. package/dist/static/images/app-barcode.png +0 -0
  13. package/dist/static/images/login/bg.png +0 -0
  14. package/dist/static/images/login/logo.png +0 -0
  15. package/dist/static/images/login/password-active.png +0 -0
  16. package/dist/static/images/login/password-default.png +0 -0
  17. package/dist/static/images/login/signIn-img.png +0 -0
  18. package/dist/static/images/login/user-active.png +0 -0
  19. package/dist/static/images/login/user-default.png +0 -0
  20. package/dist/static/images/logo-dark.png +0 -0
  21. package/dist/static/images/logo-small.png +0 -0
  22. package/dist/static/images/logo.png +0 -0
  23. package/dist/static/images/logo.svg +510 -0
  24. package/dist/static/images/no-image.png +0 -0
  25. package/dist/style.css +4 -0
  26. package/index.html +18 -0
  27. package/other/pda.vue +28 -0
  28. package/package.json +59 -0
  29. package/public/favicon.ico +0 -0
  30. package/public/setting.js +31 -0
  31. package/public/static/images/app-barcode.png +0 -0
  32. package/public/static/images/login/bg.png +0 -0
  33. package/public/static/images/login/logo.png +0 -0
  34. package/public/static/images/login/password-active.png +0 -0
  35. package/public/static/images/login/password-default.png +0 -0
  36. package/public/static/images/login/signIn-img.png +0 -0
  37. package/public/static/images/login/user-active.png +0 -0
  38. package/public/static/images/login/user-default.png +0 -0
  39. package/public/static/images/logo-dark.png +0 -0
  40. package/public/static/images/logo-small.png +0 -0
  41. package/public/static/images/logo.png +0 -0
  42. package/public/static/images/logo.svg +510 -0
  43. package/public/static/images/no-image.png +0 -0
  44. package/src/App.vue +60 -0
  45. package/src/api/application.js +35 -0
  46. package/src/api/customModel.js +187 -0
  47. package/src/api/customPage.js +15 -0
  48. package/src/api/customTable.js +24 -0
  49. package/src/api/dataSource.js +93 -0
  50. package/src/api/dataView.js +199 -0
  51. package/src/api/dictType.js +23 -0
  52. package/src/api/entityView.js +13 -0
  53. package/src/api/enum.js +15 -0
  54. package/src/api/filterColumn.js +16 -0
  55. package/src/api/model.js +244 -0
  56. package/src/api/movePlan.js +29 -0
  57. package/src/api/notification.js +28 -0
  58. package/src/api/openApiPermission.js +25 -0
  59. package/src/api/permission.js +51 -0
  60. package/src/api/planJob.js +15 -0
  61. package/src/api/process.js +23 -0
  62. package/src/api/processDef.js +36 -0
  63. package/src/api/processInst.js +16 -0
  64. package/src/api/rolePermission.js +17 -0
  65. package/src/api/roleProperty.js +36 -0
  66. package/src/api/shortcut.js +20 -0
  67. package/src/api/system.js +23 -0
  68. package/src/api/task.js +56 -0
  69. package/src/api/taskQueue.js +24 -0
  70. package/src/api/user.js +45 -0
  71. package/src/api/viewColumn.js +16 -0
  72. package/src/assets/svg/body.svg +17 -0
  73. package/src/assets/svg/header-theme-dark.svg +40 -0
  74. package/src/assets/svg/header-theme-primary.svg +40 -0
  75. package/src/assets/svg/header-top.svg +40 -0
  76. package/src/assets/svg/icon-happy.svg +1 -0
  77. package/src/assets/svg/icon-sad.svg +1 -0
  78. package/src/assets/svg/icon-social-bilibili.svg +1 -0
  79. package/src/assets/svg/icon-social-dingding.svg +1 -0
  80. package/src/assets/svg/icon-social-facebook.svg +1 -0
  81. package/src/assets/svg/icon-social-juejin.svg +1 -0
  82. package/src/assets/svg/icon-social-qq.svg +1 -0
  83. package/src/assets/svg/icon-social-twitter.svg +1 -0
  84. package/src/assets/svg/icon-social-wechat.svg +1 -0
  85. package/src/assets/svg/icon-social-weibo.svg +1 -0
  86. package/src/assets/svg/icon-social-zhihu.svg +1 -0
  87. package/src/assets/svg/nav-theme-dark.svg +40 -0
  88. package/src/assets/svg/nav-theme-light.svg +40 -0
  89. package/src/components/copyright/index.vue +28 -0
  90. package/src/components/home/notice-list.vue +62 -0
  91. package/src/components/home/shortcut.vue +125 -0
  92. package/src/components/input/dialog-select.vue +301 -0
  93. package/src/components/input/item-select.vue +195 -0
  94. package/src/components/link/index.vue +54 -0
  95. package/src/components/richEditor/index.vue +86 -0
  96. package/src/components/upload/file-upload.vue +84 -0
  97. package/src/components/upload/upload-attachment.vue +119 -0
  98. package/src/components/upload/upload-image.vue +212 -0
  99. package/src/components/view/column-check.vue +223 -0
  100. package/src/components/view/column-edit.vue +850 -0
  101. package/src/components/view/column-select.vue +206 -0
  102. package/src/components/view/condition-edit.vue +164 -0
  103. package/src/components/view/filter-edit.vue +633 -0
  104. package/src/components/view/filter-setting.vue +126 -0
  105. package/src/components/view/form-setting-layout.vue +375 -0
  106. package/src/components/view/form-setting.vue +247 -0
  107. package/src/components/view/group-column.vue +104 -0
  108. package/src/components/view/group-method.vue +104 -0
  109. package/src/components/view/mixin.js +72 -0
  110. package/src/components/view/modal-form-filter.vue +319 -0
  111. package/src/components/view/modal-form-sort.vue +248 -0
  112. package/src/components/view/modal-form.vue +453 -0
  113. package/src/components/view/modal-table.vue +471 -0
  114. package/src/components/view/table-filter.vue +702 -0
  115. package/src/components/view/table-setting.vue +533 -0
  116. package/src/components/view/view-chart.vue +423 -0
  117. package/src/components/view/view-form-draggable.vue +837 -0
  118. package/src/components/view/view-form.vue +1444 -0
  119. package/src/components/view/view-table.vue +2261 -0
  120. package/src/components/workflow/flow-chart.vue +846 -0
  121. package/src/directive/focus.js +10 -0
  122. package/src/directive/tabHide.js +9 -0
  123. package/src/i18n/index.js +15 -0
  124. package/src/i18n/locale/en-US.js +1 -0
  125. package/src/i18n/locale/lang.js +1 -0
  126. package/src/i18n/locale/zh-CN.js +1 -0
  127. package/src/i18n/locale.js +102 -0
  128. package/src/index.js +222 -0
  129. package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
  130. package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
  131. package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
  132. package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
  133. package/src/layouts/basic-layout/header-log/index.vue +41 -0
  134. package/src/layouts/basic-layout/header-logo/index.vue +23 -0
  135. package/src/layouts/basic-layout/header-notice/index.vue +218 -0
  136. package/src/layouts/basic-layout/header-reload/index.vue +21 -0
  137. package/src/layouts/basic-layout/header-search/index.vue +37 -0
  138. package/src/layouts/basic-layout/header-setting/index.vue +219 -0
  139. package/src/layouts/basic-layout/header-user/index.vue +175 -0
  140. package/src/layouts/basic-layout/i18n.js +50 -0
  141. package/src/layouts/basic-layout/index.vue +280 -0
  142. package/src/layouts/basic-layout/menu-head/index.vue +120 -0
  143. package/src/layouts/basic-layout/menu-head/title.vue +48 -0
  144. package/src/layouts/basic-layout/menu-side/index.vue +113 -0
  145. package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
  146. package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
  147. package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
  148. package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
  149. package/src/layouts/basic-layout/mixins/click-item.js +21 -0
  150. package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
  151. package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
  152. package/src/layouts/basic-layout/tabs/index.vue +192 -0
  153. package/src/layouts/basic-layout/water-mark/index.vue +29 -0
  154. package/src/libs/lodop/index.js +145 -0
  155. package/src/libs/random_str.js +10 -0
  156. package/src/libs/request/index.js +158 -0
  157. package/src/libs/system/index.js +234 -0
  158. package/src/libs/util.cookies.js +44 -0
  159. package/src/libs/util.db.js +13 -0
  160. package/src/libs/util.js +55 -0
  161. package/src/libs/util.log.js +88 -0
  162. package/src/libs/water-mark.js +44 -0
  163. package/src/menu/header.js +20 -0
  164. package/src/menu/modules/dashboard.js +23 -0
  165. package/src/menu/sider.js +12 -0
  166. package/src/mixins/app.js +9 -0
  167. package/src/mixins/page.js +643 -0
  168. package/src/pages/account/login.vue +101 -0
  169. package/src/pages/common/home.vue +169 -0
  170. package/src/pages/common/task-form.vue +350 -0
  171. package/src/pages/common/todo.vue +31 -0
  172. package/src/pages/system/apiLog.vue +79 -0
  173. package/src/pages/system/applicationType.vue +182 -0
  174. package/src/pages/system/customPage.vue +62 -0
  175. package/src/pages/system/customTable.vue +98 -0
  176. package/src/pages/system/dict.vue +36 -0
  177. package/src/pages/system/dictType.vue +58 -0
  178. package/src/pages/system/entityView.vue +38 -0
  179. package/src/pages/system/error/404.vue +6 -0
  180. package/src/pages/system/extendColumn.vue +99 -0
  181. package/src/pages/system/formView.vue +136 -0
  182. package/src/pages/system/log.vue +55 -0
  183. package/src/pages/system/notice.vue +26 -0
  184. package/src/pages/system/openApi.vue +26 -0
  185. package/src/pages/system/openUser.vue +66 -0
  186. package/src/pages/system/organization.vue +98 -0
  187. package/src/pages/system/organizationType.vue +26 -0
  188. package/src/pages/system/permission.vue +175 -0
  189. package/src/pages/system/planJob.vue +40 -0
  190. package/src/pages/system/printTemplate.vue +48 -0
  191. package/src/pages/system/process.vue +79 -0
  192. package/src/pages/system/processType.vue +26 -0
  193. package/src/pages/system/role.vue +395 -0
  194. package/src/pages/system/rolePropertyEdit.vue +480 -0
  195. package/src/pages/system/sequenceSetting.vue +26 -0
  196. package/src/pages/system/systemData.vue +52 -0
  197. package/src/pages/system/tableView.vue +386 -0
  198. package/src/pages/system/taskQueue.vue +48 -0
  199. package/src/pages/system/user.vue +250 -0
  200. package/src/pages/template/processPage.vue +243 -0
  201. package/src/pages/template/reportPage.vue +66 -0
  202. package/src/pages/template/viewPage.vue +139 -0
  203. package/src/plugins/auth/index.js +21 -0
  204. package/src/plugins/error/index.js +31 -0
  205. package/src/plugins/index.js +24 -0
  206. package/src/plugins/sweetalert2/index.js +20 -0
  207. package/src/router/dynamic.js +183 -0
  208. package/src/router/index.js +84 -0
  209. package/src/setting.js +202 -0
  210. package/src/store/index.js +9 -0
  211. package/src/store/modules/admin/index.js +16 -0
  212. package/src/store/modules/admin/modules/account.js +103 -0
  213. package/src/store/modules/admin/modules/cache.js +119 -0
  214. package/src/store/modules/admin/modules/dataView.js +112 -0
  215. package/src/store/modules/admin/modules/db.js +231 -0
  216. package/src/store/modules/admin/modules/i18n.js +87 -0
  217. package/src/store/modules/admin/modules/layout.js +115 -0
  218. package/src/store/modules/admin/modules/loader.js +44 -0
  219. package/src/store/modules/admin/modules/log.js +77 -0
  220. package/src/store/modules/admin/modules/menu.js +338 -0
  221. package/src/store/modules/admin/modules/page.js +466 -0
  222. package/src/store/modules/admin/modules/user.js +96 -0
  223. package/src/store/modules/admin/modules/viewPage.js +34 -0
  224. package/src/styles/common.less +47 -0
  225. package/src/styles/css/default.css +510 -0
  226. package/src/styles/css/login.css +1217 -0
  227. package/src/styles/default/index.less +6 -0
  228. package/src/styles/font/demo.css +539 -0
  229. package/src/styles/font/demo_index.html +372 -0
  230. package/src/styles/font/icon-demo/demo.css +539 -0
  231. package/src/styles/font/icon-demo/demo_index.html +423 -0
  232. package/src/styles/font/icon-demo/iconfont.css +61 -0
  233. package/src/styles/font/icon-demo/iconfont.eot +0 -0
  234. package/src/styles/font/icon-demo/iconfont.js +1 -0
  235. package/src/styles/font/icon-demo/iconfont.svg +59 -0
  236. package/src/styles/font/icon-demo/iconfont.ttf +0 -0
  237. package/src/styles/font/icon-demo/iconfont.woff +0 -0
  238. package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
  239. package/src/styles/font/iconfont.css +47 -0
  240. package/src/styles/font/iconfont.js +1 -0
  241. package/src/styles/font/iconfont.json +65 -0
  242. package/src/styles/font/iconfont.ttf +0 -0
  243. package/src/styles/font/iconfont.woff +0 -0
  244. package/src/styles/font/iconfont.woff2 +0 -0
  245. package/src/styles/font/ionicons.svg +870 -0
  246. package/src/styles/font/ionicons.ttf +0 -0
  247. package/src/styles/font/ionicons.woff +0 -0
  248. package/src/styles/font/ionicons.woff2 +0 -0
  249. package/src/styles/index.less +7 -0
  250. package/src/styles/layout/basic-layout/layout.less +527 -0
  251. package/src/styles/layout/basic-layout/menu.less +274 -0
  252. package/src/styles/layout/index.less +2 -0
  253. package/src/styles/setting.less +6 -0
  254. package/styleguide.config.js +22 -0
  255. package/test/api/barcode.js +50 -0
  256. package/test/api/inbound.js +47 -0
  257. package/test/api/interfaceLog.js +15 -0
  258. package/test/api/interfaceQueue.js +15 -0
  259. package/test/api/interfaceServer.js +29 -0
  260. package/test/api/movePlan.js +50 -0
  261. package/test/api/movePlanItem.js +13 -0
  262. package/test/api/moveType.js +22 -0
  263. package/test/api/openApiPermission.js +25 -0
  264. package/test/api/outbound.js +40 -0
  265. package/test/api/permission.js +34 -0
  266. package/test/api/rolePermission.js +17 -0
  267. package/test/api/user.js +40 -0
  268. package/test/api/viewColumn.js +16 -0
  269. package/test/api/warehouse.js +13 -0
  270. package/test/api/warehouseMoveType.js +18 -0
  271. package/test/main.js +55 -0
  272. package/test/package.js +33 -0
  273. package/test/pages/home/index.vue +22 -0
  274. package/test/pages/task/test.vue +28 -0
  275. package/test/pages/test/dataViewTest.vue +28 -0
  276. package/test/pages/test/logReport.vue +25 -0
  277. package/test/pages/test/testPage.vue +38 -0
  278. package/test/router/routes.js +88 -0
  279. package/test/setting.env.js +22 -0
  280. package/test/styles/css/custom.css +0 -0
  281. package/test/styles/css/login.css +1217 -0
  282. package/vite.config.js +72 -0
  283. package/vue.config.js +20 -0
@@ -0,0 +1,10 @@
1
+ export default {
2
+ update() {
3
+ setTimeout(() => {
4
+ // 聚焦元素
5
+ // if (el.offsetParent != null) {
6
+ // el.getElementsByTagName('input')[0].focus();
7
+ // }
8
+ });
9
+ }
10
+ };
@@ -0,0 +1,9 @@
1
+ export default {
2
+ update(el, binding) {
3
+ setTimeout(() => {
4
+ if (binding.value === true) {
5
+ el.getElementsByTagName('div')[0].style.display = 'none';
6
+ }
7
+ });
8
+ }
9
+ };
@@ -0,0 +1,15 @@
1
+ import { createI18n } from 'vue-i18n/index';
2
+ import store from '../store/index';
3
+ import messages from './locale';
4
+
5
+ store.dispatch('admin/i18n/getLocale');
6
+
7
+ const locale = store.state.admin.i18n.locale;
8
+
9
+ export default createI18n({
10
+ allowComposition: true,
11
+ globalInjection: true,
12
+ legacy: false,
13
+ locale,
14
+ messages
15
+ });
@@ -0,0 +1 @@
1
+ import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
@@ -0,0 +1 @@
1
+ const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
@@ -0,0 +1 @@
1
+ import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 自动配置各类语言包
3
+ * */
4
+ import { merge } from 'lodash';
5
+ import Setting from '../setting';
6
+ //import { I18nList } from '../api/i18n';
7
+
8
+ // 导入 View UI Plus 语言包
9
+ const ViewUIPlusLocale = import.meta.globEager('./locale/*-*.js');
10
+
11
+ // 导入布局语言包
12
+ import layoutLocale from '../layouts/basic-layout/i18n';
13
+
14
+ // // 页面语言包
15
+ // const pageLocale = import.meta.globEager('../pages/i18n.js');
16
+
17
+ // // 菜单语言包
18
+ // const menuLocale = import.meta.globEager('../menu/i18n.js');
19
+
20
+ // // 组件语言包
21
+ // const componentLocale = import.meta.globEager('../components/i18n.js');
22
+
23
+ /**
24
+ * @description 配置本地语言包
25
+ * */
26
+ function loadNativeLocaleMessages() {
27
+ const messages = {};
28
+
29
+ for (const lang of Setting.i18n.list) {
30
+ messages[lang.locale] = {
31
+ page: {},
32
+ menu: {},
33
+ component: {}
34
+ };
35
+
36
+ // 设置 View UI Plus 语言包
37
+ Object.keys(ViewUIPlusLocale).forEach(path => {
38
+ const currentLocale = ViewUIPlusLocale[path].default;
39
+ if (currentLocale.i.locale === lang.locale) {
40
+ Object.keys(currentLocale).forEach(key => {
41
+ messages[lang.locale][key] = currentLocale[key];
42
+ });
43
+ }
44
+ });
45
+
46
+ // 设置 Layout 语言包
47
+ Object.keys(layoutLocale).forEach(locale => {
48
+ if (lang.locale === locale) {
49
+ Object.keys(layoutLocale[locale]).forEach(key => {
50
+ messages[lang.locale][key] = layoutLocale[locale][key];
51
+ });
52
+ }
53
+ });
54
+
55
+ // // 设置页面语言包
56
+ // Object.keys(pageLocale).forEach(path => {
57
+ // const currentPage = pageLocale[path].default[lang.locale];
58
+ // if (currentPage) {
59
+ // Object.keys(currentPage).forEach(key => {
60
+ // messages[lang.locale].page[key] = currentPage[key];
61
+ // });
62
+ // }
63
+ // });
64
+
65
+ // // 设置菜单语言包
66
+ // Object.keys(menuLocale).forEach(path => {
67
+ // const currentMenu = menuLocale[path].default[lang.locale];
68
+ // if (currentMenu) {
69
+ // Object.keys(currentMenu).forEach(key => {
70
+ // messages[lang.locale].menu[key] = currentMenu[key];
71
+ // });
72
+ // }
73
+ // });
74
+
75
+ // // 设置组件语言包
76
+ // Object.keys(componentLocale).forEach(path => {
77
+ // const currentComponent = componentLocale[path].default[lang.locale];
78
+ // if (currentComponent) {
79
+ // console.log('currentComponent', currentComponent);
80
+ // Object.keys(currentComponent).forEach(key => {
81
+ // messages[lang.locale].component[key] = currentComponent[key];
82
+ // });
83
+ // }
84
+ // });
85
+ }
86
+ return messages;
87
+ }
88
+
89
+ export default loadNativeLocaleMessages();
90
+
91
+ /**
92
+ * @description 配置远程接口语言包
93
+ * */
94
+ export async function loadRemoteLocaleMessages(i18n) {
95
+ const nativeMessages = loadNativeLocaleMessages();
96
+ //const remoteMessages = await I18nList();
97
+ const remoteMessages = [];
98
+ const messages = merge({}, nativeMessages, remoteMessages);
99
+ Object.keys(messages).forEach(key => {
100
+ i18n.global.setLocaleMessage(key, messages[key]);
101
+ });
102
+ }
package/src/index.js ADDED
@@ -0,0 +1,222 @@
1
+ //import '@babel/polyfill';
2
+
3
+ // Vue
4
+ import { createApp, h, getCurrentInstance } from 'vue';
5
+ import App from './App';
6
+
7
+ // 设置
8
+ import setting from './setting';
9
+
10
+ // 混合
11
+ import mixinApp from './mixins/app';
12
+ import mixinPage from './mixins/page';
13
+
14
+ // 插件
15
+ import plugins from './plugins';
16
+
17
+ // store
18
+ import store from './store';
19
+
20
+ // ViewUIPlus
21
+ import ViewUIPlus from 'view-ui-plus';
22
+
23
+ // 菜单和路由
24
+ import router from './router';
25
+ import menuHeader from './menu/header';
26
+ //import menuSider from './menu/sider';
27
+
28
+ // 多语言
29
+ import i18n from './i18n';
30
+
31
+ // 方法
32
+ //import { getHeaderName, getMenuSider, getSiderSubmenu } from './libs/system';
33
+
34
+ // 组件
35
+ import Copyright from './components/copyright';
36
+ import Link from './components/link';
37
+ import RichEditor from './components/richEditor';
38
+ import DialogSelect from './components/input/dialog-select';
39
+ import ItemSelect from './components/input/item-select';
40
+ import AttachmentUpload from './components/upload/upload-attachment';
41
+ import ImageUpload from './components/upload/upload-image';
42
+ import FileUpload from './components/upload/file-upload';
43
+ import ViewForm from './components/view/view-form';
44
+ import ViewTable from './components/view/view-table';
45
+ import ViewChart from './components/view/view-chart';
46
+ import ModalForm from './components/view/modal-form';
47
+ import ModalTable from './components/view/modal-table';
48
+ import FormSetting from './components/view/form-setting';
49
+ import FormSettingLayout from './components/view/form-setting-layout';
50
+ import TableSetting from './components/view/table-setting';
51
+ import ModalFormFilter from './components/view/modal-form-filter';
52
+ import ModalFormSort from './components/view/modal-form-sort';
53
+ import Shortcut from './components/home/shortcut';
54
+ import NoticeList from './components/home/notice-list';
55
+
56
+ // API
57
+ import modelApi from './api/model';
58
+ import dataSourceApi from './api/dataSource';
59
+ import taskApi from './api/task';
60
+
61
+ // 使用样式,修改主题可以在 styles 目录下创建新的主题包并修改 iView 默认的 less 变量
62
+ // 参考 https://www.iviewui.com/docs/guide/theme
63
+ import './styles/index.less';
64
+ //import './libs/iview-pro/iview-pro.css';
65
+
66
+ // 默认css
67
+ import './styles/css/default.css';
68
+
69
+ // fa图标
70
+ import '@fortawesome/fontawesome-free/css/all.min.css';
71
+
72
+ // CKEditor
73
+ //import ckEditor from 'ckeditor4-vue';
74
+
75
+ // 指令
76
+ import focus from './directive/focus';
77
+ import tabHide from './directive/tabHide';
78
+
79
+ // 动态路由
80
+ //import dynamicRouter from './router/dynamic';
81
+
82
+ // 基础布局
83
+ import basicLayout from './layouts/basic-layout';
84
+
85
+ // libs
86
+ import lodop from './libs/lodop';
87
+ import * as echarts from 'echarts';
88
+ import request from './libs/request';
89
+ import util from './libs/util';
90
+
91
+ const components = {
92
+ Copyright,
93
+ RichEditor,
94
+ DialogSelect,
95
+ ItemSelect,
96
+ AttachmentUpload,
97
+ ImageUpload,
98
+ FileUpload,
99
+ ViewForm,
100
+ ViewTable,
101
+ ViewChart,
102
+ ModalForm,
103
+ ModalTable,
104
+ FormSetting,
105
+ FormSettingLayout,
106
+ TableSetting,
107
+ ModalFormFilter,
108
+ ModalFormSort,
109
+ Shortcut,
110
+ NoticeList,
111
+ iLink: Link
112
+ };
113
+
114
+ const install = function (app) {
115
+ if (install.installed) return;
116
+ //locale.use(opts.locale);
117
+ //locale.i18n(opts.i18n);
118
+
119
+ //if (window) window.$t = (key, value) => i18n.t(key, value);
120
+
121
+ app.use(plugins);
122
+ app.use(ViewUIPlus, {
123
+ i18n
124
+ });
125
+
126
+ app.mixin(mixinApp);
127
+ //Vue.use(ckEditor);
128
+
129
+ // 组件
130
+ Object.keys(components).forEach(key => {
131
+ app.component(key, components[key]);
132
+ });
133
+
134
+ // 指令,自动获得焦点
135
+ app.directive('focus', focus);
136
+ // 指令,隐藏Tab标签,保留内容
137
+ app.directive('tab-hide', tabHide);
138
+
139
+ // eCharts图表
140
+ app.config.globalProperties.$echarts = echarts;
141
+ };
142
+
143
+ // auto install
144
+ // if (typeof window !== 'undefined' && window.Vue) {
145
+ // install(window.Vue);
146
+ // }
147
+
148
+ const API = {
149
+ version: import.meta.env.VERSION,
150
+ // locale: locale.use,
151
+ // i18n: locale.i18n,
152
+ install
153
+ //...components
154
+ };
155
+
156
+ // 页面
157
+ const files = import.meta.globEager('./pages/**/*.vue');
158
+ const pages = {};
159
+
160
+ Object.keys(files).forEach(key => {
161
+ pages[key.replace(/(\.\/pages\/)/g, '')] = files[key].default;
162
+ });
163
+
164
+ // 第一次进入时,取菜单数据用于更新
165
+ let isFirstRouteChange = true;
166
+
167
+ const created = async () => {
168
+ // 加载设置
169
+ //await store.dispatch('admin/setting/init');
170
+ // 初始化动态路由
171
+ //let dynamicRoutes = await dynamicRouter.init(router, pages, layout);
172
+ // 处理路由 得到每一级的路由设置
173
+ //store.commit('admin/page/init', [...frameInRoutes, ...dynamicRoutes]);
174
+ // 设置顶栏菜单
175
+ store.commit('admin/menu/setHeader', menuHeader);
176
+ // 加载用户登录的数据
177
+ store.dispatch('admin/account/load');
178
+ // 加载边栏菜单
179
+ //store.dispatch('admin/menu/loadSider');
180
+ // 初始化全屏监听
181
+ store.dispatch('admin/layout/listenFullscreen');
182
+
183
+ // // 加载远程 i18n
184
+ // if (Setting.i18n.remote) loadRemoteLocaleMessages(i18n);
185
+ };
186
+
187
+ const routeChanged = to => {
188
+ // 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
189
+ store.dispatch('admin/menu/setMenuList', to);
190
+
191
+ if (isFirstRouteChange) {
192
+ isFirstRouteChange = false;
193
+ // 每次进入 app 时,获取一次菜单
194
+ //store.dispatch('admin/menu/getMenuList', to);
195
+ }
196
+
197
+ //this.appRouteChange(to, from);
198
+ };
199
+
200
+ export default API;
201
+
202
+ export {
203
+ pages,
204
+ createApp,
205
+ h,
206
+ getCurrentInstance,
207
+ App,
208
+ router,
209
+ store,
210
+ i18n,
211
+ setting,
212
+ basicLayout,
213
+ lodop,
214
+ request,
215
+ mixinPage,
216
+ modelApi,
217
+ dataSourceApi,
218
+ taskApi,
219
+ util,
220
+ created,
221
+ routeChanged
222
+ };
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <Breadcrumb class="i-layout-header-breadcrumb" v-if="!isLimit" ref="breadcrumb">
3
+ <BreadcrumbItem>
4
+ {{ title }}
5
+ <!-- <i-menu-head-title :item="topItem" :hide-icon="!showBreadcrumbIcon" /> -->
6
+ </BreadcrumbItem>
7
+ <BreadcrumbItem v-for="item in items" :key="item.path">
8
+ <i-menu-head-title :item="item" :hide-icon="!showBreadcrumbIcon" />
9
+ </BreadcrumbItem>
10
+ <BreadcrumbItem>
11
+ <i-menu-head-title :item="siderMenuObject[activePath]" :hide-icon="!showBreadcrumbIcon" />
12
+ </BreadcrumbItem>
13
+ </Breadcrumb>
14
+ </template>
15
+ <script>
16
+ import { nextTick } from 'vue';
17
+ import { mapState } from 'vuex';
18
+ import { flattenSiderMenu } from '../../../libs/system';
19
+ import iMenuHeadTitle from '../menu-head/title';
20
+ import { on, off } from 'view-ui-plus/src/utils/dom';
21
+ import { findComponentUpward, getStyle } from 'view-ui-plus/src/utils/assist';
22
+ import { throttle } from 'lodash';
23
+ import Setting from '../../../setting';
24
+
25
+ export default {
26
+ name: 'iHeaderBreadcrumb',
27
+ components: { iMenuHeadTitle },
28
+ computed: {
29
+ ...mapState('admin/layout', ['showBreadcrumbIcon', 'menuCollapse']),
30
+ ...mapState('admin/menu', ['openNames', 'activePath', 'header', 'headerName', 'menuSider']),
31
+ siderMenuObject() {
32
+ let obj = {};
33
+ this.allSiderMenu.forEach(item => {
34
+ if ('path' in item) {
35
+ obj[item.path] = item;
36
+ }
37
+ });
38
+ return obj;
39
+ },
40
+ items() {
41
+ let items = [...this.openNames];
42
+ let newItems = [];
43
+ items.forEach(i => {
44
+ newItems.push(this.siderMenuObject[i]);
45
+ });
46
+ items = items.filter(item => item);
47
+ return newItems;
48
+ },
49
+ // 第一级,默认是 menu/header.js 中的第一项
50
+ title() {
51
+ return Setting.info.title;
52
+ },
53
+ topItem() {
54
+ return this.header.find(item => item.name === this.headerName);
55
+ },
56
+ // 得到所有侧边菜单,并转为平级,查询图标及显示对应内容
57
+ allSiderMenu() {
58
+ return flattenSiderMenu(this.menuSider, []);
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ handleResize: () => {},
64
+ isLimit: false,
65
+ maxWidth: 560,
66
+ breadcrumbWidth: 0
67
+ };
68
+ },
69
+ methods: {
70
+ handleCheckWidth() {
71
+ const $header = findComponentUpward(this, 'Header');
72
+ if ($header) {
73
+ const headerWidth = parseInt(getStyle($header.$el, 'width'));
74
+ nextTick(() => {
75
+ this.isLimit = headerWidth - this.maxWidth <= this.breadcrumbWidth;
76
+ });
77
+ }
78
+ },
79
+ handleGetWidth() {
80
+ this.isLimit = false;
81
+ nextTick(() => {
82
+ const $breadcrumb = this.$refs.breadcrumb;
83
+ if ($breadcrumb) {
84
+ this.breadcrumbWidth = parseInt(getStyle($breadcrumb.$el, 'width'));
85
+ }
86
+ });
87
+ }
88
+ },
89
+ watch: {
90
+ topItem: {
91
+ handler() {
92
+ this.handleGetWidth();
93
+ this.handleCheckWidth();
94
+ },
95
+ deep: true
96
+ },
97
+ items: {
98
+ handler() {
99
+ this.handleGetWidth();
100
+ this.handleCheckWidth();
101
+ },
102
+ deep: true
103
+ },
104
+ activePath: {
105
+ handler() {
106
+ this.handleGetWidth();
107
+ this.handleCheckWidth();
108
+ },
109
+ deep: true
110
+ }
111
+ },
112
+ mounted() {
113
+ this.handleResize = throttle(this.handleCheckWidth, 100, { leading: false });
114
+ on(window, 'resize', this.handleResize);
115
+ this.handleGetWidth();
116
+ this.handleCheckWidth();
117
+ },
118
+ beforeUnmount() {
119
+ off(window, 'resize', this.handleResize);
120
+ }
121
+ };
122
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <span class="i-layout-header-trigger" :class="{ 'i-layout-header-trigger-min': showReload }" @click="handleToggleMenuSide">
3
+ <Icon custom="i-icon i-icon-menu-unfold" v-show="menuCollapse || isMobile" />
4
+ <Icon custom="i-icon i-icon-menu-fold" v-show="!menuCollapse && !isMobile" />
5
+ </span>
6
+ </template>
7
+ <script>
8
+ import { mapState, mapMutations } from 'vuex';
9
+
10
+ export default {
11
+ name: 'iHeaderCollapse',
12
+ emits: ['on-toggle-drawer'],
13
+ computed: {
14
+ ...mapState('admin/layout', ['isMobile', 'isTablet', 'isDesktop', 'menuCollapse', 'showReload'])
15
+ },
16
+ methods: {
17
+ ...mapMutations('admin/layout', ['updateMenuCollapse']),
18
+ // 展开/收起侧边栏
19
+ handleToggleMenuSide(state) {
20
+ if (this.isMobile) {
21
+ this.updateMenuCollapse(false);
22
+ this.$emit('on-toggle-drawer', state);
23
+ } else {
24
+ this.updateMenuCollapse(!this.menuCollapse);
25
+ }
26
+ }
27
+ },
28
+ watch: {
29
+ // 切换页面时,在移动端自动收起侧边栏
30
+ // 强行传参 false 是因为有的路由不是在菜单栏发生的,toggle 会使其显示
31
+ $route() {
32
+ if (this.isMobile) this.handleToggleMenuSide(false);
33
+ },
34
+ // 在平板时自动收起菜单
35
+ isTablet(state) {
36
+ if (!this.isMobile && state) this.updateMenuCollapse(true);
37
+ },
38
+ // 在桌面时自动展开菜单
39
+ isDesktop(state) {
40
+ if (!this.isMobile && state) this.updateMenuCollapse(false);
41
+ }
42
+ }
43
+ };
44
+ </script>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <span class="i-layout-header-trigger i-layout-header-trigger-min" @click="toggleFullscreen">
3
+ <Icon custom="i-icon i-icon-full-screen" v-show="!isFullscreen" />
4
+ <Icon custom="i-icon i-icon-exit-full-screen" v-show="isFullscreen" />
5
+ </span>
6
+ </template>
7
+ <script>
8
+ import { mapState, mapActions } from 'vuex';
9
+
10
+ export default {
11
+ name: 'iHeaderFullscreen',
12
+ computed: {
13
+ ...mapState('admin/layout', ['isFullscreen'])
14
+ },
15
+ methods: {
16
+ ...mapActions('admin/layout', ['toggleFullscreen'])
17
+ }
18
+ };
19
+ </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <Dropdown :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
3
+ <span class="i-layout-header-trigger i-layout-header-trigger-min" :class="{ 'i-layout-header-trigger-no-height': outside }">
4
+ <Icon custom="i-icon i-icon-i18n" />
5
+ </span>
6
+ <template #list>
7
+ <DropdownMenu>
8
+ <DropdownItem v-for="item in languages" :key="item.locale" :name="item.locale" :selected="locale === item.locale">
9
+ <img v-if="item.icon" :src="item.icon" />
10
+ <span>{{ item.language }}</span>
11
+ </DropdownItem>
12
+ </DropdownMenu>
13
+ </template>
14
+ </Dropdown>
15
+ </template>
16
+ <script>
17
+ import Setting from '../../../setting';
18
+ import { mapState, mapActions } from 'vuex';
19
+
20
+ export default {
21
+ name: 'iHeaderI18n',
22
+ props: {
23
+ outside: {
24
+ type: Boolean,
25
+ default: false
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ languages: Setting.i18n.list
31
+ };
32
+ },
33
+ computed: {
34
+ ...mapState('admin/i18n', ['locale']),
35
+ ...mapState('admin/layout', ['isMobile'])
36
+ },
37
+ methods: {
38
+ ...mapActions('admin/i18n', ['setLocale']),
39
+ handleClick(locale) {
40
+ if (locale === this.locale) return;
41
+ this.setLocale({ locale, vm: this });
42
+ }
43
+ }
44
+ };
45
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <Tooltip :content="tooltipContent" transfer>
3
+ <span class="i-layout-header-trigger i-layout-header-trigger-min" @click="handleOpenLog">
4
+ <Badge :count="lengthError === 0 ? null : lengthError" :overflow-count="99" :dot="showDot" :offset="showDot ? [26, 2] : [20, 0]">
5
+ <Icon custom="i-icon i-icon-record" />
6
+ </Badge>
7
+ </span>
8
+ </Tooltip>
9
+ </template>
10
+ <script>
11
+ import { mapGetters } from 'vuex';
12
+
13
+ export default {
14
+ name: 'iHeaderLog',
15
+ computed: {
16
+ ...mapGetters('admin/log', ['length', 'lengthError']),
17
+ showDot() {
18
+ return !!this.length && this.lengthError === 0;
19
+ },
20
+ tooltipContent() {
21
+ if (!this.length) {
22
+ return '没有日志或异常';
23
+ } else {
24
+ let text = `${this.length} 条日志`;
25
+ if (this.lengthError) text += ` | 包含 ${this.lengthError} 个异常`;
26
+ return text;
27
+ }
28
+ }
29
+ },
30
+ methods: {
31
+ handleOpenLog() {
32
+ this.$router.push(
33
+ {
34
+ name: 'system-log'
35
+ },
36
+ () => {}
37
+ );
38
+ }
39
+ }
40
+ };
41
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <i-link class="i-layout-header-logo" :class="{ 'i-layout-header-logo-stick': !isMobile }" to="/">
3
+ <img :src="rootPath + 'images/logo-small.png'" v-if="isMobile" />
4
+ <img :src="rootPath + 'images/logo.png'" v-else-if="headerTheme === 'light'" />
5
+ <img :src="rootPath + 'images/logo-dark.png'" v-else />
6
+ </i-link>
7
+ </template>
8
+ <script>
9
+ import { mapState } from 'vuex';
10
+ import mixinPage from '../../../mixins/page';
11
+ import Setting from '../../../setting';
12
+
13
+ export default {
14
+ name: 'iHeaderLogo',
15
+ mixins: [mixinPage],
16
+ computed: {
17
+ ...mapState('admin/layout', ['isMobile', 'headerTheme']),
18
+ rootPath() {
19
+ return Setting.rootPath;
20
+ }
21
+ }
22
+ };
23
+ </script>