Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

This commit is contained in:
吴昊天 2023-03-06 18:41:38 +08:00
commit 618a3dad3f
3 changed files with 34 additions and 9 deletions

View File

@ -3,7 +3,7 @@
<Breadcrumb :style="{ fontSize: `${fontSize}px` }">
<BreadcrumbItem
v-for="(item, index) in list"
:key="`${item.path}`"
:key="index"
:to="index !== 1 ? item.path : ''"
v-if="listLast[0].path !== homePath"
>

View File

@ -159,7 +159,7 @@ export default {
swiperData() {
loginInfoApi()
.then((res) => {
window.document.title = `${res.data.site_name} - 登录`
window.document.title = `${res.data.site_name} - 登录`;
localStorage.setItem('ADMIN_TITLE', res.data.site_name || '');
let data = res.data || {};
this.login_logo = data.login_logo ? data.login_logo : require('@/assets/images/logo.png');
@ -239,8 +239,10 @@ export default {
this.checkSocket();
} catch (e) {}
return this.$router.replace({ path: res.data.menus[0].path || this.$routeProStr + '/' });
// console.log(this.findFirstNonNullChildren(res.data.menus), 1111);
return this.$router.replace({
path: this.findFirstNonNullChildren(res.data.menus).path || this.$routeProStr + '/',
});
})
.catch((res) => {
msg();
@ -252,6 +254,26 @@ export default {
this.loading = false;
}, 1000);
},
findFirstNonNullChildren(arr) {
// 如果数组为空,返回null
if (!arr || arr.length === 0) {
return null;
}
// 找到第一个对象
const firstObj = arr[0];
// 如果第一个对象没有children属性,返回该对象
if (!firstObj.children) {
return firstObj;
}
// 如果第一个对象的children属性是数组,
// 递归查找children属性中的第一个非null children属性
if (Array.isArray(firstObj.children)) {
return this.findFirstNonNullChildren(firstObj.children);
}
// 如果数组中没有非null children属性,返回null
return null;
},
checkSocket() {
getWorkermanUrl().then((res) => {
let url = res.data.admin;

View File

@ -3,6 +3,10 @@
.ivu-date-picker .ivu-select-dropdown {
/* top: 33px!important; */
}
.vxe-tree-cell,
.vxe-cell {
font-size: 12px;
}
.plusColor {
color: #e83323;
}
@ -204,7 +208,7 @@ body {
}
/*表格公共样式*/
.ivu-table-header .ivu-table-cell{
.ivu-table-header .ivu-table-cell {
color: #999;
font-size: 13px;
padding: 10px 5px !important;
@ -519,7 +523,7 @@ body {
padding: 10px 20px;
border-bottom: 1px solid #f2f2f2;
margin-bottom: 10px;
border-radius:5px;
border-radius: 5px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
@ -542,11 +546,10 @@ body {
overflow: auto;
background-color: #f5f7f9;
}
.left-wrapper{
.left-wrapper {
height: calc(100vh - 120px);
background: #fff;
border-right: 1px solid #f2f2f2;
}
.ivu-tabs-bar {
margin-bottom: 0;
@ -710,6 +713,6 @@ body {
margin-top: 3px;
color: rgb(153, 153, 153);
}
.pt10{
.pt10 {
padding-top: 10px;
}