Browse Source

试试翰林院

dev^2
dai 2 years ago
parent
commit
9832ec93e1
  1. 3
      .env.development
  2. 2
      src/js/store/index.js
  3. 86
      src/views/main-shuju/main-navbar.vue
  4. 12
      src/views/main-shuju/main.vue

3
.env.development

@ -1,12 +1,13 @@
NODE_ENV=development
VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_API_SERVER = https://epmet-panshi.elinkservice.cn/api
# VUE_APP_NODE_ENV=dev_sdtdt
VUE_APP_NODE_ENV=dev

2
src/js/store/index.js

@ -45,6 +45,8 @@ export default new Vuex.Store({
fixed1920: {
height: document.documentElement.clientHeight,
},
fullscreen: false, //是否全屏状态
},
modules: {
user,

86
src/views/main-shuju/main-navbar.vue

@ -3,7 +3,9 @@
<nav v-if="showHeader" class="m-navbar">
<div class="navbar__header">
<h1 class="navbar__brand">
<a class="navbar__brand-lg" href="javascript:;">{{ customerName }}</a>
<a class="navbar__brand-lg" href="javascript:;">{{
customerName
}}</a>
<a class="navbar__brand-mini" href="javascript:;">{{
customerName.slice(0, 2)
}}</a>
@ -13,7 +15,9 @@
<el-menu class="navbar__menu mr-auto" mode="horizontal">
<el-menu-item
index="1"
@click="$store.state.sidebarFold = !$store.state.sidebarFold"
@click="
$store.state.sidebarFold = !$store.state.sidebarFold
"
>
<svg
class="icon-svg navbar__icon-menu navbar__icon-menu--switch"
@ -24,7 +28,10 @@
</el-menu-item>
<el-menu-item index="2" @click="refresh()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<svg
class="icon-svg navbar__icon-menu"
aria-hidden="true"
>
<use xlink:href="#icon-sync"></use>
</svg>
</el-menu-item>
@ -41,11 +48,15 @@
<span>首页</span>
</el-menu-item>
<template v-for="(menu, idx) in $store.state.mainShuju.menuList">
<template
v-for="(menu, idx) in $store.state.mainShuju.menuList"
>
<li
class="sub-menu"
:class="
$store.state.mainShuju.activeName == menu.id ? 'z-on' : ''
$store.state.mainShuju.activeName == menu.id
? 'z-on'
: ''
"
v-if="menu.children"
:key="menu.id"
@ -55,12 +66,15 @@
<div class="sub-menu-list">
<div
:class="
$store.state.mainShuju.activeName == subMenu.id
$store.state.mainShuju.activeName ==
subMenu.id
? 'z-on'
: ''
"
:key="subMenu.id"
@click="gotoRouteHandle(subMenu.id, subIndex)"
@click="
gotoRouteHandle(subMenu.id, subIndex)
"
v-for="(subMenu, subIndex) in menu.children"
>
{{ subMenu.name }}
@ -101,7 +115,10 @@
</a>
</el-menu-item> -->
<el-menu-item index="3" @click="fullscreenHandle()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<svg
class="icon-svg navbar__icon-menu"
aria-hidden="true"
>
<use xlink:href="#icon-fullscreen"></use>
</svg>
</el-menu-item>
@ -109,17 +126,23 @@
<el-menu-item index="4" class="navbar__avatar">
<el-dropdown placement="bottom" :show-timeout="0">
<span class="el-dropdown-link">
<img src="~@/assets/img/staff-default-avatar.png" />
<img
src="~@/assets/img/staff-default-avatar.png"
/>
<span>{{ $store.state.user.realName }}</span>
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updatePasswordHandle()">{{
<el-dropdown-item
@click.native="updatePasswordHandle()"
>{{
$t("updatePassword.title")
}}</el-dropdown-item>
<el-dropdown-item @click.native="logoutHandle()">{{
$t("logout")
}}</el-dropdown-item>
}}</el-dropdown-item
>
<el-dropdown-item
@click.native="logoutHandle()"
>{{ $t("logout") }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</el-menu-item>
@ -167,18 +190,42 @@ export default {
const customerId = localStorage.getItem("customerId");
let siteconfigElement = window.SITE_CONFIG["menuShujuList"];
// 亿 -
if ("04c0d396e298f13e57aa5904a657eaa6" != customerId && "3fdd0380deff5b30f45376cdf995d1c1" != customerId){
for (let index in siteconfigElement){
if (siteconfigElement[index].id == '6'){
let newMenuArr = siteconfigElement[index].children.filter(item =>item.id !== 'duoyuanfuwufenxi');
if (
"04c0d396e298f13e57aa5904a657eaa6" != customerId &&
"3fdd0380deff5b30f45376cdf995d1c1" != customerId
) {
for (let index in siteconfigElement) {
if (siteconfigElement[index].id == "6") {
let newMenuArr = siteconfigElement[index].children.filter(
(item) => item.id !== "duoyuanfuwufenxi"
);
siteconfigElement[index].children = newMenuArr;
}
}
}
this.$store.state.mainShuju.menuList = siteconfigElement;
//
this.checkFullscreen();
},
computed: {},
methods: {
//
checkFullscreen() {
const fn = () => {
if (document.fullscreenElement === null) {
console.log("Exited fullscreen");
this.$store.state.fullscreen = false;
} else {
console.log("Entered fullscreen");
this.$store.state.fullscreen = true;
}
};
//
document.addEventListener("fullscreenchange", fn);
fn();
},
toIndexPage() {
this.$router.replace("/indexWork");
},
@ -228,7 +275,8 @@ export default {
.then(() => {
//
// tabs,
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
this.$store.state.contentTabs =
this.$store.state.contentTabs.filter(
(item) => item.name === "home2"
);

12
src/views/main-shuju/main.vue

@ -9,11 +9,14 @@
{
'z-sidebar--noside': true,
},
{ 'z-iframe': $store.state.inIframe },
{ 'z-iframe': $store.state.inIframe || ($store.state.fullscreen && $route.name=='i-1642710158240174082') },
]"
>
<template v-if="!loading">
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" />
<main-navbar
ref="ref_navbar"
v-if="!$store.state.inIframe && !($store.state.fullscreen && $route.name=='i-1642710158240174082')"
/>
<div class="g-cnt">
<main-content
@ -129,7 +132,10 @@ export default {
localStorage.setItem("agencyId", data.agencyId);
localStorage.setItem("level", data.level);
if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || "");
localStorage.setItem(
"customerName",
data.customerName || ""
);
}
} else {
this.$message.error(msg);

Loading…
Cancel
Save