From d7aaad4c914d70fb178379157d393faf08bfb51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=B0=B8=E8=B6=85?= <2090205686@qq.com> Date: Mon, 1 Sep 2025 14:10:40 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9A=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=AF=A6=E6=83=85=EF=BC=8C=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5=EF=BC=8C=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/.env.production | 2 +- main/src/micro/app.js | 4 +- .../components.d.ts | 1 - sub-government-affairs-service/vite.config.js | 8 +++ sub-operation-service/src/App.vue | 42 ++----------- .../src/layouts/component/Header/index.vue | 36 +---------- .../src/layouts/component/Header/menu.js | 35 +++++++++++ sub-operation-service/src/utils/permission.js | 2 +- .../views/ecommerce/agriculturalDetail.vue | 14 ++++- .../views/ecommerce/components/goodsItem.vue | 6 +- .../views/ecommerce/components/leftMenu.vue | 13 +++- .../src/views/ecommerce/index.vue | 2 +- .../shoppingCarts/components/userHeader.vue | 14 ++++- .../src/views/shoppingCarts/shoppingCarts.vue | 59 ++++++++++++------- .../userCenter/components/userHeader.vue | 14 ++++- 15 files changed, 146 insertions(+), 106 deletions(-) create mode 100644 sub-operation-service/src/layouts/component/Header/menu.js diff --git a/main/.env.production b/main/.env.production index c1d39b7..7e3a6a6 100644 --- a/main/.env.production +++ b/main/.env.production @@ -12,5 +12,5 @@ VITE_APP_BASE_API = '/apis' VITE_APP_BASE_URL = '' VITE_APP_UPLOAD_API = '/uploadApis' VITE_APP_UPLOAD_URL = '' -VITE_APP_VIST_URL = 'https://app.yingyijt.com' +VITE_APP_VIST_URL = 'http://47.109.205.240' diff --git a/main/src/micro/app.js b/main/src/micro/app.js index 3ec68c9..60c9d7d 100644 --- a/main/src/micro/app.js +++ b/main/src/micro/app.js @@ -13,7 +13,7 @@ export const leftApps = [ { name: 'sub-operation-admin', entry: VITE_APP_SUB_OA, - activeRule: `/sub-operation-admin`, + activeRule: `${VITE_APP_VIST_URL}:82/login`, title: '管理后台', icon: 'images/platform/icon-admin.png', }, @@ -44,7 +44,7 @@ export const rightApps = [ { name: 'sub-government-admin', entry: VITE_APP_SUB_GAS, - activeRule: `/sub-government-admin`, + activeRule: `${VITE_APP_VIST_URL}:81/login`, title: '管理后台', icon: 'images/platform/icon-admin.png', }, diff --git a/new-digital-agriculture-screen/components.d.ts b/new-digital-agriculture-screen/components.d.ts index ca0fa36..694dcaa 100644 --- a/new-digital-agriculture-screen/components.d.ts +++ b/new-digital-agriculture-screen/components.d.ts @@ -12,7 +12,6 @@ declare module 'vue' { 'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default'] CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default'] Components: typeof import('./src/components/index.js')['default'] - copy: typeof import('./src/components/centerMap copy.vue')['default'] CurrentTime: typeof import('./src/components/currentTime.vue')['default'] CustomBack: typeof import('./src/components/customBack.vue')['default'] CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default'] diff --git a/sub-government-affairs-service/vite.config.js b/sub-government-affairs-service/vite.config.js index 231aa79..7a832c9 100644 --- a/sub-government-affairs-service/vite.config.js +++ b/sub-government-affairs-service/vite.config.js @@ -24,6 +24,14 @@ export default defineConfig(({ command, mode }) => { minify: 'terser', rollupOptions: { external: ['echarts-liquidfill'], // 显式声明外部依赖 + output: { + manualChunks: { + // 手动分块示例 + vue: ['vue', 'vue-router', 'pinia'], + echarts: ['echarts'], + vendor: ['lodash', 'axios'], + }, + }, }, }, server: { diff --git a/sub-operation-service/src/App.vue b/sub-operation-service/src/App.vue index a63f1e6..2d4bfac 100644 --- a/sub-operation-service/src/App.vue +++ b/sub-operation-service/src/App.vue @@ -21,47 +21,15 @@ const SettingStore = useSettingStore(); // 配置全局组件大小 const size = computed(() => SettingStore.themeConfig.globalComSize); -const meuns = ref([ - { - label: '智慧种植', - path: '/sub-operation-service/smartFarm', - }, - { - label: '电商交易', - path: '/sub-operation-service/ecommerce', - }, - { - label: '农事服务', - path: '/sub-operation-service/farmService', - }, - { - label: '分拣包装', - path: '/sub-operation-service/packaging', - }, - { - label: '仓储物流', - path: '/sub-operation-service/warehouseLogistics', - }, - { - label: '涉农金融', - path: '/sub-operation-service/finance', - }, - { - label: '公共品牌', - path: '/sub-operation-service/brand', - }, - { - label: '综合看板', - path: '/sub-operation-service/dashboard', - }, -]); +import menuList from '@/layouts/component/header/menu.js'; +const meuns = ref(menuList); import { useRoute } from 'vue-router'; import { useMenuStore } from '@/store/modules/menuStore'; const route = useRoute(); const menuStore = useMenuStore(); onMounted(() => { let item = meuns.value.find((item) => route.path.indexOf(item.path) > -1); - console.log('item', item); + // console.log('item', item); if (item) { menuStore.setMenuLabel(item.label); menuStore.setMenuPath(item.path); @@ -69,8 +37,8 @@ onMounted(() => { menuStore.setMenuLabel('智慧种植'); menuStore.setMenuPath('/sub-operation-service/smartFarm'); } - console.log(menuStore.activeMenuLabel); - console.log(menuStore.activeMenuPath); + // console.log(menuStore.activeMenuLabel); + // console.log(menuStore.activeMenuPath); }); diff --git a/sub-operation-service/src/layouts/component/Header/index.vue b/sub-operation-service/src/layouts/component/Header/index.vue index a3124ac..9c6c0f2 100644 --- a/sub-operation-service/src/layouts/component/Header/index.vue +++ b/sub-operation-service/src/layouts/component/Header/index.vue @@ -83,40 +83,8 @@ const router = useRouter(); const keyword = ref(''); -const meuns = ref([ - { - label: '智慧种植', - path: '/sub-operation-service/smartFarm', - }, - { - label: '电商交易', - path: '/sub-operation-service/ecommerce', - }, - { - label: '农事服务', - path: '/sub-operation-service/farmService', - }, - { - label: '分拣包装', - path: '/sub-operation-service/packaging', - }, - { - label: '仓储物流', - path: '/sub-operation-service/warehouseLogistics', - }, - { - label: '涉农金融', - path: '/sub-operation-service/finance', - }, - { - label: '公共品牌', - path: '/sub-operation-service/brand', - }, - { - label: '综合看板', - path: '/sub-operation-service/dashboard', - }, -]); +import menuList from './menu.js'; +const meuns = ref(menuList); const menuStore = useMenuStore(); const activeLabel = ref(menuStore.activeMenuLabel); diff --git a/sub-operation-service/src/layouts/component/Header/menu.js b/sub-operation-service/src/layouts/component/Header/menu.js new file mode 100644 index 0000000..096f121 --- /dev/null +++ b/sub-operation-service/src/layouts/component/Header/menu.js @@ -0,0 +1,35 @@ +const menuList = [ + { + label: '智慧种植', + path: '/sub-operation-service/smartFarm', + }, + { + label: '电商交易', + path: '/sub-operation-service/ecommerce', + }, + { + label: '农事服务', + path: '/sub-operation-service/farmService', + }, + { + label: '分拣包装', + path: '/sub-operation-service/packaging', + }, + { + label: '仓储物流', + path: '/sub-operation-service/warehouseLogistics', + }, + { + label: '涉农金融', + path: '/sub-operation-service/finance', + }, + { + label: '公共品牌', + path: '/sub-operation-service/brand', + }, + { + label: '综合看板', + path: '/sub-operation-service/dashboard', + }, +]; +export default menuList; diff --git a/sub-operation-service/src/utils/permission.js b/sub-operation-service/src/utils/permission.js index 2ce4284..c73d838 100644 --- a/sub-operation-service/src/utils/permission.js +++ b/sub-operation-service/src/utils/permission.js @@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { const userStore = useUserStore(); const hasToken = userStore.hasToken(); - console.log('sub-operation-service************hasToken', hasToken); + // console.log('sub-operation-service************hasToken', hasToken); if (hasToken) { if (to.path === '/login') { // 如果已登录,请重定向到主页 diff --git a/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue b/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue index 65dde73..8cf415f 100644 --- a/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue +++ b/sub-operation-service/src/views/ecommerce/agriculturalDetail.vue @@ -208,7 +208,7 @@