flx:优化

This commit is contained in:
Rain_ 2025-09-27 15:12:51 +08:00
parent f7cf425848
commit cb9e2ec63c
3 changed files with 99 additions and 80 deletions

View File

@ -60,7 +60,7 @@
class="width_100" class="width_100"
@click="goto5()" @click="goto5()"
v-if=" v-if="
$route.path.indexOf('/firm/projectManage') == -1 && $route.path.indexOf('/firm/') == -1 &&
![5, 6, 10].includes($store.state.userInfo.accountType) ![5, 6, 10].includes($store.state.userInfo.accountType)
" "
:title="enterpriseFront" :title="enterpriseFront"

View File

@ -4,24 +4,47 @@
<div class="title_l flex"> <div class="title_l flex">
<!-- <img v-if="LOGO_white" :src="'./img/logo/'+LOGO_white+'.png'" class="icon" /> <!-- <img v-if="LOGO_white" :src="'./img/logo/'+LOGO_white+'.png'" class="icon" />
<span>{{$t('message.companyDiagram.pageTitle')}}</span> --> <span>{{$t('message.companyDiagram.pageTitle')}}</span> -->
<img v-if="systemInfo.platformLogo" :src="systemInfo.platformLogo" class="logo" height="25" /> <img
<img v-else-if="LOGO_white" :src="'./img/logo/'+LOGO_white+'.png'" class="logo" height="25" /> v-if="systemInfo.platformLogo"
<span v-if="company != 'nanchang'" style="cursor: pointer" @click="back">{{systemInfo.platformName}} </span> :src="systemInfo.platformLogo"
class="logo"
height="25"
/>
<img
v-else-if="LOGO_white"
:src="'./img/logo/' + LOGO_white + '.png'"
class="logo"
height="25"
/>
<span v-if="company != 'nanchang'" style="cursor: pointer" @click="back"
>{{ systemInfo.platformName }}
</span>
<span v-if="company != 'nanchang'"> - </span> <span v-if="company != 'nanchang'"> - </span>
<span v-if="company != 'nanchang'">{{$t('message.companyDiagram.pageTitle')}}</span> <span v-if="company != 'nanchang'">{{
$t("message.companyDiagram.pageTitle")
}}</span>
<!-- 南昌地铁头部样式 --> <!-- 南昌地铁头部样式 -->
<span v-if="company == 'nanchang'" style="cursor: pointer" @click="back">{{$t('message.companyDiagram.pageTitle')}}</span> <span
v-if="company == 'nanchang'"
style="cursor: pointer"
@click="back"
>{{ $t("message.companyDiagram.pageTitle") }}</span
>
</div> </div>
<!-- <div class="title_near flex" v-if="![1,2].includes($store.state.userInfo.accountType)"> <!-- <div class="title_near flex" v-if="![1,2].includes($store.state.userInfo.accountType)">
<userChange></userChange> <userChange></userChange>
</div> --> </div> -->
<div class="title_near-tow flex" v-if="![11,1,2].includes($store.state.userInfo.accountType) && workSpaceShow"> <div
class="title_near-tow flex"
v-if="
![11, 1, 2].includes($store.state.userInfo.accountType) &&
workSpaceShow
"
>
<div class="divider-line"></div> <div class="divider-line"></div>
<centerChange></centerChange> <centerChange></centerChange>
</div> </div>
<div <div class="title_r flex">
class="title_r flex"
>
<account></account> <account></account>
</div> </div>
</div> </div>
@ -34,24 +57,20 @@
active-text-color="#5181F6" active-text-color="#5181F6"
router router
> >
<div <div
v-for="(item, index) in menuList" v-for="(item, index) in menuList"
:key="index" :key="index"
class="menuInnerBox" class="menuInnerBox"
> >
<el-menu-item class="firstLevelMenu" <el-menu-item
class="firstLevelMenu"
v-if="!hasSubMenu(item.menuList)" v-if="!hasSubMenu(item.menuList)"
:index="item.modulePath" :index="item.modulePath"
> >
{{ item.moduleName}} {{ item.moduleName }}
</el-menu-item> </el-menu-item>
<el-submenu <el-submenu :index="item.modulePath" v-else>
:index="item.modulePath" <template slot="title">{{ item.moduleName }}</template>
v-else
>
<template slot="title">{{
item.moduleName
}}</template>
<el-menu-item <el-menu-item
:index="data.path" :index="data.path"
v-for="(data, i) in item.menuList" v-for="(data, i) in item.menuList"
@ -67,8 +86,9 @@
type="primary" type="primary"
plain plain
@click="backTo()" @click="backTo()"
v-if="$route.path.indexOf('/userCenter/') == -1"
size="mini" size="mini"
style="margin-right: 30px;" style="margin-right: 30px"
>返回</el-button >返回</el-button
> >
</div> </div>
@ -83,45 +103,43 @@
import account from "@/components/account.vue"; import account from "@/components/account.vue";
import userChange from "@/components/userChange.vue"; import userChange from "@/components/userChange.vue";
import centerChange from "@/components/centerChange.vue"; import centerChange from "@/components/centerChange.vue";
import { import { getNewUserAllModulePageApi } from "@/assets/js/api/jxjadmin.js";
getNewUserAllModulePageApi,
} from "@/assets/js/api/jxjadmin.js";
export default { export default {
data() { data() {
return { return {
LOGO_white:LOGO_white, LOGO_white: LOGO_white,
currentUrl:'', currentUrl: "",
menuList:[ menuList: [
{ moduleName: '用户中心', modulePath: "/userCenter/userConfig" } { moduleName: "用户中心", modulePath: "/userCenter/userConfig" },
], ],
systemInfo:{ systemInfo: {
"loginBackgroundImage": "", loginBackgroundImage: "",
"loginLogo": "", loginLogo: "",
"platformLogo": "", platformLogo: "",
"platformName": "智慧工地云平台" platformName: "智慧工地云平台",
}, },
workSpaceShow: false workSpaceShow: false,
}; };
}, },
components:{ components: {
account, account,
userChange, userChange,
centerChange centerChange,
}, },
created() { created() {
this.company = COMPANY; this.company = COMPANY;
console.log(COMPANY) console.log(COMPANY);
if(this.$store.state.projectSn){ if (this.$store.state.projectSn) {
this.getModuleList(); this.getModuleList();
} }
}, },
mounted(){ mounted() {
// this.getAllModule() // this.getAllModule()
if(localStorage.getItem('systemInfo')){ if (localStorage.getItem("systemInfo")) {
this.systemInfo=JSON.parse(localStorage.getItem('systemInfo')) this.systemInfo = JSON.parse(localStorage.getItem("systemInfo"));
} }
// document.title='' // document.title=''
console.log('mounted',this.$route.path) console.log("mounted", this.$route.path);
}, },
methods: { methods: {
// () // ()
@ -140,7 +158,7 @@ export default {
} }
}); });
}, },
backTo(){ backTo() {
this.$router.push("/workSpace"); this.$router.push("/workSpace");
// this.$router.back(); // this.$router.back();
}, },
@ -159,36 +177,36 @@ export default {
// console.log("onoff", onoff); // console.log("onoff", onoff);
return onoff; return onoff;
}, },
getAllModule(){ getAllModule() {
var half = this.$store.state.userInfo.menuAuthority.moduleList var half = this.$store.state.userInfo.menuAuthority.moduleList;
half.forEach(element => { half.forEach((element) => {
if(element.moduleType==3){ if (element.moduleType == 3) {
this.menuList.push(element) this.menuList.push(element);
} }
}); });
// getAllModuleApi({moduleType:4}).then(res => { // getAllModuleApi({moduleType:4}).then(res => {
// if (res.success) { // if (res.success) {
// var all = res.result // var all = res.result
// all.forEach((element,index) => { // all.forEach((element,index) => {
// all[index].operation=false // all[index].operation=false
// half.forEach(element2 => { // half.forEach(element2 => {
// if(element2.moduleId==element.moduleId){ // if(element2.moduleId==element.moduleId){
// all[index].operation=true // all[index].operation=true
// all[index].menuList=element2.menuList // all[index].menuList=element2.menuList
// } // }
// }); // });
// }); // });
// this.menuList=all // this.menuList=all
// } // }
// }) // })
}, },
handleSelect(url) { handleSelect(url) {
// this.$store.commit('setCurrentUrl',url) // this.$store.commit('setCurrentUrl',url)
// this.$store.dispatch('currentUrl',url) // this.$store.dispatch('currentUrl',url)
}, },
back() { back() {
this.$router.push("/firm/projectManage") this.$router.push("/firm/projectManage");
} },
}, },
}; };
</script> </script>
@ -217,13 +235,14 @@ export default {
} }
} }
} }
/deep/.el-submenu__title{ /deep/.el-submenu__title {
padding-right: 20px!important; padding-right: 20px !important;
.el-submenu__icon-arrow{ .el-submenu__icon-arrow {
right: 0px; right: 0px;
} }
} }
.el-menu--horizontal .firstLevelMenu.is-active,/deep/.is-active .el-submenu__title { .el-menu--horizontal .firstLevelMenu.is-active,
/deep/.is-active .el-submenu__title {
border-bottom: 3px solid #409eff; border-bottom: 3px solid #409eff;
} }
.menuInnerBox { .menuInnerBox {
@ -258,7 +277,7 @@ export default {
// .menuInnerBox { // .menuInnerBox {
// display: inline-block; // display: inline-block;
// } // }
.menuBox{ .menuBox {
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
@ -273,7 +292,7 @@ export default {
height: 61px; height: 61px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end justify-content: flex-end;
} }
.title_l { .title_l {
font-family: PingFangSC-Semibold; font-family: PingFangSC-Semibold;
@ -285,14 +304,14 @@ export default {
margin-right: 14px; margin-right: 14px;
} }
} }
.title_near{ .title_near {
margin-right: 50px; margin-right: 50px;
} }
.title_near-tow{ .title_near-tow {
.divider-line{ .divider-line {
width: 1px; width: 1px;
height: 16px; height: 16px;
background: #FFFFFF; background: #ffffff;
margin-right: 50px; margin-right: 50px;
} }
} }

View File

@ -175,7 +175,7 @@ export default {
}, },
exportFn() { exportFn() {
let requestData = { let requestData = {
sn: this.$store.state.projectSn, sn: this.$store.state.projectSn || this.$store.state.userInfo.sn,
// sn: this.$store.state.userInfo.sn || this.$store.state.userInfo.headquartersSn, // sn: this.$store.state.userInfo.sn || this.$store.state.userInfo.headquartersSn,
pageNo: this.pageInfo.pageNo, pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize, pageSize: this.pageInfo.pageSize,
@ -230,7 +230,7 @@ export default {
// //
getList() { getList() {
let requestData = { let requestData = {
sn: this.$store.state.projectSn, sn: this.$store.state.projectSn || this.$store.state.userInfo.sn || this.$store.state.userInfo.headquartersSn,
// sn: this.$store.state.userInfo.sn || this.$store.state.userInfo.headquartersSn, // sn: this.$store.state.userInfo.sn || this.$store.state.userInfo.headquartersSn,
pageNo: this.pageInfo.pageNo, pageNo: this.pageInfo.pageNo,
pageSize: this.pageInfo.pageSize, pageSize: this.pageInfo.pageSize,