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,116 @@
1
+ <template>
2
+ <div class="app-container">
3
+
4
+ <div>
5
+ <FilenameOption v-model="filename" />
6
+ <AutoWidthOption v-model="autoWidth" />
7
+ <BookTypeOption v-model="bookType" />
8
+ <el-button :loading="downloadLoading" style="margin:0 0 20px 20px;" type="primary" icon="el-icon-document" @click="handleDownload">
9
+ Export Excel
10
+ </el-button>
11
+ <a href="https://panjiachen.github.io/vue-element-admin-site/feature/component/excel.html" target="_blank" style="margin-left:15px;">
12
+ <el-tag type="info">Documentation</el-tag>
13
+ </a>
14
+ </div>
15
+
16
+ <el-table v-loading="listLoading" :data="list" element-loading-text="Loading..." border fit highlight-current-row>
17
+ <el-table-column align="center" label="Id" width="95">
18
+ <template slot-scope="scope">
19
+ {{ scope.$index }}
20
+ </template>
21
+ </el-table-column>
22
+ <el-table-column label="Title">
23
+ <template slot-scope="scope">
24
+ {{ scope.row.title }}
25
+ </template>
26
+ </el-table-column>
27
+ <el-table-column label="Author" width="110" align="center">
28
+ <template slot-scope="scope">
29
+ <el-tag>{{ scope.row.author }}</el-tag>
30
+ </template>
31
+ </el-table-column>
32
+ <el-table-column label="Readings" width="115" align="center">
33
+ <template slot-scope="scope">
34
+ {{ scope.row.pageviews }}
35
+ </template>
36
+ </el-table-column>
37
+ <el-table-column align="center" label="Date" width="220">
38
+ <template slot-scope="scope">
39
+ <i class="el-icon-time" />
40
+ <span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
41
+ </template>
42
+ </el-table-column>
43
+ </el-table>
44
+ </div>
45
+ </template>
46
+
47
+ <script>
48
+ import { fetchList } from '@/api/article'
49
+ import { parseTime } from '@/utils'
50
+ // options components
51
+ import FilenameOption from './components/FilenameOption'
52
+ import AutoWidthOption from './components/AutoWidthOption'
53
+ import BookTypeOption from './components/BookTypeOption'
54
+
55
+ export default {
56
+ name: 'ExportExcel',
57
+ components: { FilenameOption, AutoWidthOption, BookTypeOption },
58
+ data() {
59
+ return {
60
+ list: null,
61
+ listLoading: true,
62
+ downloadLoading: false,
63
+ filename: '',
64
+ autoWidth: true,
65
+ bookType: 'xlsx'
66
+ }
67
+ },
68
+ created() {
69
+ this.fetchData()
70
+ },
71
+ methods: {
72
+ fetchData() {
73
+ this.listLoading = true
74
+ fetchList().then(response => {
75
+ this.list = response.data.items
76
+ this.listLoading = false
77
+ })
78
+ },
79
+ handleDownload() {
80
+ this.downloadLoading = true
81
+ import('@/vendor/Export2Excel').then(excel => {
82
+ const tHeader = ['Id', 'Title', 'Author', 'Readings', 'Date']
83
+ const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
84
+ const list = this.list
85
+ const data = this.formatJson(filterVal, list)
86
+ excel.export_json_to_excel({
87
+ header: tHeader,
88
+ data,
89
+ filename: this.filename,
90
+ autoWidth: this.autoWidth,
91
+ bookType: this.bookType
92
+ })
93
+ this.downloadLoading = false
94
+ })
95
+ },
96
+ formatJson(filterVal, jsonData) {
97
+ return jsonData.map(v => filterVal.map(j => {
98
+ if (j === 'timestamp') {
99
+ return parseTime(v[j])
100
+ } else {
101
+ return v[j]
102
+ }
103
+ }))
104
+ }
105
+ }
106
+ }
107
+ </script>
108
+
109
+ <style>
110
+ .radio-label {
111
+ font-size: 14px;
112
+ color: #606266;
113
+ line-height: 40px;
114
+ padding: 0 12px 0 30px;
115
+ }
116
+ </style>
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div class="app-container">
3
+
4
+ <el-button :loading="downloadLoading" style="margin-bottom:20px" type="primary" icon="el-icon-document" @click="handleDownload">Export</el-button>
5
+
6
+ <el-table
7
+ ref="multipleTable"
8
+ v-loading="listLoading"
9
+ :data="list"
10
+ element-loading-text="Loading"
11
+ border
12
+ fit
13
+ highlight-current-row
14
+ >
15
+ <el-table-column align="center" label="Id" width="95">
16
+ <template slot-scope="scope">
17
+ {{ scope.$index }}
18
+ </template>
19
+ </el-table-column>
20
+ <el-table-column label="Main Information" align="center">
21
+ <el-table-column label="Title">
22
+ <template slot-scope="scope">
23
+ {{ scope.row.title }}
24
+ </template>
25
+ </el-table-column>
26
+ <el-table-column label="Author" width="110" align="center">
27
+ <template slot-scope="scope">
28
+ <el-tag>{{ scope.row.author }}</el-tag>
29
+ </template>
30
+ </el-table-column>
31
+ <el-table-column label="Readings" width="115" align="center">
32
+ <template slot-scope="scope">
33
+ {{ scope.row.pageviews }}
34
+ </template>
35
+ </el-table-column>
36
+ </el-table-column>
37
+ <el-table-column align="center" label="Date" width="220">
38
+ <template slot-scope="scope">
39
+ <i class="el-icon-time" />
40
+ <span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
41
+ </template>
42
+ </el-table-column>
43
+ </el-table>
44
+
45
+ </div>
46
+ </template>
47
+
48
+ <script>
49
+ import { fetchList } from '@/api/article'
50
+ import { parseTime } from '@/utils'
51
+
52
+ export default {
53
+ name: 'MergeHeader',
54
+ data() {
55
+ return {
56
+ list: null,
57
+ listLoading: true,
58
+ downloadLoading: false
59
+ }
60
+ },
61
+ created() {
62
+ this.fetchData()
63
+ },
64
+ methods: {
65
+ fetchData() {
66
+ this.listLoading = true
67
+ fetchList(this.listQuery).then(response => {
68
+ this.list = response.data.items
69
+ this.listLoading = false
70
+ })
71
+ },
72
+ handleDownload() {
73
+ this.downloadLoading = true
74
+ import('@/vendor/Export2Excel').then(excel => {
75
+ const multiHeader = [['Id', 'Main Information', '', '', 'Date']]
76
+ const header = ['', 'Title', 'Author', 'Readings', '']
77
+ const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
78
+ const list = this.list
79
+ const data = this.formatJson(filterVal, list)
80
+ const merges = ['A1:A2', 'B1:D1', 'E1:E2']
81
+ excel.export_json_to_excel({
82
+ multiHeader,
83
+ header,
84
+ merges,
85
+ data
86
+ })
87
+ this.downloadLoading = false
88
+ })
89
+ },
90
+ formatJson(filterVal, jsonData) {
91
+ return jsonData.map(v => filterVal.map(j => {
92
+ if (j === 'timestamp') {
93
+ return parseTime(v[j])
94
+ } else {
95
+ return v[j]
96
+ }
97
+ }))
98
+ }
99
+ }
100
+ }
101
+ </script>
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <el-input v-model="filename" placeholder="Please enter the file name (default excel-list)" style="width:350px;" prefix-icon="el-icon-document" />
4
+ <el-button :loading="downloadLoading" style="margin-bottom:20px" type="primary" icon="el-icon-document" @click="handleDownload">
5
+ Export Selected Items
6
+ </el-button>
7
+ <a href="https://panjiachen.github.io/vue-element-admin-site/feature/component/excel.html" target="_blank" style="margin-left:15px;">
8
+ <el-tag type="info">Documentation</el-tag>
9
+ </a>
10
+ <el-table
11
+ ref="multipleTable"
12
+ v-loading="listLoading"
13
+ :data="list"
14
+ element-loading-text="拼命加载中"
15
+ border
16
+ fit
17
+ highlight-current-row
18
+ @selection-change="handleSelectionChange"
19
+ >
20
+ <el-table-column type="selection" align="center" />
21
+ <el-table-column align="center" label="Id" width="95">
22
+ <template slot-scope="scope">
23
+ {{ scope.$index }}
24
+ </template>
25
+ </el-table-column>
26
+ <el-table-column label="Title">
27
+ <template slot-scope="scope">
28
+ {{ scope.row.title }}
29
+ </template>
30
+ </el-table-column>
31
+ <el-table-column label="Author" width="110" align="center">
32
+ <template slot-scope="scope">
33
+ <el-tag>{{ scope.row.author }}</el-tag>
34
+ </template>
35
+ </el-table-column>
36
+ <el-table-column label="Readings" width="115" align="center">
37
+ <template slot-scope="scope">
38
+ {{ scope.row.pageviews }}
39
+ </template>
40
+ </el-table-column>
41
+ <el-table-column align="center" label="PDate" width="220">
42
+ <template slot-scope="scope">
43
+ <i class="el-icon-time" />
44
+ <span>{{ scope.row.display_time }}</span>
45
+ </template>
46
+ </el-table-column>
47
+ </el-table>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ import { fetchList } from '@/api/article'
53
+
54
+ export default {
55
+ name: 'SelectExcel',
56
+ data() {
57
+ return {
58
+ list: null,
59
+ listLoading: true,
60
+ multipleSelection: [],
61
+ downloadLoading: false,
62
+ filename: ''
63
+ }
64
+ },
65
+ created() {
66
+ this.fetchData()
67
+ },
68
+ methods: {
69
+ fetchData() {
70
+ this.listLoading = true
71
+ fetchList(this.listQuery).then(response => {
72
+ this.list = response.data.items
73
+ this.listLoading = false
74
+ })
75
+ },
76
+ handleSelectionChange(val) {
77
+ this.multipleSelection = val
78
+ },
79
+ handleDownload() {
80
+ if (this.multipleSelection.length) {
81
+ this.downloadLoading = true
82
+ import('@/vendor/Export2Excel').then(excel => {
83
+ const tHeader = ['Id', 'Title', 'Author', 'Readings', 'Date']
84
+ const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
85
+ const list = this.multipleSelection
86
+ const data = this.formatJson(filterVal, list)
87
+ excel.export_json_to_excel({
88
+ header: tHeader,
89
+ data,
90
+ filename: this.filename
91
+ })
92
+ this.$refs.multipleTable.clearSelection()
93
+ this.downloadLoading = false
94
+ })
95
+ } else {
96
+ this.$message({
97
+ message: 'Please select at least one item',
98
+ type: 'warning'
99
+ })
100
+ }
101
+ },
102
+ formatJson(filterVal, jsonData) {
103
+ return jsonData.map(v => filterVal.map(j => v[j]))
104
+ }
105
+ }
106
+ }
107
+ </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <upload-excel-component :on-success="handleSuccess" :before-upload="beforeUpload" />
4
+ <el-table :data="tableData" border highlight-current-row style="width: 100%;margin-top:20px;">
5
+ <el-table-column v-for="item of tableHeader" :key="item" :prop="item" :label="item" />
6
+ </el-table>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import UploadExcelComponent from '@/components/UploadExcel/index.vue'
12
+
13
+ export default {
14
+ name: 'UploadExcel',
15
+ components: { UploadExcelComponent },
16
+ data() {
17
+ return {
18
+ tableData: [],
19
+ tableHeader: []
20
+ }
21
+ },
22
+ methods: {
23
+ beforeUpload(file) {
24
+ const isLt1M = file.size / 1024 / 1024 < 1
25
+
26
+ if (isLt1M) {
27
+ return true
28
+ }
29
+
30
+ this.$message({
31
+ message: 'Please do not upload files larger than 1m in size.',
32
+ type: 'warning'
33
+ })
34
+ return false
35
+ },
36
+ handleSuccess({ results, header }) {
37
+ this.tableData = results
38
+ this.tableHeader = header
39
+ }
40
+ }
41
+ }
42
+ </script>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div class="app-container">
3
+ <aside>
4
+ The guide page is useful for some people who entered the project for the first time. You can briefly introduce the
5
+ features of the project. Demo is based on
6
+ <a href="https://github.com/kamranahmedse/driver.js" target="_blank">driver.js.</a>
7
+ </aside>
8
+ <el-button icon="el-icon-question" type="primary" @click.prevent.stop="guide">
9
+ Show Guide
10
+ </el-button>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ import Driver from 'driver.js' // import driver.js
16
+ import 'driver.js/dist/driver.min.css' // import driver.js css
17
+ import steps from './steps'
18
+
19
+ export default {
20
+ name: 'Guide',
21
+ data() {
22
+ return {
23
+ driver: null
24
+ }
25
+ },
26
+ mounted() {
27
+ this.driver = new Driver()
28
+ },
29
+ methods: {
30
+ guide() {
31
+ this.driver.defineSteps(steps)
32
+ this.driver.start()
33
+ }
34
+ }
35
+ }
36
+ </script>
@@ -0,0 +1,53 @@
1
+ const steps = [
2
+ {
3
+ element: '#hamburger-container',
4
+ popover: {
5
+ title: 'Hamburger',
6
+ description: 'Open && Close sidebar',
7
+ position: 'bottom'
8
+ }
9
+ },
10
+ {
11
+ element: '#breadcrumb-container',
12
+ popover: {
13
+ title: 'Breadcrumb',
14
+ description: 'Indicate the current page location',
15
+ position: 'bottom'
16
+ }
17
+ },
18
+ {
19
+ element: '#header-search',
20
+ popover: {
21
+ title: 'Page Search',
22
+ description: 'Page search, quick navigation',
23
+ position: 'left'
24
+ }
25
+ },
26
+ {
27
+ element: '#screenfull',
28
+ popover: {
29
+ title: 'Screenfull',
30
+ description: 'Set the page into fullscreen',
31
+ position: 'left'
32
+ }
33
+ },
34
+ {
35
+ element: '#size-select',
36
+ popover: {
37
+ title: 'Switch Size',
38
+ description: 'Switch the system size',
39
+ position: 'left'
40
+ }
41
+ },
42
+ {
43
+ element: '#tags-view-container',
44
+ popover: {
45
+ title: 'Tags view',
46
+ description: 'The history of the page you visited',
47
+ position: 'bottom'
48
+ },
49
+ padding: 0
50
+ }
51
+ ]
52
+
53
+ export default steps
@@ -0,0 +1,3 @@
1
+ const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']
2
+
3
+ export default elementIcons
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div class="icons-container">
3
+ <aside>
4
+ <a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
5
+ </a>
6
+ </aside>
7
+ <el-tabs type="border-card">
8
+ <el-tab-pane label="Icons">
9
+ <div class="grid">
10
+ <div v-for="item of svgIcons" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
11
+ <el-tooltip placement="top">
12
+ <div slot="content">
13
+ {{ generateIconCode(item) }}
14
+ </div>
15
+ <div class="icon-item">
16
+ <svg-icon :icon-class="item" class-name="disabled" />
17
+ <span>{{ item }}</span>
18
+ </div>
19
+ </el-tooltip>
20
+ </div>
21
+ </div>
22
+ </el-tab-pane>
23
+ <el-tab-pane label="Element-UI Icons">
24
+ <div class="grid">
25
+ <div v-for="item of elementIcons" :key="item" @click="handleClipboard(generateElementIconCode(item),$event)">
26
+ <el-tooltip placement="top">
27
+ <div slot="content">
28
+ {{ generateElementIconCode(item) }}
29
+ </div>
30
+ <div class="icon-item">
31
+ <i :class="'el-icon-' + item" />
32
+ <span>{{ item }}</span>
33
+ </div>
34
+ </el-tooltip>
35
+ </div>
36
+ </div>
37
+ </el-tab-pane>
38
+ </el-tabs>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ import clipboard from '@/utils/clipboard'
44
+ import svgIcons from './svg-icons'
45
+ import elementIcons from './element-icons'
46
+
47
+ export default {
48
+ name: 'Icons',
49
+ data() {
50
+ return {
51
+ svgIcons,
52
+ elementIcons
53
+ }
54
+ },
55
+ methods: {
56
+ generateIconCode(symbol) {
57
+ return `<svg-icon icon-class="${symbol}" />`
58
+ },
59
+ generateElementIconCode(symbol) {
60
+ return `<i class="el-icon-${symbol}" />`
61
+ },
62
+ handleClipboard(text, event) {
63
+ clipboard(text, event)
64
+ }
65
+ }
66
+ }
67
+ </script>
68
+
69
+ <style lang="scss" scoped>
70
+ .icons-container {
71
+ margin: 10px 20px 0;
72
+ overflow: hidden;
73
+
74
+ .grid {
75
+ position: relative;
76
+ display: grid;
77
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
78
+ }
79
+
80
+ .icon-item {
81
+ margin: 20px;
82
+ height: 85px;
83
+ text-align: center;
84
+ width: 100px;
85
+ float: left;
86
+ font-size: 30px;
87
+ color: #24292e;
88
+ cursor: pointer;
89
+ }
90
+
91
+ span {
92
+ display: block;
93
+ font-size: 16px;
94
+ margin-top: 10px;
95
+ }
96
+
97
+ .disabled {
98
+ pointer-events: none;
99
+ }
100
+ }
101
+ </style>
@@ -0,0 +1,10 @@
1
+ const req = require.context('../../icons/svg', false, /\.svg$/)
2
+ const requireAll = requireContext => requireContext.keys()
3
+
4
+ const re = /\.\/(.*)\.svg/
5
+
6
+ const svgIcons = requireAll(req).map(i => {
7
+ return i.match(re)[1]
8
+ })
9
+
10
+ export default svgIcons
@@ -0,0 +1,15 @@
1
+ <script>
2
+ export default {
3
+ name: 'AuthRedirect',
4
+ created() {
5
+ const hash = window.location.search.slice(1)
6
+ if (window.localStorage) {
7
+ window.localStorage.setItem('x-admin-oauth-code', hash)
8
+ window.close()
9
+ }
10
+ },
11
+ render: function(h) {
12
+ return h() // avoid warning message
13
+ }
14
+ }
15
+ </script>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <div class="social-signup-container">
3
+ <div class="sign-btn" @click="wechatHandleClick('wechat')">
4
+ <span class="wx-svg-container"><svg-icon icon-class="wechat" class="icon" /></span>
5
+ WeChat
6
+ </div>
7
+ <div class="sign-btn" @click="tencentHandleClick('tencent')">
8
+ <span class="qq-svg-container"><svg-icon icon-class="qq" class="icon" /></span>
9
+ QQ
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ // import openWindow from '@/utils/open-window'
16
+
17
+ export default {
18
+ name: 'SocialSignin',
19
+ methods: {
20
+ wechatHandleClick(thirdpart) {
21
+ alert('ok')
22
+ // this.$store.commit('SET_AUTH_TYPE', thirdpart)
23
+ // const appid = 'xxxxx'
24
+ // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
25
+ // const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect'
26
+ // openWindow(url, thirdpart, 540, 540)
27
+ },
28
+ tencentHandleClick(thirdpart) {
29
+ alert('ok')
30
+ // this.$store.commit('SET_AUTH_TYPE', thirdpart)
31
+ // const client_id = 'xxxxx'
32
+ // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
33
+ // const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri
34
+ // openWindow(url, thirdpart, 540, 540)
35
+ }
36
+ }
37
+ }
38
+ </script>
39
+
40
+ <style lang="scss" scoped>
41
+ .social-signup-container {
42
+ margin: 20px 0;
43
+ .sign-btn {
44
+ display: inline-block;
45
+ cursor: pointer;
46
+ }
47
+ .icon {
48
+ color: #fff;
49
+ font-size: 24px;
50
+ margin-top: 8px;
51
+ }
52
+ .wx-svg-container,
53
+ .qq-svg-container {
54
+ display: inline-block;
55
+ width: 40px;
56
+ height: 40px;
57
+ line-height: 40px;
58
+ text-align: center;
59
+ padding-top: 1px;
60
+ border-radius: 4px;
61
+ margin-bottom: 20px;
62
+ margin-right: 5px;
63
+ }
64
+ .wx-svg-container {
65
+ background-color: #24da70;
66
+ }
67
+ .qq-svg-container {
68
+ background-color: #6BA2D6;
69
+ margin-left: 50px;
70
+ }
71
+ }
72
+ </style>