This commit is contained in:
xiaofajia 2024-10-24 22:39:21 +08:00
commit 89c2467bb5
3 changed files with 71 additions and 20 deletions

View File

@ -56,7 +56,7 @@ export function exportOrderInfoExcel(params) {
export function toPay(params) { export function toPay(params) {
return request({ return request({
url: '/admin-api/pay/toPay', url: '/admin-api/pay/toPayCode',
method: 'get', method: 'get',
params params
}) })

View File

@ -37,8 +37,9 @@ const permission = {
// 将 menus 菜单,转换为 route 路由数组 // 将 menus 菜单,转换为 route 路由数组
const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据 const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据 const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
const sidebarRoutes = filterAsyncRouter(sdata) const sss = JSON.parse(JSON.stringify(menus))
const rewriteRoutes = filterAsyncRouter(rdata, false, true) const sidebarRoutes = filterAsyncRouter(sdata,sss)
const rewriteRoutes = filterAsyncRouter(rdata,sss, false, true)
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true}) rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
commit('SET_ROUTES', rewriteRoutes) commit('SET_ROUTES', rewriteRoutes)
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
@ -51,13 +52,12 @@ const permission = {
} }
// 遍历后台传来的路由字符串,转换为组件对象 // 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { function filterAsyncRouter(asyncRouterMap,sdata, lastRouter = false, type = false) {
return asyncRouterMap.filter(function(route,index) { return asyncRouterMap.filter(function(route,index) {
// 将 ruoyi 后端原有耦合前端的逻辑,迁移到此处 // 将 ruoyi 后端原有耦合前端的逻辑,迁移到此处
// 处理 meta 属性 // 处理 meta 属性
route.meta = { route.meta = {
title:dealMenuText(index) +' '+ route.name, title:dealMenuText(index,route,sdata) +' '+ route.name,
icon: route.icon,
noCache: !route.keepAlive, noCache: !route.keepAlive,
} }
route.hidden = !route.visible route.hidden = !route.visible
@ -89,23 +89,56 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
route.children = filterChildren(route.children) route.children = filterChildren(route.children)
} }
if (route.children != null && route.children && route.children.length) { if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type) route.children = filterAsyncRouter(route.children,sdata, route, type)
route.alwaysShow = route.alwaysShow !== undefined ? route.alwaysShow : true route.alwaysShow = route.alwaysShow !== undefined ? route.alwaysShow : true
} else { } else {
delete route['children'] delete route['children']
delete route['alwaysShow'] // 如果没有子菜单,就不需要考虑 alwaysShow 字段 delete route['alwaysShow'] // 如果没有子菜单,就不需要考虑 alwaysShow 字段
} }
console.log(route,989898)
return true return true
}) })
} }
function dealMenuText(num){ function dealMenuText(num,data,list){
let tempData =['(一)','(二)','(三)','(四)','(五)','(六)','(七)','(八)','(九)','(十)' if (data.parentId==0){
,'(十一)','(十二)','(十三)','(十四)','(十五)','(十六)','(十七)','(十八)','(十九)','(二十)','(二十一)','(二十二)','(二十三)'] let tempData =['一','二','三','四','五','六','七','八','九','十'
,'十一','十二','十三','十四','十五','十六','十七','十八','十九','二十','二十一','二十二','二十三']
if (num>tempData.length){ if (num>tempData.length){
return ""; return "";
} }
return tempData[num] return tempData[num] +'、'
}else {
let level =1;
let parData ={};
for (const item of list) {
if ( data.parentId == item.id){
parData = item
level++
break;
}
}
for (const item of list) {
if ( parData.parentId == 0){
parData = item
level++
break;
}
}
if (level==2){
let tempData2 =['(一)','(二)','(三)','(四)','(五)','(六)','(七)','(八)','(九)','(十)'
,'(十一)','(十二)','(十三)','(十四)','(十五)','(十六)','(十七)','(十八)','(十九)','(二十)','(二十一)','(二十二)','(二十三)']
if (num>tempData2.length){
return "";
}
return tempData2[num]
}else if (level == 3){
return (num+1)+'.'
}else {
return ""
}
}
} }
function filterChildren(childrenMap, lastRouter = false) { function filterChildren(childrenMap, lastRouter = false) {
let children = []; let children = [];

View File

@ -1,14 +1,15 @@
<template> <template>
<div class="container_"> <div class="container_">
<el-row> <div class="top-list">
<el-col v-for="item in serviceList" :span="4"> <div class="list-box" v-for="item in serviceList" :span="4">
<div @click="goRoute(item.id)"> <div @click="goRoute(item.id)">
<image-preview :width="300" :height="300" :src="item.coverImg"></image-preview> <img :src=" imgUrl + item.coverImg" style="width: 300px; height: 300px;">
{{ item.name }} <!-- <image-preview :width="300" :height="300" :src="item.coverImg"></image-preview>-->
<div style="font-weight: bold;text-align: center;font-size: 25px">{{ item.name }}</div>
</div> </div>
</el-col> </div>
</el-row> </div>
<div class="container-box"> <div class="container-box">
<div class="flex-box"> <div class="flex-box">
@ -117,6 +118,7 @@ export default {
}, },
data() { data() {
return { return {
imgUrl:'',
lineChartData: lineChartData.newVisitis, lineChartData: lineChartData.newVisitis,
serviceList: [], serviceList: [],
warnList: [], warnList: [],
@ -137,6 +139,8 @@ export default {
this.getServiceList() this.getServiceList()
this.getNotifyMessage() this.getNotifyMessage()
this.getWarnList() this.getWarnList()
this.imgUrl = process.env.VUE_APP_IMAGE_URL
console.log( this.imgUrl + '1111111' )
}, },
methods: { methods: {
handleSetLineChartData(type) { handleSetLineChartData(type) {
@ -179,6 +183,20 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;
} }
.top-list{
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 25px;
}
.list-box{
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 4px;
box-sizing: border-box;
padding: 15px;
border-radius: 8px;
}
.container-box{ .container-box{
width: 100%; width: 100%;
display: flex; display: flex;