'admin-23.03.26:同步master分支v2.4.32版本内容'
This commit is contained in:
parent
a67f379a4d
commit
1d11c00f91
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/
|
||||
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,8 +1,14 @@
|
|||
# <a href="https://gitee.com/lyt-top/vue-next-admin" target="_blank">vue-next-admin-template(不带国际化) 更新日志</a>
|
||||
|
||||
🎉🎉🔥 `vue-next-admin-template` 基于 (vue-next-admin-v2.4.31 版本) vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支)
|
||||
🎉🎉🔥 `vue-next-admin-template` 基于 (vue-next-admin-v2.4.32 版本) vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支)
|
||||
|
||||
## 2.4.1
|
||||
## 2.4.32
|
||||
|
||||
`2023.03.26`
|
||||
|
||||
- 🎉 同步 master 分支 v2.4.32 版本内容,具体查看 [master CHANGELOG.md](https://gitee.com/lyt-top/vue-next-admin/blob/master/CHANGELOG.md)
|
||||
|
||||
## 2.4.31
|
||||
|
||||
`2023.03.10`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
|
|
@ -94,6 +94,7 @@ cnpm run build
|
|||
|
||||
#### 💒 集成后端
|
||||
|
||||
- <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>
|
||||
|
|
@ -122,6 +123,10 @@ cnpm run build
|
|||
- <a href="https://github.com/microsoft/TypeScript" target="_blank">typescript</a>
|
||||
- <a href="https://github.com/vitejs/vite" target="_blank">vite</a>
|
||||
- <a href="https://pinia.vuejs.org/" target="_blank">pinia</a>
|
||||
- <a href="https://github.com/js-cookie/js-cookie" target="_blank">js-cookie</a>
|
||||
- <a href="https://github.com/mmf-fe/vite-plugin-cdn-import" target="_blank">vite-plugin-cdn-import</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>
|
||||
|
||||
#### 💕 特别感谢
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vue-next-admin-template",
|
||||
"version": "2.4.31",
|
||||
"version": "2.4.32",
|
||||
"description": "vue3 vite next admin template",
|
||||
"author": "lyt_20201208",
|
||||
"license": "MIT",
|
||||
|
|
@ -12,8 +12,8 @@
|
|||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"axios": "^1.3.4",
|
||||
"echarts": "^5.4.1",
|
||||
"element-plus": "^2.2.36",
|
||||
"echarts": "^5.4.2",
|
||||
"element-plus": "^2.3.1",
|
||||
"js-cookie": "^3.0.1",
|
||||
"mitt": "^3.0.0",
|
||||
"nprogress": "^0.2.0",
|
||||
|
|
@ -23,23 +23,26 @@
|
|||
"sortablejs": "^1.15.0",
|
||||
"vue": "^3.2.47",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-demi": "^0.13.11",
|
||||
"qs": "^6.11.1",
|
||||
"vue-router": "^4.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.15.0",
|
||||
"@types/node": "^18.15.10",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
||||
"@typescript-eslint/parser": "^5.54.1",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"@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.35.0",
|
||||
"eslint-plugin-vue": "^9.9.0",
|
||||
"prettier": "^2.8.4",
|
||||
"sass": "^1.58.3",
|
||||
"typescript": "^4.9.5",
|
||||
"vite": "^4.1.4",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"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": [
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 58 KiB |
|
|
@ -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 {
|
||||
|
|
@ -123,6 +122,8 @@ onBeforeMount(() => {
|
|||
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;
|
||||
}
|
||||
|
|
@ -137,17 +138,13 @@ onBeforeMount(() => {
|
|||
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();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
@ -79,10 +78,23 @@ const setColumnsAsideMove = (k: number) => {
|
|||
columnsAsideActiveRef.value.style.top = `${columnsAsideOffsetTopRefs.value[k].offsetTop + state.difference}px`;
|
||||
};
|
||||
// 菜单高亮点击事件
|
||||
const onColumnsAsideMenuClick = (v: RouteItem, k: number) => {
|
||||
const onColumnsAsideMenuClick = (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;
|
||||
|
|
@ -123,7 +135,10 @@ const setFilterRoutes = () => {
|
|||
// 刷新时,初始化一个路由设置自动收起菜单
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
|
||||
resData.children.length <= 1 ? (themeConfig.value.isCollapse = true) : (themeConfig.value.isCollapse = false);
|
||||
mittBus.emit('setSendColumnsChildren', resData);
|
||||
// 延迟 500 毫秒更新,防止 aside.vue 组件 setSendColumnsChildren 还没有注册
|
||||
setTimeout(() => {
|
||||
mittBus.emit('setSendColumnsChildren', resData);
|
||||
}, 500);
|
||||
};
|
||||
// 传送当前子级数据到菜单中
|
||||
const setSendChildren = (path: string) => {
|
||||
|
|
@ -181,10 +196,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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,11 +58,13 @@ watch(
|
|||
initScrollBarHeight();
|
||||
}
|
||||
);
|
||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
// 监听 themeConfig isTagsview 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||
watch(
|
||||
themeConfig,
|
||||
() => themeConfig.value.isTagsview,
|
||||
() => {
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ 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';
|
||||
|
|
@ -586,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();
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
.el-message-box {
|
||||
width: 80% !important;
|
||||
}
|
||||
// 锁屏页
|
||||
.layout-lock-screen-date-top {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 页面宽度小于768px
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
],
|
||||
};
|
||||
|
|
@ -46,7 +46,7 @@ service.interceptors.response.use(
|
|||
}
|
||||
return Promise.reject(service.interceptors.response);
|
||||
} else {
|
||||
return response.data;
|
||||
return res;
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -14,10 +16,13 @@ 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: {
|
||||
exclude: ['vue-demi'],
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: env.VITE_PORT as unknown as number,
|
||||
|
|
@ -37,15 +42,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 } } },
|
||||
|
|
|
|||
Loading…
Reference in New Issue