From 70f089acf7a2241469183d7364410912389d6d7f Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Wed, 14 Apr 2021 23:00:38 +0800 Subject: [PATCH 001/183] =?UTF-8?q?'admin-21.04.14:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96=E3=80=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?eslint=E8=A7=84=E5=88=99'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + package.json | 14 +++++++------- src/router/index.ts | 2 +- src/views/layout/footer/index.vue | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ea58048..5916d53 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,6 +42,7 @@ module.exports = { 'vue/no-template-key': 'off', 'vue/no-v-html': 'off', 'vue/comment-directive': 'off', + 'vue/no-parsing-error': 'off', 'no-use-before-define': 'off', 'no-restricted-globals': 'off', 'no-restricted-syntax': 'off', diff --git a/package.json b/package.json index 8fb109c..5eee0e6 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,14 @@ "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/" }, "dependencies": { - "@antv/g6": "^4.2.5", + "@antv/g6": "^4.2.6", "axios": "^0.21.1", "clipboard": "^2.0.8", "countup.js": "^2.0.7", "cropperjs": "^1.5.11", "echarts": "^5.0.2", "echarts-wordcloud": "^2.0.0", - "element-plus": "^1.0.2-beta.39", + "element-plus": "^1.0.2-beta.40", "mitt": "^2.1.0", "nprogress": "^0.2.0", "print-js": "^1.6.0", @@ -22,7 +22,7 @@ "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^3.0.5", - "vue-i18n": "^9.1.3", + "vue-i18n": "^9.1.4", "vue-router": "^4.0.2", "vue-web-screen-shot": "^1.1.8", "vuex": "^4.0.0-rc.2", @@ -34,13 +34,13 @@ "@types/node": "^14.14.37", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", - "@typescript-eslint/eslint-plugin": "^4.21.0", - "@typescript-eslint/parser": "^4.21.0", + "@typescript-eslint/eslint-plugin": "^4.22.0", + "@typescript-eslint/parser": "^4.22.0", "@vitejs/plugin-vue": "^1.2.1", "@vue/compiler-sfc": "^3.0.11", "dotenv": "^8.2.0", - "eslint": "^7.23.0", - "eslint-plugin-vue": "^7.8.0", + "eslint": "^7.24.0", + "eslint-plugin-vue": "^7.9.0", "prettier": "^2.2.1", "sass": "^1.32.8", "sass-loader": "^11.0.1", diff --git a/src/router/index.ts b/src/router/index.ts index d4bd539..376cc04 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -750,7 +750,7 @@ export const dynamicRoutes = [ component: () => import('/@/views/layout/routerView/parent.vue'), meta: { title: 'message.router.layoutIfameView', - isLink: 'https://gitee.com/lyt-top/vue-admin-wonderful', + isLink: 'https://gitee.com/lyt-top/vue-next-admin', isHide: false, isKeepAlive: false, isAffix: true, diff --git a/src/views/layout/footer/index.vue b/src/views/layout/footer/index.vue index 85ce746..9021dff 100644 --- a/src/views/layout/footer/index.vue +++ b/src/views/layout/footer/index.vue @@ -2,7 +2,7 @@ -- Gitee From b1cf16aa8c13d2d3edb08d5f22ea9c1cd5a54c83 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Thu, 15 Apr 2021 14:16:09 +0800 Subject: [PATCH 002/183] =?UTF-8?q?'admin-21.04.15:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E6=A1=88=E3=80=81=E9=93=BE=E6=8E=A5=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 56 ++++++++++++-------------------------- src/views/personal/mock.ts | 31 ++++++++++++--------- 2 files changed, 36 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 00b5b99..d0f266b 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ typescript - - license - - vite + vite + + + license

 

@@ -26,28 +26,20 @@ #### 线上预览 -###### vue3.x 版本 - -- vue-next-admin 版本预览 https://lyt-top.gitee.io/vue-next-admin-preview/#/login - -###### vue2.x 版本 - -- pro 版本预览 http://lyt-top.gitee.io/vue-admin-wonderful-preview -- fashion 版本预览 http://lyt-top.gitee.io/vue-admin-wonderful-fashion-preview -- classic 版本预览 http://lyt-top.gitee.io/vue-admin-wonderful-classic-preview -- elegant 版本预览 http://lyt-top.gitee.io/vue-admin-wonderful-elegant-preview -- strange 版本预览 http://lyt-top.gitee.io/vue-admin-wonderful-strange-preview +- vue3.x 版本预览(vue-next-admin) https://lyt-top.gitee.io/vue-next-admin-preview/#/login +- vue2.x 版本预览(vue-prev-admin)https://lyt-top.gitee.io/vue-prev-admin-preview/#/login #### 代码仓库 - vue3.x 版本 https://gitee.com/lyt-top/vue-next-admin -- vue2.x 版本 https://gitee.com/lyt-top/vue-admin-wonderful +- vue2.x 版本 https://gitee.com/lyt-top/vue-next-admin/tree/vue-prev-admin -#### 安装 cnpm +#### 安装 cnpm、yarn - 复制代码(桌面 cmd 运行) `npm install -g cnpm --registry=https://registry.npm.taobao.org` +- 复制代码(桌面 cmd 运行) `npm install -g yarn` -#### 使用说明(vue3.x 版本) +#### 使用说明 ```bash # 克隆项目 @@ -66,28 +58,18 @@ cnpm run dev cnpm run build ``` -#### 使用说明(vue2.x 版本) - -```bash -# 克隆项目 -git clone https://gitee.com/lyt-top/vue-admin-wonderful.git - -# 进入项目 -cd vue-admin-wonderful - -# 安装依赖 -cnpm install - -# 运行项目 -cnpm run serve +#### git 命令 -# 打包发布 -cnpm run build -``` +- 在本地新建一个分支:`git branch newBranch` +- 切换到你的新分支:`git checkout newBranch` +- 将新分支发布在 github、gitee 上:`git push origin newBranch` +- 在本地删除一个分支:`git branch -d newBranch` +- 在 github 远程端删除一个分支:`git push origin :newBranch (分支名前的冒号代表删除)` +- 注意删除远程分支后,如果有对应的本地分支,本地分支并不会同步删除! #### 学习交流加 QQ 群 -- 加群下载基础模板、查看开发文档、vue-next-admin 开发文档正在编写中... +- 查看开发文档、vue-next-admin 开发文档正在编写中... - 群号码:665452019 @@ -130,6 +112,4 @@ cnpm run build #### 其他事项 -- vue3.x vue-next-admin 版本,基于 vue3.x + CompositionAPI + typescript + vite + element plus。 -- vue2.x vue-prev-admin 版本,基于 vue2.x + element ui。 - 喜欢用就帮忙 gitee star 下,不喜欢用也没关系,出来打工、创业,大家都不容易,感谢大家的支持,谢谢! diff --git a/src/views/personal/mock.ts b/src/views/personal/mock.ts index 7cb8dd7..a2cbee8 100644 --- a/src/views/personal/mock.ts +++ b/src/views/personal/mock.ts @@ -1,25 +1,30 @@ // 消息通知 export const newsInfoList: Array = [ { - title: '[发布] 2021年02月28日发布 vue3.x v1.0.0 版本', + title: '[发布] 2021年02月28日发布基于 vue3.x + vite v1.0.0 版本', date: '02/28', - link: 'https://gitee.com/lyt-top/vue-next-admin', + link: 'https://gitee.com/lyt-top/vue-next-admin' }, { - title: '[发布] 2020年11月15日发布 vue2.x v1.0.0 版本', - date: '11/15', - link: 'https://gitee.com/lyt-top/vue-admin-wonderful', + title: '[发布] 2021年04月15日发布 vue2.x + webpack 重构版本', + date: '04/15', + link: 'https://gitee.com/lyt-top/vue-next-admin/tree/vue-prev-admin/' + }, + { + title: '[重构] 2021年04月10日 重构 vue2.x + webpack v1.0.0 版本', + date: '04/10', + link: 'https://gitee.com/lyt-top/vue-next-admin/tree/vue-prev-admin/' }, { title: '[预览] 2020年12月08日,基于 vue3.x 版本后台模板的预览', date: '12/08', - link: 'http://lyt-top.gitee.io/vue-next-admin-preview', + link: 'http://lyt-top.gitee.io/vue-next-admin-preview/#/login' }, { title: '[预览] 2020年11月15日,基于 vue2.x 版本后台模板的预览', date: '11/15', - link: 'http://lyt-top.gitee.io/vue-admin-wonderful-preview', - }, + link: 'https://lyt-top.gitee.io/vue-prev-admin-preview/#/login' + } ]; // 营销推荐 @@ -29,27 +34,27 @@ export const recommendList: Array = [ msg: '现金券、折扣券、营销必备', icon: 'el-icon-food', bg: '#48D18D', - iconColor: '#64d89d', + iconColor: '#64d89d' }, { title: '多人拼团', msg: '社交电商、开辟流量', icon: 'el-icon-shopping-bag-1', bg: '#F95959', - iconColor: '#F86C6B', + iconColor: '#F86C6B' }, { title: '分销中心', msg: '轻松招募分销员,成功推广奖励', icon: 'el-icon-school', bg: '#8595F4', - iconColor: '#92A1F4', + iconColor: '#92A1F4' }, { title: '秒杀', msg: '超低价抢购引导更多销量', icon: 'el-icon-alarm-clock', bg: '#FEBB50', - iconColor: '#FDC566', - }, + iconColor: '#FDC566' + } ]; -- Gitee From 1fe01e62a4625a7c4dc2f3f2d661758d5a068b4b Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Sun, 18 Apr 2021 16:45:25 +0800 Subject: [PATCH 003/183] =?UTF-8?q?'admin-21.04.18:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5eee0e6..2881f5a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "clipboard": "^2.0.8", "countup.js": "^2.0.7", "cropperjs": "^1.5.11", - "echarts": "^5.0.2", + "echarts": "^5.1.0", "echarts-wordcloud": "^2.0.0", "element-plus": "^1.0.2-beta.40", "mitt": "^2.1.0", @@ -26,12 +26,12 @@ "vue-router": "^4.0.2", "vue-web-screen-shot": "^1.1.8", "vuex": "^4.0.0-rc.2", - "wangeditor": "^4.6.14" + "wangeditor": "^4.6.15" }, "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^14.14.37", + "@types/node": "^14.14.41", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", "@typescript-eslint/eslint-plugin": "^4.22.0", @@ -42,7 +42,7 @@ "eslint": "^7.24.0", "eslint-plugin-vue": "^7.9.0", "prettier": "^2.2.1", - "sass": "^1.32.8", + "sass": "^1.32.10", "sass-loader": "^11.0.1", "typescript": "^4.2.4", "vite": "^2.1.5", -- Gitee From ea60dd9d933029da008feeb12c010805d3f9836c Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Mon, 19 Apr 2021 13:03:36 +0800 Subject: [PATCH 004/183] =?UTF-8?q?'admin-21.04.19:=E4=BF=AE=E6=94=B9tscon?= =?UTF-8?q?fig.json=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E7=BC=96=E8=AF=91=E5=99=A8=E6=8A=A5=E7=BA=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 11da58c..c15b03c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -68,6 +68,5 @@ /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] + } } -- Gitee From 1f4c902f40fad22db253fb2b87da451cc8d43abe Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Wed, 21 Apr 2021 20:54:47 +0800 Subject: [PATCH 005/183] =?UTF-8?q?'admin-21.04.21:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d0f266b..d2abe0c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ #### 线上预览 -- vue3.x 版本预览(vue-next-admin) https://lyt-top.gitee.io/vue-next-admin-preview/#/login +- vue3.x 版本预览(vue-next-admin)https://lyt-top.gitee.io/vue-next-admin-preview/#/login - vue2.x 版本预览(vue-prev-admin)https://lyt-top.gitee.io/vue-prev-admin-preview/#/login #### 代码仓库 diff --git a/package.json b/package.json index 2881f5a..775f02c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "vue": "^3.0.5", "vue-i18n": "^9.1.4", "vue-router": "^4.0.2", - "vue-web-screen-shot": "^1.1.8", + "vue-web-screen-shot": "^1.1.9", "vuex": "^4.0.0-rc.2", "wangeditor": "^4.6.15" }, @@ -42,10 +42,10 @@ "eslint": "^7.24.0", "eslint-plugin-vue": "^7.9.0", "prettier": "^2.2.1", - "sass": "^1.32.10", + "sass": "^1.32.11", "sass-loader": "^11.0.1", "typescript": "^4.2.4", - "vite": "^2.1.5", + "vite": "^2.2.1", "vue-eslint-parser": "^7.6.0" } } -- Gitee From 084e0f2c9981537208c8765951ef484cbcc902cc Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Fri, 23 Apr 2021 15:30:32 +0800 Subject: [PATCH 006/183] =?UTF-8?q?'admin-21.04.23:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A7=E5=88=B6=E8=B7=AF=E7=94=B1=E6=8A=A5?= =?UTF-8?q?Invalid-arguments=E3=80=81=E5=88=B7=E6=96=B0=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=87=BA=E7=8E=B0404=E3=80=81=E7=A9=BA=E7=99=BD=E3=80=81?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- src/router/index.ts | 120 ++++++++++++-------------- src/views/login/component/account.vue | 26 +++--- 3 files changed, 70 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index 775f02c..d691677 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/" }, "dependencies": { - "@antv/g6": "^4.2.6", + "@antv/g6": "^4.2.7", "axios": "^0.21.1", "clipboard": "^2.0.8", "countup.js": "^2.0.7", @@ -26,7 +26,7 @@ "vue-router": "^4.0.2", "vue-web-screen-shot": "^1.1.9", "vuex": "^4.0.0-rc.2", - "wangeditor": "^4.6.15" + "wangeditor": "^4.6.16" }, "devDependencies": { "@types/axios": "^0.14.0", diff --git a/src/router/index.ts b/src/router/index.ts index 376cc04..d904e02 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -806,62 +806,63 @@ const router = createRouter({ routes: staticRoutes, }); -// 后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 -export function getBackEndControlRoutes(callback: any) { +// 前端控制路由:初始化方法,防止刷新时丢失 +export function initAllFun() { + NextLoading.start(); const token = getSession('token'); if (!token) return false; - store.dispatch('userInfos/setUserInfos'); - const auth = store.state.userInfos.userInfos.authPageList[0]; // 模拟 admin 与 test - if (auth === 'admin') { - getMenuAdmin() - .then((res: any) => { - callback(res); - }) - .catch(() => {}); - } else { - getMenuTest() - .then((res: any) => { - callback(res); - }) - .catch(() => {}); - } + store.dispatch('userInfos/setUserInfos'); // 触发初始化用户信息 + router.addRoute(pathMatch); // 添加404界面 + resetRoute(); // 删除/重置路由 + setAddRoute(); // 添加动态路由 + setFilterMenu(); // 过滤权限菜单 + setCacheTagsViewRoutes(); // 添加 keepAlive 缓存 } -// 后端控制路由,模拟执行路由数据初始化 -export function setBackEndControlRoutesFun(res: any, callback?: any) { - initBackEndControlRoutesFun(res); - window.location.href = window.location.href; // 防止页面刷新时,出现空白或404 - callback(res); +// 后端控制路由:模拟执行路由数据初始化 +export async function initBackEndControlRoutesFun() { + NextLoading.start(); // 界面 loading 动画开始执行 + const token = getSession('token'); // 获取浏览器缓存 token 值 + if (!token) return false; // 无 token 停止执行下一步 + store.dispatch('userInfos/setUserInfos'); // 触发初始化用户信息 + const res = await getBackEndControlRoutes(); // 获取路由 + const oldRoutes = JSON.parse(JSON.stringify(res.data)); // 获取接口原始路由(未处理component) + store.dispatch('requestOldRoutes/setBackEndControlRoutes', oldRoutes); // 存原始路由到 vuex 中 + dynamicRoutes[0].children = await backEndRouter(res.data); // 处理路由(component) + router.addRoute(pathMatch); // 添加404界面 + await setAddRoute(); // 添加动态路由 + setFilterMenu(); // 过滤权限菜单 + setCacheTagsViewRoutes(); // 添加 keepAlive 缓存 + setRefreshPagesRestore(); // 防止界面刷新时,出现404、空白、报错等 } -// 后端控制路由,动态添加菜单时(刷新菜单) -export function setBackEndControlRefreshRoutes() { - getBackEndControlRoutes((res: any) => { - initBackEndControlRoutesFun(res); - }); +// 防止界面刷新时,出现404、空白、报错等 +export function setRefreshPagesRestore() { + const { matched, query, path } = router.currentRoute.value; + if (matched.length <= 0) router.push({ path, query }); } -// 后端控制路由,模拟执行路由数据初始化 -const initBackEndControlRoutesFun = (res: any) => { - NextLoading.start(); - const oldRoutes = JSON.parse(JSON.stringify(res.data)); - store.dispatch('requestOldRoutes/setBackEndControlRoutes', oldRoutes); - dynamicRoutes[0].children = backEndRouter(res.data); - resetRoute(); // 删除/重置路由 - router.addRoute(pathMatch); // 添加404界面 - setAddRoute(); // 添加动态路由 - setFilterMenu(); // 过滤权限菜单 - setCacheTagsViewRoutes(); // 添加 keepAlive 缓存 -}; +// 后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 +export function getBackEndControlRoutes() { + // 模拟 admin 与 test + const auth = store.state.userInfos.userInfos.authPageList[0]; + // 管理员 admin + if (auth === 'admin') return getMenuAdmin(); + // 其它用户 test + else return getMenuTest(); +} + +// 后端控制路由,动态添加菜单时(菜单管理界面刷新菜单,路径:/src/views/system/menu/component/addMenu.vue) +export function setBackEndControlRefreshRoutes() { + getBackEndControlRoutes(); +} // 后端控制路由,后端路由 component 转换 export function backEndRouter(routes: any) { if (!routes) return; return routes.map((item: any) => { - const { component } = item; - const { children } = item; - if (component) item.component = dynamicImport(dynamicViewsModules, component as string); - children && backEndRouter(children); + if (item.component) item.component = dynamicImport(dynamicViewsModules, item.component as string); + item.children && backEndRouter(item.children); return item; }); } @@ -885,7 +886,7 @@ export function dynamicImport(dynamicViewsModules: Record Promise< // 多级嵌套数组处理成一维数组 export function formatFlatteningRoutes(arr: any) { - if (arr.length < 0) return false; + if (arr.length <= 0) return false; for (let i = 0; i < arr.length; i++) { if (arr[i].children) { arr = arr.slice(0, i + 1).concat(arr[i].children, arr.slice(i + 1)); @@ -898,7 +899,7 @@ export function formatFlatteningRoutes(arr: any) { // 只保留二级:也就是二级以上全部处理成只有二级,keep-alive 支持二级缓存 // isKeepAlive 处理 `name` 值,进行缓存。顶级关闭,全部不缓存 export function formatTwoStageRoutes(arr: any) { - if (arr.length < 0) return false; + if (arr.length <= 0) return false; const newArr: any = []; const cacheList: Array = []; arr.forEach((v: any) => { @@ -983,26 +984,15 @@ export function resetRoute() { }); } -// 初始化方法,防止刷新时丢失 -export function initAllFun() { - NextLoading.start(); - const token = getSession('token'); - if (!token) return false; - store.dispatch('userInfos/setUserInfos'); // 触发初始化用户信息 - setAddRoute(); // 添加动态路由 - router.addRoute(pathMatch); // 添加404界面 - setFilterMenu(); // 过滤权限菜单 - setCacheTagsViewRoutes(); // 添加 keepAlive 缓存 -} - // 初始化方法执行 -const requestRoutes = store.state.themeConfig.themeConfig.isRequestRoutes; -if (!requestRoutes) initAllFun(); -// 后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 -if (requestRoutes) - getBackEndControlRoutes((res: any) => { - setBackEndControlRoutesFun(res); - }); +const { isRequestRoutes } = store.state.themeConfig.themeConfig; +if (!isRequestRoutes) { + // 未开启后端控制路由 + initAllFun(); +} else if (isRequestRoutes) { + // 后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 + initBackEndControlRoutesFun(); +} // 路由加载前 router.beforeEach((to, from, next) => { @@ -1022,7 +1012,7 @@ router.beforeEach((to, from, next) => { next('/home'); NProgress.done(); } else { - next(); + if (store.state.routesList.routesList.length > 0) next(); } } }); diff --git a/src/views/login/component/account.vue b/src/views/login/component/account.vue index 5db09b3..e7c8646 100644 --- a/src/views/login/component/account.vue +++ b/src/views/login/component/account.vue @@ -55,7 +55,7 @@ import { toRefs, reactive, defineComponent, computed } from 'vue'; import { useRouter } from 'vue-router'; import { ElMessage } from 'element-plus'; import { useI18n } from 'vue-i18n'; -import { initAllFun, getBackEndControlRoutes, setBackEndControlRoutesFun } from '/@/router/index.ts'; +import { initAllFun, initBackEndControlRoutesFun } from '/@/router/index.ts'; import { useStore } from '/@/store/index.ts'; import { setSession } from '/@/utils/storage.ts'; import { formatAxis } from '/@/utils/formatTime.ts'; @@ -80,7 +80,7 @@ export default defineComponent({ return formatAxis(new Date()); }); // 登录 - const onSignIn = () => { + const onSignIn = async () => { state.loading.signIn = true; let defaultAuthPageList: Array = []; let defaultAuthBtnList: Array = []; @@ -99,6 +99,7 @@ export default defineComponent({ defaultAuthPageList = testAuthPageList; defaultAuthBtnList = testAuthBtnList; } + // 用户信息模拟数据 const userInfos = { userName: state.ruleForm.userName, photo: @@ -115,18 +116,16 @@ export default defineComponent({ setSession('userInfo', userInfos); // 1、请注意执行顺序(存储用户信息到vuex) store.dispatch('userInfos/setUserInfos', userInfos); - // 前端控制路由,2、请注意执行顺序 if (!store.state.themeConfig.themeConfig.isRequestRoutes) { - initAllFun(); + // 前端控制路由,2、请注意执行顺序 + await initAllFun(); + signInSuccess(); + } else { + // 模拟后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 + // 添加完动态路由,再进行 router 跳转,否则可能报错 No match found for location with path "/" + await initBackEndControlRoutesFun(); + // 执行完 initBackEndControlRoutesFun,再执行 signInSuccess signInSuccess(); - } - // 模拟后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 - else { - getBackEndControlRoutes((res: any) => { - setBackEndControlRoutesFun(res, () => { - signInSuccess(); - }); - }); } }; // 登录成功后的跳转 @@ -134,13 +133,14 @@ export default defineComponent({ // 初始化登录成功时间问候语 let currentTimeInfo = currentTime.value; // 登录成功,跳到转首页 + // 添加完动态路由,再进行 router 跳转,否则可能报错 No match found for location with path "/" router.push('/'); // 登录成功提示 setTimeout(() => { + // 关闭 loading state.loading.signIn = true; const signInText = t('message.signInText'); ElMessage.success(`${currentTimeInfo},${signInText}`); - // 关闭 loading }, 300); }; return { -- Gitee From 827c2c6b046fc79113d592eb8da983553c4cf43a Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Fri, 23 Apr 2021 16:18:17 +0800 Subject: [PATCH 007/183] =?UTF-8?q?'admin-21.04.23:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A7=E5=88=B6=E8=B7=AF=E7=94=B1=E6=8A=A5?= =?UTF-8?q?Invalid-arguments=E3=80=81=E5=88=B7=E6=96=B0=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=87=BA=E7=8E=B0404=E3=80=81=E7=A9=BA=E7=99=BD=E3=80=81?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index d904e02..9137a99 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -808,9 +808,9 @@ const router = createRouter({ // 前端控制路由:初始化方法,防止刷新时丢失 export function initAllFun() { - NextLoading.start(); - const token = getSession('token'); - if (!token) return false; + NextLoading.start(); // 界面 loading 动画开始执行 + const token = getSession('token'); // 获取浏览器缓存 token 值 + if (!token) return false; // 无 token 停止执行下一步 store.dispatch('userInfos/setUserInfos'); // 触发初始化用户信息 router.addRoute(pathMatch); // 添加404界面 resetRoute(); // 删除/重置路由 -- Gitee From d1e656dc902aae077c1bf69e026af0c59d41cfeb Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Sun, 25 Apr 2021 21:15:44 +0800 Subject: [PATCH 008/183] =?UTF-8?q?'admin-21.04.25:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=89=93=E5=8C=85=E3=80=81=E5=88=87=E6=8D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=A0=B7=E5=BC=8F=E4=B8=A2=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/views/layout/index.vue | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d691677..fb19ecb 100644 --- a/package.json +++ b/package.json @@ -36,16 +36,16 @@ "@types/sortablejs": "^1.10.6", "@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/parser": "^4.22.0", - "@vitejs/plugin-vue": "^1.2.1", + "@vitejs/plugin-vue": "^1.2.2", "@vue/compiler-sfc": "^3.0.11", "dotenv": "^8.2.0", - "eslint": "^7.24.0", + "eslint": "^7.25.0", "eslint-plugin-vue": "^7.9.0", "prettier": "^2.2.1", "sass": "^1.32.11", "sass-loader": "^11.0.1", "typescript": "^4.2.4", - "vite": "^2.2.1", + "vite": "^2.2.2", "vue-eslint-parser": "^7.6.0" } } diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index a26fc29..bded546 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -6,17 +6,16 @@ + + diff --git a/src/views/layout/navBars/breadcrumb/user.vue b/src/views/layout/navBars/breadcrumb/user.vue index 8662335..6f1f2c2 100644 --- a/src/views/layout/navBars/breadcrumb/user.vue +++ b/src/views/layout/navBars/breadcrumb/user.vue @@ -1,5 +1,18 @@ -- Gitee From a184ebf5d344d8a24f206d67fa8c79d117e258ec Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Fri, 30 Apr 2021 16:15:43 +0800 Subject: [PATCH 015/183] =?UTF-8?q?'admin-21.04.30:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B3=A2=E6=B5=AA=E6=95=88=E6=9E=9C=E6=8C=87=E4=BB=A4=E5=8F=8A?= =?UTF-8?q?=E6=BC=94=E7=A4=BA=E3=80=81=E7=AA=97=E6=A0=BC=E6=8B=86=E5=88=86?= =?UTF-8?q?=E5=99=A8=E7=AD=89'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + package.json | 3 +- src/i18n/lang/en.ts | 2 + src/i18n/lang/zh-cn.ts | 2 + src/i18n/lang/zh-tw.ts | 2 + src/main.ts | 4 +- src/router/index.ts | 30 ++++++++ src/theme/index.scss | 1 + src/theme/waves.scss | 101 +++++++++++++++++++++++++ src/utils/authDirective.ts | 1 + src/utils/customDirective.ts | 50 +++++++++++++ src/utils/directive.ts | 11 +++ src/utils/setIconfont.ts | 2 +- src/views/fun/splitpanes/index.vue | 52 +++++++++++++ src/views/pages/waterfall/index.vue | 10 +-- src/views/pages/waves/index.vue | 112 ++++++++++++++++++++++++++++ 16 files changed, 372 insertions(+), 12 deletions(-) create mode 100644 src/theme/waves.scss create mode 100644 src/utils/customDirective.ts create mode 100644 src/utils/directive.ts create mode 100644 src/views/fun/splitpanes/index.vue create mode 100644 src/views/pages/waves/index.vue diff --git a/README.md b/README.md index 2d849e0..9e9a617 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ cnpm run build - print-js - vue-web-screen-shot - vue-grid-layout +- splitpanes #### 特别感谢 diff --git a/package.json b/package.json index 640ea69..2a5b30c 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,14 @@ "qrcodejs2-fixes": "^0.0.2", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", + "splitpanes": "^3.0.4", "vue": "^3.0.5", "vue-grid-layout": "^3.0.0-beta1", "vue-i18n": "^9.1.4", "vue-router": "^4.0.2", "vue-web-screen-shot": "^1.1.9", "vuex": "^4.0.0-rc.2", - "wangeditor": "^4.6.16" + "wangeditor": "^4.6.17" }, "devDependencies": { "@types/axios": "^0.14.0", diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index af5bf30..f149411 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -33,6 +33,7 @@ export default { funClipboard: 'Copy cut', funScreenShort: 'screenCapture', funGridLayout: 'Drag layout', + funSplitpanes: 'Pane splitter', pagesIndex: 'pages', pagesFiltering: 'Filtering', pagesFilteringDetails: 'FilteringDetails', @@ -46,6 +47,7 @@ export default { pagesWaterfall: 'Waterfall', pagesSteps: 'Steps', pagesPreview: 'Large preview', + pagesWaves: 'Wave effect', chartIndex: 'chartIndex', personal: 'personal', tools: 'tools', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index 8ceceea..c88fc5f 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -33,6 +33,7 @@ export default { funClipboard: '复制剪切', funScreenShort: 'web端自定义截屏', funGridLayout: '拖拽布局', + funSplitpanes: '窗格拆分器', pagesIndex: '页面', pagesFiltering: '过滤筛选组件', pagesFilteringDetails: '过滤筛选组件详情', @@ -46,6 +47,7 @@ export default { pagesWaterfall: '瀑布屏', pagesSteps: '步骤条', pagesPreview: '大图预览', + pagesWaves: '波浪效果', chartIndex: '大数据图表', personal: '个人中心', tools: '工具类集合', diff --git a/src/i18n/lang/zh-tw.ts b/src/i18n/lang/zh-tw.ts index 16ef697..4849a74 100644 --- a/src/i18n/lang/zh-tw.ts +++ b/src/i18n/lang/zh-tw.ts @@ -33,6 +33,7 @@ export default { funClipboard: '複製剪切', funScreenShort: '自定義截圖', funGridLayout: '拖拽佈局', + funSplitpanes: '窗格折開器', pagesIndex: '頁面', pagesFiltering: '過濾篩選組件', pagesFilteringDetails: '過濾篩選組件詳情', @@ -46,6 +47,7 @@ export default { pagesWaterfall: '瀑布屏', pagesSteps: '步驟條', pagesPreview: '大圖預覽', + pagesWaves: '波浪效果', chartIndex: '大資料圖表', personal: '個人中心', tools: '工具類集合', diff --git a/src/main.ts b/src/main.ts index 27cab17..41cbd9a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { createApp } from 'vue'; import App from './App.vue'; import router from './router'; import { store, key } from './store'; -import { authDirective } from '/@/utils/authDirective.ts'; +import { directive } from '/@/utils/directive.ts'; import { i18n } from '/@/i18n/index.ts'; import { globalComponentSize } from '/@/utils/componentSize.ts'; @@ -25,4 +25,4 @@ app app.config.globalProperties.mittBus = mitt(); -authDirective(app); +directive(app); diff --git a/src/router/index.ts b/src/router/index.ts index 4869a19..ee3a70c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -514,6 +514,21 @@ export const dynamicRoutes = [ icon: 'iconfont icon-tuodong', }, }, + { + path: '/fun/splitpanes', + name: 'funSplitpanes', + component: () => import('/@/views/fun/splitpanes/index.vue'), + meta: { + title: 'message.router.funSplitpanes', + isLink: '', + isHide: false, + isKeepAlive: true, + isAffix: false, + isIframe: false, + auth: ['admin', 'test'], + icon: 'iconfont icon--chaifenlie', + }, + }, ], }, { @@ -712,6 +727,21 @@ export const dynamicRoutes = [ icon: 'iconfont icon-15tupianyulan', }, }, + { + path: '/pages/waves', + name: 'pagesWaves', + component: () => import('/@/views/pages/waves/index.vue'), + meta: { + title: 'message.router.pagesWaves', + isLink: '', + isHide: false, + isKeepAlive: true, + isAffix: false, + isIframe: false, + auth: ['admin', 'test'], + icon: 'iconfont icon-bolangneng', + }, + }, ], }, { diff --git a/src/theme/index.scss b/src/theme/index.scss index 394edb5..9226394 100644 --- a/src/theme/index.scss +++ b/src/theme/index.scss @@ -4,3 +4,4 @@ @import './element.scss'; @import './iconSelector.scss'; @import './media/media.scss'; +@import './waves.scss'; diff --git a/src/theme/waves.scss b/src/theme/waves.scss new file mode 100644 index 0000000..23add2c --- /dev/null +++ b/src/theme/waves.scss @@ -0,0 +1,101 @@ +/* Waves v0.6.0 +* http://fian.my.id/Waves +* +* Copyright 2014 Alfiana E. Sibuea and other contributors +* Released under the MIT license +* https://github.com/fians/Waves/blob/master/LICENSE +*/ +.waves-effect { + position: relative; + cursor: pointer; + display: inline-block; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; + vertical-align: middle; + z-index: 1; + will-change: opacity, transform; + transition: all 0.3s ease-out; +} +.waves-effect .waves-ripple { + position: absolute; + border-radius: 50%; + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + opacity: 0; + background: rgba(0, 0, 0, 0.2); + transition: all 0.7s ease-out; + transition-property: opacity, -webkit-transform; + transition-property: transform, opacity; + transition-property: transform, opacity, -webkit-transform; + -webkit-transform: scale(0); + transform: scale(0); + pointer-events: none; +} +.waves-effect.waves-light .waves-ripple { + background-color: rgba(255, 255, 255, 0.45); +} +.waves-effect.waves-red .waves-ripple { + background-color: rgba(244, 67, 54, 0.7); +} +.waves-effect.waves-yellow .waves-ripple { + background-color: rgba(255, 235, 59, 0.7); +} +.waves-effect.waves-orange .waves-ripple { + background-color: rgba(255, 152, 0, 0.7); +} +.waves-effect.waves-purple .waves-ripple { + background-color: rgba(156, 39, 176, 0.7); +} +.waves-effect.waves-green .waves-ripple { + background-color: rgba(76, 175, 80, 0.7); +} +.waves-effect.waves-teal .waves-ripple { + background-color: rgba(0, 150, 136, 0.7); +} +.waves-effect input[type='button'], +.waves-effect input[type='reset'], +.waves-effect input[type='submit'] { + border: 0; + font-style: normal; + font-size: inherit; + text-transform: inherit; + background: none; +} +.waves-notransition { + transition: none !important; +} +.waves-circle { + -webkit-transform: translateZ(0); + transform: translateZ(0); + -webkit-mask-image: -webkit-radial-gradient(circle, #fff 100%, #000 100%); +} +.waves-input-wrapper { + border-radius: 0.2em; + vertical-align: bottom; +} +.waves-input-wrapper .waves-button-input { + position: relative; + top: 0; + left: 0; + z-index: 1; +} +.waves-circle { + text-align: center; + width: 2.5em; + height: 2.5em; + line-height: 2.5em; + border-radius: 50%; + -webkit-mask-image: none; +} +.waves-block { + display: block; +} +a.waves-effect .waves-ripple { + z-index: -1; +} diff --git a/src/utils/authDirective.ts b/src/utils/authDirective.ts index cb11097..18eab6e 100644 --- a/src/utils/authDirective.ts +++ b/src/utils/authDirective.ts @@ -2,6 +2,7 @@ import type { App } from 'vue'; import { store } from '/@/store/index.ts'; import { judementSameArr } from '/@/utils/arrayOperation.ts'; +// 用户权限指令 export function authDirective(app: App) { // 单个权限验证(v-auth="xxx") app.directive('auth', { diff --git a/src/utils/customDirective.ts b/src/utils/customDirective.ts new file mode 100644 index 0000000..5391121 --- /dev/null +++ b/src/utils/customDirective.ts @@ -0,0 +1,50 @@ +import type { App } from 'vue'; + +// 按钮波浪指令 +export function wavesDirective(app: App) { + app.directive('waves', { + mounted(el, binding) { + el.classList.add('waves-effect'); + binding.value && el.classList.add('waves-' + binding.value); + function setConvertStyle(obj: any) { + let style: string = ''; + for (let i in obj) { + if (obj.hasOwnProperty(i)) style += i + ':' + obj[i] + ';'; + } + return style; + } + function onCurrentClick(e: any) { + let elDiv = document.createElement('div'); + elDiv.classList.add('waves-ripple'); + el.appendChild(elDiv); + let styles = { + left: `${e.layerX}px`, + top: `${e.layerY}px`, + opacity: 1, + transform: `scale(${(el.clientWidth / 100) * 10})`, + 'transition-duration': `750ms`, + 'transition-timing-function': `cubic-bezier(0.250, 0.460, 0.450, 0.940)`, + }; + elDiv.setAttribute('style', setConvertStyle(styles)); + setTimeout(() => { + elDiv.setAttribute( + 'style', + setConvertStyle({ + opacity: 0, + transform: styles.transform, + left: styles.left, + top: styles.top, + }) + ); + setTimeout(() => { + elDiv && el.removeChild(elDiv); + }, 750); + }, 450); + } + el.addEventListener('mousedown', onCurrentClick, false); + }, + unmounted(el) { + el.addEventListener('mousedown', () => {}); + }, + }); +} diff --git a/src/utils/directive.ts b/src/utils/directive.ts new file mode 100644 index 0000000..8a6b5b0 --- /dev/null +++ b/src/utils/directive.ts @@ -0,0 +1,11 @@ +import type { App } from 'vue'; +import { authDirective } from '/@/utils/authDirective.ts'; +import { wavesDirective } from '/@/utils/customDirective.ts'; + +// 导出指令方法 +export function directive(app: App) { + // 用户权限指令 + authDirective(app); + // 按钮波浪指令 + wavesDirective(app); +} diff --git a/src/utils/setIconfont.ts b/src/utils/setIconfont.ts index 5832850..9f805dc 100644 --- a/src/utils/setIconfont.ts +++ b/src/utils/setIconfont.ts @@ -1,6 +1,6 @@ // 字体图标 url const cssCdnUrlList: Array = [ - '//at.alicdn.com/t/font_2298093_omfjza0tsa.css', + '//at.alicdn.com/t/font_2298093_zyqji9hnk.css', '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', ]; // 第三方 js url diff --git a/src/views/fun/splitpanes/index.vue b/src/views/fun/splitpanes/index.vue new file mode 100644 index 0000000..9db3d3f --- /dev/null +++ b/src/views/fun/splitpanes/index.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/views/pages/waterfall/index.vue b/src/views/pages/waterfall/index.vue index 05ce57e..d0b95ab 100644 --- a/src/views/pages/waterfall/index.vue +++ b/src/views/pages/waterfall/index.vue @@ -2,7 +2,7 @@
-
+
{{ v }}
@@ -11,7 +11,7 @@
-
+
{{ v }}
@@ -62,9 +62,6 @@ export default { transition: all 0.3s ease; cursor: pointer; } - &:active { - opacity: 0.5; - } } } .waterfall-last { @@ -84,9 +81,6 @@ export default { transition: all 0.3s ease; cursor: pointer; } - &:active { - opacity: 0.5; - } } } @media (min-width: 576px) { diff --git a/src/views/pages/waves/index.vue b/src/views/pages/waves/index.vue new file mode 100644 index 0000000..0438614 --- /dev/null +++ b/src/views/pages/waves/index.vue @@ -0,0 +1,112 @@ + + + + + -- Gitee From 6e99cdee7d425e7a0a869c686b09acd426ff6062 Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Sun, 2 May 2021 21:24:41 +0800 Subject: [PATCH 016/183] =?UTF-8?q?'admin-21.05.02:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A0=91=E5=BD=A2=E6=8E=A7=E4=BB=B6=E6=BC=94=E7=A4=BA=E3=80=81?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/en.ts | 1 + src/i18n/lang/zh-cn.ts | 1 + src/i18n/lang/zh-tw.ts | 1 + src/router/index.ts | 15 +++ src/utils/customDirective.ts | 2 +- src/utils/setIconfont.ts | 2 +- src/views/pages/tree/index.vue | 213 +++++++++++++++++++++++++++++++++ 7 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 src/views/pages/tree/index.vue diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index f149411..c2fb991 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -48,6 +48,7 @@ export default { pagesSteps: 'Steps', pagesPreview: 'Large preview', pagesWaves: 'Wave effect', + pagesTree: 'tree alter table', chartIndex: 'chartIndex', personal: 'personal', tools: 'tools', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index c88fc5f..adcd866 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -48,6 +48,7 @@ export default { pagesSteps: '步骤条', pagesPreview: '大图预览', pagesWaves: '波浪效果', + pagesTree: '树形改表格', chartIndex: '大数据图表', personal: '个人中心', tools: '工具类集合', diff --git a/src/i18n/lang/zh-tw.ts b/src/i18n/lang/zh-tw.ts index 4849a74..08a0614 100644 --- a/src/i18n/lang/zh-tw.ts +++ b/src/i18n/lang/zh-tw.ts @@ -48,6 +48,7 @@ export default { pagesSteps: '步驟條', pagesPreview: '大圖預覽', pagesWaves: '波浪效果', + pagesTree: '樹形改表格', chartIndex: '大資料圖表', personal: '個人中心', tools: '工具類集合', diff --git a/src/router/index.ts b/src/router/index.ts index ee3a70c..7aa7a4d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -742,6 +742,21 @@ export const dynamicRoutes = [ icon: 'iconfont icon-bolangneng', }, }, + { + path: '/pages/tree', + name: 'pagesTree', + component: () => import('/@/views/pages/tree/index.vue'), + meta: { + title: 'message.router.pagesTree', + isLink: '', + isHide: false, + isKeepAlive: true, + isAffix: false, + isIframe: false, + auth: ['admin', 'test'], + icon: 'iconfont icon-shuxingtu', + }, + }, ], }, { diff --git a/src/utils/customDirective.ts b/src/utils/customDirective.ts index 5391121..39e7b90 100644 --- a/src/utils/customDirective.ts +++ b/src/utils/customDirective.ts @@ -9,7 +9,7 @@ export function wavesDirective(app: App) { function setConvertStyle(obj: any) { let style: string = ''; for (let i in obj) { - if (obj.hasOwnProperty(i)) style += i + ':' + obj[i] + ';'; + if (obj.hasOwnProperty(i)) style += `${i}:${obj[i]};`; } return style; } diff --git a/src/utils/setIconfont.ts b/src/utils/setIconfont.ts index 9f805dc..8db0a93 100644 --- a/src/utils/setIconfont.ts +++ b/src/utils/setIconfont.ts @@ -1,6 +1,6 @@ // 字体图标 url const cssCdnUrlList: Array = [ - '//at.alicdn.com/t/font_2298093_zyqji9hnk.css', + '//at.alicdn.com/t/font_2298093_ysc3z187xhh.css', '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', ]; // 第三方 js url diff --git a/src/views/pages/tree/index.vue b/src/views/pages/tree/index.vue new file mode 100644 index 0000000..ae4795a --- /dev/null +++ b/src/views/pages/tree/index.vue @@ -0,0 +1,213 @@ + + + + + -- Gitee From 37e3db50b6055d7ec4cbc8e304bccc76ec0da3c6 Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Tue, 4 May 2021 20:51:36 +0800 Subject: [PATCH 017/183] =?UTF-8?q?'admin-21.05.04:=E4=BF=AE=E5=A4=8Dts?= =?UTF-8?q?=E7=9A=84interface=E7=B1=BB=E5=9E=8B=E5=A3=B0=E6=98=8E=E5=8F=8A?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/store/index.ts | 1 + src/store/interface/index.ts | 14 +++++++------- src/store/modules/keepAliveNames.ts | 2 ++ src/store/modules/requestOldRoutes.ts | 2 ++ src/store/modules/routesList.ts | 2 ++ src/store/modules/tagsViewRoutes.ts | 2 ++ src/store/modules/themeConfig.ts | 2 ++ src/store/modules/userInfos.ts | 2 ++ 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2a5b30c..695b453 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "sass": "^1.32.12", "sass-loader": "^11.0.1", "typescript": "^4.2.4", - "vite": "^2.2.3", + "vite": "^2.2.4", "vue-eslint-parser": "^7.6.0" } } diff --git a/src/store/index.ts b/src/store/index.ts index baa71c4..5d24318 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,5 +1,6 @@ import { InjectionKey } from 'vue'; import { createStore, useStore as baseUseStore, Store } from 'vuex'; +import { RootStateTypes } from '/@/store/interface/index'; import themeConfig from '/@/store/modules/themeConfig.ts'; import routesList from '/@/store/modules/routesList.ts'; import keepAliveNames from '/@/store/modules/keepAliveNames.ts'; diff --git a/src/store/interface/index.ts b/src/store/interface/index.ts index 5959c12..b7faba2 100644 --- a/src/store/interface/index.ts +++ b/src/store/interface/index.ts @@ -1,7 +1,7 @@ // 接口类型声明 // 布局配置 -declare interface ThemeConfigState { +export interface ThemeConfigState { themeConfig: { isDrawer: boolean; primary: string; @@ -52,32 +52,32 @@ declare interface ThemeConfigState { } // 路由列表 -declare interface RoutesListState { +export interface RoutesListState { routesList: Array; } // 路由缓存列表 -declare interface KeepAliveNamesState { +export interface KeepAliveNamesState { keepAliveNames: Array; } // TagsView 路由列表 -declare interface TagsViewRoutesState { +export interface TagsViewRoutesState { tagsViewRoutes: Array; } // 用户信息 -declare interface UserInfosState { +export interface UserInfosState { userInfos: object; } // 后端返回原始路由(未处理时) -declare interface RequestOldRoutesState { +export interface RequestOldRoutesState { requestOldRoutes: Array; } // 主接口(顶级类型声明) -declare interface RootStateTypes { +export interface RootStateTypes { themeConfig: ThemeConfigState; routesList: RoutesListState; keepAliveNames: KeepAliveNamesState; diff --git a/src/store/modules/keepAliveNames.ts b/src/store/modules/keepAliveNames.ts index 4a56f47..d483dcf 100644 --- a/src/store/modules/keepAliveNames.ts +++ b/src/store/modules/keepAliveNames.ts @@ -1,4 +1,6 @@ import { Module } from 'vuex'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { KeepAliveNamesState, RootStateTypes } from '/@/store/interface/index'; const keepAliveNamesModule: Module = { namespaced: true, diff --git a/src/store/modules/requestOldRoutes.ts b/src/store/modules/requestOldRoutes.ts index 71892e4..6b489b1 100644 --- a/src/store/modules/requestOldRoutes.ts +++ b/src/store/modules/requestOldRoutes.ts @@ -1,4 +1,6 @@ import { Module } from 'vuex'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { RequestOldRoutesState, RootStateTypes } from '/@/store/interface/index'; const requestOldRoutesModule: Module = { namespaced: true, diff --git a/src/store/modules/routesList.ts b/src/store/modules/routesList.ts index a6e3e72..900fe9b 100644 --- a/src/store/modules/routesList.ts +++ b/src/store/modules/routesList.ts @@ -1,4 +1,6 @@ import { Module } from 'vuex'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { RoutesListState, RootStateTypes } from '/@/store/interface/index'; const routesListModule: Module = { namespaced: true, diff --git a/src/store/modules/tagsViewRoutes.ts b/src/store/modules/tagsViewRoutes.ts index 8214c81..818a66d 100644 --- a/src/store/modules/tagsViewRoutes.ts +++ b/src/store/modules/tagsViewRoutes.ts @@ -1,4 +1,6 @@ import { Module } from 'vuex'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { TagsViewRoutesState, RootStateTypes } from '/@/store/interface/index'; const tagsViewRoutesModule: Module = { namespaced: true, diff --git a/src/store/modules/themeConfig.ts b/src/store/modules/themeConfig.ts index 66aa98c..7c26e1c 100644 --- a/src/store/modules/themeConfig.ts +++ b/src/store/modules/themeConfig.ts @@ -1,4 +1,6 @@ import { Module } from 'vuex'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { ThemeConfigState, RootStateTypes } from '/@/store/interface/index'; const themeConfigModule: Module = { namespaced: true, diff --git a/src/store/modules/userInfos.ts b/src/store/modules/userInfos.ts index 64f723a..3573306 100644 --- a/src/store/modules/userInfos.ts +++ b/src/store/modules/userInfos.ts @@ -1,5 +1,7 @@ import { Module } from 'vuex'; import { getSession } from '/@/utils/storage.ts'; +// 此处加上 `.ts` 后缀报错,具体原因不详 +import { UserInfosState, RootStateTypes } from '/@/store/interface/index'; const userInfosModule: Module = { namespaced: true, -- Gitee From 7c673b9ae6fcb3ac544292d5b8b258d2520d4076 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Fri, 7 May 2021 15:30:00 +0800 Subject: [PATCH 018/183] =?UTF-8?q?'admin-21.05.07:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - package.json | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e9a617..20edc65 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ cnpm run build - vue-router-nex - vuex - echarts -- vue-element-admin - axios - clipboard - countUp diff --git a/package.json b/package.json index 695b453..9eded85 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^15.0.1", + "@types/node": "^15.0.2", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", - "@typescript-eslint/eslint-plugin": "^4.22.0", - "@typescript-eslint/parser": "^4.22.0", + "@typescript-eslint/eslint-plugin": "^4.22.1", + "@typescript-eslint/parser": "^4.22.1", "@vitejs/plugin-vue": "^1.2.2", "@vue/compiler-sfc": "^3.0.11", - "dotenv": "^8.2.0", + "dotenv": "^9.0.0", "eslint": "^7.25.0", "eslint-plugin-vue": "^7.9.0", "prettier": "^2.2.1", -- Gitee From daaafac7f8f40f2af8bd0a47a093e8ed332d3fe4 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Sat, 8 May 2021 11:36:07 +0800 Subject: [PATCH 019/183] =?UTF-8?q?'admin-21.05.08:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E5=A4=8D=E5=88=B6=E7=9A=84=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E7=99=BB=E5=BD=95=E5=90=8E=E4=B8=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E5=AF=B9=E5=BA=94=E7=9A=84=E9=93=BE=E6=8E=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- src/views/login/component/account.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 7aa7a4d..77f8d72 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1079,7 +1079,7 @@ router.beforeEach((to, from, next) => { NProgress.done(); } else { if (!token) { - next('/login'); + next(`/login?redirect=${to.path}`); clearSession(); resetRoute(); NProgress.done(); diff --git a/src/views/login/component/account.vue b/src/views/login/component/account.vue index e7c8646..6ed078a 100644 --- a/src/views/login/component/account.vue +++ b/src/views/login/component/account.vue @@ -52,7 +52,7 @@ -- Gitee From 6a176cf78a571e66b428743c35063ec348d250e6 Mon Sep 17 00:00:00 2001 From: kangert Date: Wed, 16 Jun 2021 17:32:36 +0800 Subject: [PATCH 042/183] =?UTF-8?q?=E4=BC=98=E5=8C=96=20vuex=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=87=AA=E5=8A=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.ts | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/store/index.ts b/src/store/index.ts index 5d24318..714e26b 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,24 +1,19 @@ import { InjectionKey } from 'vue'; -import { createStore, useStore as baseUseStore, Store } from 'vuex'; +import { createStore, useStore as baseUseStore, Store, ModuleTree } from 'vuex'; import { RootStateTypes } from '/@/store/interface/index'; -import themeConfig from '/@/store/modules/themeConfig.ts'; -import routesList from '/@/store/modules/routesList.ts'; -import keepAliveNames from '/@/store/modules/keepAliveNames.ts'; -import tagsViewRoutes from '/@/store/modules/tagsViewRoutes.ts'; -import userInfos from '/@/store/modules/userInfos.ts'; -import requestOldRoutes from '/@/store/modules/requestOldRoutes.ts'; + +let modules: ModuleTree = {} +const modulesFiles: Record = import.meta.glob('./modules/*.ts') +for (const path in modulesFiles) { + const moduleName: string = path.replace(/(.*\/)*([^.]+).*/gi, '$2') + let module: ModuleTree = await modulesFiles[path]() + modules = { ...modules, [moduleName]:module.default} +} export const key: InjectionKey> = Symbol(); export const store = createStore({ - modules: { - themeConfig, - routesList, - keepAliveNames, - tagsViewRoutes, - userInfos, - requestOldRoutes, - }, + modules }); export function useStore() { -- Gitee From 793e740c324e9240b8331ce5866381593c8c0691 Mon Sep 17 00:00:00 2001 From: kangert Date: Thu, 17 Jun 2021 10:32:20 +0800 Subject: [PATCH 043/183] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8F=90=E9=AB=98=E7=BC=96=E7=A0=81=E4=BD=93?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 6c0f0a1..85a1fe9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -858,7 +858,7 @@ const pathMatch = { }; // 获取目录下的 .vue 全部文件,参考 vite:import.meta.glob -const dynamicViewsModules = import.meta.glob('../views/**/*.{vue,tsx}'); +const dynamicViewsModules: Record = import.meta.glob('../views/**/*.{vue,tsx}'); // 添加静态路由 const router = createRouter({ @@ -919,7 +919,7 @@ export function backEndRouter(routes: any) { } // 后端控制路由,后端路由 component 转换函数 -export function dynamicImport(dynamicViewsModules: Record Promise<{ [key: string]: any }>>, component: string) { +export function dynamicImport(dynamicViewsModules: Record, component: string) { const keys = Object.keys(dynamicViewsModules); const matchKeys = keys.filter((key) => { const k = key.replace('../views', ''); -- Gitee From 134b63848a6c1cb37e9a1bd0b6ca3d4f432bcd62 Mon Sep 17 00:00:00 2001 From: kangert Date: Thu, 17 Jun 2021 10:33:15 +0800 Subject: [PATCH 044/183] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=B0=86=E7=B1=BB=E5=9E=8B=E2=80=9Cstring=20|=20undefined?= =?UTF-8?q?=E2=80=9D=E5=88=86=E9=85=8D=E7=BB=99=E7=B1=BB=E5=9E=8B=E2=80=9C?= =?UTF-8?q?string=E2=80=9D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/viteBuild.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/viteBuild.ts b/src/utils/viteBuild.ts index 05bc8ea..647da4d 100644 --- a/src/utils/viteBuild.ts +++ b/src/utils/viteBuild.ts @@ -9,7 +9,7 @@ export interface ViteEnv { export function loadEnv(): ViteEnv { const env = process.env.NODE_ENV; const ret: any = {}; - const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env', ,]; + const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env', ]; envList.forEach((e) => { dotenv.config({ path: e }); }); -- Gitee From 72ffa2d6fdec58cc876ca2e69612fe81eb365730 Mon Sep 17 00:00:00 2001 From: kangert Date: Fri, 18 Jun 2021 11:11:20 +0800 Subject: [PATCH 045/183] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=B7=B1=E5=85=8B?= =?UTF-8?q?=E9=9A=86=E5=B7=A5=E5=85=B7=E6=96=B9=E4=BE=BF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/deepClone.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/utils/deepClone.ts diff --git a/src/utils/deepClone.ts b/src/utils/deepClone.ts new file mode 100644 index 0000000..3e45034 --- /dev/null +++ b/src/utils/deepClone.ts @@ -0,0 +1,22 @@ +/** + * 对象深克隆 + * @param obj 源对象 + * @returns 克隆后的对象 + */ +export function deepClone(obj: any) { + let newObj: any + try { + //如果obj有push方法则 定义newObj为数组,否则为对象。 + newObj = obj.push ? [] : {} + } catch (error) { + newObj = {} + } + for (let attr in obj) { + if (typeof obj[attr] === 'object') { + newObj[attr] = deepClone(obj[attr]); + } else { + newObj[attr] = obj[attr]; + } + } + return newObj; +} \ No newline at end of file -- Gitee From 9a43e1d6c74571301c9a3fffbeffef21765655a7 Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Sat, 19 Jun 2021 17:49:42 +0800 Subject: [PATCH 046/183] =?UTF-8?q?'admin-21.06.19:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=AF=B8=E5=A4=9A=E9=97=AE=E9=A2=98=EF=BC=8C=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E6=9F=A5=E7=9C=8BCHANGELOG.md=E6=96=87=E4=BB=B61.04=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=A5=E5=BF=97'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + CHANGELOG.md | 20 +- package.json | 32 +- shim.d.ts | 7 + src/App.vue | 22 +- src/api/login/index.ts | 14 +- src/api/menu/index.ts | 17 +- src/components/auth/auth.vue | 2 +- src/components/auth/authAll.vue | 4 +- src/components/auth/auths.vue | 2 +- src/components/iconSelector/index.vue | 2 +- src/i18n/index.ts | 20 +- src/i18n/lang/en.ts | 1 + src/i18n/lang/zh-cn.ts | 1 + src/i18n/lang/zh-tw.ts | 1 + src/{views => }/layout/component/aside.vue | 6 +- .../layout/component/columnsAside.vue | 2 +- src/{views => }/layout/component/header.vue | 4 +- src/{views => }/layout/component/main.vue | 10 +- src/{views => }/layout/footer/index.vue | 0 src/{views => }/layout/index.vue | 16 +- src/{views => }/layout/lockScreen/index.vue | 8 +- src/{views => }/layout/logo/index.vue | 2 +- src/{views => }/layout/main/classic.vue | 10 +- src/{views => }/layout/main/columns.vue | 10 +- src/{views => }/layout/main/defaults.vue | 8 +- src/{views => }/layout/main/transverse.vue | 4 +- .../layout/navBars/breadcrumb/breadcrumb.vue | 2 +- .../layout/navBars/breadcrumb/index.vue | 10 +- .../layout/navBars/breadcrumb/search.vue | 2 +- .../layout/navBars/breadcrumb/setings.vue | 32 +- .../layout/navBars/breadcrumb/user.vue | 31 +- .../layout/navBars/breadcrumb/userNews.vue | 0 src/{views => }/layout/navBars/index.vue | 6 +- .../layout/navBars/tagsView/contextmenu.vue | 0 .../layout/navBars/tagsView/tagsView.vue | 14 +- src/{views => }/layout/navMenu/horizontal.vue | 4 +- src/{views => }/layout/navMenu/subItem.vue | 0 src/{views => }/layout/navMenu/vertical.vue | 4 +- src/{views => }/layout/routerView/iframes.vue | 0 src/{views => }/layout/routerView/link.vue | 0 src/{views => }/layout/routerView/parent.vue | 2 +- src/main.ts | 6 +- src/router/backEnd.ts | 98 ++ src/router/frontEnd.ts | 24 + src/router/index.ts | 1049 ++--------------- src/router/route.ts | 869 ++++++++++++++ src/store/index.ts | 35 +- src/store/modules/themeConfig.ts | 4 +- src/store/modules/userInfos.ts | 4 +- src/theme/media/login.scss | 17 +- src/utils/arrayOperation.ts | 9 +- src/utils/authDirective.ts | 15 +- src/utils/authFunction.ts | 32 +- src/utils/componentSize.ts | 9 +- src/utils/customDirective.ts | 10 +- src/utils/deepClone.ts | 21 + src/utils/directive.ts | 10 +- src/utils/formatTime.ts | 66 +- src/utils/getStyleSheets.ts | 7 +- src/utils/loading.ts | 11 +- src/utils/request.ts | 12 +- src/utils/setIconfont.ts | 12 +- src/utils/storage.ts | 55 +- src/utils/theme.ts | 28 +- src/utils/toolsValidate.ts | 133 ++- src/utils/viteBuild.ts | 11 +- src/utils/wartermark.ts | 10 +- src/views/chart/chart.ts | 20 +- src/views/chart/head.vue | 2 +- src/views/chart/index.vue | 4 +- src/views/error/401.vue | 4 +- src/views/fun/echartsMap/index.vue | 4 +- src/views/fun/tree/index.vue | 4 +- src/views/home/index.vue | 19 +- src/views/home/mock.ts | 15 +- src/views/limits/frontEnd/btn/index.vue | 2 +- src/views/limits/frontEnd/page/index.vue | 24 +- src/views/login/component/account.vue | 24 +- src/views/login/index.vue | 4 +- src/views/pages/awesome/index.vue | 2 +- src/views/pages/element/index.vue | 2 +- src/views/pages/filtering/details.vue | 2 +- src/views/pages/filtering/details1.vue | 2 +- src/views/pages/filtering/index.vue | 2 +- src/views/pages/iocnfont/index.vue | 2 +- src/views/pages/listAdapt/index.vue | 2 +- src/views/personal/index.vue | 4 +- src/views/personal/mock.ts | 32 +- src/views/system/menu/component/addMenu.vue | 4 +- src/views/system/menu/component/editMenu.vue | 4 +- src/views/system/menu/index.vue | 2 +- src/views/tools/index.vue | 2 +- vite.config.ts | 2 +- 94 files changed, 1735 insertions(+), 1345 deletions(-) rename src/{views => }/layout/component/aside.vue (96%) rename src/{views => }/layout/component/columnsAside.vue (99%) rename src/{views => }/layout/component/header.vue (83%) rename src/{views => }/layout/component/main.vue (90%) rename src/{views => }/layout/footer/index.vue (100%) rename src/{views => }/layout/index.vue (72%) rename src/{views => }/layout/lockScreen/index.vue (97%) rename src/{views => }/layout/logo/index.vue (97%) rename src/{views => }/layout/main/classic.vue (72%) rename src/{views => }/layout/main/columns.vue (72%) rename src/{views => }/layout/main/defaults.vue (82%) rename src/{views => }/layout/main/transverse.vue (73%) rename src/{views => }/layout/navBars/breadcrumb/breadcrumb.vue (98%) rename src/{views => }/layout/navBars/breadcrumb/index.vue (91%) rename src/{views => }/layout/navBars/breadcrumb/search.vue (98%) rename src/{views => }/layout/navBars/breadcrumb/setings.vue (97%) rename src/{views => }/layout/navBars/breadcrumb/user.vue (90%) rename src/{views => }/layout/navBars/breadcrumb/userNews.vue (100%) rename src/{views => }/layout/navBars/index.vue (78%) rename src/{views => }/layout/navBars/tagsView/contextmenu.vue (100%) rename src/{views => }/layout/navBars/tagsView/tagsView.vue (96%) rename src/{views => }/layout/navMenu/horizontal.vue (97%) rename src/{views => }/layout/navMenu/subItem.vue (100%) rename src/{views => }/layout/navMenu/vertical.vue (95%) rename src/{views => }/layout/routerView/iframes.vue (100%) rename src/{views => }/layout/routerView/link.vue (100%) rename src/{views => }/layout/routerView/parent.vue (97%) create mode 100644 src/router/backEnd.ts create mode 100644 src/router/frontEnd.ts create mode 100644 src/router/route.ts create mode 100644 src/utils/deepClone.ts diff --git a/.eslintrc.js b/.eslintrc.js index d876c74..6824bb0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -57,5 +57,6 @@ module.exports = { 'no-unused-vars': 'error', 'no-v-model-argument': 'off', 'no-case-declarations': 'off', + 'no-console': 'error', }, }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 4def1f0..b0c42ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,31 @@ 🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支) +## 1.0.4 + +`2021.06.19` + +- 🌟 更新 依赖更新最新版本("vite": "^2.3.7")热更新无问题 +- 🎉 新增 深克隆工具,方便开发,感谢@kangert(#6) +- 🎯 优化 类型定义提高编码体验,修复不能将类型“string | undefined”分配给类型“string”的问题。感谢@kangert(#5) +- 🎯 优化 `layout` 文件夹移动到与 `views` 文件夹同级(改动较大,`/@/views/layout` 变成 `/@/layout`) +- 🎯 优化 页面有 `console.log` 时 `eslint` 不生效问题 +- 🎯 优化 页面、ts 中 `any` 类型问题(改动较大) +- 🎯 优化 登录页在手机上显示的效果 +- 🎯 优化 多行注释信息,鼠标放到方法名即可查看,更加直观的知道方法参数等。引入方法时需去掉以 `.ts` 结尾的后缀(改动较大) +- 🎯 优化 移除 `utils/storage.ts` 下的旧写法(改动较大) +- 🎯 优化 拆分 `router` 下内容,路由、前端、后端控制分开写,方便理解 +- 🐞 修复 鼠标移入顶部用户信息栏 `开/关全屏` 文字反向问题 +- 🐞 修复 热更新时,NextLoading(界面 loading) 不消失问题 `window.nextLoading === undefined` +- 🐞 修复 vuex 中不可以使用 `/@/api/xxx` 下的接口调用问题 + ## 1.0.3 `2021.06.02` - ❄️ 删除 G6 思维导图界面 - 🌟 更新 手动更新 vue、vue-router、vuex 到最近最多人使用的版本,出现不可预测的问题请降低版本。版本查看:vue 版本查看 -- 🐞 修复 开启后端控制路由`isRequestRoutes`在非首页刷新页面后,回到首页的问题,感谢群友@伯牙已遇钟子期 +- 🐞 修复 开启后端控制路由 `isRequestRoutes` 在非首页刷新页面后,回到首页的问题,感谢群友@伯牙已遇钟子期 ## 1.0.2 diff --git a/package.json b/package.json index a49a1c9..a96ad91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-next-admin", - "version": "1.0.3", + "version": "1.0.4", "scripts": { "dev": "vite", "build": "vite build", @@ -10,10 +10,10 @@ "axios": "^0.21.1", "clipboard": "^2.0.8", "countup.js": "^2.0.7", - "cropperjs": "^1.5.11", - "echarts": "^5.1.1", + "cropperjs": "^1.5.12", + "echarts": "^5.1.2", "echarts-wordcloud": "^2.0.0", - "element-plus": "^1.0.2-beta.45", + "element-plus": "^1.0.2-beta.48", "mitt": "^2.1.0", "nprogress": "^0.2.0", "print-js": "^1.6.0", @@ -27,26 +27,26 @@ "vue-router": "^4.0.8", "vue-web-screen-shot": "^1.2.0", "vuex": "^4.0.1", - "wangeditor": "^4.7.1" + "wangeditor": "^4.7.4" }, "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^15.6.1", + "@types/node": "^15.12.4", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", - "@typescript-eslint/eslint-plugin": "^4.26.0", - "@typescript-eslint/parser": "^4.26.0", + "@typescript-eslint/eslint-plugin": "^4.27.0", + "@typescript-eslint/parser": "^4.27.0", "@vitejs/plugin-vue": "^1.2.3", - "@vue/compiler-sfc": "^3.0.11", + "@vue/compiler-sfc": "^3.1.1", "dotenv": "^10.0.0", - "eslint": "^7.27.0", - "eslint-plugin-vue": "^7.10.0", - "prettier": "^2.3.0", - "sass": "^1.34.0", - "sass-loader": "^11.1.1", - "typescript": "^4.3.2", - "vite": "^2.3.5", + "eslint": "^7.29.0", + "eslint-plugin-vue": "^7.11.1", + "prettier": "^2.3.1", + "sass": "^1.35.1", + "sass-loader": "^12.1.0", + "typescript": "^4.3.4", + "vite": "^2.3.7", "vue-eslint-parser": "^7.6.0" }, "browserslist": [ diff --git a/shim.d.ts b/shim.d.ts index 1877785..3e9bfd0 100644 --- a/shim.d.ts +++ b/shim.d.ts @@ -1,6 +1,13 @@ /* eslint-disable */ + +// 声明文件,*.vue 后缀的文件交给 vue 模块来处理 declare module '*.vue' { import type { DefineComponent } from 'vue'; const component: DefineComponent<{}, {}, any>; export default component; } + +// 声明文件,定义全局变量。其它 app.config.globalProperties.xxx,使用 getCurrentInstance() 来获取 +interface Window { + nextLoading: boolean; +} diff --git a/src/App.vue b/src/App.vue index 7a9e5eb..731a9d3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,11 +8,11 @@ import { computed, ref, getCurrentInstance, onBeforeMount, onMounted, onUnmounted, nextTick, defineComponent, watch } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; -import { useStore } from '/@/store/index.ts'; -import { getLocal } from '/@/utils/storage.ts'; -import setIntroduction from '/@/utils/setIconfont.ts'; -import LockScreen from '/@/views/layout/lockScreen/index.vue'; -import Setings from '/@/views/layout/navBars/breadcrumb/setings.vue'; +import { useStore } from '/@/store/index'; +import { Local } from '/@/utils/storage'; +import setIntroduction from '/@/utils/setIconfont'; +import LockScreen from '/@/layout/lockScreen/index.vue'; +import Setings from '/@/layout/navBars/breadcrumb/setings.vue'; export default defineComponent({ name: 'app', components: { LockScreen, Setings }, @@ -45,9 +45,9 @@ export default defineComponent({ openSetingsDrawer(); }); // 获取缓存中的布局配置 - if (getLocal('themeConfig')) { - store.dispatch('themeConfig/setThemeConfig', getLocal('themeConfig')); - document.documentElement.style.cssText = getLocal('themeConfigStyle'); + if (Local.get('themeConfig')) { + store.dispatch('themeConfig/setThemeConfig', Local.get('themeConfig')); + document.documentElement.style.cssText = Local.get('themeConfigStyle'); } }); }); @@ -60,9 +60,9 @@ export default defineComponent({ () => route.path, () => { nextTick(() => { - let webTitle = ''; - route.path === '/login' ? (webTitle = route.meta.title) : (webTitle = t(route.meta.title)); - document.title = `${webTitle} - ${getThemeConfig.value.globalTitle}` || getThemeConfig.value.globalTitle; + // let webTitle = ''; + // route.path === '/login' ? (webTitle = route.meta.title) : (webTitle = t(route.meta.title)); + // document.title = `${webTitle} - ${getThemeConfig.value.globalTitle}` || getThemeConfig.value.globalTitle; }); } ); diff --git a/src/api/login/index.ts b/src/api/login/index.ts index 8512a24..5726378 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -1,6 +1,10 @@ -import request from '/@/utils/request.ts'; +import request from '/@/utils/request'; -// 用户登录 +/** + * 用户登录 + * @param params 要传的参数值 + * @returns 返回接口数据 + */ export function signIn(params: object) { return request({ url: '/user/signIn', @@ -9,7 +13,11 @@ export function signIn(params: object) { }); } -// 用户退出登录 +/** + * 用户退出登录 + * @param params 要传的参数值 + * @returns 返回接口数据 + */ export function signOut(params: object) { return request({ url: '/user/signOut', diff --git a/src/api/menu/index.ts b/src/api/menu/index.ts index a10a070..d438ee1 100644 --- a/src/api/menu/index.ts +++ b/src/api/menu/index.ts @@ -1,10 +1,16 @@ -import request from '/@/utils/request.ts'; +import request from '/@/utils/request'; /** * 后端控制菜单模拟json,路径在 https://gitee.com/lyt-top/vue-next-admin-images/tree/master/menu * 后端控制路由,isRequestRoutes 为 true,则开启后端控制路由 */ -// 获取后端动态路由菜单(admin) + +/** + * 获取后端动态路由菜单(admin) + * @link 参考:https://gitee.com/lyt-top/vue-next-admin-images/tree/master/menu + * @param params 要传的参数值,非必传 + * @returns 返回接口数据 + */ export function getMenuAdmin(params?: object) { return request({ url: '/gitee/lyt-top/vue-next-admin-images/raw/master/menu/adminMenu.json', @@ -13,7 +19,12 @@ export function getMenuAdmin(params?: object) { }); } -// 获取后端动态路由菜单(test) +/** + * 获取后端动态路由菜单(test) + * @link 参考:https://gitee.com/lyt-top/vue-next-admin-images/tree/master/menu + * @param params 要传的参数值,非必传 + * @returns 返回接口数据 + */ export function getMenuTest(params?: object) { return request({ url: '/gitee/lyt-top/vue-next-admin-images/raw/master/menu/testMenu.json', diff --git a/src/components/auth/auth.vue b/src/components/auth/auth.vue index 6bde67e..f7353da 100644 --- a/src/components/auth/auth.vue +++ b/src/components/auth/auth.vue @@ -6,7 +6,7 @@ -- Gitee From 92904ffef35a2bd495ff69df037729a6578fb73e Mon Sep 17 00:00:00 2001 From: lyt-Top <1105290566@qq.com> Date: Thu, 24 Jun 2021 19:45:50 +0800 Subject: [PATCH 053/183] =?UTF-8?q?'admin-21.06.24:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=8B=96=E5=8A=A8=E6=8C=87=E4=BB=A4=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/theme/element.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/theme/element.scss b/src/theme/element.scss index 2768f40..57aa137 100644 --- a/src/theme/element.scss +++ b/src/theme/element.scss @@ -933,6 +933,7 @@ justify-content: center; .el-dialog { margin: 0 auto !important; + position: absolute; .el-dialog__body { padding: 20px !important; } -- Gitee From b2fd7d60100d6eacd14e2fed008c97d3af005793 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Tue, 29 Jun 2021 17:20:40 +0800 Subject: [PATCH 054/183] =?UTF-8?q?'admin-21.06.29:=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E4=BE=9D=E8=B5=96=E3=80=81=E5=90=84=E9=A1=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E8=AF=B7=E6=9F=A5=E7=9C=8BCHANGELOG?= =?UTF-8?q?.md=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 11 ++ package.json | 16 +-- src/components/iconSelector/index.vue | 168 ++++++++++++++------------ src/i18n/index.ts | 6 + src/i18n/lang/en.ts | 1 + src/i18n/lang/zh-cn.ts | 1 + src/i18n/lang/zh-tw.ts | 1 + src/i18n/pages/formI18n/en.ts | 13 ++ src/i18n/pages/formI18n/zh-cn.ts | 13 ++ src/i18n/pages/formI18n/zh-tw.ts | 13 ++ src/router/route.ts | 15 +++ src/theme/element.scss | 2 +- src/theme/iconSelector.scss | 51 +++----- src/theme/media/form.scss | 3 + src/utils/customDirective.ts | 135 ++++++++------------- src/utils/setIconfont.ts | 2 +- src/views/fun/selector/index.vue | 116 ++++++++++++++++-- src/views/fun/tagsView/index.vue | 14 ++- src/views/login/component/account.vue | 20 ++- src/views/login/component/mobile.vue | 11 +- src/views/pages/cityLinkage/index.vue | 7 +- src/views/pages/formI18n/index.vue | 54 +++++++++ 22 files changed, 445 insertions(+), 228 deletions(-) create mode 100644 src/i18n/pages/formI18n/en.ts create mode 100644 src/i18n/pages/formI18n/zh-cn.ts create mode 100644 src/i18n/pages/formI18n/zh-tw.ts create mode 100644 src/views/pages/formI18n/index.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb4373..6709dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ 🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支) +## 1.0.8 + +`2021.06.29` + +- 🌟 更新 依赖更新最新版本 +- 🎉 新增 表单中英文切换演示 +- 🎯 优化 登录页查看密码 icon 图标 +- 🎯 优化 图标选择器 +- 🎯 优化 拖动指令 +- 🐞 修复 form 表单在页面小于 576px 时的排版问题 + ## 1.0.7 `2021.06.24` diff --git a/package.json b/package.json index 968a7e6..2090948 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-next-admin", - "version": "1.0.7", + "version": "1.0.8", "scripts": { "dev": "vite", "build": "vite build", @@ -13,7 +13,7 @@ "cropperjs": "^1.5.12", "echarts": "^5.1.2", "echarts-wordcloud": "^2.0.0", - "element-plus": "^1.0.2-beta.51", + "element-plus": "^1.0.2-beta.53", "mitt": "^3.0.0", "nprogress": "^0.2.0", "print-js": "^1.6.0", @@ -32,17 +32,17 @@ "devDependencies": { "@types/axios": "^0.14.0", "@types/clipboard": "^2.0.1", - "@types/node": "^15.12.4", + "@types/node": "^15.12.5", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.10.6", - "@typescript-eslint/eslint-plugin": "^4.28.0", - "@typescript-eslint/parser": "^4.28.0", - "@vitejs/plugin-vue": "^1.2.3", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", + "@vitejs/plugin-vue": "^1.2.4", "@vue/compiler-sfc": "^3.1.2", "dotenv": "^10.0.0", "eslint": "^7.29.0", - "eslint-plugin-vue": "^7.11.1", - "prettier": "^2.3.1", + "eslint-plugin-vue": "^7.12.1", + "prettier": "^2.3.2", "sass": "^1.35.1", "sass-loader": "^12.1.0", "typescript": "^4.3.4", diff --git a/src/components/iconSelector/index.vue b/src/components/iconSelector/index.vue index d07580c..3f52362 100644 --- a/src/components/iconSelector/index.vue +++ b/src/components/iconSelector/index.vue @@ -1,57 +1,49 @@ diff --git a/src/layout/routerView/link.vue b/src/layout/routerView/link.vue index 6b0b0a6..8f773c6 100644 --- a/src/layout/routerView/link.vue +++ b/src/layout/routerView/link.vue @@ -1,13 +1,13 @@ + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 458b752..58a2c80 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -6,21 +6,27 @@