zetan-cli-dev-template-vue-element-admin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. package/package.json +8 -0
  2. package/template/.editorconfig +14 -0
  3. package/template/.env.development +5 -0
  4. package/template/.env.production +6 -0
  5. package/template/.env.staging +8 -0
  6. package/template/.eslintignore +4 -0
  7. package/template/.eslintrc.js +198 -0
  8. package/template/.travis.yml +5 -0
  9. package/template/LICENSE +21 -0
  10. package/template/README.es.md +228 -0
  11. package/template/README.ja.md +224 -0
  12. package/template/README.md +250 -0
  13. package/template/README.zh-CN.md +273 -0
  14. package/template/babel.config.js +14 -0
  15. package/template/build/index.js +35 -0
  16. package/template/jest.config.js +24 -0
  17. package/template/jsconfig.json +9 -0
  18. package/template/mock/article.js +116 -0
  19. package/template/mock/index.js +60 -0
  20. package/template/mock/mock-server.js +81 -0
  21. package/template/mock/remote-search.js +51 -0
  22. package/template/mock/role/index.js +98 -0
  23. package/template/mock/role/routes.js +530 -0
  24. package/template/mock/user.js +84 -0
  25. package/template/mock/utils.js +48 -0
  26. package/template/package.json +111 -0
  27. package/template/plop-templates/component/index.hbs +26 -0
  28. package/template/plop-templates/component/prompt.js +55 -0
  29. package/template/plop-templates/store/index.hbs +16 -0
  30. package/template/plop-templates/store/prompt.js +62 -0
  31. package/template/plop-templates/utils.js +2 -0
  32. package/template/plop-templates/view/index.hbs +26 -0
  33. package/template/plop-templates/view/prompt.js +55 -0
  34. package/template/plopfile.js +9 -0
  35. package/template/postcss.config.js +5 -0
  36. package/template/public/favicon.ico +0 -0
  37. package/template/public/index.html +15 -0
  38. package/template/src/App.vue +11 -0
  39. package/template/src/api/article.js +41 -0
  40. package/template/src/api/qiniu.js +8 -0
  41. package/template/src/api/remote-search.js +17 -0
  42. package/template/src/api/role.js +38 -0
  43. package/template/src/api/user.js +24 -0
  44. package/template/src/assets/401_images/401.gif +0 -0
  45. package/template/src/assets/404_images/404.png +0 -0
  46. package/template/src/assets/404_images/404_cloud.png +0 -0
  47. package/template/src/assets/custom-theme/fonts/element-icons.ttf +0 -0
  48. package/template/src/assets/custom-theme/fonts/element-icons.woff +0 -0
  49. package/template/src/assets/custom-theme/index.css +1 -0
  50. package/template/src/components/BackToTop/index.vue +111 -0
  51. package/template/src/components/Breadcrumb/index.vue +82 -0
  52. package/template/src/components/Charts/Keyboard.vue +155 -0
  53. package/template/src/components/Charts/LineMarker.vue +227 -0
  54. package/template/src/components/Charts/MixChart.vue +271 -0
  55. package/template/src/components/Charts/mixins/resize.js +56 -0
  56. package/template/src/components/DndList/index.vue +166 -0
  57. package/template/src/components/DragSelect/index.vue +65 -0
  58. package/template/src/components/Dropzone/index.vue +297 -0
  59. package/template/src/components/ErrorLog/index.vue +78 -0
  60. package/template/src/components/GithubCorner/index.vue +54 -0
  61. package/template/src/components/Hamburger/index.vue +44 -0
  62. package/template/src/components/HeaderSearch/index.vue +180 -0
  63. package/template/src/components/ImageCropper/index.vue +1779 -0
  64. package/template/src/components/ImageCropper/utils/data2blob.js +19 -0
  65. package/template/src/components/ImageCropper/utils/effectRipple.js +39 -0
  66. package/template/src/components/ImageCropper/utils/language.js +232 -0
  67. package/template/src/components/ImageCropper/utils/mimes.js +7 -0
  68. package/template/src/components/JsonEditor/index.vue +77 -0
  69. package/template/src/components/Kanban/index.vue +99 -0
  70. package/template/src/components/MDinput/index.vue +360 -0
  71. package/template/src/components/MarkdownEditor/default-options.js +31 -0
  72. package/template/src/components/MarkdownEditor/index.vue +118 -0
  73. package/template/src/components/Pagination/index.vue +101 -0
  74. package/template/src/components/PanThumb/index.vue +142 -0
  75. package/template/src/components/RightPanel/index.vue +145 -0
  76. package/template/src/components/Screenfull/index.vue +60 -0
  77. package/template/src/components/Share/DropdownMenu.vue +103 -0
  78. package/template/src/components/SizeSelect/index.vue +57 -0
  79. package/template/src/components/Sticky/index.vue +91 -0
  80. package/template/src/components/SvgIcon/index.vue +62 -0
  81. package/template/src/components/TextHoverEffect/Mallki.vue +113 -0
  82. package/template/src/components/ThemePicker/index.vue +175 -0
  83. package/template/src/components/Tinymce/components/EditorImage.vue +111 -0
  84. package/template/src/components/Tinymce/dynamicLoadScript.js +59 -0
  85. package/template/src/components/Tinymce/index.vue +247 -0
  86. package/template/src/components/Tinymce/plugins.js +7 -0
  87. package/template/src/components/Tinymce/toolbar.js +6 -0
  88. package/template/src/components/Upload/SingleImage.vue +134 -0
  89. package/template/src/components/Upload/SingleImage2.vue +130 -0
  90. package/template/src/components/Upload/SingleImage3.vue +157 -0
  91. package/template/src/components/UploadExcel/index.vue +138 -0
  92. package/template/src/directive/clipboard/clipboard.js +49 -0
  93. package/template/src/directive/clipboard/index.js +13 -0
  94. package/template/src/directive/el-drag-dialog/drag.js +77 -0
  95. package/template/src/directive/el-drag-dialog/index.js +13 -0
  96. package/template/src/directive/el-table/adaptive.js +41 -0
  97. package/template/src/directive/el-table/index.js +13 -0
  98. package/template/src/directive/permission/index.js +13 -0
  99. package/template/src/directive/permission/permission.js +31 -0
  100. package/template/src/directive/sticky.js +91 -0
  101. package/template/src/directive/waves/index.js +13 -0
  102. package/template/src/directive/waves/waves.css +26 -0
  103. package/template/src/directive/waves/waves.js +72 -0
  104. package/template/src/filters/index.js +68 -0
  105. package/template/src/icons/index.js +9 -0
  106. package/template/src/icons/svg/404.svg +1 -0
  107. package/template/src/icons/svg/bug.svg +1 -0
  108. package/template/src/icons/svg/chart.svg +1 -0
  109. package/template/src/icons/svg/clipboard.svg +1 -0
  110. package/template/src/icons/svg/component.svg +1 -0
  111. package/template/src/icons/svg/dashboard.svg +1 -0
  112. package/template/src/icons/svg/documentation.svg +1 -0
  113. package/template/src/icons/svg/drag.svg +1 -0
  114. package/template/src/icons/svg/edit.svg +1 -0
  115. package/template/src/icons/svg/education.svg +1 -0
  116. package/template/src/icons/svg/email.svg +1 -0
  117. package/template/src/icons/svg/example.svg +1 -0
  118. package/template/src/icons/svg/excel.svg +1 -0
  119. package/template/src/icons/svg/exit-fullscreen.svg +1 -0
  120. package/template/src/icons/svg/eye-open.svg +1 -0
  121. package/template/src/icons/svg/eye.svg +1 -0
  122. package/template/src/icons/svg/form.svg +1 -0
  123. package/template/src/icons/svg/fullscreen.svg +1 -0
  124. package/template/src/icons/svg/guide.svg +1 -0
  125. package/template/src/icons/svg/icon.svg +1 -0
  126. package/template/src/icons/svg/international.svg +1 -0
  127. package/template/src/icons/svg/language.svg +1 -0
  128. package/template/src/icons/svg/link.svg +1 -0
  129. package/template/src/icons/svg/list.svg +1 -0
  130. package/template/src/icons/svg/lock.svg +1 -0
  131. package/template/src/icons/svg/message.svg +1 -0
  132. package/template/src/icons/svg/money.svg +1 -0
  133. package/template/src/icons/svg/nested.svg +1 -0
  134. package/template/src/icons/svg/password.svg +1 -0
  135. package/template/src/icons/svg/pdf.svg +1 -0
  136. package/template/src/icons/svg/people.svg +1 -0
  137. package/template/src/icons/svg/peoples.svg +1 -0
  138. package/template/src/icons/svg/qq.svg +1 -0
  139. package/template/src/icons/svg/search.svg +1 -0
  140. package/template/src/icons/svg/shopping.svg +1 -0
  141. package/template/src/icons/svg/size.svg +1 -0
  142. package/template/src/icons/svg/skill.svg +1 -0
  143. package/template/src/icons/svg/star.svg +1 -0
  144. package/template/src/icons/svg/tab.svg +1 -0
  145. package/template/src/icons/svg/table.svg +1 -0
  146. package/template/src/icons/svg/theme.svg +1 -0
  147. package/template/src/icons/svg/tree-table.svg +1 -0
  148. package/template/src/icons/svg/tree.svg +1 -0
  149. package/template/src/icons/svg/user.svg +1 -0
  150. package/template/src/icons/svg/wechat.svg +1 -0
  151. package/template/src/icons/svg/zip.svg +1 -0
  152. package/template/src/icons/svgo.yml +22 -0
  153. package/template/src/layout/components/AppMain.vue +57 -0
  154. package/template/src/layout/components/Navbar.vue +167 -0
  155. package/template/src/layout/components/Settings/index.vue +108 -0
  156. package/template/src/layout/components/Sidebar/FixiOSBug.js +26 -0
  157. package/template/src/layout/components/Sidebar/Item.vue +41 -0
  158. package/template/src/layout/components/Sidebar/Link.vue +43 -0
  159. package/template/src/layout/components/Sidebar/Logo.vue +82 -0
  160. package/template/src/layout/components/Sidebar/SidebarItem.vue +95 -0
  161. package/template/src/layout/components/Sidebar/index.vue +54 -0
  162. package/template/src/layout/components/TagsView/ScrollPane.vue +94 -0
  163. package/template/src/layout/components/TagsView/index.vue +292 -0
  164. package/template/src/layout/components/index.js +5 -0
  165. package/template/src/layout/index.vue +102 -0
  166. package/template/src/layout/mixin/ResizeHandler.js +45 -0
  167. package/template/src/main.js +53 -0
  168. package/template/src/permission.js +74 -0
  169. package/template/src/router/index.js +404 -0
  170. package/template/src/router/modules/charts.js +36 -0
  171. package/template/src/router/modules/components.js +102 -0
  172. package/template/src/router/modules/nested.js +66 -0
  173. package/template/src/router/modules/table.js +41 -0
  174. package/template/src/settings.js +35 -0
  175. package/template/src/store/getters.js +15 -0
  176. package/template/src/store/index.js +25 -0
  177. package/template/src/store/modules/app.js +56 -0
  178. package/template/src/store/modules/errorLog.js +28 -0
  179. package/template/src/store/modules/permission.js +69 -0
  180. package/template/src/store/modules/settings.js +35 -0
  181. package/template/src/store/modules/tagsView.js +160 -0
  182. package/template/src/store/modules/user.js +131 -0
  183. package/template/src/styles/btn.scss +99 -0
  184. package/template/src/styles/element-ui.scss +84 -0
  185. package/template/src/styles/element-variables.scss +31 -0
  186. package/template/src/styles/index.scss +191 -0
  187. package/template/src/styles/mixin.scss +66 -0
  188. package/template/src/styles/sidebar.scss +226 -0
  189. package/template/src/styles/transition.scss +48 -0
  190. package/template/src/styles/variables.scss +35 -0
  191. package/template/src/utils/auth.js +15 -0
  192. package/template/src/utils/clipboard.js +32 -0
  193. package/template/src/utils/error-log.js +35 -0
  194. package/template/src/utils/get-page-title.js +10 -0
  195. package/template/src/utils/index.js +357 -0
  196. package/template/src/utils/open-window.js +25 -0
  197. package/template/src/utils/permission.js +21 -0
  198. package/template/src/utils/request.js +85 -0
  199. package/template/src/utils/scroll-to.js +58 -0
  200. package/template/src/utils/validate.js +87 -0
  201. package/template/src/vendor/Export2Excel.js +220 -0
  202. package/template/src/vendor/Export2Zip.js +24 -0
  203. package/template/src/views/charts/keyboard.vue +23 -0
  204. package/template/src/views/charts/line.vue +23 -0
  205. package/template/src/views/charts/mix-chart.vue +23 -0
  206. package/template/src/views/clipboard/index.vue +49 -0
  207. package/template/src/views/components-demo/avatar-upload.vue +61 -0
  208. package/template/src/views/components-demo/back-to-top.vue +154 -0
  209. package/template/src/views/components-demo/count-to.vue +218 -0
  210. package/template/src/views/components-demo/dnd-list.vue +39 -0
  211. package/template/src/views/components-demo/drag-dialog.vue +61 -0
  212. package/template/src/views/components-demo/drag-kanban.vue +66 -0
  213. package/template/src/views/components-demo/drag-select.vue +43 -0
  214. package/template/src/views/components-demo/dropzone.vue +31 -0
  215. package/template/src/views/components-demo/json-editor.vue +36 -0
  216. package/template/src/views/components-demo/markdown.vue +101 -0
  217. package/template/src/views/components-demo/mixin.vue +169 -0
  218. package/template/src/views/components-demo/split-pane.vue +67 -0
  219. package/template/src/views/components-demo/sticky.vue +135 -0
  220. package/template/src/views/components-demo/tinymce.vue +36 -0
  221. package/template/src/views/dashboard/admin/components/BarChart.vue +102 -0
  222. package/template/src/views/dashboard/admin/components/BoxCard.vue +118 -0
  223. package/template/src/views/dashboard/admin/components/LineChart.vue +135 -0
  224. package/template/src/views/dashboard/admin/components/PanelGroup.vue +181 -0
  225. package/template/src/views/dashboard/admin/components/PieChart.vue +79 -0
  226. package/template/src/views/dashboard/admin/components/RaddarChart.vue +116 -0
  227. package/template/src/views/dashboard/admin/components/TodoList/Todo.vue +81 -0
  228. package/template/src/views/dashboard/admin/components/TodoList/index.scss +320 -0
  229. package/template/src/views/dashboard/admin/components/TodoList/index.vue +127 -0
  230. package/template/src/views/dashboard/admin/components/TransactionTable.vue +55 -0
  231. package/template/src/views/dashboard/admin/components/mixins/resize.js +55 -0
  232. package/template/src/views/dashboard/admin/index.vue +124 -0
  233. package/template/src/views/dashboard/editor/index.vue +74 -0
  234. package/template/src/views/dashboard/index.vue +31 -0
  235. package/template/src/views/documentation/index.vue +57 -0
  236. package/template/src/views/error-log/components/ErrorTestA.vue +13 -0
  237. package/template/src/views/error-log/components/ErrorTestB.vue +11 -0
  238. package/template/src/views/error-log/index.vue +32 -0
  239. package/template/src/views/error-page/401.vue +99 -0
  240. package/template/src/views/error-page/404.vue +228 -0
  241. package/template/src/views/example/components/ArticleDetail.vue +289 -0
  242. package/template/src/views/example/components/Dropdown/Comment.vue +41 -0
  243. package/template/src/views/example/components/Dropdown/Platform.vue +46 -0
  244. package/template/src/views/example/components/Dropdown/SourceUrl.vue +38 -0
  245. package/template/src/views/example/components/Dropdown/index.js +3 -0
  246. package/template/src/views/example/components/Warning.vue +13 -0
  247. package/template/src/views/example/create.vue +13 -0
  248. package/template/src/views/example/edit.vue +13 -0
  249. package/template/src/views/example/list.vue +112 -0
  250. package/template/src/views/excel/components/AutoWidthOption.vue +34 -0
  251. package/template/src/views/excel/components/BookTypeOption.vue +39 -0
  252. package/template/src/views/excel/components/FilenameOption.vue +27 -0
  253. package/template/src/views/excel/export-excel.vue +116 -0
  254. package/template/src/views/excel/merge-header.vue +101 -0
  255. package/template/src/views/excel/select-excel.vue +107 -0
  256. package/template/src/views/excel/upload-excel.vue +42 -0
  257. package/template/src/views/guide/index.vue +36 -0
  258. package/template/src/views/guide/steps.js +53 -0
  259. package/template/src/views/icons/element-icons.js +3 -0
  260. package/template/src/views/icons/index.vue +101 -0
  261. package/template/src/views/icons/svg-icons.js +10 -0
  262. package/template/src/views/login/auth-redirect.vue +15 -0
  263. package/template/src/views/login/components/SocialSignin.vue +72 -0
  264. package/template/src/views/login/index.vue +324 -0
  265. package/template/src/views/nested/menu1/index.vue +7 -0
  266. package/template/src/views/nested/menu1/menu1-1/index.vue +7 -0
  267. package/template/src/views/nested/menu1/menu1-2/index.vue +7 -0
  268. package/template/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue +5 -0
  269. package/template/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue +5 -0
  270. package/template/src/views/nested/menu1/menu1-3/index.vue +5 -0
  271. package/template/src/views/nested/menu2/index.vue +5 -0
  272. package/template/src/views/pdf/content.js +58 -0
  273. package/template/src/views/pdf/download.vue +201 -0
  274. package/template/src/views/pdf/index.vue +13 -0
  275. package/template/src/views/permission/components/SwitchRoles.vue +32 -0
  276. package/template/src/views/permission/directive.vue +111 -0
  277. package/template/src/views/permission/page.vue +19 -0
  278. package/template/src/views/permission/role.vue +270 -0
  279. package/template/src/views/profile/components/Account.vue +38 -0
  280. package/template/src/views/profile/components/Activity.vue +185 -0
  281. package/template/src/views/profile/components/Timeline.vue +43 -0
  282. package/template/src/views/profile/components/UserCard.vue +134 -0
  283. package/template/src/views/profile/index.vue +68 -0
  284. package/template/src/views/qiniu/upload.vue +41 -0
  285. package/template/src/views/redirect/index.vue +12 -0
  286. package/template/src/views/tab/components/TabPane.vue +103 -0
  287. package/template/src/views/tab/index.vue +57 -0
  288. package/template/src/views/table/complex-table.vue +379 -0
  289. package/template/src/views/table/drag-table.vue +153 -0
  290. package/template/src/views/table/dynamic-table/components/FixedThead.vue +62 -0
  291. package/template/src/views/table/dynamic-table/components/UnfixedThead.vue +50 -0
  292. package/template/src/views/table/dynamic-table/index.vue +24 -0
  293. package/template/src/views/table/inline-edit-table.vue +149 -0
  294. package/template/src/views/theme/index.vue +120 -0
  295. package/template/src/views/zip/index.vue +77 -0
  296. package/template/tests/unit/.eslintrc.js +5 -0
  297. package/template/tests/unit/components/Hamburger.spec.js +18 -0
  298. package/template/tests/unit/components/SvgIcon.spec.js +22 -0
  299. package/template/tests/unit/utils/formatTime.spec.js +29 -0
  300. package/template/tests/unit/utils/param2Obj.spec.js +14 -0
  301. package/template/tests/unit/utils/parseTime.spec.js +37 -0
  302. package/template/tests/unit/utils/validate.spec.js +28 -0
  303. package/template/vue.config.js +124 -0
