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 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-yantai.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-test.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://epmet-cloud.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epdc-shibei.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:41080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/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_sdtdt
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

2
src/js/store/index.js

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

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

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

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

@ -9,11 +9,14 @@
{ {
'z-sidebar--noside': true, '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"> <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"> <div class="g-cnt">
<main-content <main-content
@ -129,7 +132,10 @@ export default {
localStorage.setItem("agencyId", data.agencyId); localStorage.setItem("agencyId", data.agencyId);
localStorage.setItem("level", data.level); localStorage.setItem("level", data.level);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem(
"customerName",
data.customerName || ""
);
} }
} else { } else {
this.$message.error(msg); this.$message.error(msg);

Loading…
Cancel
Save