perf:购物车跳转详情,购物车返回首页,个人中心返回首页,顶部菜单高亮优化
This commit is contained in:
		
							parent
							
								
									30470ee192
								
							
						
					
					
						commit
						d7aaad4c91
					
				| @ -12,5 +12,5 @@ VITE_APP_BASE_API = '/apis' | |||||||
| VITE_APP_BASE_URL = '' | VITE_APP_BASE_URL = '' | ||||||
| VITE_APP_UPLOAD_API = '/uploadApis' | VITE_APP_UPLOAD_API = '/uploadApis' | ||||||
| VITE_APP_UPLOAD_URL = '' | VITE_APP_UPLOAD_URL = '' | ||||||
| VITE_APP_VIST_URL = 'https://app.yingyijt.com' | VITE_APP_VIST_URL = 'http://47.109.205.240' | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ export const leftApps = [ | |||||||
|   { |   { | ||||||
|     name: 'sub-operation-admin', |     name: 'sub-operation-admin', | ||||||
|     entry: VITE_APP_SUB_OA, |     entry: VITE_APP_SUB_OA, | ||||||
|     activeRule: `/sub-operation-admin`, |     activeRule: `${VITE_APP_VIST_URL}:82/login`, | ||||||
|     title: '管理后台', |     title: '管理后台', | ||||||
|     icon: 'images/platform/icon-admin.png', |     icon: 'images/platform/icon-admin.png', | ||||||
|   }, |   }, | ||||||
| @ -44,7 +44,7 @@ export const rightApps = [ | |||||||
|   { |   { | ||||||
|     name: 'sub-government-admin', |     name: 'sub-government-admin', | ||||||
|     entry: VITE_APP_SUB_GAS, |     entry: VITE_APP_SUB_GAS, | ||||||
|     activeRule: `/sub-government-admin`, |     activeRule: `${VITE_APP_VIST_URL}:81/login`, | ||||||
|     title: '管理后台', |     title: '管理后台', | ||||||
|     icon: 'images/platform/icon-admin.png', |     icon: 'images/platform/icon-admin.png', | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -12,7 +12,6 @@ declare module 'vue' { | |||||||
|     'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default'] |     'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default'] | ||||||
|     CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default'] |     CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default'] | ||||||
|     Components: typeof import('./src/components/index.js')['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'] |     CurrentTime: typeof import('./src/components/currentTime.vue')['default'] | ||||||
|     CustomBack: typeof import('./src/components/customBack.vue')['default'] |     CustomBack: typeof import('./src/components/customBack.vue')['default'] | ||||||
|     CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default'] |     CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default'] | ||||||
|  | |||||||
| @ -24,6 +24,14 @@ export default defineConfig(({ command, mode }) => { | |||||||
|       minify: 'terser', |       minify: 'terser', | ||||||
|       rollupOptions: { |       rollupOptions: { | ||||||
|         external: ['echarts-liquidfill'], // 显式声明外部依赖
 |         external: ['echarts-liquidfill'], // 显式声明外部依赖
 | ||||||
|  |         output: { | ||||||
|  |           manualChunks: { | ||||||
|  |             // 手动分块示例
 | ||||||
|  |             vue: ['vue', 'vue-router', 'pinia'], | ||||||
|  |             echarts: ['echarts'], | ||||||
|  |             vendor: ['lodash', 'axios'], | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|     server: { |     server: { | ||||||
|  | |||||||
| @ -21,47 +21,15 @@ const SettingStore = useSettingStore(); | |||||||
| // 配置全局组件大小 | // 配置全局组件大小 | ||||||
| const size = computed(() => SettingStore.themeConfig.globalComSize); | const size = computed(() => SettingStore.themeConfig.globalComSize); | ||||||
| 
 | 
 | ||||||
| const meuns = ref([ | import menuList from '@/layouts/component/header/menu.js'; | ||||||
|   { | const meuns = ref(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', |  | ||||||
|   }, |  | ||||||
| ]); |  | ||||||
| import { useRoute } from 'vue-router'; | import { useRoute } from 'vue-router'; | ||||||
| import { useMenuStore } from '@/store/modules/menuStore'; | import { useMenuStore } from '@/store/modules/menuStore'; | ||||||
| const route = useRoute(); | const route = useRoute(); | ||||||
| const menuStore = useMenuStore(); | const menuStore = useMenuStore(); | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|   let item = meuns.value.find((item) => route.path.indexOf(item.path) > -1); |   let item = meuns.value.find((item) => route.path.indexOf(item.path) > -1); | ||||||
|   console.log('item', item); |   // console.log('item', item); | ||||||
|   if (item) { |   if (item) { | ||||||
|     menuStore.setMenuLabel(item.label); |     menuStore.setMenuLabel(item.label); | ||||||
|     menuStore.setMenuPath(item.path); |     menuStore.setMenuPath(item.path); | ||||||
| @ -69,8 +37,8 @@ onMounted(() => { | |||||||
|     menuStore.setMenuLabel('智慧种植'); |     menuStore.setMenuLabel('智慧种植'); | ||||||
|     menuStore.setMenuPath('/sub-operation-service/smartFarm'); |     menuStore.setMenuPath('/sub-operation-service/smartFarm'); | ||||||
|   } |   } | ||||||
|   console.log(menuStore.activeMenuLabel); |   // console.log(menuStore.activeMenuLabel); | ||||||
|   console.log(menuStore.activeMenuPath); |   // console.log(menuStore.activeMenuPath); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -83,40 +83,8 @@ const router = useRouter(); | |||||||
| 
 | 
 | ||||||
| const keyword = ref(''); | const keyword = ref(''); | ||||||
| 
 | 
 | ||||||
| const meuns = ref([ | import menuList from './menu.js'; | ||||||
|   { | const meuns = ref(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', |  | ||||||
|   }, |  | ||||||
| ]); |  | ||||||
| 
 | 
 | ||||||
| const menuStore = useMenuStore(); | const menuStore = useMenuStore(); | ||||||
| const activeLabel = ref(menuStore.activeMenuLabel); | const activeLabel = ref(menuStore.activeMenuLabel); | ||||||
|  | |||||||
							
								
								
									
										35
									
								
								sub-operation-service/src/layouts/component/Header/menu.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								sub-operation-service/src/layouts/component/Header/menu.js
									
									
									
									
									
										Normal file
									
								
							| @ -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; | ||||||
| @ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { | |||||||
| 
 | 
 | ||||||
|   const userStore = useUserStore(); |   const userStore = useUserStore(); | ||||||
|   const hasToken = userStore.hasToken(); |   const hasToken = userStore.hasToken(); | ||||||
|   console.log('sub-operation-service************hasToken', hasToken); |   // console.log('sub-operation-service************hasToken', hasToken);
 | ||||||
|   if (hasToken) { |   if (hasToken) { | ||||||
|     if (to.path === '/login') { |     if (to.path === '/login') { | ||||||
|       // 如果已登录,请重定向到主页
 |       // 如果已登录,请重定向到主页
 | ||||||
|  | |||||||
| @ -208,7 +208,7 @@ | |||||||
| <script setup> | <script setup> | ||||||
| import common from './components/common.vue'; | import common from './components/common.vue'; | ||||||
| import banner from './components/banner.vue'; | import banner from './components/banner.vue'; | ||||||
| import { onMounted, reactive, ref, computed } from 'vue'; | import { onMounted, reactive, ref, computed, watch } from 'vue'; | ||||||
| import { getAssetsFile } from '@/utils'; | import { getAssetsFile } from '@/utils'; | ||||||
| import { qrImg } from '@/layouts/component/Header/base64img.js'; | import { qrImg } from '@/layouts/component/Header/base64img.js'; | ||||||
| import evaluate from './components/evaluate.vue'; | import evaluate from './components/evaluate.vue'; | ||||||
| @ -226,6 +226,7 @@ const goodId = route.query.id; // 获取参数 | |||||||
| const pId = route.query.pid; | const pId = route.query.pid; | ||||||
| const currentWeight = ref(0); | const currentWeight = ref(0); | ||||||
| const showPhone = ref(false); | const showPhone = ref(false); | ||||||
|  | const jumpType = ref('1'); | ||||||
| 
 | 
 | ||||||
| let bannerList = reactive(['images/ecommerce/' + 'banner.png', 'images/ecommerce/' + 'banner.png']); | let bannerList = reactive(['images/ecommerce/' + 'banner.png', 'images/ecommerce/' + 'banner.png']); | ||||||
| const tabList = reactive([ | const tabList = reactive([ | ||||||
| @ -401,6 +402,8 @@ let saveInfo = reactive({ | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|  |   jumpType.value = route.query.type ?? '1'; | ||||||
|  | 
 | ||||||
|   showDetail.value = false; |   showDetail.value = false; | ||||||
|   // const num = Number(pId); |   // const num = Number(pId); | ||||||
|   getGoodDetail(goodId) |   getGoodDetail(goodId) | ||||||
| @ -472,7 +475,14 @@ const formattedData = (data) => { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const toCodeDetail = () => { | const toCodeDetail = () => { | ||||||
|  |   console.log(jumpType.value); | ||||||
|  |   if (jumpType.value === '1') { | ||||||
|  |     // 农资交易 | ||||||
|     router.push('/sub-operation-service/ecommerce-agricultural/ecommerce-agriculturalDetail/source?id=' + goodId); |     router.push('/sub-operation-service/ecommerce-agricultural/ecommerce-agriculturalDetail/source?id=' + goodId); | ||||||
|  |   } else if (jumpType.value === '2') { | ||||||
|  |     // 农产品交易 | ||||||
|  |     router.push('/sub-operation-service/ecommerce-supplier/detail/source?id=' + goodId); | ||||||
|  |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const toBack = (level) => { | const toBack = (level) => { | ||||||
|  | |||||||
| @ -64,6 +64,7 @@ import { useMethodsStore } from '@/store/modules/methods'; | |||||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | import { ElMessage, ElMessageBox } from 'element-plus'; | ||||||
| const route = useRoute(); | const route = useRoute(); | ||||||
| const router = useRouter(); | const router = useRouter(); | ||||||
|  | const emit = defineEmits(['toDetail']); | ||||||
| 
 | 
 | ||||||
| const props = defineProps({ | const props = defineProps({ | ||||||
|   data: { |   data: { | ||||||
| @ -151,10 +152,11 @@ const openDialog = (data) => { | |||||||
| 
 | 
 | ||||||
| const toDetail = (id, pid) => { | const toDetail = (id, pid) => { | ||||||
|   if (props.type === 2) { |   if (props.type === 2) { | ||||||
|     router.push('/sub-operation-service/ecommerce-supplier/detail?id=' + id + '&pid=' + pid); |     router.push('/sub-operation-service/ecommerce-supplier/detail?id=' + id + '&pid=' + pid + '&type=' + 2); | ||||||
|   } else { |   } else { | ||||||
|     router.push('/sub-operation-service/ecommerce-agricultural/ecommerce-agriculturalDetail?id=' + id + '&pid=' + pid); |     router.push('/sub-operation-service/ecommerce-agricultural/ecommerce-agriculturalDetail?id=' + id + '&pid=' + pid + '&type=' + 1); | ||||||
|   } |   } | ||||||
|  |   // emit('toDetail', id, pid); | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
|  | |||||||
| @ -33,14 +33,23 @@ let currentIndex = ref(0); | |||||||
| watch( | watch( | ||||||
|   () => props.currentName, |   () => props.currentName, | ||||||
|   () => { |   () => { | ||||||
|     console.info('currentName', props.currentName); |     // console.info('currentName', props.currentName); | ||||||
|     currentIndex.value = leftMenu.findIndex((m) => { |     currentIndex.value = leftMenu.findIndex((m) => { | ||||||
|       return m.name == props.currentName; |       return m.name == props.currentName; | ||||||
|     }); |     }); | ||||||
|   }, |   }, | ||||||
|   { deep: true, immediate: true } |   { deep: true, immediate: true } | ||||||
| ); | ); | ||||||
| 
 | watch( | ||||||
|  |   () => route.path, | ||||||
|  |   () => { | ||||||
|  |     // console.info('route.path', route.path); | ||||||
|  |     currentIndex.value = leftMenu.findIndex((m) => { | ||||||
|  |       return route.path.indexOf(m.path) > -1; | ||||||
|  |     }); | ||||||
|  |   }, | ||||||
|  |   { deep: true, immediate: true } | ||||||
|  | ); | ||||||
| const toLink = (index) => { | const toLink = (index) => { | ||||||
|   currentIndex.value = index; |   currentIndex.value = index; | ||||||
|   let path = index != undefined ? leftMenu[index].path : null; |   let path = index != undefined ? leftMenu[index].path : null; | ||||||
|  | |||||||
| @ -38,7 +38,7 @@ | |||||||
|           <div class="goods-list"> |           <div class="goods-list"> | ||||||
|             <template v-for="(n, index) in list" :key="n.id"> |             <template v-for="(n, index) in list" :key="n.id"> | ||||||
|               <div class="goods-item"> |               <div class="goods-item"> | ||||||
|                 <goodsItem :data="n"></goodsItem> |                 <goodsItem :data="n" :type="1"></goodsItem> | ||||||
|               </div> |               </div> | ||||||
|             </template> |             </template> | ||||||
|           </div> |           </div> | ||||||
|  | |||||||
| @ -50,10 +50,22 @@ watch( | |||||||
|   } |   } | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | import menuList from '@/layouts/component/header/menu.js'; | ||||||
|  | const meuns = ref(menuList); | ||||||
|  | import { useMenuStore } from '@/store/modules/menuStore'; | ||||||
|  | const menuStore = useMenuStore(); | ||||||
| const toLink = (item) => { | const toLink = (item) => { | ||||||
|   currentLink.value = item.name; |   currentLink.value = item.name; | ||||||
|   if (item.path && item.path != '') { |   if (item.name == 'home') { | ||||||
|  |     menuStore.setMenuLabel('智慧种植'); | ||||||
|  |     menuStore.setMenuPath('/sub-operation-service/smartFarm'); | ||||||
|     router.push(item.path); |     router.push(item.path); | ||||||
|  |   } else { | ||||||
|  |     let obj = meuns.value.find((el) => el.name == item.name); | ||||||
|  |     console.log('obj', obj); | ||||||
|  |     menuStore.setMenuLabel(obj.label); | ||||||
|  |     menuStore.setMenuPath(obj.path); | ||||||
|  |     router.push(obj.path); | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -44,19 +44,20 @@ | |||||||
|                           <ischeck :value="g.ischeck" size="24px"></ischeck> |                           <ischeck :value="g.ischeck" size="24px"></ischeck> | ||||||
|                         </div> |                         </div> | ||||||
|                       </div> |                       </div> | ||||||
|                       <div class="good-img" @click="toCheckGood(index, indexg)"> |                       <div class="good-row-info" @click="goDetail(g, indexg)"> | ||||||
|  |                         <div class="good-img"> | ||||||
|                           <!-- <costomImg :url="g.productImgUrl" :is-view="false"></costomImg> --> |                           <!-- <costomImg :url="g.productImgUrl" :is-view="false"></costomImg> --> | ||||||
|                           <img class="good-img" style="border-radius: 5px" :src="g.productImgUrl.split('?')[0]" alt="" /> |                           <img class="good-img" style="border-radius: 5px" :src="g.productImgUrl.split('?')[0]" alt="" /> | ||||||
|                         </div> |                         </div> | ||||||
|                       <div class="good-info" @click="toCheckGood(index, indexg)"> |                         <div class="good-info"> | ||||||
|                           <div class="good-info-pos"> |                           <div class="good-info-pos"> | ||||||
|                             <div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div> |                             <div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div> | ||||||
|                           </div> |                           </div> | ||||||
|                         </div> |                         </div> | ||||||
|                         <div class="good-price-num"> |                         <div class="good-price-num"> | ||||||
|                           <div class="good-price-num-pos"> |                           <div class="good-price-num-pos"> | ||||||
|                           <div class="price" @click="toCheckGood(index, indexg)">{{ g.netWeightInfoVO?.goodSpecs }}</div> |                             <div class="price">{{ g.netWeightInfoVO?.goodSpecs }}</div> | ||||||
|                           <div class="total" @click="toCheckGood(index, indexg)">{{ (g.price * g.quantity).toFixed(2) }}</div> |                             <div class="total">{{ (g.price * g.quantity).toFixed(2) }}</div> | ||||||
|                             <div class="num"> |                             <div class="num"> | ||||||
|                               <div class="right-item"> |                               <div class="right-item"> | ||||||
|                                 <el-input-number v-model="g.quantity" :min="1" @change="numberChange(g.quantity, index, indexg)"> |                                 <el-input-number v-model="g.quantity" :min="1" @change="numberChange(g.quantity, index, indexg)"> | ||||||
| @ -76,6 +77,7 @@ | |||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
|  |             </div> | ||||||
| 
 | 
 | ||||||
|             <div class="fix-bottom"> |             <div class="fix-bottom"> | ||||||
|               <div class="bottom-total"> |               <div class="bottom-total"> | ||||||
| @ -170,6 +172,16 @@ const pagination = (value) => { | |||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | const jumpType = ref('1'); //这个需要在商品详情中添加商品的类型,1为农资,2为农产品 | ||||||
|  | const goDetail = (item, indexg) => { | ||||||
|  |   console.log(item, indexg); | ||||||
|  |   if (jumpType.value === 2) { | ||||||
|  |     router.push('/sub-operation-service/ecommerce-supplier/detail?id=' + item.productId + '&type=' + 2); | ||||||
|  |   } else { | ||||||
|  |     router.push('/sub-operation-service/ecommerce-agricultural/ecommerce-agriculturalDetail?id=' + item.productId + '&type=' + 1); | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| function addIsCheckProperty(data) { | function addIsCheckProperty(data) { | ||||||
|   if (!data) return; |   if (!data) return; | ||||||
| 
 | 
 | ||||||
| @ -584,6 +596,11 @@ function removeCheckedItems(data) { | |||||||
|               width: 100%; |               width: 100%; | ||||||
|               gap: 16px; |               gap: 16px; | ||||||
|             } |             } | ||||||
|  |             .good-row-info { | ||||||
|  |               flex: 1; | ||||||
|  |               display: flex; | ||||||
|  |               gap: 16px; | ||||||
|  |             } | ||||||
|             .good-do, |             .good-do, | ||||||
|             .good-img, |             .good-img, | ||||||
|             .good-info, |             .good-info, | ||||||
| @ -630,7 +647,7 @@ function removeCheckedItems(data) { | |||||||
|                 } |                 } | ||||||
|                 .price { |                 .price { | ||||||
|                   font-weight: 400; |                   font-weight: 400; | ||||||
|                   width: 200px; |                   width: 180px; | ||||||
|                 } |                 } | ||||||
|                 .total { |                 .total { | ||||||
|                   font-weight: 700; |                   font-weight: 700; | ||||||
|  | |||||||
| @ -50,10 +50,22 @@ watch( | |||||||
|   } |   } | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | import menuList from '@/layouts/component/header/menu.js'; | ||||||
|  | const meuns = ref(menuList); | ||||||
|  | import { useMenuStore } from '@/store/modules/menuStore'; | ||||||
|  | const menuStore = useMenuStore(); | ||||||
| const toLink = (item) => { | const toLink = (item) => { | ||||||
|   currentLink.value = item.name; |   currentLink.value = item.name; | ||||||
|   if (item.path && item.path != '') { |   if (item.name == 'home') { | ||||||
|  |     menuStore.setMenuLabel('智慧种植'); | ||||||
|  |     menuStore.setMenuPath('/sub-operation-service/smartFarm'); | ||||||
|     router.push(item.path); |     router.push(item.path); | ||||||
|  |   } else { | ||||||
|  |     let obj = meuns.value.find((el) => el.name == item.name); | ||||||
|  |     console.log('obj', obj); | ||||||
|  |     menuStore.setMenuLabel(obj.label); | ||||||
|  |     menuStore.setMenuPath(obj.path); | ||||||
|  |     router.push(obj.path); | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user