diff --git a/README.md b/README.md index 4ea93fe..ad6254d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vue3-element-admin -这个模板使用了最新的 vue3 和 element-plus UI框架,vite 构建工具、pinia 状态管理、vue-router 路由管理、mockjs 数据模拟。功能从Vue Element Admin 移植而来,详细使用可以参考[该文档](https://panjiachen.github.io/vue-element-admin-site/zh/guide/essentials/router-and-nav.html)。 +这个模板使用了最新的 vue3 和 element-plus UI 框架,vite 构建工具、pinia 状态管理、vue-router 路由管理、mockjs 数据模拟。功能从 Vue Element Admin 移植而来,详细使用可以参考[该文档](https://panjiachen.github.io/vue-element-admin-site/zh/guide/essentials/router-and-nav.html)。 # 在线示例 @@ -8,13 +8,13 @@ [element plus](https://element-plus.midfar.com/) -## 推荐的IDE工具和插件 +## 推荐的 IDE 工具和插件 [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (禁用 Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). -## Vite构建工具配置 +## Vite 构建工具配置 -参考 [Vite配置](https://vitejs.dev/config/). +参考 [Vite 配置](https://vitejs.dev/config/). ## 安装依赖 @@ -44,10 +44,10 @@ npm run lint 如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink: - +wechat: midfar-sun ## License [MIT](https://opensource.org/licenses/MIT) -Copyright (c) 2022-present, Midfar Sun \ No newline at end of file +Copyright (c) 2022-present, Midfar Sun diff --git a/components.d.ts b/components.d.ts index f6c18da..268ad2d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -77,6 +77,7 @@ declare module '@vue/runtime-core' { Sticky: typeof import('./src/components/Sticky/index.vue')['default'] SvgIcon: typeof import('./src/components/SvgIcon/index.vue')['default'] Tinymce: typeof import('./src/components/Tinymce/index.vue')['default'] + UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default'] VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default'] } export interface ComponentCustomProperties { diff --git a/src/components/UploadExcel/index.vue b/src/components/UploadExcel/index.vue new file mode 100644 index 0000000..1fec6d5 --- /dev/null +++ b/src/components/UploadExcel/index.vue @@ -0,0 +1,147 @@ + + + + + Drop excel file here or + + Browse + + + + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 881a354..bdf67b3 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -7,8 +7,11 @@ :class="{ 'submenu-title-noDropdown': !isNest }"> - + + + + {{ onlyOneChild.meta.title }} @@ -19,7 +22,11 @@ - + + + + + {{ item.meta.title }} { if (this.isItemHidden) { @@ -119,4 +132,12 @@ export default defineComponent({ .left-sub-menu :deep(.el-sub-menu__title) { display: block; } + +.el-svg-icon { + width: 1em; + height: 1em; + vertical-align: -0.15em; + fill: currentColor; + overflow: hidden; +} diff --git a/src/router/index.ts b/src/router/index.ts index d97fcae..67bb33e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,5 +1,7 @@ +import { markRaw } from 'vue'; import { createRouter, createWebHashHistory } from 'vue-router'; // createWebHashHistory, createWebHistory import type { Router, RouteRecordRaw, RouteComponent } from 'vue-router'; +import { Help as IconHelp } from '@element-plus/icons-vue'; /* Layout */ const Layout = ():RouteComponent => import('@/layout/index.vue'); @@ -178,7 +180,7 @@ export const asyncRoutes:RouteRecordRaw[] = [ name: 'Example', meta: { title: 'Example', - icon: 'el-icon-s-help' + icon: markRaw(IconHelp) }, children: [ { @@ -253,42 +255,42 @@ export const asyncRoutes:RouteRecordRaw[] = [ ] }, - // { - // path: '/excel', - // component: Layout, - // redirect: '/excel/export-excel', - // name: 'Excel', - // meta: { - // title: 'Excel', - // icon: 'excel' - // }, - // children: [ - // { - // path: 'export-excel', - // component: () => import('@/views/excel/export-excel'), - // name: 'ExportExcel', - // meta: { title: 'Export Excel' } - // }, - // { - // path: 'export-selected-excel', - // component: () => import('@/views/excel/select-excel'), - // name: 'SelectExcel', - // meta: { title: 'Export Selected' } - // }, - // { - // path: 'export-merge-header', - // component: () => import('@/views/excel/merge-header'), - // name: 'MergeHeader', - // meta: { title: 'Merge Header' } - // }, - // { - // path: 'upload-excel', - // component: () => import('@/views/excel/upload-excel'), - // name: 'UploadExcel', - // meta: { title: 'Upload Excel' } - // } - // ] - // }, + { + path: '/excel', + component: Layout, + redirect: '/excel/export-excel', + name: 'Excel', + meta: { + title: 'Excel', + icon: 'excel' + }, + children: [ + { + path: 'export-excel', + component: () => import('@/views/excel/export-excel.vue'), + name: 'ExportExcel', + meta: { title: 'Export Excel' } + }, + { + path: 'export-selected-excel', + component: () => import('@/views/excel/select-excel.vue'), + name: 'SelectExcel', + meta: { title: 'Export Selected' } + }, + { + path: 'export-merge-header', + component: () => import('@/views/excel/merge-header.vue'), + name: 'MergeHeader', + meta: { title: 'Merge Header' } + }, + { + path: 'upload-excel', + component: () => import('@/views/excel/upload-excel.vue'), + name: 'UploadExcel', + meta: { title: 'Upload Excel' } + } + ] + }, { path: '/zip', diff --git a/src/views/excel/components/AutoWidthOption.vue b/src/views/excel/components/AutoWidthOption.vue new file mode 100644 index 0000000..abbdc72 --- /dev/null +++ b/src/views/excel/components/AutoWidthOption.vue @@ -0,0 +1,36 @@ + + + Cell Auto-Width: + + + True + + + False + + + + + + diff --git a/src/views/excel/components/BookTypeOption.vue b/src/views/excel/components/BookTypeOption.vue new file mode 100644 index 0000000..d97bcdd --- /dev/null +++ b/src/views/excel/components/BookTypeOption.vue @@ -0,0 +1,41 @@ + + + Book Type: + + + + + + + diff --git a/src/views/excel/components/FilenameOption.vue b/src/views/excel/components/FilenameOption.vue new file mode 100644 index 0000000..84f4bda --- /dev/null +++ b/src/views/excel/components/FilenameOption.vue @@ -0,0 +1,35 @@ + + + Filename: + + + + + diff --git a/src/views/excel/export-excel.vue b/src/views/excel/export-excel.vue new file mode 100644 index 0000000..4987daf --- /dev/null +++ b/src/views/excel/export-excel.vue @@ -0,0 +1,120 @@ + + + + + + + + + Export Excel + + + Documentation + + + + + + + {{ scope.$index }} + + + + + {{ scope.row.title }} + + + + + {{ scope.row.author }} + + + + + {{ scope.row.pageviews }} + + + + + + {{ parseTime(scope.row.timestamp, '{y}-{m}-{d} {h}:{i}') }} + + + + + + + + + diff --git a/src/views/excel/merge-header.vue b/src/views/excel/merge-header.vue new file mode 100644 index 0000000..2e0eb53 --- /dev/null +++ b/src/views/excel/merge-header.vue @@ -0,0 +1,106 @@ + + + + Export + + + + + {{ scope.$index }} + + + + + + {{ scope.row.title }} + + + + + {{ scope.row.author }} + + + + + {{ scope.row.pageviews }} + + + + + + + {{ parseTime(scope.row.timestamp, '{y}-{m}-{d} {h}:{i}') }} + + + + + + + + diff --git a/src/views/excel/select-excel.vue b/src/views/excel/select-excel.vue new file mode 100644 index 0000000..ffb457e --- /dev/null +++ b/src/views/excel/select-excel.vue @@ -0,0 +1,113 @@ + + + + + + Export Selected Items + + + Documentation + + + + + + + {{ scope.$index }} + + + + + {{ scope.row.title }} + + + + + {{ scope.row.author }} + + + + + {{ scope.row.pageviews }} + + + + + + {{ scope.row.display_time }} + + + + + + + diff --git a/src/views/excel/upload-excel.vue b/src/views/excel/upload-excel.vue new file mode 100644 index 0000000..fc15d6d --- /dev/null +++ b/src/views/excel/upload-excel.vue @@ -0,0 +1,43 @@ + + + + + + + + + +