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,135 @@
1
+ <template>
2
+ <div :class="className" :style="{height:height,width:width}" />
3
+ </template>
4
+
5
+ <script>
6
+ import echarts from 'echarts'
7
+ require('echarts/theme/macarons') // echarts theme
8
+ import resize from './mixins/resize'
9
+
10
+ export default {
11
+ mixins: [resize],
12
+ props: {
13
+ className: {
14
+ type: String,
15
+ default: 'chart'
16
+ },
17
+ width: {
18
+ type: String,
19
+ default: '100%'
20
+ },
21
+ height: {
22
+ type: String,
23
+ default: '350px'
24
+ },
25
+ autoResize: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ chartData: {
30
+ type: Object,
31
+ required: true
32
+ }
33
+ },
34
+ data() {
35
+ return {
36
+ chart: null
37
+ }
38
+ },
39
+ watch: {
40
+ chartData: {
41
+ deep: true,
42
+ handler(val) {
43
+ this.setOptions(val)
44
+ }
45
+ }
46
+ },
47
+ mounted() {
48
+ this.$nextTick(() => {
49
+ this.initChart()
50
+ })
51
+ },
52
+ beforeDestroy() {
53
+ if (!this.chart) {
54
+ return
55
+ }
56
+ this.chart.dispose()
57
+ this.chart = null
58
+ },
59
+ methods: {
60
+ initChart() {
61
+ this.chart = echarts.init(this.$el, 'macarons')
62
+ this.setOptions(this.chartData)
63
+ },
64
+ setOptions({ expectedData, actualData } = {}) {
65
+ this.chart.setOption({
66
+ xAxis: {
67
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
68
+ boundaryGap: false,
69
+ axisTick: {
70
+ show: false
71
+ }
72
+ },
73
+ grid: {
74
+ left: 10,
75
+ right: 10,
76
+ bottom: 20,
77
+ top: 30,
78
+ containLabel: true
79
+ },
80
+ tooltip: {
81
+ trigger: 'axis',
82
+ axisPointer: {
83
+ type: 'cross'
84
+ },
85
+ padding: [5, 10]
86
+ },
87
+ yAxis: {
88
+ axisTick: {
89
+ show: false
90
+ }
91
+ },
92
+ legend: {
93
+ data: ['expected', 'actual']
94
+ },
95
+ series: [{
96
+ name: 'expected', itemStyle: {
97
+ normal: {
98
+ color: '#FF005A',
99
+ lineStyle: {
100
+ color: '#FF005A',
101
+ width: 2
102
+ }
103
+ }
104
+ },
105
+ smooth: true,
106
+ type: 'line',
107
+ data: expectedData,
108
+ animationDuration: 2800,
109
+ animationEasing: 'cubicInOut'
110
+ },
111
+ {
112
+ name: 'actual',
113
+ smooth: true,
114
+ type: 'line',
115
+ itemStyle: {
116
+ normal: {
117
+ color: '#3888fa',
118
+ lineStyle: {
119
+ color: '#3888fa',
120
+ width: 2
121
+ },
122
+ areaStyle: {
123
+ color: '#f3f8ff'
124
+ }
125
+ }
126
+ },
127
+ data: actualData,
128
+ animationDuration: 2800,
129
+ animationEasing: 'quadraticOut'
130
+ }]
131
+ })
132
+ }
133
+ }
134
+ }
135
+ </script>
@@ -0,0 +1,181 @@
1
+ <template>
2
+ <el-row :gutter="40" class="panel-group">
3
+ <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
4
+ <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
5
+ <div class="card-panel-icon-wrapper icon-people">
6
+ <svg-icon icon-class="peoples" class-name="card-panel-icon" />
7
+ </div>
8
+ <div class="card-panel-description">
9
+ <div class="card-panel-text">
10
+ New Visits
11
+ </div>
12
+ <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
13
+ </div>
14
+ </div>
15
+ </el-col>
16
+ <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
17
+ <div class="card-panel" @click="handleSetLineChartData('messages')">
18
+ <div class="card-panel-icon-wrapper icon-message">
19
+ <svg-icon icon-class="message" class-name="card-panel-icon" />
20
+ </div>
21
+ <div class="card-panel-description">
22
+ <div class="card-panel-text">
23
+ Messages
24
+ </div>
25
+ <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
26
+ </div>
27
+ </div>
28
+ </el-col>
29
+ <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
30
+ <div class="card-panel" @click="handleSetLineChartData('purchases')">
31
+ <div class="card-panel-icon-wrapper icon-money">
32
+ <svg-icon icon-class="money" class-name="card-panel-icon" />
33
+ </div>
34
+ <div class="card-panel-description">
35
+ <div class="card-panel-text">
36
+ Purchases
37
+ </div>
38
+ <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
39
+ </div>
40
+ </div>
41
+ </el-col>
42
+ <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
43
+ <div class="card-panel" @click="handleSetLineChartData('shoppings')">
44
+ <div class="card-panel-icon-wrapper icon-shopping">
45
+ <svg-icon icon-class="shopping" class-name="card-panel-icon" />
46
+ </div>
47
+ <div class="card-panel-description">
48
+ <div class="card-panel-text">
49
+ Shoppings
50
+ </div>
51
+ <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
52
+ </div>
53
+ </div>
54
+ </el-col>
55
+ </el-row>
56
+ </template>
57
+
58
+ <script>
59
+ import CountTo from 'vue-count-to'
60
+
61
+ export default {
62
+ components: {
63
+ CountTo
64
+ },
65
+ methods: {
66
+ handleSetLineChartData(type) {
67
+ this.$emit('handleSetLineChartData', type)
68
+ }
69
+ }
70
+ }
71
+ </script>
72
+
73
+ <style lang="scss" scoped>
74
+ .panel-group {
75
+ margin-top: 18px;
76
+
77
+ .card-panel-col {
78
+ margin-bottom: 32px;
79
+ }
80
+
81
+ .card-panel {
82
+ height: 108px;
83
+ cursor: pointer;
84
+ font-size: 12px;
85
+ position: relative;
86
+ overflow: hidden;
87
+ color: #666;
88
+ background: #fff;
89
+ box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
90
+ border-color: rgba(0, 0, 0, .05);
91
+
92
+ &:hover {
93
+ .card-panel-icon-wrapper {
94
+ color: #fff;
95
+ }
96
+
97
+ .icon-people {
98
+ background: #40c9c6;
99
+ }
100
+
101
+ .icon-message {
102
+ background: #36a3f7;
103
+ }
104
+
105
+ .icon-money {
106
+ background: #f4516c;
107
+ }
108
+
109
+ .icon-shopping {
110
+ background: #34bfa3
111
+ }
112
+ }
113
+
114
+ .icon-people {
115
+ color: #40c9c6;
116
+ }
117
+
118
+ .icon-message {
119
+ color: #36a3f7;
120
+ }
121
+
122
+ .icon-money {
123
+ color: #f4516c;
124
+ }
125
+
126
+ .icon-shopping {
127
+ color: #34bfa3
128
+ }
129
+
130
+ .card-panel-icon-wrapper {
131
+ float: left;
132
+ margin: 14px 0 0 14px;
133
+ padding: 16px;
134
+ transition: all 0.38s ease-out;
135
+ border-radius: 6px;
136
+ }
137
+
138
+ .card-panel-icon {
139
+ float: left;
140
+ font-size: 48px;
141
+ }
142
+
143
+ .card-panel-description {
144
+ float: right;
145
+ font-weight: bold;
146
+ margin: 26px;
147
+ margin-left: 0px;
148
+
149
+ .card-panel-text {
150
+ line-height: 18px;
151
+ color: rgba(0, 0, 0, 0.45);
152
+ font-size: 16px;
153
+ margin-bottom: 12px;
154
+ }
155
+
156
+ .card-panel-num {
157
+ font-size: 20px;
158
+ }
159
+ }
160
+ }
161
+ }
162
+
163
+ @media (max-width:550px) {
164
+ .card-panel-description {
165
+ display: none;
166
+ }
167
+
168
+ .card-panel-icon-wrapper {
169
+ float: none !important;
170
+ width: 100%;
171
+ height: 100%;
172
+ margin: 0 !important;
173
+
174
+ .svg-icon {
175
+ display: block;
176
+ margin: 14px auto !important;
177
+ float: none !important;
178
+ }
179
+ }
180
+ }
181
+ </style>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <div :class="className" :style="{height:height,width:width}" />
3
+ </template>
4
+
5
+ <script>
6
+ import echarts from 'echarts'
7
+ require('echarts/theme/macarons') // echarts theme
8
+ import resize from './mixins/resize'
9
+
10
+ export default {
11
+ mixins: [resize],
12
+ props: {
13
+ className: {
14
+ type: String,
15
+ default: 'chart'
16
+ },
17
+ width: {
18
+ type: String,
19
+ default: '100%'
20
+ },
21
+ height: {
22
+ type: String,
23
+ default: '300px'
24
+ }
25
+ },
26
+ data() {
27
+ return {
28
+ chart: null
29
+ }
30
+ },
31
+ mounted() {
32
+ this.$nextTick(() => {
33
+ this.initChart()
34
+ })
35
+ },
36
+ beforeDestroy() {
37
+ if (!this.chart) {
38
+ return
39
+ }
40
+ this.chart.dispose()
41
+ this.chart = null
42
+ },
43
+ methods: {
44
+ initChart() {
45
+ this.chart = echarts.init(this.$el, 'macarons')
46
+
47
+ this.chart.setOption({
48
+ tooltip: {
49
+ trigger: 'item',
50
+ formatter: '{a} <br/>{b} : {c} ({d}%)'
51
+ },
52
+ legend: {
53
+ left: 'center',
54
+ bottom: '10',
55
+ data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
56
+ },
57
+ series: [
58
+ {
59
+ name: 'WEEKLY WRITE ARTICLES',
60
+ type: 'pie',
61
+ roseType: 'radius',
62
+ radius: [15, 95],
63
+ center: ['50%', '38%'],
64
+ data: [
65
+ { value: 320, name: 'Industries' },
66
+ { value: 240, name: 'Technology' },
67
+ { value: 149, name: 'Forex' },
68
+ { value: 100, name: 'Gold' },
69
+ { value: 59, name: 'Forecasts' }
70
+ ],
71
+ animationEasing: 'cubicInOut',
72
+ animationDuration: 2600
73
+ }
74
+ ]
75
+ })
76
+ }
77
+ }
78
+ }
79
+ </script>
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <div :class="className" :style="{height:height,width:width}" />
3
+ </template>
4
+
5
+ <script>
6
+ import echarts from 'echarts'
7
+ require('echarts/theme/macarons') // echarts theme
8
+ import resize from './mixins/resize'
9
+
10
+ const animationDuration = 3000
11
+
12
+ export default {
13
+ mixins: [resize],
14
+ props: {
15
+ className: {
16
+ type: String,
17
+ default: 'chart'
18
+ },
19
+ width: {
20
+ type: String,
21
+ default: '100%'
22
+ },
23
+ height: {
24
+ type: String,
25
+ default: '300px'
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ chart: null
31
+ }
32
+ },
33
+ mounted() {
34
+ this.$nextTick(() => {
35
+ this.initChart()
36
+ })
37
+ },
38
+ beforeDestroy() {
39
+ if (!this.chart) {
40
+ return
41
+ }
42
+ this.chart.dispose()
43
+ this.chart = null
44
+ },
45
+ methods: {
46
+ initChart() {
47
+ this.chart = echarts.init(this.$el, 'macarons')
48
+
49
+ this.chart.setOption({
50
+ tooltip: {
51
+ trigger: 'axis',
52
+ axisPointer: { // 坐标轴指示器,坐标轴触发有效
53
+ type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
54
+ }
55
+ },
56
+ radar: {
57
+ radius: '66%',
58
+ center: ['50%', '42%'],
59
+ splitNumber: 8,
60
+ splitArea: {
61
+ areaStyle: {
62
+ color: 'rgba(127,95,132,.3)',
63
+ opacity: 1,
64
+ shadowBlur: 45,
65
+ shadowColor: 'rgba(0,0,0,.5)',
66
+ shadowOffsetX: 0,
67
+ shadowOffsetY: 15
68
+ }
69
+ },
70
+ indicator: [
71
+ { name: 'Sales', max: 10000 },
72
+ { name: 'Administration', max: 20000 },
73
+ { name: 'Information Technology', max: 20000 },
74
+ { name: 'Customer Support', max: 20000 },
75
+ { name: 'Development', max: 20000 },
76
+ { name: 'Marketing', max: 20000 }
77
+ ]
78
+ },
79
+ legend: {
80
+ left: 'center',
81
+ bottom: '10',
82
+ data: ['Allocated Budget', 'Expected Spending', 'Actual Spending']
83
+ },
84
+ series: [{
85
+ type: 'radar',
86
+ symbolSize: 0,
87
+ areaStyle: {
88
+ normal: {
89
+ shadowBlur: 13,
90
+ shadowColor: 'rgba(0,0,0,.2)',
91
+ shadowOffsetX: 0,
92
+ shadowOffsetY: 10,
93
+ opacity: 1
94
+ }
95
+ },
96
+ data: [
97
+ {
98
+ value: [5000, 7000, 12000, 11000, 15000, 14000],
99
+ name: 'Allocated Budget'
100
+ },
101
+ {
102
+ value: [4000, 9000, 15000, 15000, 13000, 11000],
103
+ name: 'Expected Spending'
104
+ },
105
+ {
106
+ value: [5500, 11000, 12000, 15000, 12000, 12000],
107
+ name: 'Actual Spending'
108
+ }
109
+ ],
110
+ animationDuration: animationDuration
111
+ }]
112
+ })
113
+ }
114
+ }
115
+ }
116
+ </script>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <li :class="{ completed: todo.done, editing: editing }" class="todo">
3
+ <div class="view">
4
+ <input
5
+ :checked="todo.done"
6
+ class="toggle"
7
+ type="checkbox"
8
+ @change="toggleTodo( todo)"
9
+ >
10
+ <label @dblclick="editing = true" v-text="todo.text" />
11
+ <button class="destroy" @click="deleteTodo( todo )" />
12
+ </div>
13
+ <input
14
+ v-show="editing"
15
+ v-focus="editing"
16
+ :value="todo.text"
17
+ class="edit"
18
+ @keyup.enter="doneEdit"
19
+ @keyup.esc="cancelEdit"
20
+ @blur="doneEdit"
21
+ >
22
+ </li>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ name: 'Todo',
28
+ directives: {
29
+ focus(el, { value }, { context }) {
30
+ if (value) {
31
+ context.$nextTick(() => {
32
+ el.focus()
33
+ })
34
+ }
35
+ }
36
+ },
37
+ props: {
38
+ todo: {
39
+ type: Object,
40
+ default: function() {
41
+ return {}
42
+ }
43
+ }
44
+ },
45
+ data() {
46
+ return {
47
+ editing: false
48
+ }
49
+ },
50
+ methods: {
51
+ deleteTodo(todo) {
52
+ this.$emit('deleteTodo', todo)
53
+ },
54
+ editTodo({ todo, value }) {
55
+ this.$emit('editTodo', { todo, value })
56
+ },
57
+ toggleTodo(todo) {
58
+ this.$emit('toggleTodo', todo)
59
+ },
60
+ doneEdit(e) {
61
+ const value = e.target.value.trim()
62
+ const { todo } = this
63
+ if (!value) {
64
+ this.deleteTodo({
65
+ todo
66
+ })
67
+ } else if (this.editing) {
68
+ this.editTodo({
69
+ todo,
70
+ value
71
+ })
72
+ this.editing = false
73
+ }
74
+ },
75
+ cancelEdit(e) {
76
+ e.target.value = this.todo.text
77
+ this.editing = false
78
+ }
79
+ }
80
+ }
81
+ </script>