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,320 @@
1
+ .todoapp {
2
+ font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ line-height: 1.4em;
4
+ color: #4d4d4d;
5
+ min-width: 230px;
6
+ max-width: 550px;
7
+ margin: 0 auto ;
8
+ -webkit-font-smoothing: antialiased;
9
+ -moz-osx-font-smoothing: grayscale;
10
+ font-weight: 300;
11
+ background: #fff;
12
+ z-index: 1;
13
+ position: relative;
14
+ button {
15
+ margin: 0;
16
+ padding: 0;
17
+ border: 0;
18
+ background: none;
19
+ font-size: 100%;
20
+ vertical-align: baseline;
21
+ font-family: inherit;
22
+ font-weight: inherit;
23
+ color: inherit;
24
+ -webkit-appearance: none;
25
+ appearance: none;
26
+ -webkit-font-smoothing: antialiased;
27
+ -moz-osx-font-smoothing: grayscale;
28
+ }
29
+ :focus {
30
+ outline: 0;
31
+ }
32
+ .hidden {
33
+ display: none;
34
+ }
35
+ .todoapp {
36
+ background: #fff;
37
+ margin: 130px 0 40px 0;
38
+ position: relative;
39
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1);
40
+ }
41
+ .todoapp input::-webkit-input-placeholder {
42
+ font-style: italic;
43
+ font-weight: 300;
44
+ color: #e6e6e6;
45
+ }
46
+ .todoapp input::-moz-placeholder {
47
+ font-style: italic;
48
+ font-weight: 300;
49
+ color: #e6e6e6;
50
+ }
51
+ .todoapp input::input-placeholder {
52
+ font-style: italic;
53
+ font-weight: 300;
54
+ color: #e6e6e6;
55
+ }
56
+ .todoapp h1 {
57
+ position: absolute;
58
+ top: -155px;
59
+ width: 100%;
60
+ font-size: 100px;
61
+ font-weight: 100;
62
+ text-align: center;
63
+ color: rgba(175, 47, 47, 0.15);
64
+ -webkit-text-rendering: optimizeLegibility;
65
+ -moz-text-rendering: optimizeLegibility;
66
+ text-rendering: optimizeLegibility;
67
+ }
68
+ .new-todo,
69
+ .edit {
70
+ position: relative;
71
+ margin: 0;
72
+ width: 100%;
73
+ font-size: 18px;
74
+ font-family: inherit;
75
+ font-weight: inherit;
76
+ line-height: 1.4em;
77
+ border: 0;
78
+ color: inherit;
79
+ padding: 6px;
80
+ border: 1px solid #999;
81
+ box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
82
+ box-sizing: border-box;
83
+ -webkit-font-smoothing: antialiased;
84
+ -moz-osx-font-smoothing: grayscale;
85
+ }
86
+ .new-todo {
87
+ padding: 10px 16px 16px 60px;
88
+ border: none;
89
+ background: rgba(0, 0, 0, 0.003);
90
+ box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.03);
91
+ }
92
+ .main {
93
+ position: relative;
94
+ z-index: 2;
95
+ border-top: 1px solid #e6e6e6;
96
+ }
97
+ .toggle-all {
98
+ text-align: center;
99
+ border: none;
100
+ /* Mobile Safari */
101
+ opacity: 0;
102
+ position: absolute;
103
+ }
104
+ .toggle-all+label {
105
+ width: 60px;
106
+ height: 34px;
107
+ font-size: 0;
108
+ position: absolute;
109
+ top: -52px;
110
+ left: -13px;
111
+ -webkit-transform: rotate(90deg);
112
+ transform: rotate(90deg);
113
+ }
114
+ .toggle-all+label:before {
115
+ content: '❯';
116
+ font-size: 22px;
117
+ color: #e6e6e6;
118
+ padding: 10px 27px 10px 27px;
119
+ }
120
+ .toggle-all:checked+label:before {
121
+ color: #737373;
122
+ }
123
+ .todo-list {
124
+ margin: 0;
125
+ padding: 0;
126
+ list-style: none;
127
+ }
128
+ .todo-list li {
129
+ position: relative;
130
+ font-size: 24px;
131
+ border-bottom: 1px solid #ededed;
132
+ }
133
+ .todo-list li:last-child {
134
+ border-bottom: none;
135
+ }
136
+ .todo-list li.editing {
137
+ border-bottom: none;
138
+ padding: 0;
139
+ }
140
+ .todo-list li.editing .edit {
141
+ display: block;
142
+ width: 506px;
143
+ padding: 12px 16px;
144
+ margin: 0 0 0 43px;
145
+ }
146
+ .todo-list li.editing .view {
147
+ display: none;
148
+ }
149
+ .todo-list li .toggle {
150
+ text-align: center;
151
+ width: 40px;
152
+ /* auto, since non-WebKit browsers doesn't support input styling */
153
+ height: auto;
154
+ position: absolute;
155
+ top: 0;
156
+ bottom: 0;
157
+ margin: auto 0;
158
+ border: none;
159
+ /* Mobile Safari */
160
+ -webkit-appearance: none;
161
+ appearance: none;
162
+ }
163
+ .todo-list li .toggle {
164
+ opacity: 0;
165
+ }
166
+ .todo-list li .toggle+label {
167
+ /*
168
+ Firefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433
169
+ IE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/
170
+ */
171
+ background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E');
172
+ background-repeat: no-repeat;
173
+ background-position: center left;
174
+ background-size: 36px;
175
+ }
176
+ .todo-list li .toggle:checked+label {
177
+ background-size: 36px;
178
+ background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E');
179
+ }
180
+ .todo-list li label {
181
+ word-break: break-all;
182
+ padding: 15px 15px 15px 50px;
183
+ display: block;
184
+ line-height: 1.0;
185
+ font-size: 14px;
186
+ transition: color 0.4s;
187
+ }
188
+ .todo-list li.completed label {
189
+ color: #d9d9d9;
190
+ text-decoration: line-through;
191
+ }
192
+ .todo-list li .destroy {
193
+ display: none;
194
+ position: absolute;
195
+ top: 0;
196
+ right: 10px;
197
+ bottom: 0;
198
+ width: 40px;
199
+ height: 40px;
200
+ margin: auto 0;
201
+ font-size: 30px;
202
+ color: #cc9a9a;
203
+ transition: color 0.2s ease-out;
204
+ cursor: pointer;
205
+ }
206
+ .todo-list li .destroy:hover {
207
+ color: #af5b5e;
208
+ }
209
+ .todo-list li .destroy:after {
210
+ content: '×';
211
+ }
212
+ .todo-list li:hover .destroy {
213
+ display: block;
214
+ }
215
+ .todo-list li .edit {
216
+ display: none;
217
+ }
218
+ .todo-list li.editing:last-child {
219
+ margin-bottom: -1px;
220
+ }
221
+ .footer {
222
+ color: #777;
223
+ position: relative;
224
+ padding: 10px 15px;
225
+ height: 40px;
226
+ text-align: center;
227
+ border-top: 1px solid #e6e6e6;
228
+ }
229
+ .footer:before {
230
+ content: '';
231
+ position: absolute;
232
+ right: 0;
233
+ bottom: 0;
234
+ left: 0;
235
+ height: 40px;
236
+ overflow: hidden;
237
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 0 -3px #f6f6f6, 0 9px 1px -3px rgba(0, 0, 0, 0.2), 0 16px 0 -6px #f6f6f6, 0 17px 2px -6px rgba(0, 0, 0, 0.2);
238
+ }
239
+ .todo-count {
240
+ float: left;
241
+ text-align: left;
242
+ }
243
+ .todo-count strong {
244
+ font-weight: 300;
245
+ }
246
+ .filters {
247
+ margin: 0;
248
+ padding: 0;
249
+ position: relative;
250
+ z-index: 1;
251
+ list-style: none;
252
+ }
253
+ .filters li {
254
+ display: inline;
255
+ }
256
+ .filters li a {
257
+ color: inherit;
258
+ font-size: 12px;
259
+ padding: 3px 7px;
260
+ text-decoration: none;
261
+ border: 1px solid transparent;
262
+ border-radius: 3px;
263
+ }
264
+ .filters li a:hover {
265
+ border-color: rgba(175, 47, 47, 0.1);
266
+ }
267
+ .filters li a.selected {
268
+ border-color: rgba(175, 47, 47, 0.2);
269
+ }
270
+ .clear-completed,
271
+ html .clear-completed:active {
272
+ float: right;
273
+ position: relative;
274
+ line-height: 20px;
275
+ text-decoration: none;
276
+ cursor: pointer;
277
+ }
278
+ .clear-completed:hover {
279
+ text-decoration: underline;
280
+ }
281
+ .info {
282
+ margin: 65px auto 0;
283
+ color: #bfbfbf;
284
+ font-size: 10px;
285
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
286
+ text-align: center;
287
+ }
288
+ .info p {
289
+ line-height: 1;
290
+ }
291
+ .info a {
292
+ color: inherit;
293
+ text-decoration: none;
294
+ font-weight: 400;
295
+ }
296
+ .info a:hover {
297
+ text-decoration: underline;
298
+ }
299
+ /*
300
+ Hack to remove background from Mobile Safari.
301
+ Can't use it globally since it destroys checkboxes in Firefox
302
+ */
303
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
304
+ .toggle-all,
305
+ .todo-list li .toggle {
306
+ background: none;
307
+ }
308
+ .todo-list li .toggle {
309
+ height: 40px;
310
+ }
311
+ }
312
+ @media (max-width: 430px) {
313
+ .footer {
314
+ height: 50px;
315
+ }
316
+ .filters {
317
+ bottom: 10px;
318
+ }
319
+ }
320
+ }
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <section class="todoapp">
3
+ <!-- header -->
4
+ <header class="header">
5
+ <input class="new-todo" autocomplete="off" placeholder="Todo List" @keyup.enter="addTodo">
6
+ </header>
7
+ <!-- main section -->
8
+ <section v-show="todos.length" class="main">
9
+ <input id="toggle-all" :checked="allChecked" class="toggle-all" type="checkbox" @change="toggleAll({ done: !allChecked })">
10
+ <label for="toggle-all" />
11
+ <ul class="todo-list">
12
+ <todo
13
+ v-for="(todo, index) in filteredTodos"
14
+ :key="index"
15
+ :todo="todo"
16
+ @toggleTodo="toggleTodo"
17
+ @editTodo="editTodo"
18
+ @deleteTodo="deleteTodo"
19
+ />
20
+ </ul>
21
+ </section>
22
+ <!-- footer -->
23
+ <footer v-show="todos.length" class="footer">
24
+ <span class="todo-count">
25
+ <strong>{{ remaining }}</strong>
26
+ {{ remaining | pluralize('item') }} left
27
+ </span>
28
+ <ul class="filters">
29
+ <li v-for="(val, key) in filters" :key="key">
30
+ <a :class="{ selected: visibility === key }" @click.prevent="visibility = key">{{ key | capitalize }}</a>
31
+ </li>
32
+ </ul>
33
+ <!-- <button class="clear-completed" v-show="todos.length > remaining" @click="clearCompleted">
34
+ Clear completed
35
+ </button> -->
36
+ </footer>
37
+ </section>
38
+ </template>
39
+
40
+ <script>
41
+ import Todo from './Todo.vue'
42
+
43
+ const STORAGE_KEY = 'todos'
44
+ const filters = {
45
+ all: todos => todos,
46
+ active: todos => todos.filter(todo => !todo.done),
47
+ completed: todos => todos.filter(todo => todo.done)
48
+ }
49
+ const defalutList = [
50
+ { text: 'star this repository', done: false },
51
+ { text: 'fork this repository', done: false },
52
+ { text: 'follow author', done: false },
53
+ { text: 'vue-element-admin', done: true },
54
+ { text: 'vue', done: true },
55
+ { text: 'element-ui', done: true },
56
+ { text: 'axios', done: true },
57
+ { text: 'webpack', done: true }
58
+ ]
59
+ export default {
60
+ components: { Todo },
61
+ filters: {
62
+ pluralize: (n, w) => n === 1 ? w : w + 's',
63
+ capitalize: s => s.charAt(0).toUpperCase() + s.slice(1)
64
+ },
65
+ data() {
66
+ return {
67
+ visibility: 'all',
68
+ filters,
69
+ // todos: JSON.parse(window.localStorage.getItem(STORAGE_KEY)) || defalutList
70
+ todos: defalutList
71
+ }
72
+ },
73
+ computed: {
74
+ allChecked() {
75
+ return this.todos.every(todo => todo.done)
76
+ },
77
+ filteredTodos() {
78
+ return filters[this.visibility](this.todos)
79
+ },
80
+ remaining() {
81
+ return this.todos.filter(todo => !todo.done).length
82
+ }
83
+ },
84
+ methods: {
85
+ setLocalStorage() {
86
+ window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos))
87
+ },
88
+ addTodo(e) {
89
+ const text = e.target.value
90
+ if (text.trim()) {
91
+ this.todos.push({
92
+ text,
93
+ done: false
94
+ })
95
+ this.setLocalStorage()
96
+ }
97
+ e.target.value = ''
98
+ },
99
+ toggleTodo(val) {
100
+ val.done = !val.done
101
+ this.setLocalStorage()
102
+ },
103
+ deleteTodo(todo) {
104
+ this.todos.splice(this.todos.indexOf(todo), 1)
105
+ this.setLocalStorage()
106
+ },
107
+ editTodo({ todo, value }) {
108
+ todo.text = value
109
+ this.setLocalStorage()
110
+ },
111
+ clearCompleted() {
112
+ this.todos = this.todos.filter(todo => !todo.done)
113
+ this.setLocalStorage()
114
+ },
115
+ toggleAll({ done }) {
116
+ this.todos.forEach(todo => {
117
+ todo.done = done
118
+ this.setLocalStorage()
119
+ })
120
+ }
121
+ }
122
+ }
123
+ </script>
124
+
125
+ <style lang="scss">
126
+ @import './index.scss';
127
+ </style>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <el-table :data="list" style="width: 100%;padding-top: 15px;">
3
+ <el-table-column label="Order_No" min-width="200">
4
+ <template slot-scope="scope">
5
+ {{ scope.row.order_no | orderNoFilter }}
6
+ </template>
7
+ </el-table-column>
8
+ <el-table-column label="Price" width="195" align="center">
9
+ <template slot-scope="scope">
10
+ ¥{{ scope.row.price | toThousandFilter }}
11
+ </template>
12
+ </el-table-column>
13
+ <el-table-column label="Status" width="100" align="center">
14
+ <template slot-scope="{row}">
15
+ <el-tag :type="row.status | statusFilter">
16
+ {{ row.status }}
17
+ </el-tag>
18
+ </template>
19
+ </el-table-column>
20
+ </el-table>
21
+ </template>
22
+
23
+ <script>
24
+ import { transactionList } from '@/api/remote-search'
25
+
26
+ export default {
27
+ filters: {
28
+ statusFilter(status) {
29
+ const statusMap = {
30
+ success: 'success',
31
+ pending: 'danger'
32
+ }
33
+ return statusMap[status]
34
+ },
35
+ orderNoFilter(str) {
36
+ return str.substring(0, 30)
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ list: null
42
+ }
43
+ },
44
+ created() {
45
+ this.fetchData()
46
+ },
47
+ methods: {
48
+ fetchData() {
49
+ transactionList().then(response => {
50
+ this.list = response.data.items.slice(0, 8)
51
+ })
52
+ }
53
+ }
54
+ }
55
+ </script>
@@ -0,0 +1,55 @@
1
+ import { debounce } from '@/utils'
2
+
3
+ export default {
4
+ data() {
5
+ return {
6
+ $_sidebarElm: null,
7
+ $_resizeHandler: null
8
+ }
9
+ },
10
+ mounted() {
11
+ this.$_resizeHandler = debounce(() => {
12
+ if (this.chart) {
13
+ this.chart.resize()
14
+ }
15
+ }, 100)
16
+ this.$_initResizeEvent()
17
+ this.$_initSidebarResizeEvent()
18
+ },
19
+ beforeDestroy() {
20
+ this.$_destroyResizeEvent()
21
+ this.$_destroySidebarResizeEvent()
22
+ },
23
+ // to fixed bug when cached by keep-alive
24
+ // https://github.com/PanJiaChen/vue-element-admin/issues/2116
25
+ activated() {
26
+ this.$_initResizeEvent()
27
+ this.$_initSidebarResizeEvent()
28
+ },
29
+ deactivated() {
30
+ this.$_destroyResizeEvent()
31
+ this.$_destroySidebarResizeEvent()
32
+ },
33
+ methods: {
34
+ // use $_ for mixins properties
35
+ // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
36
+ $_initResizeEvent() {
37
+ window.addEventListener('resize', this.$_resizeHandler)
38
+ },
39
+ $_destroyResizeEvent() {
40
+ window.removeEventListener('resize', this.$_resizeHandler)
41
+ },
42
+ $_sidebarResizeHandler(e) {
43
+ if (e.propertyName === 'width') {
44
+ this.$_resizeHandler()
45
+ }
46
+ },
47
+ $_initSidebarResizeEvent() {
48
+ this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
49
+ this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
50
+ },
51
+ $_destroySidebarResizeEvent() {
52
+ this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <div class="dashboard-editor-container">
3
+ <github-corner class="github-corner" />
4
+
5
+ <panel-group @handleSetLineChartData="handleSetLineChartData" />
6
+
7
+ <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
8
+ <line-chart :chart-data="lineChartData" />
9
+ </el-row>
10
+
11
+ <el-row :gutter="32">
12
+ <el-col :xs="24" :sm="24" :lg="8">
13
+ <div class="chart-wrapper">
14
+ <raddar-chart />
15
+ </div>
16
+ </el-col>
17
+ <el-col :xs="24" :sm="24" :lg="8">
18
+ <div class="chart-wrapper">
19
+ <pie-chart />
20
+ </div>
21
+ </el-col>
22
+ <el-col :xs="24" :sm="24" :lg="8">
23
+ <div class="chart-wrapper">
24
+ <bar-chart />
25
+ </div>
26
+ </el-col>
27
+ </el-row>
28
+
29
+ <el-row :gutter="8">
30
+ <el-col :xs="{span: 24}" :sm="{span: 24}" :md="{span: 24}" :lg="{span: 12}" :xl="{span: 12}" style="padding-right:8px;margin-bottom:30px;">
31
+ <transaction-table />
32
+ </el-col>
33
+ <el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
34
+ <todo-list />
35
+ </el-col>
36
+ <el-col :xs="{span: 24}" :sm="{span: 12}" :md="{span: 12}" :lg="{span: 6}" :xl="{span: 6}" style="margin-bottom:30px;">
37
+ <box-card />
38
+ </el-col>
39
+ </el-row>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import GithubCorner from '@/components/GithubCorner'
45
+ import PanelGroup from './components/PanelGroup'
46
+ import LineChart from './components/LineChart'
47
+ import RaddarChart from './components/RaddarChart'
48
+ import PieChart from './components/PieChart'
49
+ import BarChart from './components/BarChart'
50
+ import TransactionTable from './components/TransactionTable'
51
+ import TodoList from './components/TodoList'
52
+ import BoxCard from './components/BoxCard'
53
+
54
+ const lineChartData = {
55
+ newVisitis: {
56
+ expectedData: [100, 120, 161, 134, 105, 160, 165],
57
+ actualData: [120, 82, 91, 154, 162, 140, 145]
58
+ },
59
+ messages: {
60
+ expectedData: [200, 192, 120, 144, 160, 130, 140],
61
+ actualData: [180, 160, 151, 106, 145, 150, 130]
62
+ },
63
+ purchases: {
64
+ expectedData: [80, 100, 121, 104, 105, 90, 100],
65
+ actualData: [120, 90, 100, 138, 142, 130, 130]
66
+ },
67
+ shoppings: {
68
+ expectedData: [130, 140, 141, 142, 145, 150, 160],
69
+ actualData: [120, 82, 91, 154, 162, 140, 130]
70
+ }
71
+ }
72
+
73
+ export default {
74
+ name: 'DashboardAdmin',
75
+ components: {
76
+ GithubCorner,
77
+ PanelGroup,
78
+ LineChart,
79
+ RaddarChart,
80
+ PieChart,
81
+ BarChart,
82
+ TransactionTable,
83
+ TodoList,
84
+ BoxCard
85
+ },
86
+ data() {
87
+ return {
88
+ lineChartData: lineChartData.newVisitis
89
+ }
90
+ },
91
+ methods: {
92
+ handleSetLineChartData(type) {
93
+ this.lineChartData = lineChartData[type]
94
+ }
95
+ }
96
+ }
97
+ </script>
98
+
99
+ <style lang="scss" scoped>
100
+ .dashboard-editor-container {
101
+ padding: 32px;
102
+ background-color: rgb(240, 242, 245);
103
+ position: relative;
104
+
105
+ .github-corner {
106
+ position: absolute;
107
+ top: 0px;
108
+ border: 0;
109
+ right: 0;
110
+ }
111
+
112
+ .chart-wrapper {
113
+ background: #fff;
114
+ padding: 16px 16px 0;
115
+ margin-bottom: 32px;
116
+ }
117
+ }
118
+
119
+ @media (max-width:1024px) {
120
+ .chart-wrapper {
121
+ padding: 8px;
122
+ }
123
+ }
124
+ </style>