mirror of
https://gitee.com/lyt-top/vue-next-admin
synced 2026-06-07 10:22:14 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7544b23d7c | |||
| 225bce794b | |||
| f92574c0f2 | |||
| a91f84e3a1 | |||
| ccca4cd355 | |||
| a894768c56 | |||
| 496594578a | |||
| 1cbc0f1b4e | |||
| bf9fce206a | |||
| 9195d8367f | |||
| 1b3600f394 | |||
| 16823b2ef7 | |||
| 9d794f2309 | |||
| bd8ac2cc94 | |||
| 2b9506845c |
3
.env
3
.env
@ -4,5 +4,8 @@ VITE_PORT = 8888
|
||||
# open 运行 npm run dev 时自动打开浏览器
|
||||
VITE_OPEN = false
|
||||
|
||||
# 打包是否开启 cdn(源文件 utils/build.ts),可自行修改
|
||||
VITE_OPEN_CDN = false
|
||||
|
||||
# public path 配置线上环境路径(打包)、本地通过 http-server 访问时,请置空即可
|
||||
VITE_PUBLIC_PATH = /vue-next-admin-preview/
|
||||
@ -1,5 +1,5 @@
|
||||
# 本地环境
|
||||
ENV = 'development'
|
||||
ENV = development
|
||||
|
||||
# 本地环境接口地址
|
||||
VITE_API_URL = 'http://localhost:8888/'
|
||||
VITE_API_URL = http://localhost:8888/
|
||||
@ -1,5 +1,5 @@
|
||||
# 线上环境
|
||||
ENV = 'production'
|
||||
ENV = production
|
||||
|
||||
# 线上环境接口地址
|
||||
VITE_API_URL = 'https://lyt-top.gitee.io/vue-next-admin-preview/'
|
||||
VITE_API_URL = https://lyt-top.gitee.io/vue-next-admin-preview/
|
||||
52
CHANGELOG.md
52
CHANGELOG.md
@ -2,6 +2,58 @@
|
||||
|
||||
🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支)
|
||||
|
||||
## 2.4.32
|
||||
|
||||
💔💔💔 图片不显示问题(README.md、演示中使用的图片,[vue-next-admin-images](https://gitee.com/lyt-top/vue-next-admin-images)),通过网站 [https://www.hd-r.cn/](https://www.hd-r.cn/) 转在线链接,如若侵权请联系作者 qq:1105290566
|
||||
|
||||
`2023.03.26`
|
||||
|
||||
- 🌟 更新 依赖更新最新版本
|
||||
- 🐞 修复 [关于开发环境 sourceMap 的问题](https://gitee.com/lyt-top/vue-next-admin/issues/I6DNDQ),感谢[@XiaoSongJiang](https://gitee.com/XiaoSongJiang)
|
||||
- 🐞 修复 打包提示 `[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.`,不能使用 `:deep {}`,而应使用 `:deep() {}`
|
||||
- 🎨 合并 [feat: 一级菜单重定向为空,分栏模式下,点击一次菜单时现在会切换子菜单列表,而不是打开空白页](https://gitee.com/lyt-top/vue-next-admin/commit/a91f84e3a1a86d8d303a5b46171622913d9d0737),感谢[@写意](https://gitee.com/xjj_0906)
|
||||
- 🎯 优化 经典布局分割菜单只有一项子级时,收起左侧导航菜单
|
||||
- 🎯 优化 watch 监听范围
|
||||
- 🎯 优化 打包:分包(manualChunks)、gzip 压缩、cdn 加速 `默认关闭 .env 中开启`(可查看文章[vue-next-admin vue3 + vite 打包 gzip 压缩、cdn 加速](https://blog.csdn.net/qq_34450741/article/details/129766676))
|
||||
|
||||
## 2.4.31
|
||||
|
||||
`2023.03.10`
|
||||
|
||||
- 🌟 更新 依赖更新最新版本
|
||||
- 🐞 修复 顶栏背景渐变设置不生效
|
||||
- 🐞 修复 顶栏背景渐变、菜单背景渐变时,深色主题不生效
|
||||
- 🐞 修复 顶栏搜索框移动端显示问题
|
||||
- 🎯 优化 `main.ts`,相关 issues [#I6KNFH](https://gitee.com/lyt-top/vue-next-admin/issues/I6KNFH)、[#I6JRH6](https://gitee.com/lyt-top/vue-next-admin/issues/I6JRH6)
|
||||
- 🎯 优化 菜单横向模式显示(horizontal)
|
||||
- 🎯 优化 分栏布局,[希望分栏布局做一下优化,在没有二级菜单的时候,直接全屏展示一级菜单链接](https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H),感谢[@jiuping](https://gitee.com/jiuping),`tagsview` 点击时处理 `收起/展开` 菜单
|
||||
|
||||
## 2.4.3
|
||||
|
||||
`2023.02.22`
|
||||
|
||||
🚩🚩🚩 感谢 [驰骋工作流引擎-表单引擎-低代码开发平台](http://www.ccflow.org/) 赞助商的赞助。驰骋公司为社会提供流程引擎+表单引擎+低代码开发平台一体的开源软件解决方案,欢迎广大开发者前去体验!
|
||||
|
||||
- 🌟 更新 依赖更新最新版本
|
||||
- 🎉 新增 赞助商组件(`/src/layout/sponsors`),[项目目录结构查看](https://lyt-top.gitee.io/vue-next-admin-doc-preview/config/)
|
||||
- 🐞 修复 [过滤筛选组件展开点击不了](https://gitee.com/lyt-top/vue-next-admin/issues/I688WG)
|
||||
- 🐞 修复 [设置锁屏时间时直接白屏了不能恢复,除非删除主题配置才会重新加载](https://gitee.com/lyt-top/vue-next-admin/issues/I6AF8P),感谢[@baizunxian](https://gitee.com/xb_xiaobai)
|
||||
- 🐞 修复 `分栏布局` 地址栏输入不存在的路由报错问题
|
||||
- 🎨 合并 [!44 tagsViewName 正则匹配错误,匹配到含 en 单词](https://gitee.com/lyt-top/vue-next-admin/pulls/44/files),感谢[@tony 星](https://gitee.com/tony_tong_xin)
|
||||
- 🎨 合并 [!45 fix 地址栏出现 false 问题](https://gitee.com/lyt-top/vue-next-admin/pulls/45),感谢[@随心](https://gitee.com/jiangqiang1996)
|
||||
- 🎯 优化 `/src/utils/storage` 下 `key` 编写成 `${__NEXT_NAME__}:${key}`,防止部署多套系统到同一域名不同目录时,变量共用的问题(`__NEXT_NAME__`为 `package.json` 中的 `name`)
|
||||
- 🎯 优化 watermark 单词拼写错误
|
||||
|
||||
## 2.4.21
|
||||
|
||||
`2022.12.12`
|
||||
|
||||
- 🌟 更新 依赖更新最新版本
|
||||
- 🎉 新增 菜单背景高亮颜色可自定义,通过 `布局配置 -> 菜单设置 -> 菜单高亮背景色` 进行设置
|
||||
- 🐞 修复 `分栏布局` 二级导航菜单内容多时,无法滚动问题,感谢群友@静雨轩主人
|
||||
- 🐞 修复 [!42 修复 工作流无法添加新节点问题](https://gitee.com/lyt-top/vue-next-admin/pulls/42),感谢[@beta](https://gitee.com/beta_dz)
|
||||
- 🎯 优化 `/make/tableDemo` 表头很多时,无法滚动问题,感谢群友@糊涂涂涂
|
||||
|
||||
## 2.4.2
|
||||
|
||||
`2022.12.09`
|
||||
|
||||
60
README.md
60
README.md
@ -1,25 +1,31 @@
|
||||
<div align="center">
|
||||
<img src="https://img-blog.csdnimg.cn/9efd5420327a46b7bd6d93524a97229d.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_14,color_FFFFFF,t_70,g_se,x_16">
|
||||
<img src="https://i.hd-r.cn/6ce52e5724fae609444b5b48bdc4accb.png">
|
||||
<p align="center">
|
||||
<a href="https://v3.vuejs.org/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/vue.js-vue3.x-green" alt="vue">
|
||||
</a>
|
||||
<a href="https://element-plus.gitee.io/#/zh-CN/component/changelog" target="_blank">
|
||||
<img src="https://img.shields.io/badge/element--plus-%3E1.0.0-blue" alt="element plus">
|
||||
</a>
|
||||
<a href="https://v3.vuejs.org/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/vue.js-vue3.x-green" alt="vue">
|
||||
</a>
|
||||
<a href="https://element-plus.gitee.io/#/zh-CN/component/changelog" target="_blank">
|
||||
<img src="https://img.shields.io/badge/element--plus-%3E1.0.0-blue" alt="element plus">
|
||||
</a>
|
||||
<a href="https://www.tslang.cn/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/typescript-%3E4.0.0-blue" alt="typescript">
|
||||
</a>
|
||||
<img src="https://img.shields.io/badge/typescript-%3E4.0.0-blue" alt="typescript">
|
||||
</a>
|
||||
<a href="https://vitejs.dev/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/vite-%3E2.0.0-yellow" alt="vite">
|
||||
<img src="https://img.shields.io/badge/vite-%3E2.0.0-yellow" alt="vite">
|
||||
</a>
|
||||
<a href="https://gitee.com/lyt-top/vue-next-admin/blob/master/LICENSE" target="_blank">
|
||||
<img src="https://img.shields.io/badge/license-MIT-success" alt="license">
|
||||
<img src="https://img.shields.io/badge/license-MIT-success" alt="license">
|
||||
</a>
|
||||
</p>
|
||||
<p> </p>
|
||||
</div>
|
||||
|
||||
#### 💝 长期赞助商
|
||||
|
||||
<a href="http://www.ccflow.org/" target="_blank">
|
||||
<img src="./src/assets/ccflowRightNextAdmin.png" width="50%" height="70px">
|
||||
</a>
|
||||
|
||||
#### 🌈 介绍
|
||||
|
||||
基于 vue3.x + CompositionAPI setup 语法糖 + typescript + vite + element plus + vue-router-next + pinia 技术,适配手机、平板、pc 的后台开源免费模板,希望减少工作量,帮助大家实现快速开发。
|
||||
@ -28,6 +34,7 @@
|
||||
|
||||
- vue3.x 版本预览(vue-next-admin)<a href="https://lyt-top.gitee.io/vue-next-admin-preview/#/login" target="_blank">https://lyt-top.gitee.io/vue-next-admin-preview/#/login</a>
|
||||
- vue2.x 版本预览(vue-prev-admin)<a href="https://lyt-top.gitee.io/vue-prev-admin-preview/#/login" target="_blank">https://lyt-top.gitee.io/vue-prev-admin-preview/#/login</a>
|
||||
- vue3.x + uni-app 商城 H5(vue-next-admin-shop)<a href="https://lyt-top.gitee.io/vue-next-admin-shop-preview" target="_blank">https://lyt-top.gitee.io/vue-next-admin-shop-preview</a>
|
||||
|
||||
#### 💒 代码仓库
|
||||
|
||||
@ -76,28 +83,15 @@ cnpm run build
|
||||
|
||||
#### 💯 学习交流加 QQ 群
|
||||
|
||||
> 若加群了没同意(一般秒过),那就是群满了(500 人群),请换一个群试试。群会定期清理半年(6 个月)未发言的群友,资源有限,请谅解。建议勿加多群,可能会误伤!微信群由于只有 `7天有效` 就不放这里了。
|
||||
> 1 - 4 交流群已满,请加 vue-next-admin 交流群 5
|
||||
|
||||
- 1 群:<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=RdUY97Vx0T0vZ_1OOu-X1yFNkWgDwbjC&jump_from=webapi">665452019</a>
|
||||
- 2 群:<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=zVfy3gNy7pNWVK3kMduDzwU369PZg2fw&jump_from=webapi">766356862</a>
|
||||
- 3 群:<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=02EWb5P2JkP-8iwzaDadgFdxA0HSHPpn&jump_from=webapi">795345435</a>
|
||||
- 4 群:<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=0gTFO04WwkeZZ6R4lju6gucbeXHK-wNd&jump_from=webapi">736626228</a>
|
||||
群号:556254895
|
||||
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=RdUY97Vx0T0vZ_1OOu-X1yFNkWgDwbjC&jump_from=webapi">
|
||||
<img src="https://img-blog.csdnimg.cn/35e00f12a3fe4820892ec630ca72f15f.png" width="220" height="220" alt="vue-next-admin 讨论群1" title="vue-next-admin 讨论群1"/>
|
||||
</a>
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=zVfy3gNy7pNWVK3kMduDzwU369PZg2fw&jump_from=webapi">
|
||||
<img src="https://img-blog.csdnimg.cn/5f1b548abd9f434eb41edde31d1c1fa9.png" width="220" height="220" alt="vue-next-admin 讨论群2" title="vue-next-admin 讨论群2"/>
|
||||
</a>
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=02EWb5P2JkP-8iwzaDadgFdxA0HSHPpn&jump_from=webapi">
|
||||
<img src="https://img-blog.csdnimg.cn/70c8a012dd304246bddeac2184c4ab3a.png" width="220" height="220" alt="vue-next-admin 讨论群3" title="vue-next-admin 讨论群3"/>
|
||||
</a>
|
||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=0gTFO04WwkeZZ6R4lju6gucbeXHK-wNd&jump_from=webapi">
|
||||
<img src="https://img-blog.csdnimg.cn/e5c9704eed1342bc9d9e74b37203402d.png" width="220" height="220" alt="vue-next-admin 讨论群4" title="vue-next-admin 讨论群4"/>
|
||||
</a>
|
||||
其它交流群请查看文档首页 [vueNextAdmin 解疑问](https://lyt-top.gitee.io/vue-next-admin-doc-preview/)
|
||||
|
||||
#### 💒 集成后端
|
||||
|
||||
- <a target="_blank" href="https://gitee.com/zuohuaijun/Admin.NET">@zuohuaijun Admin.NET</a>
|
||||
- <a target="_blank" href="https://github.com/PandaGoAdmin/PandaX">@熊猫 PandaGoAdmin</a>
|
||||
- <a target="_blank" href="https://toscode.gitee.com/GionConnection/gopro_free">@甜蜜蜜 GoPro 平台</a>
|
||||
- <a target="_blank" href="https://gitee.com/GionConnection/niupi-free">@甜蜜蜜 NiuPi 平台</a>
|
||||
@ -118,7 +112,6 @@ cnpm run build
|
||||
- <a href="https://github.com/vuejs/pinia" target="_blank">pinia</a>
|
||||
- <a href="https://github.com/apache/echarts" target="_blank">echarts</a>
|
||||
- <a href="https://github.com/axios/axios" target="_blank">axios</a>
|
||||
- <a href="https://github.com/zenorocha/clipboard.js" target="_blank">clipboard</a>
|
||||
- <a href="https://github.com/inorganik/countUp.js" target="_blank">countUp</a>
|
||||
- <a href="https://github.com/developit/mitt" target="_blank">mitt</a>
|
||||
- <a href="https://github.com/rstacruz/nprogress" target="_blank">nprogress</a>
|
||||
@ -129,12 +122,19 @@ cnpm run build
|
||||
- <a href="https://github.com/vitejs/vite" target="_blank">vite</a>
|
||||
- <a href="https://github.com/wangeditor-team/wangEditor" target="_blank">wangeditor</a>
|
||||
- <a href="https://github.com/fengyuanchen/cropperjs" target="_blank">cropperjs</a>
|
||||
- <a href="https://github.com/davidshimjs/qrcodejs" target="_blank">qrcodejs</a>
|
||||
- <a href="https://github.com/crabbly/Print.js" target="_blank">print-js</a>
|
||||
- <a href="https://github.com/jbaysolutions/vue-grid-layout" target="_blank">vue-grid-layout</a>
|
||||
- <a href="https://github.com/antoniandre/splitpanes" target="_blank">splitpanes</a>
|
||||
- <a href="https://github.com/jsplumb/jsplumb" target="_blank">jsplumb</a>
|
||||
- <a href="https://github.com/hxj9102/table2excel" target="_blank">js-table2excel</a>
|
||||
- <a href="https://github.com/mmf-fe/vite-plugin-cdn-import" target="_blank">vite-plugin-cdn-import</a>
|
||||
- <a href="https://github.com/js-cookie/js-cookie" target="_blank">js-cookie</a>
|
||||
- <a href="https://github.com/davidshimjs/qrcodejs" target="_blank">qrcodejs2-fixes</a>
|
||||
- <a href="https://github.com/ljharb/qs" target="_blank">qs</a>
|
||||
- <a href="https://github.com/JamieCurnow/vue-clipboard3" target="_blank">vue-clipboard3</a>
|
||||
- <a href="https://github.com/intlify/vue-i18n-next" target="_blank">vue-i18n</a>
|
||||
- <a href="https://github.com/vbenjs/vite-plugin-compression" target="_blank">vite-plugin-compression</a>
|
||||
- <a href="https://github.com/chenxch/vite-plugin-vue-setup-extend-plus" target="_blank">vite-plugin-vue-setup-extend-plus</a>
|
||||
|
||||
#### 💕 特别感谢
|
||||
|
||||
|
||||
1899
package-lock.json
generated
1899
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
47
package.json
47
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-next-admin",
|
||||
"version": "2.4.2",
|
||||
"version": "2.4.32",
|
||||
"description": "vue3 vite next admin template",
|
||||
"author": "lyt_20201208",
|
||||
"license": "MIT",
|
||||
@ -10,49 +10,52 @@
|
||||
"lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.0.10",
|
||||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "^1.2.1",
|
||||
"countup.js": "^2.3.2",
|
||||
"axios": "^1.3.4",
|
||||
"countup.js": "^2.6.0",
|
||||
"cropperjs": "^1.5.13",
|
||||
"echarts": "^5.4.0",
|
||||
"echarts": "^5.4.2",
|
||||
"echarts-gl": "^2.0.9",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "^2.2.26",
|
||||
"element-plus": "^2.3.1",
|
||||
"js-cookie": "^3.0.1",
|
||||
"js-table2excel": "^1.0.3",
|
||||
"jsplumb": "^2.15.6",
|
||||
"mitt": "^3.0.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.0.28",
|
||||
"pinia": "^2.0.33",
|
||||
"print-js": "^1.6.0",
|
||||
"qrcodejs2-fixes": "^0.0.2",
|
||||
"qs": "^6.11.0",
|
||||
"qs": "^6.11.1",
|
||||
"screenfull": "^6.0.2",
|
||||
"sortablejs": "^1.15.0",
|
||||
"splitpanes": "^3.1.5",
|
||||
"vue": "^3.2.45",
|
||||
"vue": "^3.2.47",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-demi": "^0.13.11",
|
||||
"vue-grid-layout": "^3.0.0-beta1",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-router": "^4.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.12",
|
||||
"@types/node": "^18.15.10",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/sortablejs": "^1.15.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
||||
"@typescript-eslint/parser": "^5.46.0",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"@vue/compiler-sfc": "^3.2.45",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-vue": "^9.8.0",
|
||||
"prettier": "^2.8.1",
|
||||
"sass": "^1.56.2",
|
||||
"typescript": "^4.9.4",
|
||||
"vite": "^4.0.0",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"@types/sortablejs": "^1.15.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"@vitejs/plugin-vue": "^4.1.0",
|
||||
"@vue/compiler-sfc": "^3.2.47",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-plugin-vue": "^9.10.0",
|
||||
"prettier": "^2.8.7",
|
||||
"sass": "^1.60.0",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.2.1",
|
||||
"vite-plugin-cdn-import": "^0.3.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-vue-setup-extend-plus": "^0.1.0",
|
||||
"vue-eslint-parser": "^9.1.0"
|
||||
},
|
||||
"browserslist": [
|
||||
|
||||
14
src/App.vue
14
src/App.vue
@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<el-config-provider :size="getGlobalComponentSize" :locale="getGlobalI18n">
|
||||
<router-view v-show="themeConfig.lockScreenTime > 1" />
|
||||
<router-view v-show="setLockScreen" />
|
||||
<LockScreen v-if="themeConfig.isLockScreen" />
|
||||
<Setings ref="setingsRef" v-show="themeConfig.lockScreenTime > 1" />
|
||||
<Setings ref="setingsRef" v-show="setLockScreen" />
|
||||
<CloseFull v-if="!themeConfig.isLockScreen" />
|
||||
<Upgrade v-if="getVersion" />
|
||||
<Sponsors />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
@ -25,6 +26,7 @@ const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index
|
||||
const Setings = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/setings.vue'));
|
||||
const CloseFull = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/closeFull.vue'));
|
||||
const Upgrade = defineAsyncComponent(() => import('/@/layout/upgrade/index.vue'));
|
||||
const Sponsors = defineAsyncComponent(() => import('/@/layout/sponsors/index.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const { messages, locale } = useI18n();
|
||||
@ -34,12 +36,18 @@ const stores = useTagsViewRoutes();
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||
|
||||
// 设置锁屏时组件显示隐藏
|
||||
const setLockScreen = computed(() => {
|
||||
// 防止锁屏后,刷新出现不相关界面
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I6AF8P
|
||||
return themeConfig.value.isLockScreen ? themeConfig.value.lockScreenTime > 1 : themeConfig.value.lockScreenTime >= 0;
|
||||
});
|
||||
// 获取版本号
|
||||
const getVersion = computed(() => {
|
||||
let isVersion = false;
|
||||
if (route.path !== '/login') {
|
||||
// @ts-ignore
|
||||
if ((Local.get('version') && Local.get('version') !== __VERSION__) || !Local.get('version')) isVersion = true;
|
||||
if ((Local.get('version') && Local.get('version') !== __NEXT_VERSION__) || !Local.get('version')) isVersion = true;
|
||||
}
|
||||
return isVersion;
|
||||
});
|
||||
|
||||
BIN
src/assets/ccflowRightNextAdmin.png
Normal file
BIN
src/assets/ccflowRightNextAdmin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
@ -71,26 +71,28 @@
|
||||
<SvgIcon name="iconfont icon-quanjushezhi_o" :size="22" title="设置" />
|
||||
</template>
|
||||
<template #default>
|
||||
<div ref="toolSetRef">
|
||||
<div class="tool-box">
|
||||
<el-tooltip content="拖动进行排序" placement="top-start">
|
||||
<SvgIcon name="fa fa-question-circle-o" :size="17" class="ml11" color="#909399" />
|
||||
</el-tooltip>
|
||||
<el-checkbox
|
||||
v-model="state.checkListAll"
|
||||
:indeterminate="state.checkListIndeterminate"
|
||||
class="ml10 mr1"
|
||||
label="列显示"
|
||||
@change="onCheckAllChange"
|
||||
/>
|
||||
<el-checkbox v-model="getConfig.isSerialNo" class="ml12 mr1" label="序号" />
|
||||
<el-checkbox v-model="getConfig.isSelection" class="ml12 mr1" label="多选" />
|
||||
</div>
|
||||
<div class="tool-item" v-for="v in header" :key="v.key" :data-key="v.key">
|
||||
<i class="fa fa-arrows-alt handle cursor-pointer"></i>
|
||||
<el-checkbox v-model="v.isCheck" class="ml12 mr8" :label="v.title" @change="onCheckChange" />
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<el-tooltip content="拖动进行排序" placement="top-start">
|
||||
<SvgIcon name="fa fa-question-circle-o" :size="17" class="ml11" color="#909399" />
|
||||
</el-tooltip>
|
||||
<el-checkbox
|
||||
v-model="state.checkListAll"
|
||||
:indeterminate="state.checkListIndeterminate"
|
||||
class="ml10 mr1"
|
||||
label="列显示"
|
||||
@change="onCheckAllChange"
|
||||
/>
|
||||
<el-checkbox v-model="getConfig.isSerialNo" class="ml12 mr1" label="序号" />
|
||||
<el-checkbox v-model="getConfig.isSelection" class="ml12 mr1" label="多选" />
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<div ref="toolSetRef" class="tool-sortable">
|
||||
<div class="tool-sortable-item" v-for="v in header" :key="v.key" :data-key="v.key">
|
||||
<i class="fa fa-arrows-alt handle cursor-pointer"></i>
|
||||
<el-checkbox v-model="v.isCheck" size="default" class="ml12 mr8" :label="v.title" @change="onCheckChange" />
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
|
||||
@ -7,7 +7,7 @@ import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
|
||||
/**
|
||||
* 说明:
|
||||
* 须在 pages 下新建文件夹(建议 `要国际化界面目录` 与 `i18 目录` 相同,方便查找),
|
||||
* 须在 pages 下新建文件夹(建议 `要国际化界面目录` 与 `i18n 目录` 相同,方便查找),
|
||||
* 注意国际化定义的字段,不要与原有的定义字段相同。
|
||||
* 1、/src/i18n/lang 下的 ts 为框架的国际化内容
|
||||
* 2、/src/i18n/pages 下的 ts 为各界面的国际化内容
|
||||
|
||||
@ -137,6 +137,7 @@ export default {
|
||||
twoIsTopBarColorGradual: 'Top bar gradient',
|
||||
twoMenuBar: 'Menu background',
|
||||
twoMenuBarColor: 'Menu default font color',
|
||||
twoMenuBarActiveColor: 'Menu Highlight Color',
|
||||
twoIsMenuBarColorGradual: 'Menu gradient',
|
||||
twoColumnsMenuBar: 'Column menu background',
|
||||
twoColumnsMenuBarColor: 'Default font color bar menu',
|
||||
|
||||
@ -137,6 +137,7 @@ export default {
|
||||
twoIsTopBarColorGradual: '顶栏背景渐变',
|
||||
twoMenuBar: '菜单背景',
|
||||
twoMenuBarColor: '菜单默认字体颜色',
|
||||
twoMenuBarActiveColor: '菜单高亮背景色',
|
||||
twoIsMenuBarColorGradual: '菜单背景渐变',
|
||||
twoColumnsMenuBar: '分栏菜单背景',
|
||||
twoColumnsMenuBarColor: '分栏菜单默认字体颜色',
|
||||
|
||||
@ -137,6 +137,7 @@ export default {
|
||||
twoIsTopBarColorGradual: '頂欄背景漸變',
|
||||
twoMenuBar: '選單背景',
|
||||
twoMenuBarColor: '選單默認字體顏色',
|
||||
twoMenuBarActiveColor: '選單高亮背景色',
|
||||
twoIsMenuBarColorGradual: '選單背景漸變',
|
||||
twoColumnsMenuBar: '分欄選單背景',
|
||||
twoColumnsMenuBarColor: '分欄選單默認字體顏色',
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
<script setup lang="ts" name="layoutAside">
|
||||
import { defineAsyncComponent, reactive, computed, watch, onBeforeMount, ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import pinia from '/@/stores/index';
|
||||
import { useRoutesList } from '/@/stores/routesList';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
|
||||
@ -56,8 +55,8 @@ const setCollapseStyle = computed(() => {
|
||||
return [asideBrColor, 'layout-aside-mobile', 'layout-aside-mobile-close'];
|
||||
}
|
||||
} else {
|
||||
if (layout === 'columns') {
|
||||
// 分栏布局,菜单收起时宽度给 1px
|
||||
if (layout === 'columns' || layout === 'classic') {
|
||||
// 分栏布局、经典布局,菜单收起时宽度给 1px,防止切换动画消失
|
||||
if (isCollapse) return [asideBrColor, 'layout-aside-pc-1'];
|
||||
else return [asideBrColor, 'layout-aside-pc-220'];
|
||||
} else {
|
||||
@ -107,7 +106,8 @@ const onAsideEnterLeave = (bool: Boolean) => {
|
||||
let { layout } = themeConfig.value;
|
||||
if (layout !== 'columns') return false;
|
||||
if (!bool) mittBus.emit('restoreDefault');
|
||||
stores.setColumnsMenuHover(bool);
|
||||
// 开启 `分栏菜单鼠标悬停预加载` 才设置,防止 columnsAside.vue 监听 pinia.state
|
||||
if (themeConfig.value.isColumnsMenuHoverPreload) stores.setColumnsMenuHover(bool);
|
||||
};
|
||||
// 页面加载前
|
||||
onBeforeMount(() => {
|
||||
@ -118,37 +118,35 @@ onBeforeMount(() => {
|
||||
mittBus.on('setSendColumnsChildren', (res: MittMenu) => {
|
||||
state.menuList = res.children;
|
||||
});
|
||||
// 开启经典布局分割菜单时,设置菜单数据
|
||||
mittBus.on('setSendClassicChildren', (res: MittMenu) => {
|
||||
let { layout, isClassicSplitMenu } = themeConfig.value;
|
||||
if (layout === 'classic' && isClassicSplitMenu) {
|
||||
// 经典布局分割菜单只要一项子级时,收起左侧导航菜单
|
||||
res.children.length <= 1 ? (themeConfig.value.isCollapse = true) : (themeConfig.value.isCollapse = false);
|
||||
state.menuList = [];
|
||||
state.menuList = res.children;
|
||||
}
|
||||
});
|
||||
// 开启经典布局分割菜单时,重新处理菜单数据
|
||||
mittBus.on('getBreadcrumbIndexSetFilterRoutes', () => {
|
||||
setFilterRoutes();
|
||||
});
|
||||
// 监听窗口大小改变时(适配移动端)
|
||||
mittBus.on('layoutMobileResize', (res: LayoutMobileResize) => {
|
||||
initMenuFixed(res.clientWidth);
|
||||
closeLayoutAsideMobileMode();
|
||||
});
|
||||
});
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(themeConfig.value, (val) => {
|
||||
if (val.isShowLogoChange !== val.isShowLogo) {
|
||||
if (layoutAsideScrollbarRef.value) layoutAsideScrollbarRef.value.update();
|
||||
}
|
||||
});
|
||||
// 监听 pinia 值的变化,动态赋值给菜单中
|
||||
watch(
|
||||
pinia.state,
|
||||
(val) => {
|
||||
let { layout, isClassicSplitMenu } = val.themeConfig.themeConfig;
|
||||
() => [themeConfig.value.isShowLogoChange, themeConfig.value.isShowLogo, themeConfig.value.layout, themeConfig.value.isClassicSplitMenu],
|
||||
([isShowLogoChange, isShowLogo, layout, isClassicSplitMenu]) => {
|
||||
if (isShowLogoChange !== isShowLogo) {
|
||||
if (layoutAsideScrollbarRef.value) layoutAsideScrollbarRef.value.update();
|
||||
}
|
||||
if (layout === 'classic' && isClassicSplitMenu) return false;
|
||||
setFilterRoutes();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<li
|
||||
v-for="(v, k) in state.columnsAsideList"
|
||||
:key="k"
|
||||
@click="onColumnsAsideMenuClick(v, k)"
|
||||
@click="onColumnsAsideMenuClick(v)"
|
||||
@mouseenter="onColumnsAsideMenuMouseenter(v, k)"
|
||||
:ref="
|
||||
(el) => {
|
||||
@ -48,7 +48,6 @@
|
||||
import { reactive, ref, onMounted, nextTick, watch, onUnmounted } from 'vue';
|
||||
import { useRoute, useRouter, onBeforeRouteUpdate, RouteRecordRaw } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import pinia from '/@/stores/index';
|
||||
import { useRoutesList } from '/@/stores/routesList';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
@ -74,15 +73,33 @@ const state = reactive<ColumnsAsideState>({
|
||||
|
||||
// 设置菜单高亮位置移动
|
||||
const setColumnsAsideMove = (k: number) => {
|
||||
if (k === undefined) return false;
|
||||
state.liIndex = k;
|
||||
columnsAsideActiveRef.value.style.top = `${columnsAsideOffsetTopRefs.value[k].offsetTop + state.difference}px`;
|
||||
};
|
||||
// 菜单高亮点击事件
|
||||
const onColumnsAsideMenuClick = (v: RouteItem, k: number) => {
|
||||
setColumnsAsideMove(k);
|
||||
const onColumnsAsideMenuClick = async (v: RouteItem) => {
|
||||
let { path, redirect } = v;
|
||||
if (redirect) router.push(redirect);
|
||||
else router.push(path);
|
||||
if (redirect) {
|
||||
onColumnsAsideDown(v.k);
|
||||
if (route.path.startsWith(redirect)) mittBus.emit('setSendColumnsChildren', setSendChildren(redirect));
|
||||
else router.push(redirect);
|
||||
} else {
|
||||
if (!v.children) {
|
||||
router.push(path);
|
||||
} else {
|
||||
// 显示子级菜单
|
||||
const resData: MittMenu = setSendChildren(path);
|
||||
if (Object.keys(resData).length <= 0) return false;
|
||||
onColumnsAsideDown(resData.item?.k);
|
||||
mittBus.emit('setSendColumnsChildren', resData);
|
||||
}
|
||||
}
|
||||
|
||||
// 一个路由设置自动收起菜单
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
|
||||
if (!v.children) themeConfig.value.isCollapse = true;
|
||||
else if (v.children.length > 1) themeConfig.value.isCollapse = false;
|
||||
};
|
||||
// 鼠标移入时,显示当前的子级菜单
|
||||
const onColumnsAsideMenuMouseenter = (v: RouteRecordRaw, k: number) => {
|
||||
@ -97,6 +114,7 @@ const onColumnsAsideMenuMouseenter = (v: RouteRecordRaw, k: number) => {
|
||||
};
|
||||
// 鼠标移走时,显示原来的子级菜单
|
||||
const onColumnsAsideMenuMouseleave = async () => {
|
||||
if (!themeConfig.value.isColumnsMenuHoverPreload) return false;
|
||||
await stores.setColumnsNavHover(false);
|
||||
// 添加延时器,防止拿到的 store.state.routesList 值不是最新的
|
||||
setTimeout(() => {
|
||||
@ -115,7 +133,13 @@ const setFilterRoutes = () => {
|
||||
const resData: MittMenu = setSendChildren(route.path);
|
||||
if (Object.keys(resData).length <= 0) return false;
|
||||
onColumnsAsideDown(resData.item?.k);
|
||||
mittBus.emit('setSendColumnsChildren', resData);
|
||||
// 刷新时,初始化一个路由设置自动收起菜单
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
|
||||
resData.children.length <= 1 ? (themeConfig.value.isCollapse = true) : (themeConfig.value.isCollapse = false);
|
||||
// 延迟 500 毫秒更新,防止 aside.vue 组件 setSendColumnsChildren 还没有注册
|
||||
setTimeout(() => {
|
||||
mittBus.emit('setSendColumnsChildren', resData);
|
||||
}, 500);
|
||||
};
|
||||
// 传送当前子级数据到菜单中
|
||||
const setSendChildren = (path: string) => {
|
||||
@ -173,10 +197,10 @@ onBeforeRouteUpdate((to) => {
|
||||
});
|
||||
// 监听布局配置信息的变化,动态增加菜单高亮位置移动像素
|
||||
watch(
|
||||
pinia.state,
|
||||
(val) => {
|
||||
val.themeConfig.themeConfig.columnsAsideStyle === 'columnsRound' ? (state.difference = 3) : (state.difference = 0);
|
||||
if (!val.routesList.isColumnsMenuHover && !val.routesList.isColumnsNavHover) {
|
||||
[() => themeConfig.value.columnsAsideStyle, isColumnsMenuHover, isColumnsNavHover],
|
||||
() => {
|
||||
themeConfig.value.columnsAsideStyle === 'columnsRound' ? (state.difference = 3) : (state.difference = 0);
|
||||
if (!isColumnsMenuHover.value && !isColumnsNavHover.value) {
|
||||
state.liHoverIndex = null;
|
||||
mittBus.emit('setSendColumnsChildren', setSendChildren(route.path));
|
||||
} else {
|
||||
@ -198,7 +222,8 @@ watch(
|
||||
background: var(--next-bg-columnsMenuBar);
|
||||
ul {
|
||||
position: relative;
|
||||
.layout-columns-active {
|
||||
.layout-columns-active,
|
||||
.layout-columns-active a {
|
||||
color: var(--next-bg-columnsMenuBarColor) !important;
|
||||
transition: 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ onUnmounted(() => {
|
||||
}
|
||||
.layout-lock-screen-img {
|
||||
@extend .layout-lock-screen-fixed;
|
||||
background-image: url('https://img-blog.csdnimg.cn/afa9c317667f47d5bea34b85af45979e.png#pic_center');
|
||||
background-image: url('https://i.hd-r.cn/e4a19d84364f185266666765ac21a5db.jpg');
|
||||
background-size: 100% 100%;
|
||||
z-index: 9999991;
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ const initScrollBarHeight = () => {
|
||||
setTimeout(() => {
|
||||
updateScrollbar();
|
||||
// '!' not null 断言操作符,不执行运行时检查
|
||||
layoutMainRef.value!.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
|
||||
if (layoutMainRef.value) layoutMainRef.value!.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
@ -58,11 +58,13 @@ watch(
|
||||
initScrollBarHeight();
|
||||
}
|
||||
);
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
// 监听 themeConfig isTagsview 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(
|
||||
themeConfig,
|
||||
() => themeConfig.value.isTagsview,
|
||||
() => {
|
||||
updateScrollbar();
|
||||
nextTick(() => {
|
||||
updateScrollbar();
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
||||
@ -35,7 +35,7 @@ const updateScrollbar = () => {
|
||||
// 更新父级 scrollbar
|
||||
layoutScrollbarRef.value.update();
|
||||
// 更新子级 scrollbar
|
||||
layoutMainRef.value!.layoutMainScrollbarRef.update();
|
||||
layoutMainRef.value && layoutMainRef.value!.layoutMainScrollbarRef.update();
|
||||
};
|
||||
// 重置滚动条高度,由于组件是异步引入的
|
||||
const initScrollBarHeight = () => {
|
||||
@ -60,9 +60,11 @@ watch(
|
||||
);
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(
|
||||
themeConfig,
|
||||
() => [themeConfig.value.isTagsview, themeConfig.value.isFixedHeader],
|
||||
() => {
|
||||
updateScrollbar();
|
||||
nextTick(() => {
|
||||
updateScrollbar();
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
||||
@ -60,9 +60,11 @@ watch(
|
||||
);
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(
|
||||
themeConfig,
|
||||
() => [themeConfig.value.isTagsview, themeConfig.value.isFixedHeader],
|
||||
() => {
|
||||
updateScrollbar();
|
||||
nextTick(() => {
|
||||
updateScrollbar();
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
||||
@ -47,9 +47,11 @@ watch(
|
||||
);
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(
|
||||
themeConfig,
|
||||
() => themeConfig.value.isTagsview,
|
||||
() => {
|
||||
updateScrollbar();
|
||||
nextTick(() => {
|
||||
updateScrollbar();
|
||||
});
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
||||
@ -107,6 +107,7 @@ defineExpose({
|
||||
display: none;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
@ -59,6 +59,17 @@
|
||||
<el-color-picker v-model="getThemeConfig.menuBarColor" size="default" @change="onBgColorPickerChange('menuBarColor')"> </el-color-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-breadcrumb-seting-bar-flex">
|
||||
<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('message.layout.twoMenuBarActiveColor') }}</div>
|
||||
<div class="layout-breadcrumb-seting-bar-flex-value">
|
||||
<el-color-picker
|
||||
v-model="getThemeConfig.menuBarActiveColor"
|
||||
size="default"
|
||||
show-alpha
|
||||
@change="onBgColorPickerChange('menuBarActiveColor')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-breadcrumb-seting-bar-flex mt14">
|
||||
<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('message.layout.twoIsMenuBarColorGradual') }}</div>
|
||||
<div class="layout-breadcrumb-seting-bar-flex-value">
|
||||
@ -427,7 +438,7 @@ import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import { useChangeColor } from '/@/utils/theme';
|
||||
import { verifyAndSpace } from '/@/utils/toolsValidate';
|
||||
import { Local } from '/@/utils/storage';
|
||||
import Watermark from '/@/utils/wartermark';
|
||||
import Watermark from '/@/utils/watermark';
|
||||
import commonFunction from '/@/utils/commonFunction';
|
||||
import other from '/@/utils/other';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
@ -483,14 +494,16 @@ const onColumnsMenuBarGradualChange = () => {
|
||||
};
|
||||
// 2、菜单 / 顶栏 --> 背景渐变函数
|
||||
const setGraduaFun = (el: string, bool: boolean, color: string) => {
|
||||
setTimeout(() => {
|
||||
let els = document.querySelector(el);
|
||||
if (!els) return false;
|
||||
document.documentElement.style.setProperty('--el-menu-bg-color', document.documentElement.style.getPropertyValue('--next-bg-menuBar'));
|
||||
if (bool) els.setAttribute('style', `background:linear-gradient(to bottom left , ${color}, ${getLightColor(color, 0.6)}) !important;`);
|
||||
else els.setAttribute('style', ``);
|
||||
setLocalThemeConfig();
|
||||
}, 200);
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
let els = document.querySelector(el);
|
||||
if (!els) return false;
|
||||
document.documentElement.style.setProperty('--el-menu-bg-color', document.documentElement.style.getPropertyValue('--next-bg-menuBar'));
|
||||
if (bool) els.setAttribute('style', `background:linear-gradient(to bottom , ${color}, ${getLightColor(color, 0.5)})`);
|
||||
else els.setAttribute('style', ``);
|
||||
setLocalThemeConfig();
|
||||
}, 300);
|
||||
});
|
||||
};
|
||||
// 2、分栏设置 ->
|
||||
const onColumnsMenuHoverPreloadChange = () => {
|
||||
@ -577,6 +590,7 @@ const onSetLayout = (layout: string) => {
|
||||
const initLayoutChangeFun = () => {
|
||||
onBgColorPickerChange('menuBar');
|
||||
onBgColorPickerChange('menuBarColor');
|
||||
onBgColorPickerChange('menuBarActiveColor');
|
||||
onBgColorPickerChange('topBar');
|
||||
onBgColorPickerChange('topBarColor');
|
||||
onBgColorPickerChange('columnsMenuBar');
|
||||
@ -620,7 +634,7 @@ const onResetConfigClick = () => {
|
||||
Local.clear();
|
||||
window.location.reload();
|
||||
// @ts-ignore
|
||||
Local.set('version', __VERSION__);
|
||||
Local.set('version', __NEXT_VERSION__);
|
||||
};
|
||||
// 初始化菜单样式等
|
||||
const initSetStyle = () => {
|
||||
|
||||
@ -52,10 +52,10 @@ import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||
import Sortable from 'sortablejs';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import pinia from '/@/stores/index';
|
||||
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import { useKeepALiveNames } from '/@/stores/keepAliveNames';
|
||||
import { useRoutesList } from '/@/stores/routesList';
|
||||
import { Session } from '/@/utils/storage';
|
||||
import { isObjectValueEqual } from '/@/utils/arrayOperation';
|
||||
import other from '/@/utils/other';
|
||||
@ -72,8 +72,10 @@ const tagsUlRef = ref();
|
||||
const stores = useTagsViewRoutes();
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
const storesTagsViewRoutes = useTagsViewRoutes();
|
||||
const storesRoutesList = useRoutesList();
|
||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||
const { tagsViewRoutes } = storeToRefs(storesTagsViewRoutes);
|
||||
const { routesList } = storeToRefs(storesRoutesList);
|
||||
const storesKeepALiveNames = useKeepALiveNames();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@ -382,6 +384,11 @@ const onMousedownMenu = (v: RouteItem, e: MouseEvent) => {
|
||||
const onTagsClick = (v: RouteItem, k: number) => {
|
||||
state.tagsRefsIndex = k;
|
||||
router.push(v);
|
||||
// 分栏布局时,收起/展开菜单
|
||||
if (getThemeConfig.value.layout === 'columns') {
|
||||
const item: RouteItem = routesList.value.find((r: RouteItem) => r.path.indexOf(`/${v.path.split('/')[1]}`) > -1);
|
||||
!item.children ? (getThemeConfig.value.isCollapse = true) : (getThemeConfig.value.isCollapse = false);
|
||||
}
|
||||
};
|
||||
// 处理 url,地址栏链接有参数时,tagsview 右键菜单刷新功能失效问题,感谢 @ZzZz-RIPPER、@dejavuuuuu
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I5K3YO
|
||||
@ -578,9 +585,9 @@ onBeforeRouteUpdate(async (to) => {
|
||||
});
|
||||
// 监听路由的变化,动态赋值给 tagsView
|
||||
watch(
|
||||
pinia.state,
|
||||
() => tagsViewRoutes.value,
|
||||
(val) => {
|
||||
if (val.tagsViewRoutes.tagsViewRoutes.length === state.tagsViewRoutesList.length) return false;
|
||||
if (val.length === state.tagsViewRoutesList.length) return false;
|
||||
getTagsViewRoutes();
|
||||
},
|
||||
{
|
||||
|
||||
@ -1,37 +1,35 @@
|
||||
<template>
|
||||
<div class="el-menu-horizontal-warp">
|
||||
<el-scrollbar @wheel.native.prevent="onElMenuHorizontalScroll" ref="elMenuHorizontalScrollRef">
|
||||
<el-menu router :default-active="state.defaultActive" :ellipsis="false" background-color="transparent" mode="horizontal">
|
||||
<template v-for="val in menuLists">
|
||||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
<template #title>
|
||||
<el-menu router :default-active="state.defaultActive" background-color="transparent" mode="horizontal">
|
||||
<template v-for="val in menuLists">
|
||||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
<template #title>
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<span>{{ $t(val.meta.title) }}</span>
|
||||
</template>
|
||||
<SubItem :chil="val.children" />
|
||||
</el-sub-menu>
|
||||
<template v-else>
|
||||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
<span>{{ $t(val.meta.title) }}</span>
|
||||
{{ $t(val.meta.title) }}
|
||||
</template>
|
||||
<SubItem :chil="val.children" />
|
||||
</el-sub-menu>
|
||||
<template v-else>
|
||||
<el-menu-item :index="val.path" :key="val.path">
|
||||
<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
|
||||
<template #title v-else>
|
||||
<a class="w100" @click.prevent="onALinkClick(val)">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
{{ $t(val.meta.title) }}
|
||||
</template>
|
||||
<template #title v-else>
|
||||
<a class="w100" @click.prevent="onALinkClick(val)">
|
||||
<SvgIcon :name="val.meta.icon" />
|
||||
{{ $t(val.meta.title) }}
|
||||
</a>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</a>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
</el-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="navMenuHorizontal">
|
||||
import { defineAsyncComponent, reactive, computed, onMounted, nextTick, onBeforeMount, ref } from 'vue';
|
||||
import { defineAsyncComponent, reactive, computed, onBeforeMount } from 'vue';
|
||||
import { useRoute, onBeforeRouteUpdate, RouteRecordRaw } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useRoutesList } from '/@/stores/routesList';
|
||||
@ -52,7 +50,6 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
// 定义变量内容
|
||||
const elMenuHorizontalScrollRef = ref();
|
||||
const stores = useRoutesList();
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
const { routesList } = storeToRefs(stores);
|
||||
@ -66,19 +63,6 @@ const state = reactive({
|
||||
const menuLists = computed(() => {
|
||||
return <RouteItems>props.menuList;
|
||||
});
|
||||
// 设置横向滚动条可以鼠标滚轮滚动
|
||||
const onElMenuHorizontalScroll = (e: WheelEventType) => {
|
||||
const eventDelta = e.wheelDelta || -e.deltaY * 40;
|
||||
elMenuHorizontalScrollRef.value.$refs.wrapRef.scrollLeft = elMenuHorizontalScrollRef.value.$refs.wrapRef.scrollLeft + eventDelta / 4;
|
||||
};
|
||||
// 初始化数据,页面刷新时,滚动条滚动到对应位置
|
||||
const initElMenuOffsetLeft = () => {
|
||||
nextTick(() => {
|
||||
let els = <HTMLElement>document.querySelector('.el-menu.el-menu--horizontal li.is-active');
|
||||
if (!els) return false;
|
||||
elMenuHorizontalScrollRef.value.$refs.wrapRef.scrollLeft = els.offsetLeft;
|
||||
});
|
||||
};
|
||||
// 路由过滤递归函数
|
||||
const filterRoutesFun = <T extends RouteItem>(arr: T[]): T[] => {
|
||||
return arr
|
||||
@ -122,10 +106,6 @@ const onALinkClick = (val: RouteItem) => {
|
||||
onBeforeMount(() => {
|
||||
setCurrentRouterHighlight(route);
|
||||
});
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
initElMenuOffsetLeft();
|
||||
});
|
||||
// 路由更新时
|
||||
onBeforeRouteUpdate((to) => {
|
||||
// 修复:https://gitee.com/lyt-top/vue-next-admin/issues/I3YX6G
|
||||
|
||||
@ -91,9 +91,9 @@ onBeforeRouteUpdate((to) => {
|
||||
});
|
||||
// 设置菜单的收起/展开
|
||||
watch(
|
||||
themeConfig.value,
|
||||
() => {
|
||||
document.body.clientWidth <= 1000 ? (state.isCollapse = false) : (state.isCollapse = themeConfig.value.isCollapse);
|
||||
() => themeConfig.value.isCollapse,
|
||||
(isCollapse) => {
|
||||
document.body.clientWidth <= 1000 ? (state.isCollapse = false) : (state.isCollapse = isCollapse);
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="layout-padding layout-padding-unset layout-iframe">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<div class="w100" v-for="v in setIframeList" :key="v.path" v-loading="v.meta.loading" element-loading-background="white">
|
||||
<transition-group :name="name" mode="out-in">
|
||||
<transition-group :name="name">
|
||||
<iframe
|
||||
:src="v.meta.isLink"
|
||||
:key="v.path"
|
||||
|
||||
108
src/layout/sponsors/index.vue
Normal file
108
src/layout/sponsors/index.vue
Normal file
@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div class="sponsors-container" title="点击前往体验" v-show="state.sponsors.isShow" @click="onSponsorsClick">
|
||||
<el-carousel height="240px" indicator-position="none" :arrow="setCarouselShow" @change="onCarouselChange">
|
||||
<el-carousel-item v-for="(v, k) in state.sponsors.list" :key="k">
|
||||
<img :src="v.url" class="sponsors-img" />
|
||||
<div class="sponsors-text" v-html="v.text"></div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<div class="sponsors-close">
|
||||
<SvgIcon name="ele-Close" :size="12" title="关闭赞助商" @click.stop="onCloseSponsors" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="layoutSponsors">
|
||||
import { reactive, computed, onMounted } from 'vue';
|
||||
import sponsorsOne from '/@/assets/ccflowRightNextAdmin.png';
|
||||
|
||||
// 定义变量内容
|
||||
const state = reactive({
|
||||
sponsors: {
|
||||
list: [
|
||||
{
|
||||
url: sponsorsOne,
|
||||
text: `驰骋BPM系统包含表单引擎+流程引擎+权限控制,方便集成,配置灵活,功能强大,适合中国国情的工作流引擎.演示:http://demo.ccflow.org。右上角点star方可加群: 1060674395`,
|
||||
link: 'http://www.ccflow.org/',
|
||||
},
|
||||
],
|
||||
isShow: false,
|
||||
index: 0,
|
||||
},
|
||||
});
|
||||
|
||||
// 设置轮播图箭头显示
|
||||
const setCarouselShow = computed(() => {
|
||||
return state.sponsors.list.length <= 1 ? 'never' : 'hover';
|
||||
});
|
||||
// 关闭赞助商
|
||||
const onCloseSponsors = () => {
|
||||
state.sponsors.isShow = false;
|
||||
};
|
||||
// 轮播图改变时
|
||||
const onCarouselChange = (e: number) => {
|
||||
state.sponsors.index = e;
|
||||
};
|
||||
// 当前项内容点击
|
||||
const onSponsorsClick = () => {
|
||||
window.open(state.sponsors.list[state.sponsors.index].link);
|
||||
};
|
||||
// 延迟显示,防止影响其它界面加载
|
||||
const delayShow = () => {
|
||||
setTimeout(() => {
|
||||
state.sponsors.isShow = true;
|
||||
}, 3000);
|
||||
};
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
delayShow();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sponsors-container {
|
||||
position: fixed;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
z-index: 3;
|
||||
width: 200px;
|
||||
background-color: var(--next-bg-main-color);
|
||||
box-shadow: var(--el-box-shadow-lighter);
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
.sponsors-img {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
}
|
||||
.sponsors-text {
|
||||
padding: 10px;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: var(--el-dialog-content-font-size);
|
||||
}
|
||||
.sponsors-close {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 100%;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
position: absolute;
|
||||
right: -35px;
|
||||
bottom: -35px;
|
||||
:deep(i) {
|
||||
position: absolute;
|
||||
left: 9px;
|
||||
top: 9px;
|
||||
color: #afafaf;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
&:hover {
|
||||
transition: all 0.3s ease;
|
||||
:deep(i) {
|
||||
color: var(--el-color-primary);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -45,7 +45,7 @@ const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||
const state = reactive({
|
||||
isUpgrade: false,
|
||||
// @ts-ignore
|
||||
version: __VERSION__,
|
||||
version: __NEXT_VERSION__,
|
||||
isLoading: false,
|
||||
btnTxt: '',
|
||||
});
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { createApp } from 'vue';
|
||||
import pinia from '/@/stores/index';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import App from '/@/App.vue';
|
||||
import router from '/@/router';
|
||||
import { directive } from '/@/directive/index';
|
||||
import { i18n } from '/@/i18n/index';
|
||||
import other from '/@/utils/other';
|
||||
|
||||
import ElementPlus from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import '/@/theme/index.scss';
|
||||
import VueGridLayout from 'vue-grid-layout';
|
||||
|
||||
@ -16,4 +15,4 @@ const app = createApp(App);
|
||||
directive(app);
|
||||
other.elSvg(app);
|
||||
|
||||
app.use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t }).use(i18n).use(VueGridLayout).mount('#app');
|
||||
app.use(pinia).use(router).use(ElementPlus).use(i18n).use(VueGridLayout).mount('#app');
|
||||
|
||||
@ -23,10 +23,7 @@ export const useThemeConfig = defineStore('themeConfig', {
|
||||
isIsDark: false,
|
||||
|
||||
/**
|
||||
* 菜单 / 顶栏
|
||||
* 注意:v1.0.17 版本去除设置布局切换,重置主题样式(initSetLayoutChange),
|
||||
* 切换布局需手动设置样式,设置的样式自动同步各布局,
|
||||
* 代码位置:/@/layout/navBars/breadcrumb/setings.vue
|
||||
* 顶栏设置
|
||||
*/
|
||||
// 默认顶栏导航背景颜色
|
||||
topBar: '#ffffff',
|
||||
@ -34,12 +31,22 @@ export const useThemeConfig = defineStore('themeConfig', {
|
||||
topBarColor: '#606266',
|
||||
// 是否开启顶栏背景颜色渐变
|
||||
isTopBarColorGradual: false,
|
||||
|
||||
/**
|
||||
* 菜单设置
|
||||
*/
|
||||
// 默认菜单导航背景颜色
|
||||
menuBar: '#545c64',
|
||||
// 默认菜单导航字体颜色
|
||||
menuBarColor: '#eaeaea',
|
||||
// 默认菜单高亮背景色
|
||||
menuBarActiveColor: 'rgba(0, 0, 0, 0.2)',
|
||||
// 是否开启菜单背景颜色渐变
|
||||
isMenuBarColorGradual: false,
|
||||
|
||||
/**
|
||||
* 分栏设置
|
||||
*/
|
||||
// 默认分栏菜单背景颜色
|
||||
columnsMenuBar: '#545c64',
|
||||
// 默认分栏菜单字体颜色
|
||||
|
||||
@ -63,6 +63,7 @@ export const useUserInfo = defineStore('userInfo', {
|
||||
roles: defaultRoles,
|
||||
authBtnList: defaultAuthBtnList,
|
||||
};
|
||||
Session.set('userInfo', userInfos);
|
||||
resolve(userInfos);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
@ -141,6 +141,8 @@ body,
|
||||
.layout-aside-pc-1 {
|
||||
width: 1px !important;
|
||||
transition: width 0.3s ease;
|
||||
position: relative;
|
||||
left: -1px;
|
||||
}
|
||||
// 手机端左侧导航样式
|
||||
.layout-aside-mobile {
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
--next-bg-topBarColor: var(--next-color-bar) !important;
|
||||
--next-bg-menuBar: var(--next-color-disabled) !important;
|
||||
--next-bg-menuBarColor: var(--next-color-bar) !important;
|
||||
--next-bg-menuBarActiveColor: var(--next-color-hover-rgba) !important;
|
||||
--next-bg-columnsMenuBar: var(--next-color-disabled) !important;
|
||||
--next-bg-columnsMenuBarColor: var(--next-color-bar) !important;
|
||||
--next-border-color-light: var(--next-border-black) !important;
|
||||
@ -105,9 +106,15 @@
|
||||
background-color: var(--next-color-disabled) !important;
|
||||
}
|
||||
|
||||
// topBar
|
||||
.layout-navbars-breadcrumb-index {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
// menu
|
||||
.layout-aside {
|
||||
border-right: 1px solid var(--next-border-color-light) !important;
|
||||
@extend .layout-navbars-breadcrumb-index;
|
||||
}
|
||||
|
||||
// colorPicker
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
------------------------------- */
|
||||
// 鼠标 hover 时颜色
|
||||
.el-menu-hover-bg-color {
|
||||
background-color: var(--next-color-menu-hover) !important;
|
||||
background-color: var(--next-bg-menuBarActiveColor) !important;
|
||||
}
|
||||
// 默认样式修改
|
||||
.el-menu {
|
||||
@ -108,6 +108,9 @@
|
||||
.el-sub-menu:not(.is-opened):hover .el-sub-menu__title {
|
||||
@extend .el-menu-hover-bg-color;
|
||||
}
|
||||
.el-menu-item:hover {
|
||||
@extend .el-menu-hover-bg-color;
|
||||
}
|
||||
.el-sub-menu.is-active.is-opened .el-sub-menu__title {
|
||||
background-color: unset !important;
|
||||
}
|
||||
@ -145,12 +148,12 @@
|
||||
background: var(--next-bg-topBar);
|
||||
.el-menu-item,
|
||||
.el-sub-menu {
|
||||
height: 50px !important;
|
||||
line-height: 50px !important;
|
||||
height: 48px !important;
|
||||
line-height: 48px !important;
|
||||
color: var(--next-bg-topBarColor);
|
||||
.el-sub-menu__title {
|
||||
height: 50px !important;
|
||||
line-height: 50px !important;
|
||||
height: 48px !important;
|
||||
line-height: 48px !important;
|
||||
color: var(--next-bg-topBarColor);
|
||||
}
|
||||
.el-popper.is-pure.is-light {
|
||||
@ -177,7 +180,7 @@
|
||||
width: 100% !important;
|
||||
.el-menu-item,
|
||||
.el-sub-menu__title {
|
||||
height: 50px !important;
|
||||
height: 48px !important;
|
||||
color: var(--next-bg-topBarColor);
|
||||
}
|
||||
.el-menu-item:not(.is-active):hover,
|
||||
@ -279,6 +282,10 @@
|
||||
.layout-container-view .el-scrollbar__view {
|
||||
height: 100%;
|
||||
}
|
||||
/*防止分栏布局二级菜单很多时,滚动条消失问题*/
|
||||
.layout-columns-warp .layout-aside .el-scrollbar__view {
|
||||
height: unset !important;
|
||||
}
|
||||
|
||||
/* Pagination 分页
|
||||
------------------------------- */
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
@import 'element-plus/dist/index.css';
|
||||
@import './app.scss';
|
||||
@import 'common/transition.scss';
|
||||
@import './other.scss';
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
.el-message-box {
|
||||
width: 80% !important;
|
||||
}
|
||||
// 锁屏页
|
||||
.layout-lock-screen-date-top {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 页面宽度小于768px
|
||||
|
||||
@ -8,18 +8,20 @@
|
||||
height: 40px;
|
||||
align-items: center;
|
||||
}
|
||||
.tool-item {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
color: var(--el-text-color-primary);
|
||||
height: 35px;
|
||||
align-items: center;
|
||||
padding: var(--el-popover-padding);
|
||||
&:hover {
|
||||
background: var(--el-fill-color-lighter);
|
||||
}
|
||||
i {
|
||||
opacity: 0.7;
|
||||
.tool-sortable {
|
||||
max-height: 303px;
|
||||
.tool-sortable-item {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
color: var(--el-text-color-primary);
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
&:hover {
|
||||
background: var(--el-fill-color-lighter);
|
||||
}
|
||||
i {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
src/types/global.d.ts
vendored
1
src/types/global.d.ts
vendored
@ -6,6 +6,7 @@ declare module 'js-cookie';
|
||||
declare module '@wangeditor/editor-for-vue';
|
||||
declare module 'js-table2excel';
|
||||
declare module 'qs';
|
||||
declare module 'sortablejs';
|
||||
|
||||
// 声明一个模块,防止引入文件时报错
|
||||
declare module '*.json';
|
||||
|
||||
1
src/types/pinia.d.ts
vendored
1
src/types/pinia.d.ts
vendored
@ -48,6 +48,7 @@ declare interface ThemeConfigState {
|
||||
isTopBarColorGradual: boolean;
|
||||
menuBar: string;
|
||||
menuBarColor: string;
|
||||
menuBarActiveColor: string;
|
||||
isMenuBarColorGradual: boolean;
|
||||
columnsMenuBar: string;
|
||||
columnsMenuBarColor: string;
|
||||
|
||||
2
src/types/views.d.ts
vendored
2
src/types/views.d.ts
vendored
@ -242,8 +242,6 @@ declare type XyState = {
|
||||
};
|
||||
|
||||
declare type WorkflowState<T = any> = {
|
||||
workflowRightRef: HTMLDivElement | null;
|
||||
leftNavRefs: HTMLElement[];
|
||||
leftNavList: T[];
|
||||
dropdownNode: XyState;
|
||||
dropdownLine: XyState;
|
||||
|
||||
125
src/utils/build.ts
Normal file
125
src/utils/build.ts
Normal file
@ -0,0 +1,125 @@
|
||||
import importToCDN from 'vite-plugin-cdn-import';
|
||||
|
||||
/**
|
||||
* 打包相关
|
||||
* 注意 prodUrl:使用的是 jsdelivr 还是 unpkg。它们的 path 可能不一致
|
||||
* 文章链接:https://blog.csdn.net/qq_34450741/article/details/129766676,使用的是 jsdelivr
|
||||
* @description importToCDN https://github.com/mmf-fe/vite-plugin-cdn-import
|
||||
* @description cdn 在线引入的 cdn 地址配置。path:https://www.jsdelivr.com/ || https://unpkg.com/
|
||||
* @description external 打包时,过滤包导入。参考:https://rollupjs.org/configuration-options/#external
|
||||
*/
|
||||
export const buildConfig = {
|
||||
cdn() {
|
||||
return importToCDN({
|
||||
prodUrl: 'https://unpkg.com/{name}@{version}/{path}',
|
||||
modules: [
|
||||
// autoComplete('vue'),
|
||||
// autoComplete('axios'),
|
||||
{
|
||||
name: 'vue',
|
||||
var: 'Vue',
|
||||
path: 'dist/vue.global.js',
|
||||
},
|
||||
{
|
||||
name: 'vue-demi',
|
||||
var: 'VueDemi',
|
||||
path: 'lib/index.iife.js',
|
||||
},
|
||||
{
|
||||
name: 'vue-router',
|
||||
var: 'VueRouter',
|
||||
path: 'dist/vue-router.global.js',
|
||||
},
|
||||
{
|
||||
name: 'element-plus',
|
||||
var: 'ElementPlus',
|
||||
path: 'dist/index.full.js',
|
||||
},
|
||||
// {
|
||||
// name: '@element-plus/icons-vue',
|
||||
// var: 'ElementPlusIconsVue',
|
||||
// path: 'dist/index.iife.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'echarts',
|
||||
// var: 'echarts',
|
||||
// path: 'dist/echarts.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'echarts-gl',
|
||||
// var: 'echarts-gl',
|
||||
// path: 'dist/echarts-gl.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'echarts-wordcloud',
|
||||
// var: 'echarts-wordcloud',
|
||||
// path: 'dist/echarts-wordcloud.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'vue-i18n',
|
||||
// var: 'VueI18n',
|
||||
// path: 'dist/vue-i18n.global.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'jsplumb',
|
||||
// var: 'jsPlumb',
|
||||
// path: 'dist/js/jsplumb.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'cropperjs',
|
||||
// var: 'Cropper',
|
||||
// path: 'dist/cropper.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'sortablejs',
|
||||
// var: 'Sortable',
|
||||
// path: 'Sortable.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'qrcodejs2-fixes',
|
||||
// var: 'QRCode',
|
||||
// path: 'qrcode.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'print-js',
|
||||
// var: 'printJS',
|
||||
// path: 'dist/print.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: '@wangeditor/editor',
|
||||
// var: 'wangEditor',
|
||||
// path: 'dist/index.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: '@wangeditor/editor-for-vue',
|
||||
// var: 'WangEditorForVue',
|
||||
// path: 'dist/index.min.js',
|
||||
// },
|
||||
// {
|
||||
// name: 'vue-grid-layout',
|
||||
// var: 'VueGridLayout',
|
||||
// path: 'https://cdn.jsdelivr.net/npm/vue-grid-layout@3.0.0-beta1/dist/vue-grid-layout.umd.min.js',
|
||||
// },
|
||||
],
|
||||
});
|
||||
},
|
||||
external: [
|
||||
'vue',
|
||||
// 'axios',
|
||||
'vue-router',
|
||||
'element-plus',
|
||||
// '@element-plus/icons-vue',
|
||||
// 'echarts',
|
||||
// 'echarts-gl',
|
||||
// 'echarts-wordcloud',
|
||||
// 'vue-i18n',
|
||||
// 'jsplumb',
|
||||
// 'cropperjs',
|
||||
// 'sortablejs',
|
||||
// 'qrcodejs2-fixes',
|
||||
// 'print-js',
|
||||
// '@wangeditor/editor',
|
||||
// '@wangeditor/editor-for-vue',
|
||||
// 'vue-grid-layout',
|
||||
],
|
||||
};
|
||||
@ -53,8 +53,11 @@ export function useTitle() {
|
||||
export function setTagsViewNameI18n(item: any) {
|
||||
let tagsViewName: string = '';
|
||||
const { query, params, meta } = item;
|
||||
// 修复tagsViewName匹配到其他含下列单词的路由
|
||||
// https://gitee.com/lyt-top/vue-next-admin/pulls/44/files
|
||||
const pattern = /^\{("(zh-cn|en|zh-tw)":"[^,]+",?){1,3}}$/;
|
||||
if (query?.tagsViewName || params?.tagsViewName) {
|
||||
if (/\/zh-cn|en|zh-tw\//.test(query?.tagsViewName) || /\/zh-cn|en|zh-tw\//.test(params?.tagsViewName)) {
|
||||
if (pattern.test(query?.tagsViewName) || pattern.test(params?.tagsViewName)) {
|
||||
// 国际化
|
||||
const urlTagsParams = (query?.tagsViewName && JSON.parse(query?.tagsViewName)) || (params?.tagsViewName && JSON.parse(params?.tagsViewName));
|
||||
tagsViewName = urlTagsParams[i18n.global.locale.value];
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Session } from '/@/utils/storage';
|
||||
import qs from 'qs';
|
||||
@ -17,7 +17,7 @@ const service: AxiosInstance = axios.create({
|
||||
|
||||
// 添加请求拦截器
|
||||
service.interceptors.request.use(
|
||||
(config: AxiosRequestConfig) => {
|
||||
(config) => {
|
||||
// 在发送请求之前做些什么 token
|
||||
if (Session.get('token')) {
|
||||
config.headers!['Authorization'] = `${Session.get('token')}`;
|
||||
@ -46,7 +46,7 @@ service.interceptors.response.use(
|
||||
}
|
||||
return Promise.reject(service.interceptors.response);
|
||||
} else {
|
||||
return response.data;
|
||||
return res;
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
|
||||
@ -8,18 +8,23 @@ import Cookies from 'js-cookie';
|
||||
* @method clear 移除全部永久缓存
|
||||
*/
|
||||
export const Local = {
|
||||
// 查看 v2.4.3版本更新日志
|
||||
setKey(key: string) {
|
||||
// @ts-ignore
|
||||
return `${__NEXT_NAME__}:${key}`;
|
||||
},
|
||||
// 设置永久缓存
|
||||
set(key: string, val: any) {
|
||||
window.localStorage.setItem(key, JSON.stringify(val));
|
||||
set<T>(key: string, val: T) {
|
||||
window.localStorage.setItem(Local.setKey(key), JSON.stringify(val));
|
||||
},
|
||||
// 获取永久缓存
|
||||
get(key: string) {
|
||||
let json = <string>window.localStorage.getItem(key);
|
||||
let json = <string>window.localStorage.getItem(Local.setKey(key));
|
||||
return JSON.parse(json);
|
||||
},
|
||||
// 移除永久缓存
|
||||
remove(key: string) {
|
||||
window.localStorage.removeItem(key);
|
||||
window.localStorage.removeItem(Local.setKey(key));
|
||||
},
|
||||
// 移除全部永久缓存
|
||||
clear() {
|
||||
@ -36,20 +41,20 @@ export const Local = {
|
||||
*/
|
||||
export const Session = {
|
||||
// 设置临时缓存
|
||||
set(key: string, val: any) {
|
||||
set<T>(key: string, val: T) {
|
||||
if (key === 'token') return Cookies.set(key, val);
|
||||
window.sessionStorage.setItem(key, JSON.stringify(val));
|
||||
window.sessionStorage.setItem(Local.setKey(key), JSON.stringify(val));
|
||||
},
|
||||
// 获取临时缓存
|
||||
get(key: string) {
|
||||
if (key === 'token') return Cookies.get(key);
|
||||
let json = <string>window.sessionStorage.getItem(key);
|
||||
let json = <string>window.sessionStorage.getItem(Local.setKey(key));
|
||||
return JSON.parse(json);
|
||||
},
|
||||
// 移除临时缓存
|
||||
remove(key: string) {
|
||||
if (key === 'token') return Cookies.remove(key);
|
||||
window.sessionStorage.removeItem(key);
|
||||
window.sessionStorage.removeItem(Local.setKey(key));
|
||||
},
|
||||
// 移除全部临时缓存
|
||||
clear() {
|
||||
|
||||
@ -13,9 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<img
|
||||
src="https://img-blog.csdnimg.cn/3333f265772a4fa89287993500ecbf96.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16"
|
||||
/>
|
||||
<img src="https://i.hd-r.cn/2cf0d2e192660eec23eb9d0655753e7d.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -13,9 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<img
|
||||
src="https://img-blog.csdnimg.cn/9eb1d85a417f4ed1ba7107f149ce3da1.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16"
|
||||
/>
|
||||
<img src="https://i.hd-r.cn/1a0d90a6c1e8b0184c7299dda713effd.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -8,21 +8,12 @@
|
||||
element-loading-background="rgba(255, 255, 255, 0.1)"
|
||||
:class="{ 'min-h-360': state.tableData.data.length <= 0 }"
|
||||
>
|
||||
<div
|
||||
v-for="(val, key) in filtering"
|
||||
:key="key"
|
||||
:ref="
|
||||
(el) => {
|
||||
if (el) dlRefs[key] = el;
|
||||
}
|
||||
"
|
||||
class="filtering-list-flex"
|
||||
>
|
||||
<div v-for="(val, key) in state.filtering" :key="key" ref="dlRefs" class="filtering-list-flex">
|
||||
<div class="filtering-list-title">{{ val.title }}</div>
|
||||
<div class="filtering-list-item" :style="{ height: val.isMore ? 'auto' : '50px' }">
|
||||
<span class="span" :class="v.active ? 'dd-active' : ''" v-for="(v, k) in val.children" :key="k" @click="onSelItem(val, v)">{{
|
||||
v.label
|
||||
}}</span>
|
||||
<span class="span" :class="v.active ? 'dd-active' : ''" v-for="(v, k) in val.children" :key="k" @click="onSelItem(val, v)">
|
||||
{{ v.label }}
|
||||
</span>
|
||||
<div class="dd-more" v-if="val.isShowMore" @click="val.isMore = !val.isMore">
|
||||
<span>{{ val.isMore ? '收起' : '展开' }}</span>
|
||||
<i :class="val.isMore ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"></i>
|
||||
@ -235,6 +226,9 @@ const onHandleCurrentChange = (val: number) => {
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
margin: 0 -5px;
|
||||
.el-row {
|
||||
width: 101%;
|
||||
}
|
||||
.flex-warp-item {
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="layout-pd">
|
||||
<el-card shadow="hover" header="表单表格验证">
|
||||
<el-form ref="tableRulesRef" :model="state.tableData" size="default">
|
||||
<el-table :data="state.tableData.data" border class="module-table-uncollected">
|
||||
<el-table ref="tableRef" :data="state.tableData.data" border class="module-table-uncollected" max-height="200">
|
||||
<el-table-column
|
||||
v-for="(item, index) in state.tableData.header"
|
||||
:key="index"
|
||||
@ -55,12 +55,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="pagesTableRules">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { reactive, ref, nextTick } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import type { FormInstance } from 'element-plus';
|
||||
|
||||
// 定义变量内容
|
||||
const tableRulesRef = ref<FormInstance>();
|
||||
const tableRef = ref();
|
||||
const state = reactive<TableRulesState>({
|
||||
tableData: {
|
||||
data: [],
|
||||
@ -103,5 +104,9 @@ const onAddRow = () => {
|
||||
a7: '',
|
||||
a8: '',
|
||||
});
|
||||
tableRef.value.doLayout();
|
||||
nextTick(() => {
|
||||
tableRef.value.setScrollTop(1000000);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -222,7 +222,7 @@ defineExpose({
|
||||
|
||||
<style scoped lang="scss">
|
||||
.workflow-drawer-node {
|
||||
:deep {
|
||||
:deep() {
|
||||
.el-tabs {
|
||||
box-shadow: unset;
|
||||
border: unset;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<el-scrollbar>
|
||||
<div
|
||||
ref="leftNavRefs"
|
||||
v-for="val in leftNavList"
|
||||
v-for="val in state.leftNavList"
|
||||
:key="val.id"
|
||||
:style="{ height: val.isOpen ? 'auto' : '50px', overflow: 'hidden' }"
|
||||
class="workflow-left-id"
|
||||
@ -86,6 +86,8 @@ const Drawer = defineAsyncComponent(() => import('./component/drawer/index.vue')
|
||||
const Help = defineAsyncComponent(() => import('./component/tool/help.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const leftNavRefs = ref([]);
|
||||
const workflowRightRef = ref();
|
||||
const contextmenuNodeRef = ref();
|
||||
const contextmenuLineRef = ref();
|
||||
const drawerRef = ref();
|
||||
@ -95,8 +97,6 @@ const storesThemeConfig = useThemeConfig();
|
||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||
const { copyText } = commonFunction();
|
||||
const state = reactive<WorkflowState>({
|
||||
workflowRightRef: null,
|
||||
leftNavRefs: [],
|
||||
leftNavList: [],
|
||||
dropdownNode: { x: '', y: '' },
|
||||
dropdownLine: { x: '', y: '' },
|
||||
@ -151,7 +151,7 @@ const initLeftNavList = () => {
|
||||
};
|
||||
// 左侧导航-初始化拖动
|
||||
const initSortable = () => {
|
||||
state.leftNavRefs.forEach((v) => {
|
||||
leftNavRefs.value.forEach((v) => {
|
||||
Sortable.create(v as HTMLDivElement, {
|
||||
group: {
|
||||
name: 'vue-next-admin-1',
|
||||
@ -165,7 +165,7 @@ const initSortable = () => {
|
||||
onEnd: function (evt: any) {
|
||||
const { name, icon, id } = evt.clone.dataset;
|
||||
const { layerX, layerY, clientX, clientY } = evt.originalEvent;
|
||||
const el = state.workflowRightRef!;
|
||||
const el = workflowRightRef.value!;
|
||||
const { x, y, width, height } = el.getBoundingClientRect();
|
||||
if (clientX < x || clientX > width + x || clientY < y || y > y + height) {
|
||||
ElMessage.warning('请把节点拖入到画布中');
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="组件路径">
|
||||
<el-input v-model="state.ruleForm.component" placeholder="组件路径" clearable></el-input>
|
||||
<el-input v-model="state.ruleForm.componentAlias" placeholder="组件路径" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
@ -169,6 +169,7 @@ const state = reactive({
|
||||
menuType: 'menu', // 菜单类型
|
||||
name: '', // 路由名称
|
||||
component: '', // 组件路径
|
||||
componentAlias: '', // 组件路径别名
|
||||
isLink: false, // 是否外链
|
||||
menuSort: 0, // 菜单排序
|
||||
path: '', // 路由路径
|
||||
@ -209,12 +210,8 @@ const openDialog = (type: string, row?: any) => {
|
||||
if (type === 'edit') {
|
||||
// 模拟数据,实际请走接口
|
||||
row.menuType = 'menu';
|
||||
row.menuSort = Math.random();
|
||||
row.component = `${row.component} `
|
||||
.match(/\'(.+)\'/g)
|
||||
?.join('')
|
||||
.replace(/\'/g, '');
|
||||
state.ruleForm = row;
|
||||
row.menuSort = Math.floor(Math.random() * 100);
|
||||
state.ruleForm = JSON.parse(JSON.stringify(row));
|
||||
state.dialog.title = '修改菜单';
|
||||
state.dialog.submitTxt = '修 改';
|
||||
} else {
|
||||
|
||||
@ -235,8 +235,6 @@ import 'echarts-gl';
|
||||
import { formatDate } from '/@/utils/formatTime';
|
||||
import { NextLoading } from '/@/utils/loading';
|
||||
import { dropdownList, skyList, dBtnList, earth3DBtnList, chartData4List } from './mock/demo2';
|
||||
import worldImg from './images/world.jpg';
|
||||
import bathymetryImg from './images/bathymetry.jpg';
|
||||
|
||||
// 定义变量内容
|
||||
const rightChartData1 = ref();
|
||||
@ -694,8 +692,8 @@ const init3DEarth = (globeRadius: any) => {
|
||||
const myChart = echarts.init(el);
|
||||
const option = {
|
||||
globe: {
|
||||
baseTexture: worldImg,
|
||||
heightTexture: bathymetryImg,
|
||||
baseTexture: 'https://i.hd-r.cn/4d572a171eb475da0c2e731d15b63aea.jpg',
|
||||
heightTexture: 'https://i.hd-r.cn/52356e8d906c84c5e23390f829dec7a3.jpg',
|
||||
shading: 'realistic',
|
||||
light: {
|
||||
ambient: {
|
||||
@ -790,7 +788,7 @@ onUnmounted(() => {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background: url(https://img-blog.csdnimg.cn/6267533849444025811bf0840f9366e3.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_20,color_FFFFFF,t_70,g_se,x_16);
|
||||
background: url(https://i.hd-r.cn/b1040178e4a2265fe87ffbb9bda839a4.jpg);
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 607 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 783 KiB |
@ -1,7 +1,9 @@
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { resolve } from 'path';
|
||||
import { defineConfig, loadEnv, ConfigEnv } from 'vite';
|
||||
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
|
||||
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus';
|
||||
import viteCompression from 'vite-plugin-compression';
|
||||
import { buildConfig } from './src/utils/build';
|
||||
|
||||
const pathResolve = (dir: string) => {
|
||||
return resolve(__dirname, '.', dir);
|
||||
@ -15,17 +17,18 @@ const alias: Record<string, string> = {
|
||||
const viteConfig = defineConfig((mode: ConfigEnv) => {
|
||||
const env = loadEnv(mode.mode, process.cwd());
|
||||
return {
|
||||
plugins: [vue(), vueSetupExtend()],
|
||||
plugins: [vue(), vueSetupExtend(), viteCompression(), JSON.parse(env.VITE_OPEN_CDN) ? buildConfig.cdn() : null],
|
||||
root: process.cwd(),
|
||||
resolve: { alias },
|
||||
base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,
|
||||
optimizeDeps: {
|
||||
include: ['element-plus/lib/locale/lang/zh-cn', 'element-plus/lib/locale/lang/en', 'element-plus/lib/locale/lang/zh-tw'],
|
||||
exclude: ['vue-demi'],
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: env.VITE_PORT as unknown as number,
|
||||
open: env.VITE_OPEN,
|
||||
open: JSON.parse(env.VITE_OPEN),
|
||||
hmr: true,
|
||||
proxy: {
|
||||
'/gitee': {
|
||||
@ -41,15 +44,16 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
|
||||
chunkSizeWarningLimit: 1500,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: `assets/[name].[hash].js`,
|
||||
chunkFileNames: `assets/[name].[hash].js`,
|
||||
assetFileNames: `assets/[name].[hash].[ext]`,
|
||||
compact: true,
|
||||
manualChunks: {
|
||||
vue: ['vue', 'vue-router', 'pinia'],
|
||||
echarts: ['echarts'],
|
||||
chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
return id.toString().split('node_modules/')[1].split('/')[0].toString();
|
||||
}
|
||||
},
|
||||
},
|
||||
external: JSON.parse(env.VITE_OPEN_CDN) ? buildConfig.external : [],
|
||||
},
|
||||
},
|
||||
css: { preprocessorOptions: { css: { charset: false } } },
|
||||
@ -57,7 +61,8 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
|
||||
__VUE_I18N_LEGACY_API__: JSON.stringify(false),
|
||||
__VUE_I18N_FULL_INSTALL__: JSON.stringify(false),
|
||||
__INTLIFY_PROD_DEVTOOLS__: JSON.stringify(false),
|
||||
__VERSION__: JSON.stringify(process.env.npm_package_version),
|
||||
__NEXT_VERSION__: JSON.stringify(process.env.npm_package_version),
|
||||
__NEXT_NAME__: JSON.stringify(process.env.npm_package_name),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user