flx:修复新用户模块展示问题

This commit is contained in:
X_Rian 2024-07-26 18:15:38 +08:00
parent e288c56bdf
commit a2f4489038

View File

@ -13,9 +13,9 @@
<!-- <div class="module_title">{{$t('message.homeLayout.existingProducts')}}</div> --> <!-- <div class="module_title">{{$t('message.homeLayout.existingProducts')}}</div> -->
<div class="projectIndex" id="projectIndex"> <div class="projectIndex" id="projectIndex">
<template v-for="(item, index) in list"> <template v-for="(item, index) in list">
<div style="width: 100%;height: 1px;" v-if="index == 0 || (index > 0 && list[index - 1].labelName != item.labelName)"></div> <div style="width: 100%;height: 1px;" v-if="index == 0 || item.operationFlag || (index > 0 && list[index - 1].labelName != item.labelName)"></div>
<div class="moduleBox" v-if="item.operation" > <div class="moduleBox" v-if="item.operation" >
<div class="module_title" v-if=" index == 0 || (index > 0 && list[index - 1].labelName != item.labelName)"> <div class="module_title" v-if="index == 0 || item.operationFlag || (index > 0 && list[index - 1].labelName != item.labelName)">
{{ item.labelName }} {{ item.labelName }}
</div> </div>
<div <div
@ -331,7 +331,7 @@ export default {
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
let all = res.result.moduleList; let all = res.result.moduleList;
console.log("all", all); console.log("all11", all);
all.forEach((element, index) => { all.forEach((element, index) => {
all[index].operation = false; all[index].operation = false;
res.result.menuList.forEach((element2) => { res.result.menuList.forEach((element2) => {
@ -344,7 +344,7 @@ export default {
console.log("all111", all); console.log("all111", all);
// this.list = all; // this.list = all;
this.list = all.filter(item => item.plugin != 'contractors' && item.plugin != "programConfig");// this.list = all.filter(item => item.plugin != 'contractors' && item.plugin != "programConfig");//
console.log(111111, this.list)
let pathItem = localStorage.getItem('lageToBackend') let pathItem = localStorage.getItem('lageToBackend')
if(pathItem.length > 0){ if(pathItem.length > 0){
localStorage.removeItem('lageToBackend') localStorage.removeItem('lageToBackend')
@ -361,7 +361,6 @@ export default {
this.$router.push(path); this.$router.push(path);
} }
} }
}); });
} else { } else {
@ -383,6 +382,20 @@ export default {
}); });
// this.list = all; // this.list = all;
this.list = all.filter(item => item.plugin != 'contractors' && item.plugin != "programConfig");// this.list = all.filter(item => item.plugin != 'contractors' && item.plugin != "programConfig");//
this.list = this.list.filter(item => item.operation).reduce((prev, item) => {
const findIndex = prev.findIndex(ele => ele.labelName == item.labelName);
if(findIndex > -1){
prev.push(item);
} else {
prev.push({
...item,
operationFlag: true
})
}
return prev
},[])
console.log(this.list, 222)
} }
}); });
} }