@@ -0,0 +1 @@
1
+ <svg width="130" height="130" xmlns="http://www.w3.org/2000/svg"><path d="M63.444 64.996c20.633 0 37.359-14.308 37.359-31.953 0-17.649-16.726-31.952-37.359-31.952-20.631 0-37.36 14.303-37.358 31.952 0 17.645 16.727 31.953 37.359 31.953zM80.57 75.65H49.434c-26.652 0-48.26 18.477-48.26 41.27v2.664c0 9.316 21.608 9.325 48.26 9.325H80.57c26.649 0 48.256-.344 48.256-9.325v-2.663c0-22.794-21.605-41.271-48.256-41.271z" stroke="#979797"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="128" height="110" xmlns="http://www.w3.org/2000/svg"><path d="M86.635 33.334c1.467 0 2.917.113 4.358.283C87.078 14.392 67.58.111 45.321.111 20.44.111.055 17.987.055 40.687c0 13.104 6.781 23.863 18.115 32.209l-4.527 14.352 15.82-8.364c5.666 1.182 10.207 2.395 15.858 2.395 1.42 0 2.829-.073 4.227-.189-.886-3.19-1.398-6.53-1.398-9.996 0-20.845 16.98-37.76 38.485-37.76zm-24.34-12.936c3.407 0 5.665 2.363 5.665 5.954 0 3.576-2.258 5.97-5.666 5.97-3.392 0-6.795-2.395-6.795-5.97 0-3.591 3.403-5.954 6.795-5.954zM30.616 32.323c-3.393 0-6.818-2.395-6.818-5.971 0-3.591 3.425-5.954 6.818-5.954 3.392 0 5.65 2.363 5.65 5.954 0 3.576-2.258 5.97-5.65 5.97z"/><path d="M127.945 70.52c0-19.075-18.108-34.623-38.448-34.623-21.537 0-38.5 15.548-38.5 34.623 0 19.108 16.963 34.622 38.5 34.622 4.508 0 9.058-1.2 13.584-2.395l12.414 7.167-3.404-11.923c9.087-7.184 15.854-16.712 15.854-27.471zm-50.928-5.97c-2.254 0-4.53-2.362-4.53-4.773 0-2.378 2.276-4.771 4.53-4.771 3.422 0 5.665 2.393 5.665 4.771 0 2.41-2.243 4.773-5.665 4.773zm24.897 0c-2.24 0-4.498-2.362-4.498-4.773 0-2.378 2.258-4.771 4.498-4.771 3.392 0 5.665 2.393 5.665 4.771 0 2.41-2.273 4.773-5.665 4.773z"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.527 116.793c.178.008.348.024.527.024h40.233c4.711-.005 8.53-3.677 8.534-8.21V18.895c-.004-4.532-3.823-8.204-8.534-8.209H79.054c-.179 0-.353.016-.527.024V0L0 10.082v107.406l78.527 10.342v-11.037zm0-101.362c.174-.024.348-.052.527-.052h40.233c2.018 0 3.659 1.578 3.659 3.52v89.713c-.003 1.942-1.64 3.517-3.659 3.519H79.054c-.179 0-.353-.028-.527-.052V15.431zM30.262 75.757l-18.721-.46V72.37l11.3-16.673v-.148l-10.266.164v-4.51l17.504-.44v3.264L18.696 70.76v.144l11.566.176v4.678zm9.419.231l-5.823-.144V50.671l5.823-.144v25.461zm22.255-11.632c-2.168 1.922-5.353 2.76-9.02 2.736-.702.004-1.402-.04-2.097-.131v9.303l-5.997-.148V50.743c1.852-.352 4.473-.647 8.218-.743 3.838-.096 6.608.539 8.48 1.913 1.807 1.306 3.032 3.5 3.032 6.112s-.926 4.833-2.612 6.331h-.004zM53.36 54.45c-.856-.01-1.71.083-2.541.275v7.682c.523.116 1.167.152 2.06.152 3.301-.004 5.36-1.614 5.36-4.314 0-2.425-1.772-3.843-4.875-3.791l-.004-.004zm39.847-37.066h9.564v3.795h-9.564v-3.795zm-9.568 5.68h9.564v3.8h-9.564v-3.8zm9.568 6.216h9.564v3.799h-9.564V29.28zm0 12h9.564v3.794h-9.564V41.28zm-9.568-6.096h9.564v3.795h-9.564v-3.795zm9.472 47.064c2.512 0 4.921-.96 6.697-2.67 1.776-1.708 2.773-4.026 2.772-6.442l-1.748-15.263c0-5.033-2.492-9.112-7.725-9.112-5.232 0-7.72 4.079-7.72 9.112l-1.752 15.263c-.001 2.417.996 4.735 2.773 6.444 1.777 1.71 4.187 2.669 6.7 2.668h.003zm-3.135-16.75h6.27v12.743h-6.27V65.5z"/></svg>
@@ -0,0 +1,22 @@
1
+ # replace default config
2
+
3
+ # multipass: true
4
+ # full: true
5
+
6
+ plugins:
7
+
8
+ # - name
9
+ #
10
+ # or:
11
+ # - name: false
12
+ # - name: true
13
+ #
14
+ # or:
15
+ # - name:
16
+ # param1: 1
17
+ # param2: 2
18
+
19
+ - removeAttrs:
20
+ attrs:
21
+ - 'fill'
22
+ - 'fill-rule'
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <section class="app-main">
3
+ <transition name="fade-transform" mode="out-in">
4
+ <keep-alive :include="cachedViews">
5
+ <router-view :key="key" />
6
+ </keep-alive>
7
+ </transition>
8
+ </section>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ name: 'AppMain',
14
+ computed: {
15
+ cachedViews() {
16
+ return this.$store.state.tagsView.cachedViews
17
+ },
18
+ key() {
19
+ return this.$route.path
20
+ }
21
+ }
22
+ }
23
+ </script>
24
+
25
+ <style lang="scss" scoped>
26
+ .app-main {
27
+ /* 50= navbar 50 */
28
+ min-height: calc(100vh - 50px);
29
+ width: 100%;
30
+ position: relative;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .fixed-header+.app-main {
35
+ padding-top: 50px;
36
+ }
37
+
38
+ .hasTagsView {
39
+ .app-main {
40
+ /* 84 = navbar + tags-view = 50 + 34 */
41
+ min-height: calc(100vh - 84px);
42
+ }
43
+
44
+ .fixed-header+.app-main {
45
+ padding-top: 84px;
46
+ }
47
+ }
48
+ </style>
49
+
50
+ <style lang="scss">
51
+ // fix css style bug in open el-dialog
52
+ .el-popup-parent--hidden {
53
+ .fixed-header {
54
+ padding-right: 15px;
55
+ }
56
+ }
57
+ </style>
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <div class="navbar">
3
+ <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
4
+
5
+ <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
6
+
7
+ <div class="right-menu">
8
+ <template v-if="device!=='mobile'">
9
+ <search id="header-search" class="right-menu-item" />
10
+
11
+ <error-log class="errLog-container right-menu-item hover-effect" />
12
+
13
+ <screenfull id="screenfull" class="right-menu-item hover-effect" />
14
+
15
+ <el-tooltip content="Global Size" effect="dark" placement="bottom">
16
+ <size-select id="size-select" class="right-menu-item hover-effect" />
17
+ </el-tooltip>
18
+
19
+ </template>
20
+
21
+ <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
22
+ <div class="avatar-wrapper">
23
+ <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
24
+ <i class="el-icon-caret-bottom" />
25
+ </div>
26
+ <el-dropdown-menu slot="dropdown">
27
+ <router-link to="/profile/index">
28
+ <el-dropdown-item>Profile</el-dropdown-item>
29
+ </router-link>
30
+ <router-link to="/">
31
+ <el-dropdown-item>Dashboard</el-dropdown-item>
32
+ </router-link>
33
+ <a target="_blank" href="https://github.com/PanJiaChen/vue-element-admin/">
34
+ <el-dropdown-item>Github</el-dropdown-item>
35
+ </a>
36
+ <a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
37
+ <el-dropdown-item>Docs</el-dropdown-item>
38
+ </a>
39
+ <el-dropdown-item divided @click.native="logout">
40
+ <span style="display:block;">Log Out</span>
41
+ </el-dropdown-item>
42
+ </el-dropdown-menu>
43
+ </el-dropdown>
44
+ </div>
45
+ </div>
46
+ </template>
47
+
48
+ <script>
49
+ import { mapGetters } from 'vuex'
50
+ import Breadcrumb from '@/components/Breadcrumb'
51
+ import Hamburger from '@/components/Hamburger'
52
+ import ErrorLog from '@/components/ErrorLog'
53
+ import Screenfull from '@/components/Screenfull'
54
+ import SizeSelect from '@/components/SizeSelect'
55
+ import Search from '@/components/HeaderSearch'
56
+
57
+ export default {
58
+ components: {
59
+ Breadcrumb,
60
+ Hamburger,
61
+ ErrorLog,
62
+ Screenfull,
63
+ SizeSelect,
64
+ Search
65
+ },
66
+ computed: {
67
+ ...mapGetters([
68
+ 'sidebar',
69
+ 'avatar',
70
+ 'device'
71
+ ])
72
+ },
73
+ methods: {
74
+ toggleSideBar() {
75
+ this.$store.dispatch('app/toggleSideBar')
76
+ },
77
+ async logout() {
78
+ await this.$store.dispatch('user/logout')
79
+ this.$router.push(`/login?redirect=${this.$route.fullPath}`)
80
+ }
81
+ }
82
+ }
83
+ </script>
84
+
85
+ <style lang="scss" scoped>
86
+ .navbar {
87
+ height: 50px;
88
+ overflow: hidden;
89
+ position: relative;
90
+ background: #fff;
91
+ box-shadow: 0 1px 4px rgba(0,21,41,.08);
92
+
93
+ .hamburger-container {
94
+ line-height: 46px;
95
+ height: 100%;
96
+ float: left;
97
+ cursor: pointer;
98
+ transition: background .3s;
99
+ -webkit-tap-highlight-color:transparent;
100
+
101
+ &:hover {
102
+ background: rgba(0, 0, 0, .025)
103
+ }
104
+ }
105
+
106
+ .breadcrumb-container {
107
+ float: left;
108
+ }
109
+
110
+ .errLog-container {
111
+ display: inline-block;
112
+ vertical-align: top;
113
+ }
114
+
115
+ .right-menu {
116
+ float: right;
117
+ height: 100%;
118
+ line-height: 50px;
119
+
120
+ &:focus {
121
+ outline: none;
122
+ }
123
+
124
+ .right-menu-item {
125
+ display: inline-block;
126
+ padding: 0 8px;
127
+ height: 100%;
128
+ font-size: 18px;
129
+ color: #5a5e66;
130
+ vertical-align: text-bottom;
131
+
132
+ &.hover-effect {
133
+ cursor: pointer;
134
+ transition: background .3s;
135
+
136
+ &:hover {
137
+ background: rgba(0, 0, 0, .025)
138
+ }
139
+ }
140
+ }
141
+
142
+ .avatar-container {
143
+ margin-right: 30px;
144
+
145
+ .avatar-wrapper {
146
+ margin-top: 5px;
147
+ position: relative;
148
+
149
+ .user-avatar {
150
+ cursor: pointer;
151
+ width: 40px;
152
+ height: 40px;
153
+ border-radius: 10px;
154
+ }
155
+
156
+ .el-icon-caret-bottom {
157
+ cursor: pointer;
158
+ position: absolute;
159
+ right: -20px;
160
+ top: 25px;
161
+ font-size: 12px;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ </style>
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <div class="drawer-container">
3
+ <div>
4
+ <h3 class="drawer-title">Page style setting</h3>
5
+
6
+ <div class="drawer-item">
7
+ <span>Theme Color</span>
8
+ <theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
9
+ </div>
10
+
11
+ <div class="drawer-item">
12
+ <span>Open Tags-View</span>
13
+ <el-switch v-model="tagsView" class="drawer-switch" />
14
+ </div>
15
+
16
+ <div class="drawer-item">
17
+ <span>Fixed Header</span>
18
+ <el-switch v-model="fixedHeader" class="drawer-switch" />
19
+ </div>
20
+
21
+ <div class="drawer-item">
22
+ <span>Sidebar Logo</span>
23
+ <el-switch v-model="sidebarLogo" class="drawer-switch" />
24
+ </div>
25
+
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import ThemePicker from '@/components/ThemePicker'
32
+
33
+ export default {
34
+ components: { ThemePicker },
35
+ data() {
36
+ return {}
37
+ },
38
+ computed: {
39
+ fixedHeader: {
40
+ get() {
41
+ return this.$store.state.settings.fixedHeader
42
+ },
43
+ set(val) {
44
+ this.$store.dispatch('settings/changeSetting', {
45
+ key: 'fixedHeader',
46
+ value: val
47
+ })
48
+ }
49
+ },
50
+ tagsView: {
51
+ get() {
52
+ return this.$store.state.settings.tagsView
53
+ },
54
+ set(val) {
55
+ this.$store.dispatch('settings/changeSetting', {
56
+ key: 'tagsView',
57
+ value: val
58
+ })
59
+ }
60
+ },
61
+ sidebarLogo: {
62
+ get() {
63
+ return this.$store.state.settings.sidebarLogo
64
+ },
65
+ set(val) {
66
+ this.$store.dispatch('settings/changeSetting', {
67
+ key: 'sidebarLogo',
68
+ value: val
69
+ })
70
+ }
71
+ }
72
+ },
73
+ methods: {
74
+ themeChange(val) {
75
+ this.$store.dispatch('settings/changeSetting', {
76
+ key: 'theme',
77
+ value: val
78
+ })
79
+ }
80
+ }
81
+ }
82
+ </script>
83
+
84
+ <style lang="scss" scoped>
85
+ .drawer-container {
86
+ padding: 24px;
87
+ font-size: 14px;
88
+ line-height: 1.5;
89
+ word-wrap: break-word;
90
+
91
+ .drawer-title {
92
+ margin-bottom: 12px;
93
+ color: rgba(0, 0, 0, .85);
94
+ font-size: 14px;
95
+ line-height: 22px;
96
+ }
97
+
98
+ .drawer-item {
99
+ color: rgba(0, 0, 0, .65);
100
+ font-size: 14px;
101
+ padding: 12px 0;
102
+ }
103
+
104
+ .drawer-switch {
105
+ float: right
106
+ }
107
+ }
108
+ </style>
@@ -0,0 +1,26 @@
1
+ export default {
2
+ computed: {
3
+ device() {
4
+ return this.$store.state.app.device
5
+ }
6
+ },
7
+ mounted() {
8
+ // In order to fix the click on menu on the ios device will trigger the mouseleave bug
9
+ // https://github.com/PanJiaChen/vue-element-admin/issues/1135
10
+ this.fixBugIniOS()
11
+ },
12
+ methods: {
13
+ fixBugIniOS() {
14
+ const $subMenu = this.$refs.subMenu
15
+ if ($subMenu) {
16
+ const handleMouseleave = $subMenu.handleMouseleave
17
+ $subMenu.handleMouseleave = (e) => {
18
+ if (this.device === 'mobile') {
19
+ return
20
+ }
21
+ handleMouseleave(e)
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,41 @@
1
+ <script>
2
+ export default {
3
+ name: 'MenuItem',
4
+ functional: true,
5
+ props: {
6
+ icon: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ title: {
11
+ type: String,
12
+ default: ''
13
+ }
14
+ },
15
+ render(h, context) {
16
+ const { icon, title } = context.props
17
+ const vnodes = []
18
+
19
+ if (icon) {
20
+ if (icon.includes('el-icon')) {
21
+ vnodes.push(<i class={[icon, 'sub-el-icon']} />)
22
+ } else {
23
+ vnodes.push(<svg-icon icon-class={icon}/>)
24
+ }
25
+ }
26
+
27
+ if (title) {
28
+ vnodes.push(<span slot='title'>{(title)}</span>)
29
+ }
30
+ return vnodes
31
+ }
32
+ }
33
+ </script>
34
+
35
+ <style scoped>
36
+ .sub-el-icon {
37
+ color: currentColor;
38
+ width: 1em;
39
+ height: 1em;
40
+ }
41
+ </style>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <component :is="type" v-bind="linkProps(to)">
3
+ <slot />
4
+ </component>
5
+ </template>
6
+
7
+ <script>
8
+ import { isExternal } from '@/utils/validate'
9
+
10
+ export default {
11
+ props: {
12
+ to: {
13
+ type: String,
14
+ required: true
15
+ }
16
+ },
17
+ computed: {
18
+ isExternal() {
19
+ return isExternal(this.to)
20
+ },
21
+ type() {
22
+ if (this.isExternal) {
23
+ return 'a'
24
+ }
25
+ return 'router-link'
26
+ }
27
+ },
28
+ methods: {
29
+ linkProps(to) {
30
+ if (this.isExternal) {
31
+ return {
32
+ href: to,
33
+ target: '_blank',
34
+ rel: 'noopener'
35
+ }
36
+ }
37
+ return {
38
+ to: to
39
+ }
40
+ }
41
+ }
42
+ }
43
+ </script>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div class="sidebar-logo-container" :class="{'collapse':collapse}">
3
+ <transition name="sidebarLogoFade">
4
+ <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
5
+ <img v-if="logo" :src="logo" class="sidebar-logo">
6
+ <h1 v-else class="sidebar-title">{{ title }} </h1>
7
+ </router-link>
8
+ <router-link v-else key="expand" class="sidebar-logo-link" to="/">
9
+ <img v-if="logo" :src="logo" class="sidebar-logo">
10
+ <h1 class="sidebar-title">{{ title }} </h1>
11
+ </router-link>
12
+ </transition>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name: 'SidebarLogo',
19
+ props: {
20
+ collapse: {
21
+ type: Boolean,
22
+ required: true
23
+ }
24
+ },
25
+ data() {
26
+ return {
27
+ title: 'Vue Element Admin',
28
+ logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <style lang="scss" scoped>
35
+ .sidebarLogoFade-enter-active {
36
+ transition: opacity 1.5s;
37
+ }
38
+
39
+ .sidebarLogoFade-enter,
40
+ .sidebarLogoFade-leave-to {
41
+ opacity: 0;
42
+ }
43
+
44
+ .sidebar-logo-container {
45
+ position: relative;
46
+ width: 100%;
47
+ height: 50px;
48
+ line-height: 50px;
49
+ background: #2b2f3a;
50
+ text-align: center;
51
+ overflow: hidden;
52
+
53
+ & .sidebar-logo-link {
54
+ height: 100%;
55
+ width: 100%;
56
+
57
+ & .sidebar-logo {
58
+ width: 32px;
59
+ height: 32px;
60
+ vertical-align: middle;
61
+ margin-right: 12px;
62
+ }
63
+
64
+ & .sidebar-title {
65
+ display: inline-block;
66
+ margin: 0;
67
+ color: #fff;
68
+ font-weight: 600;
69
+ line-height: 50px;
70
+ font-size: 14px;
71
+ font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
72
+ vertical-align: middle;
73
+ }
74
+ }
75
+
76
+ &.collapse {
77
+ .sidebar-logo {
78
+ margin-right: 0px;
79
+ }
80
+ }
81
+ }
82
+ </style>
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <div v-if="!item.hidden">
3
+ <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
4
+ <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
5
+ <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6
+ <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
7
+ </el-menu-item>
8
+ </app-link>
9
+ </template>
10
+
11
+ <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
12
+ <template slot="title">
13
+ <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
14
+ </template>
15
+ <sidebar-item
16
+ v-for="child in item.children"
17
+ :key="child.path"
18
+ :is-nest="true"
19
+ :item="child"
20
+ :base-path="resolvePath(child.path)"
21
+ class="nest-menu"
22
+ />
23
+ </el-submenu>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import path from 'path'
29
+ import { isExternal } from '@/utils/validate'
30
+ import Item from './Item'
31
+ import AppLink from './Link'
32
+ import FixiOSBug from './FixiOSBug'
33
+
34
+ export default {
35
+ name: 'SidebarItem',
36
+ components: { Item, AppLink },
37
+ mixins: [FixiOSBug],
38
+ props: {
39
+ // route object
40
+ item: {
41
+ type: Object,
42
+ required: true
43
+ },
44
+ isNest: {
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ basePath: {
49
+ type: String,
50
+ default: ''
51
+ }
52
+ },
53
+ data() {
54
+ // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
55
+ // TODO: refactor with render function
56
+ this.onlyOneChild = null
57
+ return {}
58
+ },
59
+ methods: {
60
+ hasOneShowingChild(children = [], parent) {
61
+ const showingChildren = children.filter(item => {
62
+ if (item.hidden) {
63
+ return false
64
+ } else {
65
+ // Temp set(will be used if only has one showing child)
66
+ this.onlyOneChild = item
67
+ return true
68
+ }
69
+ })
70
+
71
+ // When there is only one child router, the child router is displayed by default
72
+ if (showingChildren.length === 1) {
73
+ return true
74
+ }
75
+
76
+ // Show parent if there are no child router to display
77
+ if (showingChildren.length === 0) {
78
+ this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
79
+ return true
80
+ }
81
+
82
+ return false
83
+ },
84
+ resolvePath(routePath) {
85
+ if (isExternal(routePath)) {
86
+ return routePath
87
+ }
88
+ if (isExternal(this.basePath)) {
89
+ return this.basePath
90
+ }
91
+ return path.resolve(this.basePath, routePath)
92
+ }
93
+ }
94
+ }
95
+ </script>