@@ -66,7 +66,7 @@ const handleGetArticleList = async () => {
* @desc: 添加拖拽表格
*/
const initDrapTable = () => {
- const tbody = document.querySelectorAll('.drag-table .el-table__body-wrapper > table > tbody')[0] as unknown as HTMLElement
+ const tbody = document.querySelectorAll('.drag-table .el-table__body-wrapper table > tbody')[0] as unknown as HTMLElement
Sortable.create(tbody, {
animation: 100,
onEnd(evt) {
diff --git a/vite.config.ts b/vite.config.ts
index d9789be..c37cc17 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,13 +1,25 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
+//elementplus按需引入
+import AutoImport from 'unplugin-auto-import/vite'
+import Components from 'unplugin-vue-components/vite'
+import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
base: './',
define: {
'process.env': {}
},
- plugins: [vue()],
+ plugins: [
+ vue(),
+ AutoImport({
+ resolvers: [ElementPlusResolver()]
+ }),
+ Components({
+ resolvers: [ElementPlusResolver()]
+ })
+ ],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
From 2d9429d1292dddce3811c500939f150addceefd6 Mon Sep 17 00:00:00 2001
From: lpyhutu <1048672466@qq.com>
Date: Wed, 23 Feb 2022 15:17:18 +0800
Subject: [PATCH 04/19] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0elementplus?=
=?UTF-8?q?=E6=8C=89=E9=9C=80=E5=BC=95=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components.d.ts | 7 -------
1 file changed, 7 deletions(-)
diff --git a/components.d.ts b/components.d.ts
index 33f180d..f8c3e81 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -7,7 +7,6 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
- ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -20,17 +19,11 @@ declare module 'vue' {
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
- ElPagination: typeof import('element-plus/es')['ElPagination']
- ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
- ElTable: typeof import('element-plus/es')['ElTable']
- ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
- ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
Index: typeof import('./src/components/Breadcrumb/Index.vue')['default']
- Loading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
From fde53d18d028972219750e065c504754b36760b1 Mon Sep 17 00:00:00 2001
From: lpyhutu <1048672466@qq.com>
Date: Wed, 23 Feb 2022 16:38:44 +0800
Subject: [PATCH 05/19] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0dayjs=E6=8A=A5?=
=?UTF-8?q?=E9=94=99=E8=A7=A3=E5=86=B3=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 16 +++++++++++++---
components.d.ts | 7 +++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 0d89a33..274df44 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
## 简介
-[vue3+vite+elemetnplus+admin](https://github.com/lpya/vue3-vite-elementplus-admin)是一个后台前端解决方案,它基于vue3和element-plus实现。它使用了最新的前端技术栈,内置了动态路由、权限验证等业务模型,后续会提供更多的功能组件...
+[vue3+vite+elemetnplus+admin](https://github.com/lpya/vue3-vite-elementplus-admin)是一个后台前端解决方案,它基于 vue3 和 element-plus 实现。它使用了最新的前端技术栈,内置了动态路由、权限验证等业务模型,后续会提供更多的功能组件...
## 目录结构
@@ -41,11 +41,12 @@
├── index.html # html模板
├── .env.development # 配置文件
├── .env.production # 配置文件
-├── package.json # package.json
+├── package.json # package.json
├── README.md # README.md
├── tsconfig.json # ts配置
└── vite.config.ts # vite配置
```
+
## 开发
```
@@ -62,6 +63,7 @@ npm install
npm run dev
```
+
## 发布
```
@@ -72,6 +74,14 @@ npm run preview
npm run build
```
+## 其他问题
+
+运行出现下面错误时,先把 App.vue template 里面内容注释掉再随便添加个 div,然后重新运行,该报错就不会出现了,好像更新了elementplus才出现的问题
+
+```
+Uncaught SyntaxError: The requested module '/node_modules/_dayjs@1.10.7@dayjs/dayjs.min.js' does not provide an export named 'default'
+```
+
## 感谢
[vuejs [ vue ]](https://github.com/vuejs/vue)
@@ -82,4 +92,4 @@ npm run build
[PanJiaChen [ vue-element-admin ]](https://github.com/PanJiaChen/vue-element-admin)
-...
\ No newline at end of file
+...
diff --git a/components.d.ts b/components.d.ts
index f8c3e81..33f180d 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -7,6 +7,7 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
+ ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -19,11 +20,17 @@ declare module 'vue' {
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+ ElPagination: typeof import('element-plus/es')['ElPagination']
+ ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
+ ElTable: typeof import('element-plus/es')['ElTable']
+ ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+ ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
Index: typeof import('./src/components/Breadcrumb/Index.vue')['default']
+ Loading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
From ef757873fe66581c7cf32b80069ff7f4d5994de8 Mon Sep 17 00:00:00 2001
From: lpyhutu <1048672466@qq.com>
Date: Wed, 23 Feb 2022 16:52:19 +0800
Subject: [PATCH 06/19] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Delementplus=20me?=
=?UTF-8?q?ssage=E6=A0=B7=E5=BC=8F=E9=94=99=E4=B9=B1=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
auto-imports.d.ts | 3 ++-
src/permission.ts | 1 -
src/views/login/Index.vue | 1 -
src/views/table/complex-table/Index.vue | 4 +---
4 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/auto-imports.d.ts b/auto-imports.d.ts
index 5e073f1..533f285 100644
--- a/auto-imports.d.ts
+++ b/auto-imports.d.ts
@@ -1,6 +1,7 @@
// Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control
declare global {
-
+ const ElMessage: typeof import('element-plus/es')['ElMessage']
+ const ElNotification: typeof import('element-plus/es')['ElNotification']
}
export {}
diff --git a/src/permission.ts b/src/permission.ts
index f438ccf..ec20fe2 100644
--- a/src/permission.ts
+++ b/src/permission.ts
@@ -9,7 +9,6 @@ import { asyncRoutes } from '@/router/asyncRoutes'
import store from '@/store'
import { GENERATE_ROUTES } from '@/store/type'
import { getToken } from '@/utils/auth'
-import { ElMessage } from 'element-plus'
NProgress.configure({ showSpinner: false })
const whiteList = ['/'] // no redirect whitelist
diff --git a/src/views/login/Index.vue b/src/views/login/Index.vue
index b0b93a2..47b5360 100644
--- a/src/views/login/Index.vue
+++ b/src/views/login/Index.vue
@@ -30,7 +30,6 @@ import { reactive, ref } from 'vue'
import { useStore } from 'vuex'
import { useRoute, useRouter } from 'vue-router'
import { USER_LOGIN } from '@/store/type'
-import { ElMessage } from 'element-plus'
import { Values } from 'async-validator'
import { validUsername } from '@/utils/validate'
diff --git a/src/views/table/complex-table/Index.vue b/src/views/table/complex-table/Index.vue
index c51c059..69aa361 100644
--- a/src/views/table/complex-table/Index.vue
+++ b/src/views/table/complex-table/Index.vue
@@ -3,7 +3,7 @@
* @Author: hutu
* @Date: 2022-01-12 17:32:00
* @LastEditors: hutu
- * @LastEditTime: 2022-01-17 10:37:41
+ * @LastEditTime: 2022-02-23 16:48:02
-->
@@ -60,8 +60,6 @@
diff --git a/src/views/dashboard/components/ArticleTotal.vue b/src/views/dashboard/components/ArticleTotal.vue
new file mode 100644
index 0000000..56abdae
--- /dev/null
+++ b/src/views/dashboard/components/ArticleTotal.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
diff --git a/src/views/dashboard/components/BarChart.vue b/src/views/dashboard/components/BarChart.vue
deleted file mode 100644
index ae6352a..0000000
--- a/src/views/dashboard/components/BarChart.vue
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/dashboard/components/FlowTrend.vue b/src/views/dashboard/components/FlowTrend.vue
new file mode 100644
index 0000000..392636a
--- /dev/null
+++ b/src/views/dashboard/components/FlowTrend.vue
@@ -0,0 +1,210 @@
+
+
+
+
+
diff --git a/src/views/dashboard/components/LineChart.vue b/src/views/dashboard/components/LineChart.vue
deleted file mode 100644
index 81d0093..0000000
--- a/src/views/dashboard/components/LineChart.vue
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/dashboard/components/OnlineChart.vue b/src/views/dashboard/components/OnlineChart.vue
new file mode 100644
index 0000000..76b0f26
--- /dev/null
+++ b/src/views/dashboard/components/OnlineChart.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
deleted file mode 100644
index 7ee92f2..0000000
--- a/src/views/dashboard/components/PanelGroup.vue
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
{{ item.num }}
-
-
{{ item.title }}
-
- 较昨天
- {{ item.percent * 100 }}%
- {{ item.percent * 100 }}%
- {{ item.percent * 100 }}%
-
-
-
-
-
-
-
-
-
diff --git a/src/views/dashboard/components/PieChart.vue b/src/views/dashboard/components/PieChart.vue
deleted file mode 100644
index dd4674c..0000000
--- a/src/views/dashboard/components/PieChart.vue
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/dashboard/components/TestChart.vue b/src/views/dashboard/components/TestChart.vue
deleted file mode 100644
index e2c9d8d..0000000
--- a/src/views/dashboard/components/TestChart.vue
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/views/dashboard/components/UserDistributionMap.vue b/src/views/dashboard/components/UserDistributionMap.vue
new file mode 100644
index 0000000..85d388b
--- /dev/null
+++ b/src/views/dashboard/components/UserDistributionMap.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
diff --git a/src/views/dashboard/components/UserDistributionRank.vue b/src/views/dashboard/components/UserDistributionRank.vue
new file mode 100644
index 0000000..5d2b3d3
--- /dev/null
+++ b/src/views/dashboard/components/UserDistributionRank.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
diff --git a/src/views/dashboard/components/UserTotal.vue b/src/views/dashboard/components/UserTotal.vue
new file mode 100644
index 0000000..56dd1eb
--- /dev/null
+++ b/src/views/dashboard/components/UserTotal.vue
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
实时在线人数
+
+
+
+
+
+
diff --git a/src/views/dashboard/components/VisitorDevice.vue b/src/views/dashboard/components/VisitorDevice.vue
new file mode 100644
index 0000000..7d2614b
--- /dev/null
+++ b/src/views/dashboard/components/VisitorDevice.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
diff --git a/src/views/dashboard/components/datas.ts b/src/views/dashboard/components/datas.ts
new file mode 100644
index 0000000..5a3ecd7
--- /dev/null
+++ b/src/views/dashboard/components/datas.ts
@@ -0,0 +1,17 @@
+export const UserRankChina = [
+ { name: '广东省', value: 290 },
+ { name: '浙江省', value: 180 },
+ { name: '上海市', value: 164 },
+ { name: '江苏省', value: 155 },
+ { name: '四川省', value: 142 },
+ { name: '福建省', value: 55 },
+ { name: '湖南省', value: 39 }
+]
+
+export const UserRankWorld = [
+ { name: '中国', value: 199 },
+ { name: '美国', value: 180 },
+ { name: '日本', value: 39 },
+ { name: '法国', value: 55 },
+ { name: '英国', value: 15 }
+]
diff --git a/src/views/login/Index.vue b/src/views/login/Index.vue
index 47b5360..9fc67f5 100644
--- a/src/views/login/Index.vue
+++ b/src/views/login/Index.vue
@@ -1,84 +1,103 @@
-
-
Vue3-Vite-ElementPlus-admin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ state.loading ? '登陆中' : '登陆' }}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+ {{ loading ? '登陆中' : '登陆' }}
+
+
-
diff --git a/src/views/login/components/Owl.vue b/src/views/login/components/Owl.vue
new file mode 100644
index 0000000..17f99f9
--- /dev/null
+++ b/src/views/login/components/Owl.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
diff --git a/src/views/login/index.scss b/src/views/login/index.scss
new file mode 100644
index 0000000..15b8e80
--- /dev/null
+++ b/src/views/login/index.scss
@@ -0,0 +1,28 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ .login-container {
+ position: relative;
+ .login-card {
+ padding: 20px;
+ width: 400px;
+ .el-form {
+ .el-button {
+ margin-top: 15px;
+ width: 100%;
+ }
+ .code {
+ display: flex;
+ width: 100%;
+ img {
+ cursor: pointer;
+ height: 33px;
+ background-color: #fff
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/views/nested/menu1-1/Index.vue b/src/views/nested/menu1-1/Index.vue
index d1c4091..84ff5c8 100644
--- a/src/views/nested/menu1-1/Index.vue
+++ b/src/views/nested/menu1-1/Index.vue
@@ -1,10 +1,3 @@
-
diff --git a/src/views/nested/menu1-2/Index.vue b/src/views/nested/menu1-2/Index.vue
index ffba552..c6e104d 100644
--- a/src/views/nested/menu1-2/Index.vue
+++ b/src/views/nested/menu1-2/Index.vue
@@ -1,11 +1,3 @@
-
-