Commit 110445be authored by 黄奎's avatar 黄奎

页面修改

parent 2093a834
<style> <style>
@import "../assets/css/Details.css"; @import "../assets/css/Details.css";
</style> </style>
<template> <template>
<div class="flexDiv"> <div class="flexDiv">
<div class="secondMenu"> <div class="secondMenu">
<div class="secondMenu_l"> <div class="secondMenu_l">
<div class="menuItem" > <div class="menuItem">
<el-menu <el-menu default-active="" background-color="#282733" text-color="#a3ace0" active-text-color="#FFFFFF"
default-active="" class="el-menu-vertical-demo" :collapse="isCollapse">
background-color="#282733" <el-submenu v-for="(item,index) in items" :index="String(index+1)" :key='index'>
text-color="#a3ace0" <template slot="title" class="left-nav">
active-text-color="#FFFFFF" <i :class="[fontPub,item.MenuStyleIcon]" class="big-icon"></i>
class="el-menu-vertical-demo" :collapse="isCollapse"> </template>
<el-submenu v-for="(item,index) in items" :index="String(index+1)" :key='index'> <el-menu-item-group class="my_maxheight">
<template slot="title" class="left-nav"> <span slot="title">{{item.MenuName}}</span>
<i :class="[fontPub,item.MenuStyleIcon]" class="big-icon"></i> <el-menu-item class="thridMenu" v-for="(subItem,sindex) in item.childerns"
</template> :index="String(index+1)+'-'+String(sindex+1)" @click="goUrl(subItem.MenuUrl)" :key='sindex'>
<el-menu-item-group class="my_maxheight"> <i :class="[fontPub,subItem.MenuStyleIcon]"></i>
<span slot="title">{{item.MenuName}}</span> {{subItem.MenuName}}</el-menu-item>
<el-menu-item class="thridMenu" v-for="(subItem,sindex) in item.childerns" :index="String(index+1)+'-'+String(sindex+1)" @click="goUrl(subItem.MenuUrl)" :key='sindex'> </el-menu-item-group>
<i :class="[fontPub,subItem.MenuStyleIcon]" ></i> </el-submenu>
{{subItem.MenuName}}</el-menu-item> </el-menu>
</el-menu-item-group>
</el-submenu>
</el-menu>
</div>
</div>
</div>
<div class="flexParent" v-if="openMode==1">
<div class="nav-tabs-box" @contextmenu.prevent="showRightMenu" :style="{width:`${navWidth}px`}">
<el-tabs v-if='tabs && tabs.length>0' v-model="currentTabName" style="margin-left: 120px;" :closable="tabs.length>1" type="card" @edit="handleTabsEdit">
<el-tab-pane :key="i" v-for="(item,i) in tabs" :label="item.title" :name="item.name+'_'+i">
</el-tab-pane>
</el-tabs>
<div class="browner-opera-box" v-if="currentTag.history&&currentTag.history.length>0" style="border-bottom: 1px solid #e4e7ed;">
<i class="iconfont icon-houtui" @click="goback(0)" :class="{'active':this.currentTag && this.currentTag.hisIndex>0}" title="后退"></i>
<i class="iconfont icon-qianjin" @click="goback(1)" :class="{'active':this.currentTag && this.currentTag.hisIndex<this.currentTag.history.length-1}" title="前进"></i>
<i class="iconfont icon-shuaxin1 active" @click="reloadpage" title="刷新"></i>
</div>
</div> </div>
<analogIFrame :key="i" :type='item.type' v-model="item.history" :curIndex='i' :refer='item.refer' v-show="tabs.indexOf(currentTag)==i" :componentTemp='item.comp' v-for="(item,i) in tabs" v-if='item.comp' :path='item.path' :name='item.name'></analogIFrame> </div>
</div> </div>
<div class="flexParent" v-if="openMode==0"> <div class="flexParent" v-if="openMode==1">
<a :href='blankUrl' id='blankLink' target="_blank" style="display:none">1</a> <div class="nav-tabs-box" @contextmenu.prevent="showRightMenu" :style="{width:`${navWidth}px`}">
<div class="resource-ttop" style="font-family:PingFangSC-Semibold" v-if="rootName!=''"> <el-tabs v-if='tabs && tabs.length>0' v-model="currentTabName" style="margin-left: 120px;"
{{rootName}}<i class="iconfont icon-weibiaoti102"></i>{{parentName}}<i class="iconfont icon-weibiaoti102"></i><span class="active">{{currentName}}</span> :closable="tabs.length>1" type="card" @edit="handleTabsEdit">
</div> <el-tab-pane :key="i" v-for="(item,i) in tabs" :label="item.title" :name="item.name+'_'+i">
<div class="frame-box" ref="frameBox" name="frameBox"> </el-tab-pane>
<router-view></router-view> </el-tabs>
<div class="browner-opera-box" v-if="currentTag.history&&currentTag.history.length>0"
style="border-bottom: 1px solid #e4e7ed;">
<i class="iconfont icon-houtui" @click="goback(0)"
:class="{'active':this.currentTag && this.currentTag.hisIndex>0}" title="后退"></i>
<i class="iconfont icon-qianjin" @click="goback(1)"
:class="{'active':this.currentTag && this.currentTag.hisIndex<this.currentTag.history.length-1}"
title="前进"></i>
<i class="iconfont icon-shuaxin1 active" @click="reloadpage" title="刷新"></i>
</div> </div>
</div> </div>
<ul class="right-menu" @contextmenu.prevent="nullMethod" v-if='currentRightIndex>-1' :style="{top:mouserY+'px',left:mouseX+'px'}"> <analogIFrame :key="i" :type='item.type' v-model="item.history" :curIndex='i' :refer='item.refer'
<li @click="referPage">重新加载当前页</li> v-show="tabs.indexOf(currentTag)==i" :componentTemp='item.comp' v-for="(item,i) in tabs" v-if='item.comp'
<li class="split"></li> :path='item.path' :name='item.name'></analogIFrame>
<li @click="closeCurrent" :class="{'disable':tabs.length==1}">关闭标签</li> </div>
<li @click="closeOther" :class="{'disable':tabs.length<2}">关闭其它标签</li> <div class="flexParent" v-if="openMode==0">
<li @click="closeRight" :class="{'disable':currentRightIndex==tabs.length-1}">关闭右侧标签</li> <a :href='blankUrl' id='blankLink' target="_blank" style="display:none">1</a>
</ul> <div class="resource-ttop" style="font-family:PingFangSC-Semibold" v-if="rootName!=''">
</div> {{rootName}}<i class="iconfont icon-weibiaoti102"></i>{{parentName}}<i
class="iconfont icon-weibiaoti102"></i><span class="active">{{currentName}}</span>
</div>
<div class="frame-box" ref="frameBox" name="frameBox">
<router-view></router-view>
</div>
</div>
<ul class="right-menu" @contextmenu.prevent="nullMethod" v-if='currentRightIndex>-1'
:style="{top:mouserY+'px',left:mouseX+'px'}">
<li @click="referPage">重新加载当前页</li>
<li class="split"></li>
<li @click="closeCurrent" :class="{'disable':tabs.length==1}">关闭标签</li>
<li @click="closeOther" :class="{'disable':tabs.length<2}">关闭其它标签</li>
<li @click="closeRight" :class="{'disable':currentRightIndex==tabs.length-1}">关闭右侧标签</li>
</ul>
</div>
</template> </template>
<script type="text/javascript"> <script type="text/javascript">
import routerConfig from '../router/config'; import routerConfig from '../router/config';
import analogIFrame from './analogIFrame'; import analogIFrame from './analogIFrame';
import MsgBus from '../assets/utils/msgBus.js'; import MsgBus from '../assets/utils/msgBus.js';
import { ALPN_ENABLED } from 'constants'; import {
export default { ALPN_ENABLED
data() { } from 'constants';
return { export default {
msg: { data() {
ParentId: "", return {
MenuStatus: "0", msg: {
MenuName: "" ParentId: "",
}, MenuStatus: "0",
fontPub: "iconfont", MenuName: ""
num: -1, },
items: [], fontPub: "iconfont",
openId: 0, num: -1,
rootName: "", items: [],
parentName: "", openId: 0,
currentName: "", rootName: "",
isCollapse: true, parentName: "",
tabs:[], currentName: "",
currentTabName:'', isCollapse: true,
currentTag:{}, tabs: [],
type:'d', currentTabName: '',
currentRightIndex:-1, currentTag: {},
mouseX:0, type: 'd',
mouserY:0, currentRightIndex: -1,
ctrlDown:false, mouseX: 0,
openMode:0, mouserY: 0,
blankUrl:'', ctrlDown: false,
navWidth:0, openMode: 0,
//加密id blankUrl: '',
EnCodeWord:'' navWidth: 0,
}; //加密id
}, EnCodeWord: ''
components:{ };
analogIFrame
},
watch: {
$route: "getMenu",
currentTabName:function(val,oldval){
this.tabs.forEach((x,i)=>{
if((x.name+"_"+i)==val){
this.currentTag=x
if(!x.comp){
x.comp=this.mapObj(x.path,x.name).comp
}
this.$router.push({path: x.path})
}
})
}, },
tabs: { components: {
handler(newValue, oldValue) { analogIFrame
window.localStorage.navTabs=JSON.stringify(newValue) },
}, watch: {
deep: true $route: "getMenu",
  }, currentTabName: function (val, oldval) {
currentTag:{ this.tabs.forEach((x, i) => {
handler(newValue, oldValue) { if ((x.name + "_" + i) == val) {
setTimeout(() => { this.currentTag = x
document.querySelectorAll('.frame-box').forEach(x=>{ if (!x.comp) {
if(x.style.display!='none'){ x.comp = this.mapObj(x.path, x.name).comp
let opContents=x.querySelectorAll(".query-box ul li");
if(opContents && opContents.length>0){
this.navWidth=document.querySelector(".flexParent").offsetWidth-opContents[opContents.length-1].offsetWidth-50
}else{
this.navWidth=document.querySelector(".flexParent").offsetWidth-20;
} }
this.$router.push({
path: x.path
})
} }
}) })
}, 300);
}, },
deep: true tabs: {
} handler(newValue, oldValue) {
}, window.localStorage.navTabs = JSON.stringify(newValue)
mounted() { },
this.openMode=0 deep: true
if(localStorage.openMode && localStorage.openMode==1) },
this.openMode=1 currentTag: {
this.MsgBus.$on('msg', ()=> { handler(newValue, oldValue) {
this.handleTabsEdit(this.currentTabName,'remove') setTimeout(() => {
}); document.querySelectorAll('.frame-box').forEach(x => {
this.MsgBus.$on('refresh', ()=> { if (x.style.display != 'none') {
this.reloadpage() let opContents = x.querySelectorAll(".query-box ul li");
}); if (opContents && opContents.length > 0) {
this.navWidth=document.querySelector(".flexParent").offsetWidth; this.navWidth = document.querySelector(".flexParent").offsetWidth - opContents[opContents
.length - 1].offsetWidth - 50
if(this.openMode==1){ } else {
if(localStorage['navTabs']){ this.navWidth = document.querySelector(".flexParent").offsetWidth - 20;
this.tabs=JSON.parse(localStorage['navTabs']) }
} }
} })
this.getMenu() }, 300);
this.filterRouter() },
let hrefs=window.location.href.split('/') deep: true
if(this.openMode==1){
let hrefs=window.location.href.split('/')
this.goUrl('/'+hrefs[hrefs.length-1])
this.propF5()
}else{
this.goUrl('/'+hrefs[hrefs.length-1])
}
},
methods: {
nullMethod(){
},
referPage(){
this.currentTabName=this.tabs[this.currentRightIndex].name+'_'+this.currentRightIndex
this.tabs[this.currentRightIndex].refer+=1
},
closeOther(){
if(this.tabs.length>1){
let temp=this.tabs.filter((x,i)=>{
return i==this.currentRightIndex
})
if(temp.length==1){
this.tabs=[]
this.tabs.push(temp[0])
this.currentTabName=temp[0].name+'_0'
}
} }
}, },
closeRight(){ mounted() {
if(this.currentRightIndex<this.tabs.length-1){ this.openMode = 0
let temp=this.tabs.filter((x,i)=>{ if (localStorage.openMode && localStorage.openMode == 1)
return i<=this.currentRightIndex this.openMode = 1
}) this.MsgBus.$on('msg', () => {
if(temp.length>0){ this.handleTabsEdit(this.currentTabName, 'remove')
this.tabs=[] });
this.tabs=temp this.MsgBus.$on('refresh', () => {
this.currentTabName=temp[this.currentRightIndex].name+"_"+this.currentRightIndex this.reloadpage()
});
this.navWidth = document.querySelector(".flexParent").offsetWidth;
if (this.openMode == 1) {
if (localStorage['navTabs']) {
this.tabs = JSON.parse(localStorage['navTabs'])
} }
} }
}, this.getMenu()
closeCurrent(){ this.filterRouter()
if(this.tabs.length>1){ let hrefs = window.location.href.split('/')
this.handleTabsEdit(this.tabs[this.currentRightIndex].name,'remove') if (this.openMode == 1) {
let hrefs = window.location.href.split('/')
this.goUrl('/' + hrefs[hrefs.length - 1])
this.propF5()
} else {
this.goUrl('/' + hrefs[hrefs.length - 1])
} }
}, },
showRightMenu(e){ methods: {
if(e.button==2){ nullMethod() {
let id=''
e.path.forEach(x=>{ },
if(x.className && x.className.indexOf('el-tabs__item')!=-1){ referPage() {
id=x.id.split('-')[1] this.currentTabName = this.tabs[this.currentRightIndex].name + '_' + this.currentRightIndex
return false this.tabs[this.currentRightIndex].refer += 1
},
closeOther() {
if (this.tabs.length > 1) {
let temp = this.tabs.filter((x, i) => {
return i == this.currentRightIndex
})
if (temp.length == 1) {
this.tabs = []
this.tabs.push(temp[0])
this.currentTabName = temp[0].name + '_0'
} }
}) }
this.tabs.forEach((x,i)=>{ },
if((x.name+"_"+i)==id){ closeRight() {
this.mouseX=e.clientX if (this.currentRightIndex < this.tabs.length - 1) {
this.mouserY=e.offsetY let temp = this.tabs.filter((x, i) => {
this.currentRightIndex=i return i <= this.currentRightIndex
})
if (temp.length > 0) {
this.tabs = []
this.tabs = temp
this.currentTabName = temp[this.currentRightIndex].name + "_" + this.currentRightIndex
} }
})
}
},
goback(t){
if(t==0 && this.currentTag.hisIndex>0) {
this.type='b'
this.currentTag.type='b'
this.currentTag.hisIndex-=1
this.$router.push({path: this.currentTag.history[this.currentTag.hisIndex]})
} else if(t==1 && this.currentTag.hisIndex<this.currentTag.history.length-1){
this.type='f'
this.currentTag.type='f'
this.currentTag.hisIndex+=1
this.$router.push({path: this.currentTag.history[this.currentTag.hisIndex]})
}
},
propF5(){
let that=this
//注册JS屏蔽F5事件
document.onkeydown = function(event){
if(event.keyCode==17){ // ctrlDown 用来判断是否按下ctrl键 ctrl + F5
that.ctrlDown = true;
} }
if(event.keyCode==116&&!that.ctrlDown) { // 只有在单独使用F5 的时候 阻止刷新 },
that.reloadpage(); closeCurrent() {
return false if (this.tabs.length > 1) {
this.handleTabsEdit(this.tabs[this.currentRightIndex].name, 'remove')
} }
}; },
document.onkeyup = function(e) { //ctrl放开后改变状态 showRightMenu(e) {
if(e.keyCode==17){ if (e.button == 2) {
that.ctrlDown = false; let id = ''
e.path.forEach(x => {
if (x.className && x.className.indexOf('el-tabs__item') != -1) {
id = x.id.split('-')[1]
return false
}
})
this.tabs.forEach((x, i) => {
if ((x.name + "_" + i) == id) {
this.mouseX = e.clientX
this.mouserY = e.offsetY
this.currentRightIndex = i
}
})
} }
}; },
//不想写checkout方法了,直接JS原生,那位义士把这里搞成checkout一下 goback(t) {
document.onclick=function(e){ if (t == 0 && this.currentTag.hisIndex > 0) {
if(e.button!=2){ this.type = 'b'
that.currentRightIndex=-1 this.currentTag.type = 'b'
this.currentTag.hisIndex -= 1
this.$router.push({
path: this.currentTag.history[this.currentTag.hisIndex]
})
} else if (t == 1 && this.currentTag.hisIndex < this.currentTag.history.length - 1) {
this.type = 'f'
this.currentTag.type = 'f'
this.currentTag.hisIndex += 1
this.$router.push({
path: this.currentTag.history[this.currentTag.hisIndex]
})
} }
} },
}, propF5() {
reloadpage(){ let that = this
this.tabs.forEach((x,i)=>{ //注册JS屏蔽F5事件
if(x.name==this.currentTabName.split('_')[0]){ document.onkeydown = function (event) {
x.refer+=1 if (event.keyCode == 17) { // ctrlDown 用来判断是否按下ctrl键 ctrl + F5
return false that.ctrlDown = true;
}
if (event.keyCode == 116 && !that.ctrlDown) { // 只有在单独使用F5 的时候 阻止刷新
that.reloadpage();
return false
}
};
document.onkeyup = function (e) { //ctrl放开后改变状态
if (e.keyCode == 17) {
that.ctrlDown = false;
}
};
//不想写checkout方法了,直接JS原生,那位义士把这里搞成checkout一下
document.onclick = function (e) {
if (e.button != 2) {
that.currentRightIndex = -1
}
} }
}) },
}, reloadpage() {
handleTabsEdit(targetName, action) { this.tabs.forEach((x, i) => {
if (action === 'remove') { if (x.name == this.currentTabName.split('_')[0]) {
let index=0 x.refer += 1
this.tabs.forEach((x,i)=>{
if(x.name==targetName.split('_')[0] && i==targetName.split('_')[1]){
index=i
return false return false
} }
}) })
if(this.currentTabName==targetName){ },
if(index<this.tabs.length-1) handleTabsEdit(targetName, action) {
this.currentTabName=this.tabs[index+1].name+"_"+index if (action === 'remove') {
else if(index>0){ let index = 0
this.currentTabName=this.tabs[index-1].name+"_"+(index-1) this.tabs.forEach((x, i) => {
if (x.name == targetName.split('_')[0] && i == targetName.split('_')[1]) {
index = i
return false
}
})
if (this.currentTabName == targetName) {
if (index < this.tabs.length - 1)
this.currentTabName = this.tabs[index + 1].name + "_" + index
else if (index > 0) {
this.currentTabName = this.tabs[index - 1].name + "_" + (index - 1)
}
} }
this.tabs.splice(index, 1)
} }
this.tabs.splice(index,1) },
} mapObj(path, name) {
}, let obj = {}
mapObj(path,name){ obj = this.getTitleByRouter(name)
let obj={} if (obj.title == '')
obj=this.getTitleByRouter(name) obj.title = this.getMenuV2(path)
if(obj.title=='') obj.title == '' ? '未命名' : obj.title
obj.title=this.getMenuV2(path) return obj
obj.title==''?'未命名':obj.title },
return obj goUrl(path) {
}, if (this.openMode == 1) {
goUrl(path) { let pathArray = path.split('/')
if(this.openMode==1){ let isExsit = false
let pathArray=path.split('/')
let isExsit=false
let newName = pathArray[1].split('?')[0]; let newName = pathArray[1].split('?')[0];
let temp=this.mapObj(path,newName) let temp = this.mapObj(path, newName)
if(path==="/TravelManager3"){ if (path === "/TravelManager3") {
this.$router.push({ this.$router.push({
name: 'TravelManager3', name: 'TravelManager3',
query: { flag: true,blank:'y'} query: {
flag: true,
blank: 'y'
}
}); });
return return
} }
if(path==="/TravelControlList3"){ if (path === "/TravelControlList3") {
this.$router.push({ this.$router.push({
name: 'TravelControlList3', name: 'TravelControlList3',
query: { flag: true,blank:'y'} query: {
flag: true,
blank: 'y'
}
}); });
return return
} }
this.tabs.forEach((x,i)=>{ this.tabs.forEach((x, i) => {
if(pathArray[1]==x.name||path==x.path||x.history.indexOf(path)!=-1){ if (pathArray[1] == x.name || path == x.path || x.history.indexOf(path) != -1) {
this.tabs[i].hisIndex=this.tabs[i].history.length this.tabs[i].hisIndex = this.tabs[i].history.length
this.tabs[i].path=path this.tabs[i].path = path
isExsit=true isExsit = true
this.currentTabName=x.name+"_"+i this.currentTabName = x.name + "_" + i
this.comp=temp.comp this.comp = temp.comp
this.tabs[i].type='d' this.tabs[i].type = 'd'
return false return false
} }
}) })
if(!isExsit){ if (!isExsit) {
let obj={} let obj = {}
obj.path=path obj.path = path
obj.title=temp.title obj.title = temp.title
obj.name=newName obj.name = newName
obj.comp=temp.comp obj.comp = temp.comp
obj.refer=0 obj.refer = 0
obj.history=[] obj.history = []
obj.type='d' obj.type = 'd'
obj.hisIndex=0 obj.hisIndex = 0
this.currentTabName=obj.name+'_'+this.tabs.length this.currentTabName = obj.name + '_' + this.tabs.length
this.tabs.push(obj) this.tabs.push(obj)
} }
this.type='d' this.type = 'd'
} else if (this.openMode==0 && path != "") { } else if (this.openMode == 0 && path != "") {
this.$router.push({ path }); this.$router.push({
path
});
} }
}, },
showToggle(id) { showToggle(id) {
if (this.openId != id) { if (this.openId != id) {
this.openId = id; this.openId = id;
} else { } else {
this.openId = 0; this.openId = 0;
} }
}, },
getMenu() { getMenu() {
this.menuList = this.getLocalStorage().UserMenu; this.menuList = this.getLocalStorage().UserMenu;
let path = this.$route.path.split("?")[0]; let path = this.$route.path.split("?")[0];
let root = 0; let root = 0;
let temprootName = ""; //根节点名称 let temprootName = ""; //根节点名称
let tempparentName = ""; //二级节点名称 let tempparentName = ""; //二级节点名称
let tempcurrentName = ""; //当前名称 let tempcurrentName = ""; //当前名称
let itemsTemp = []; let itemsTemp = [];
let that = this; let that = this;
//三级下面的子页面 //三级下面的子页面
switch (path) { switch (path) {
case "/leaderChedule": //领队档期 case "/leaderChedule": //领队档期
path = "/leaderManagement"; path = "/leaderManagement";
break; break;
case "/leaderStateDetails": //领队绩效 case "/leaderStateDetails": //领队绩效
path = "/leaderManagement"; path = "/leaderManagement";
break; break;
case "/HotelInfo": //酒店基本信息新增修改 case "/HotelInfo": //酒店基本信息新增修改
path = "/HotelManagement"; path = "/HotelManagement";
break; break;
case "/HotelProductManage": //酒店房型 case "/HotelProductManage": //酒店房型
path = "/HotelManagement"; path = "/HotelManagement";
break; break;
case "/HotelPrice": //酒店报价 case "/HotelPrice": //酒店报价
path = "/HotelManagement"; path = "/HotelManagement";
break; break;
case "/HotelOrder": //酒店销量看板详情 case "/HotelOrder": //酒店销量看板详情
path = "/HotelSalesBoard"; path = "/HotelSalesBoard";
break; break;
case "/detailsInventory": //酒店总库存看板详情 case "/detailsInventory": //酒店总库存看板详情
path = "/HotelTotalStock"; path = "/HotelTotalStock";
break; break;
case "/HotelSinglePrice": //酒店总库存看板(报价)详情 case "/HotelSinglePrice": //酒店总库存看板(报价)详情
path = "/HotelTotalStock"; path = "/HotelTotalStock";
break; break;
case "/HotelAccountInfo": //酒店核算详情 case "/HotelAccountInfo": //酒店核算详情
path = "/HotelAccounting"; path = "/HotelAccounting";
break; break;
case "/restaurantInfoManage": //餐厅新增修改 case "/restaurantInfoManage": //餐厅新增修改
path = "/restaurantList"; path = "/restaurantList";
break; break;
case "/RestaurantPackage": //餐厅套餐新增修改 case "/RestaurantPackage": //餐厅套餐新增修改
path = "/restaurantList"; path = "/restaurantList";
break; break;
case "/RestaurantPrice": //餐厅套餐报价新增修改 case "/RestaurantPrice": //餐厅套餐报价新增修改
path = "/restaurantList"; path = "/restaurantList";
break; break;
case "/RestauranAccountingDetail": //餐厅内部核算详情 case "/RestauranAccountingDetail": //餐厅内部核算详情
path = "/RestauranAccounting"; path = "/RestauranAccounting";
break; break;
case "/scenicSpotInfoManage": //票劵新增修改 case "/scenicSpotInfoManage": //票劵新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/ticketManagement": //票劵门票新增修改 case "/ticketManagement": //票劵门票新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/scenicSpotPackagePrice": //票劵门票报价新增修改 case "/scenicSpotPackagePrice": //票劵门票报价新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/scenicSpotDetails": //票劵内部核算详情 case "/scenicSpotDetails": //票劵内部核算详情
path = "/scenicSpotAccounting"; path = "/scenicSpotAccounting";
break; break;
case "/TicketAccountingDetails": //机票核算详情 case "/TicketAccountingDetails": //机票核算详情
path = "/TicketAccounting"; path = "/TicketAccounting";
break; break;
case "/TicketPlanInfo": //机票计划详情 case "/TicketPlanInfo": //机票计划详情
path = "/TicketPlan"; path = "/TicketPlan";
break; break;
case "/BusInfo": //新增修改车辆信息 case "/BusInfo": //新增修改车辆信息
path = "/busManage"; path = "/busManage";
break; break;
case "/BusAccountInfo": //车辆内部核算详情 case "/BusAccountInfo": //车辆内部核算详情
path = "/busManage"; path = "/busManage";
break; break;
case "/MakeQuotation": //制作报价单 case "/MakeQuotation": //制作报价单
path = "/quoTation"; path = "/quoTation";
break; break;
case "/TravelManager": //团控详情-开团 case "/TravelManager": //团控详情-开团
path = "/quoTation"; path = "/quoTation";
break; break;
case "/ThroughSetting": //机票联运设置 case "/ThroughSetting": //机票联运设置
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/QuotationPrice": //报价单 case "/QuotationPrice": //报价单
path = "/quoTation"; path = "/quoTation";
break; break;
case "/DistributionTransport": //分销联运 case "/DistributionTransport": //分销联运
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/RegistrationList": //报名清单 case "/RegistrationList": //报名清单
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/addPassenger": //报名清单 case "/addPassenger": //报名清单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/passengerListSale": //报名清单 case "/passengerListSale": //报名清单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/passengerList": //旅客名单 case "/passengerList": //旅客名单
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/salesApprovalDetail": //计划审批 case "/salesApprovalDetail": //计划审批
path = "/salesApproval"; path = "/salesApproval";
break; break;
case "/MyCustomerDetail": //计划审批 case "/MyCustomerDetail": //计划审批
path = "/MyCustomer"; path = "/MyCustomer";
break; break;
case "/saleDepartmentMap": //销售地图区域划分 case "/saleDepartmentMap": //销售地图区域划分
path = "/saleDepartmet"; path = "/saleDepartmet";
break; break;
case "/QuotationDetails": //报价单详情 case "/QuotationDetails": //报价单详情
path = "/AuditDan"; path = "/AuditDan";
break; break;
case "/DirectQuotation": //报价单 case "/DirectQuotation": //报价单
path = "/MakeQuotation"; path = "/MakeQuotation";
break; break;
case "/VisaProductOrder": //报价单 case "/VisaProductOrder": //报价单
path = "/VisaProduct"; path = "/VisaProduct";
break; break;
case "/CombinedOrderList": //查看联运订单 case "/CombinedOrderList": //查看联运订单
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/groupTourOrderByTuan": //查看联运订单 case "/groupTourOrderByTuan": //查看联运订单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/empBankAccount": //查看联运订单 case "/empBankAccount": //查看联运订单
path = "/userManagement"; path = "/userManagement";
break; break;
case "/BasicOpenGroup": //基础班开团 case "/BasicOpenGroup": //基础班开团
path = "/BasicTravelControlList"; path = "/BasicTravelControlList";
break; break;
case "/askPriceTotal": //工作汇总 询价 case "/askPriceTotal": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/worksalesApproval": //工作汇总 询价 case "/worksalesApproval": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/TeamBalancePayment": //团队收支明细 case "/TeamBalancePayment": //团队收支明细
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/saleReceivablesTotal": //工作汇总 询价 case "/saleReceivablesTotal": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/PassengerList": //机票名单 case "/PassengerList": //机票名单
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/roomReservationsDetails": //机票名单 case "/roomReservationsDetails": //机票名单
path = "/roomReservations"; path = "/roomReservations";
break; break;
case "/bookDinnerStatisticsDetails": //餐厅 case "/bookDinnerStatisticsDetails": //餐厅
path = "/bookDinnerStatistics"; path = "/bookDinnerStatistics";
break; break;
case "/OrderDetails": //国内机票历史订单详情 case "/OrderDetails": //国内机票历史订单详情
path = "/SettlementOrder"; path = "/SettlementOrder";
break; break;
case "/AccountPageList": //财务 下属账号页面 case "/AccountPageList": //财务 下属账号页面
path = "/institutionsManagement"; path = "/institutionsManagement";
break; break;
case "/SalesFinancialDetail": //销售 case "/SalesFinancialDetail": //销售
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/addCapitalAllocation": //资金调拨 case "/addCapitalAllocation": //资金调拨
path = "/CapitalAllocation"; path = "/CapitalAllocation";
break; break;
case "/CapitalAllocationDetail": //资金调拨 case "/CapitalAllocationDetail": //资金调拨
path = "/CapitalAllocation"; path = "/CapitalAllocation";
break; break;
case "/addIntegralMall": //新增商品 case "/addIntegralMall": //新增商品
path = "/IntegralMall"; path = "/IntegralMall";
break; break;
case "/VoucherInquiryAdd": //新增调查 case "/VoucherInquiryAdd": //新增调查
path = "/VoucherInquiry"; path = "/VoucherInquiry";
break; break;
case "/LianMengManagementList": //客户联盟客户列表 case "/LianMengManagementList": //客户联盟客户列表
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/happyMoneyDetails": // 红包结算 case "/happyMoneyDetails": // 红包结算
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/happyMoney": // 红包结算 case "/happyMoney": // 红包结算
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/OpHotelOrderDetail": // 酒店订单详情 case "/OpHotelOrderDetail": // 酒店订单详情
path = "/OpHotelOrder"; path = "/OpHotelOrder";
break; break;
} }
//找到Root
this.menuList.forEach(rootItem => {
rootItem.ChildMenu.forEach(secondItem => {
secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) {
root = rootItem.MenuId;
return false;
}
});
});
});
this.menuList.forEach(rootItem => { //找到Root
if (rootItem.MenuId == root) { this.menuList.forEach(rootItem => {
temprootName = rootItem.MenuName;
rootItem.ChildMenu.forEach(secondItem => { rootItem.ChildMenu.forEach(secondItem => {
secondItem.childerns = [];
let style = JSON.parse(secondItem.MenuStyle);
secondItem.MenuStyleIcon = style.icon;
secondItem.MenuStyleColor = style.color;
secondItem.ChildMenu.forEach(thirdItem => { secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) { if (thirdItem.MenuUrl == path) {
this.openId = secondItem.MenuId; root = rootItem.MenuId;
tempparentName = secondItem.MenuName; return false;
tempcurrentName = thirdItem.MenuName;
} }
secondItem.childerns.push(thirdItem);
let style2 = JSON.parse(thirdItem.MenuStyle);
thirdItem.MenuStyleIcon = style2.icon;
thirdItem.MenuStyleColor = style2.color;
}); });
itemsTemp.push(secondItem);
}); });
} });
});
if (itemsTemp.length > 0) { this.menuList.forEach(rootItem => {
this.items = itemsTemp; if (rootItem.MenuId == root) {
this.rootName = temprootName; temprootName = rootItem.MenuName;
this.parentName = tempparentName; rootItem.ChildMenu.forEach(secondItem => {
this.currentName = tempcurrentName; secondItem.childerns = [];
} let style = JSON.parse(secondItem.MenuStyle);
}, secondItem.MenuStyleIcon = style.icon;
getMenuV2(path) { secondItem.MenuStyleColor = style.color;
this.menuList = this.getLocalStorage().UserMenu; secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) {
this.openId = secondItem.MenuId;
tempparentName = secondItem.MenuName;
tempcurrentName = thirdItem.MenuName;
}
secondItem.childerns.push(thirdItem);
let style2 = JSON.parse(thirdItem.MenuStyle);
thirdItem.MenuStyleIcon = style2.icon;
thirdItem.MenuStyleColor = style2.color;
});
itemsTemp.push(secondItem);
});
}
});
let root = 0; if (itemsTemp.length > 0) {
let temprootName = ""; //根节点名称 this.items = itemsTemp;
let tempparentName = ""; //二级节点名称 this.rootName = temprootName;
let tempcurrentName = ""; //当前名称 this.parentName = tempparentName;
let itemsTemp = []; this.currentName = tempcurrentName;
let that = this; }
//三级下面的子页面 },
switch (path) { getMenuV2(path) {
case "/leaderChedule": //领队档期 this.menuList = this.getLocalStorage().UserMenu;
path = "/leaderManagement";
break; let root = 0;
case "/leaderStateDetails": //领队绩效 let temprootName = ""; //根节点名称
path = "/leaderManagement"; let tempparentName = ""; //二级节点名称
break; let tempcurrentName = ""; //当前名称
case "/HotelInfo": //酒店基本信息新增修改 let itemsTemp = [];
path = "/HotelManagement"; let that = this;
break; //三级下面的子页面
case "/HotelProductManage": //酒店房型 switch (path) {
path = "/HotelManagement"; case "/leaderChedule": //领队档期
break; path = "/leaderManagement";
case "/HotelPrice": //酒店报价 break;
path = "/HotelManagement"; case "/leaderStateDetails": //领队绩效
break; path = "/leaderManagement";
case "/HotelOrder": //酒店销量看板详情 break;
path = "/HotelSalesBoard"; case "/HotelInfo": //酒店基本信息新增修改
break; path = "/HotelManagement";
case "/detailsInventory": //酒店总库存看板详情 break;
path = "/HotelTotalStock"; case "/HotelProductManage": //酒店房型
break; path = "/HotelManagement";
case "/HotelSinglePrice": //酒店总库存看板(报价)详情 break;
path = "/HotelTotalStock"; case "/HotelPrice": //酒店报价
break; path = "/HotelManagement";
case "/HotelAccountInfo": //酒店核算详情 break;
path = "/HotelAccounting"; case "/HotelOrder": //酒店销量看板详情
break; path = "/HotelSalesBoard";
case "/restaurantInfoManage": //餐厅新增修改 break;
path = "/restaurantList"; case "/detailsInventory": //酒店总库存看板详情
break; path = "/HotelTotalStock";
case "/RestaurantPackage": //餐厅套餐新增修改 break;
path = "/restaurantList"; case "/HotelSinglePrice": //酒店总库存看板(报价)详情
break; path = "/HotelTotalStock";
case "/RestaurantPrice": //餐厅套餐报价新增修改 break;
path = "/restaurantList"; case "/HotelAccountInfo": //酒店核算详情
break; path = "/HotelAccounting";
case "/RestauranAccountingDetail": //餐厅内部核算详情 break;
path = "/RestauranAccounting"; case "/restaurantInfoManage": //餐厅新增修改
break; path = "/restaurantList";
break;
case "/RestaurantPackage": //餐厅套餐新增修改
path = "/restaurantList";
break;
case "/RestaurantPrice": //餐厅套餐报价新增修改
path = "/restaurantList";
break;
case "/RestauranAccountingDetail": //餐厅内部核算详情
path = "/RestauranAccounting";
break;
case "/scenicSpotInfoManage": //票劵新增修改 case "/scenicSpotInfoManage": //票劵新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/ticketManagement": //票劵门票新增修改 case "/ticketManagement": //票劵门票新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/scenicSpotPackagePrice": //票劵门票报价新增修改 case "/scenicSpotPackagePrice": //票劵门票报价新增修改
path = "/scenicSpotList"; path = "/scenicSpotList";
break; break;
case "/scenicSpotDetails": //票劵内部核算详情 case "/scenicSpotDetails": //票劵内部核算详情
path = "/scenicSpotAccounting"; path = "/scenicSpotAccounting";
break; break;
case "/TicketAccountingDetails": //机票核算详情 case "/TicketAccountingDetails": //机票核算详情
path = "/TicketAccounting"; path = "/TicketAccounting";
break; break;
case "/TicketPlanInfo": //机票计划详情 case "/TicketPlanInfo": //机票计划详情
path = "/TicketPlan"; path = "/TicketPlan";
break; break;
case "/BusInfo": //新增修改车辆信息 case "/BusInfo": //新增修改车辆信息
path = "/busManage"; path = "/busManage";
break; break;
case "/BusAccountInfo": //车辆内部核算详情 case "/BusAccountInfo": //车辆内部核算详情
path = "/busManage"; path = "/busManage";
break; break;
case "/MakeQuotation": //制作报价单 case "/MakeQuotation": //制作报价单
path = "/quoTation"; path = "/quoTation";
break; break;
case "/TravelManager": //团控详情-开团 case "/TravelManager": //团控详情-开团
path = "/quoTation"; path = "/quoTation";
break; break;
case "/ThroughSetting": //机票联运设置 case "/ThroughSetting": //机票联运设置
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/QuotationPrice": //报价单 case "/QuotationPrice": //报价单
path = "/quoTation"; path = "/quoTation";
break; break;
case "/DistributionTransport": //分销联运 case "/DistributionTransport": //分销联运
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/RegistrationList": //报名清单 case "/RegistrationList": //报名清单
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/addPassenger": //报名清单 case "/addPassenger": //报名清单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/passengerListSale": //报名清单 case "/passengerListSale": //报名清单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/passengerList": //旅客名单 case "/passengerList": //旅客名单
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/salesApprovalDetail": //计划审批 case "/salesApprovalDetail": //计划审批
path = "/salesApproval"; path = "/salesApproval";
break; break;
case "/MyCustomerDetail": //计划审批 case "/MyCustomerDetail": //计划审批
path = "/MyCustomer"; path = "/MyCustomer";
break; break;
case "/saleDepartmentMap": //销售地图区域划分 case "/saleDepartmentMap": //销售地图区域划分
path = "/saleDepartmet"; path = "/saleDepartmet";
break; break;
case "/QuotationDetails": //报价单详情 case "/QuotationDetails": //报价单详情
path = "/AuditDan"; path = "/AuditDan";
break; break;
case "/DirectQuotation": //报价单 case "/DirectQuotation": //报价单
path = "/MakeQuotation"; path = "/MakeQuotation";
break; break;
case "/VisaProductOrder": //报价单 case "/VisaProductOrder": //报价单
path = "/VisaProduct"; path = "/VisaProduct";
break; break;
case "/CombinedOrderList": //查看联运订单 case "/CombinedOrderList": //查看联运订单
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/groupTourOrderByTuan": //查看联运订单 case "/groupTourOrderByTuan": //查看联运订单
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/empBankAccount": //查看联运订单 case "/empBankAccount": //查看联运订单
path = "/userManagement"; path = "/userManagement";
break; break;
case "/BasicOpenGroup": //基础班开团 case "/BasicOpenGroup": //基础班开团
path = "/BasicTravelControlList"; path = "/BasicTravelControlList";
break; break;
case "/askPriceTotal": //工作汇总 询价 case "/askPriceTotal": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/worksalesApproval": //工作汇总 询价 case "/worksalesApproval": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/TeamBalancePayment": //团队收支明细 case "/TeamBalancePayment": //团队收支明细
path = "/TravelControlList"; path = "/TravelControlList";
break; break;
case "/saleReceivablesTotal": //工作汇总 询价 case "/saleReceivablesTotal": //工作汇总 询价
path = "/workTotal"; path = "/workTotal";
break; break;
case "/PassengerList": //机票名单 case "/PassengerList": //机票名单
path = "/TicketManager"; path = "/TicketManager";
break; break;
case "/roomReservationsDetails": //机票名单 case "/roomReservationsDetails": //机票名单
path = "/roomReservations"; path = "/roomReservations";
break; break;
case "/bookDinnerStatisticsDetails": //餐厅 case "/bookDinnerStatisticsDetails": //餐厅
path = "/bookDinnerStatistics"; path = "/bookDinnerStatistics";
break; break;
case "/OrderDetails": //国内机票历史订单详情 case "/OrderDetails": //国内机票历史订单详情
path = "/SettlementOrder"; path = "/SettlementOrder";
break; break;
case "/AccountPageList": //财务 下属账号页面 case "/AccountPageList": //财务 下属账号页面
path = "/institutionsManagement"; path = "/institutionsManagement";
break; break;
case "/SalesFinancialDetail": //销售 case "/SalesFinancialDetail": //销售
path = "/groupTourOrder"; path = "/groupTourOrder";
break; break;
case "/addCapitalAllocation": //资金调拨 case "/addCapitalAllocation": //资金调拨
path = "/CapitalAllocation"; path = "/CapitalAllocation";
break; break;
case "/CapitalAllocationDetail": //资金调拨 case "/CapitalAllocationDetail": //资金调拨
path = "/CapitalAllocation"; path = "/CapitalAllocation";
break; break;
case "/addIntegralMall": //新增商品 case "/addIntegralMall": //新增商品
path = "/IntegralMall"; path = "/IntegralMall";
break; break;
case "/VoucherInquiryAdd": //新增调查 case "/VoucherInquiryAdd": //新增调查
path = "/VoucherInquiry"; path = "/VoucherInquiry";
break; break;
case "/LianMengManagementList": //客户联盟客户列表 case "/LianMengManagementList": //客户联盟客户列表
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/happyMoneyDetails": // 红包结算 case "/happyMoneyDetails": // 红包结算
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/happyMoney": // 红包结算 case "/happyMoney": // 红包结算
path = "/LianMengManagement"; path = "/LianMengManagement";
break; break;
case "/OpHotelOrderDetail": // 酒店订单详情 case "/OpHotelOrderDetail": // 酒店订单详情
path = "/OpHotelOrder"; path = "/OpHotelOrder";
break; break;
} }
//找到Root
this.menuList.forEach(rootItem => {
rootItem.ChildMenu.forEach(secondItem => {
secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) {
root = rootItem.MenuId;
return false;
}
});
});
});
this.menuList.forEach(rootItem => { //找到Root
if (rootItem.MenuId == root) { this.menuList.forEach(rootItem => {
temprootName = rootItem.MenuName;
rootItem.ChildMenu.forEach(secondItem => { rootItem.ChildMenu.forEach(secondItem => {
secondItem.childerns = [];
let style = JSON.parse(secondItem.MenuStyle);
secondItem.MenuStyleIcon = style.icon;
secondItem.MenuStyleColor = style.color;
secondItem.ChildMenu.forEach(thirdItem => { secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) { if (thirdItem.MenuUrl == path) {
this.openId = secondItem.MenuId; root = rootItem.MenuId;
tempparentName = secondItem.MenuName; return false;
tempcurrentName = thirdItem.MenuName;
} }
secondItem.childerns.push(thirdItem);
let style2 = JSON.parse(thirdItem.MenuStyle);
thirdItem.MenuStyleIcon = style2.icon;
thirdItem.MenuStyleColor = style2.color;
}); });
itemsTemp.push(secondItem);
}); });
} });
});
if (itemsTemp.length > 0) { this.menuList.forEach(rootItem => {
this.items = itemsTemp; if (rootItem.MenuId == root) {
this.rootName = temprootName; temprootName = rootItem.MenuName;
this.parentName = tempparentName; rootItem.ChildMenu.forEach(secondItem => {
this.currentName = tempcurrentName; secondItem.childerns = [];
} let style = JSON.parse(secondItem.MenuStyle);
secondItem.MenuStyleIcon = style.icon;
secondItem.MenuStyleColor = style.color;
secondItem.ChildMenu.forEach(thirdItem => {
if (thirdItem.MenuUrl == path) {
this.openId = secondItem.MenuId;
tempparentName = secondItem.MenuName;
tempcurrentName = thirdItem.MenuName;
}
secondItem.childerns.push(thirdItem);
let style2 = JSON.parse(thirdItem.MenuStyle);
thirdItem.MenuStyleIcon = style2.icon;
thirdItem.MenuStyleColor = style2.color;
});
itemsTemp.push(secondItem);
});
}
});
return tempcurrentName if (itemsTemp.length > 0) {
}, this.items = itemsTemp;
getTitleByRouter(name){ this.rootName = temprootName;
let obj={} this.parentName = tempparentName;
routerConfig.routes[11].children[0].children.forEach(x=>{ this.currentName = tempcurrentName;
if(x.name==name){
obj.comp=x.component
if(x.meta && x.meta.title)
obj.title=x.meta.title
else
obj.title=''
return false
} }
})
return obj
},
filterRouter(){
let that=this
let userInfo = this.getLocalStorage();
this.$router.beforeEach((to, from, next) => {
document.title = to.meta.title ? to.meta.title : ''
if(to.path=="/ModifyVisaProduct"){
this.reloadpage();
}
if(that.openMode==1){
let isThreeNav=false
to.matched.forEach(x=>{
if(x.name=='Details'){
isThreeNav=true
return false
}
})
if(isThreeNav){ return tempcurrentName
if(!to.query.blank || to.query.blank!='y'){ },
let comp=that.getTitleByRouter(to.name) getTitleByRouter(name) {
if(that.tabs.length>0){ let obj = {}
let tabs=that.tabs.filter(x=>{ routerConfig.routes[11].children[0].children.forEach(x => {
let item=x if (x.name == name) {
if(x.name==that.currentTabName.split('_')[0]&& x.path==that.currentTag.path){ obj.comp = x.component
if(that.type=='d'){ if (x.meta && x.meta.title)
x.hisIndex=x.history.length obj.title = x.meta.title
else
obj.title = ''
return false
}
})
return obj
},
filterRouter() {
let that = this
let userInfo = this.getLocalStorage();
this.$router.beforeEach((to, from, next) => {
document.title = to.meta.title ? to.meta.title : ''
if (to.path == "/ModifyVisaProduct") {
this.reloadpage();
}
if (that.openMode == 1) {
let isThreeNav = false
to.matched.forEach(x => {
if (x.name == 'Details') {
isThreeNav = true
return false
}
})
if (isThreeNav) {
if (!to.query.blank || to.query.blank != 'y') {
let comp = that.getTitleByRouter(to.name)
if (that.tabs.length > 0) {
let tabs = that.tabs.filter(x => {
let item = x
if (x.name == that.currentTabName.split('_')[0] && x.path == that.currentTag.path) {
if (that.type == 'd') {
x.hisIndex = x.history.length
}
x.title = comp.title == '' ? x.title : comp.title
x.path = to.fullPath
x.comp = comp.comp
} }
x.title=comp.title==''?x.title:comp.title return item
x.path=to.fullPath })
x.comp=comp.comp that.$set(that.tabs, tabs)
that.type = 'd'
}
} else {
let temp = that.mapObj(to.path, to.name)
let realPath = to.fullPath.split('?')[1]
let newPath = to.path + '?'
realPath.split('&').forEach((x, i) => {
if (x.indexOf('blank') == -1) {
if (i > 0)
newPath += '&'
newPath += x
} }
return item
}) })
that.$set(that.tabs,tabs) let isExsit = false
that.type='d' let tabs = that.tabs.filter((x, i) => {
} if (x.path == newPath) {
}else{ that.currentTabName = x.name + '_' + i
let temp=that.mapObj(to.path,to.name) isExsit = true
let realPath=to.fullPath.split('?')[1] }
let newPath=to.path+'?' return x
realPath.split('&').forEach((x,i)=>{ })
if(x.indexOf('blank')==-1){ if (isExsit)
if(i>0) that.$set(that.tabs, tabs)
newPath+='&' else {
newPath+=x let obj = {}
} obj.path = newPath
}) obj.title = to.query.tab ? to.query.tab : temp.title
let isExsit=false obj.name = to.name
let tabs=that.tabs.filter((x,i)=>{ obj.comp = temp.comp
if(x.path==newPath){ obj.refer = 0
that.currentTabName=x.name+'_'+i obj.history = []
isExsit=true obj.type = 'd'
obj.hisIndex = 0
that.tabs.push(obj)
that.currentTabName = obj.name + "_" + (that.tabs.length - 1)
} }
return x
})
if(isExsit)
that.$set(that.tabs,tabs)
else{
let obj={}
obj.path=newPath
obj.title=to.query.tab?to.query.tab:temp.title
obj.name=to.name
obj.comp=temp.comp
obj.refer=0
obj.history=[]
obj.type='d'
obj.hisIndex=0
that.tabs.push(obj)
that.currentTabName=obj.name+"_"+(that.tabs.length-1)
} }
} }
next()
} else if (that.openMode == 0 && to.query.blank && to.query.blank == 'y') {
let dom = document.querySelector("#blankLink")
dom.href = `http://${window.location.host}/#${to.fullPath}`
dom.click()
} else {
next()
} }
});
this.$nextTick(function () {
document.title = this.$route.meta.title ? this.$route.meta.title : ''
})
}
},
beforeDestroy() {
//卸载屏蔽事件
document.onkeydown = null
if (this.tabs.length > 0)
window.localStorage.navTabs = JSON.stringify(this.tabs)
},
created() {
next()
}else if(that.openMode==0 && to.query.blank && to.query.blank=='y'){
let dom = document.querySelector("#blankLink")
dom.href=`http://${window.location.host}/#${to.fullPath}`
dom.click()
}else{
next()
}
});
this.$nextTick(function(){
  document.title = this.$route.meta.title ? this.$route.meta.title : ''
 })
} }
}, };
beforeDestroy() {
//卸载屏蔽事件
document.onkeydown=null
if(this.tabs.length>0)
window.localStorage.navTabs=JSON.stringify(this.tabs)
},
created(){
}
};
</script> </script>
<style> <style>
@import "../assets/css/login2019.css"; @import "../assets/css/login2019.css";
.login_body{
height: calc(100vh); .login_body {
width: 100%; height: calc(100vh);
background-color: white; width: 100%;
} background-color: white;
.logo_box{ }
.logo_box {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 16px; font-size: 16px;
} }
.logo_box img{
margin-right: 10px; .logo_box img {
} margin-right: 10px;
.jitang{ }
margin-top: 40px;
} .jitang {
.jitang p{ margin-top: 40px;
}
.jitang p {
color: #424242; color: #424242;
font-size: 14px; font-size: 14px;
width: 60%; width: 60%;
margin: 0 auto; margin: 0 auto;
} }
.jitang .iconfont {
font-size: 32px; .jitang .iconfont {
padding-right: 10px; font-size: 32px;
color: #d2d2d2; padding-right: 10px;
color: #d2d2d2;
}
.FPF_s {
font-family: 'PingFangR';
}
} .FPF_b {
.FPF_s{
font-family: 'PingFangR'; font-family: 'PingFangR';
font-weight: 600;
} }
.FPF_b{
font-family: 'PingFangR';
font-weight: 600;
}
</style> </style>
<template> <template>
<div> <div>
<el-row class="login_body"> <el-row class="login_body">
<el-col :span="16"> <el-col :span="16">
<my-carousel :speed='speed' :imgList='imgList'/> <my-carousel :speed='speed' :imgList='imgList' />
</el-col> </el-col>
<el-col :span="8" class="login-box newSummaryLogin"> <el-col :span="8" class="login-box newSummaryLogin">
<div v-if="isShow==1" class="login_Div"> <div v-if="isShow==1" class="login_Div">
<div class="logo_box"> <div class="logo_box">
<img style="width: 40px;" src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt=""> <img style="width: 40px;"
src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt="">
<p class="FPF_b">{{groupModel.GroupName?groupModel.GroupName:''}}</p> <p class="FPF_b">{{groupModel.GroupName?groupModel.GroupName:''}}</p>
</div> </div>
<div class="sumMainTitle FPF_s">登录</div> <div class="sumMainTitle FPF_s">登录</div>
<div class="login-commonBotm"> <div class="login-commonBotm">
<i class="icon-login-name iconfont icon-user11" :style="{color: name_bline==true?'#E95252':'#000000'}"></i> <i class="icon-login-name iconfont icon-user11" :style="{color: name_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b" @focus="name_bline=true" @blur="name_bline=false" maxlength="20" autocomplete="new-password" v-model="userInfo.name" style="background-color:transparent !important;" type="text" :placeholder="$t('login.login_account')" @keyup.enter="doLogin"/> <input class="input FPF_b" @focus="name_bline=true" @blur="name_bline=false" maxlength="20"
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div> autocomplete="new-password" v-model="userInfo.name" style="background-color:transparent !important;"
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div> type="text" :placeholder="$t('login.login_account')" @keyup.enter="doLogin" />
</div> <div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="error-msg"> <div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div> </div>
</div> <div class="error-msg">
<div class="login-commonBotm"> <div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
<i class="icon-login-password iconfont icon-mima" :style="{color: pwd_bline==true?'#E95252':'#000000'}"></i> </div>
<input type="text" name="text" autocomplete="on" style="width:0;height:0;position: absolute;z-index: -999;"> <div class="login-commonBotm">
<input type="password" name="password" autocomplete="on" style="width:0;height:0;position: absolute;z-index: -999;"> <i class="icon-login-password iconfont icon-mima" :style="{color: pwd_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b" @focus="pwd_bline=true" @blur="pwd_bline=false" maxlength="20" autocomplete="new-password" v-model="userInfo.password" style="background-color:transparent !important" type="password" :placeholder="$t('login.login_password')" @keyup.enter="doLogin"/> <input type="text" name="text" autocomplete="on" style="width:0;height:0;position: absolute;z-index: -999;">
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div> <input type="password" name="password" autocomplete="on"
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div> style="width:0;height:0;position: absolute;z-index: -999;">
</div> <input class="input FPF_b" @focus="pwd_bline=true" @blur="pwd_bline=false" maxlength="20"
<div class="error-msg"> autocomplete="new-password" v-model="userInfo.password" style="background-color:transparent !important"
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div> type="password" :placeholder="$t('login.login_password')" @keyup.enter="doLogin" />
</div> <div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div style="text-align: center;margin-top: 40px;"> <div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
<button type="button" class="sLoginBtn FPF_s" :class="{'loginIng':loginState==1}" :disabled="loginState==1" @click="doLogin">{{loginState==1?'登录中...':'登录'}}</button> </div>
</div> <div class="error-msg">
<div class="forgetPw"> <div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
<div> </div>
<el-checkbox v-model="checkedAotu">下次自动登录</el-checkbox> <div style="text-align: center;margin-top: 40px;">
</div> <button type="button" class="sLoginBtn FPF_s" :class="{'loginIng':loginState==1}" :disabled="loginState==1"
<span @click="updatePwd">{{$t('login.login_forgetpwd')}}?</span> @click="doLogin">{{loginState==1?'登录中...':'登录'}}</button>
</div>
<div class="forgetPw">
<div>
<el-checkbox v-model="checkedAotu">下次自动登录</el-checkbox>
</div> </div>
<!-- <div class="login-way"> <span @click="updatePwd">{{$t('login.login_forgetpwd')}}?</span>
</div>
<!-- <div class="login-way">
<div class="wayLeft"> <div class="wayLeft">
<i class="icon-login-qqicon"></i> <i class="icon-login-qqicon"></i>
<span>QQ登录</span> <span>QQ登录</span>
...@@ -89,368 +105,377 @@ ...@@ -89,368 +105,377 @@
<span>微信登录</span> <span>微信登录</span>
</div> </div>
</div> --> </div> -->
</div>
<div v-if="isShow==2" class="phoneLogin login_Div>">
<div class="logo_box">
<img style="width: 40px;"
src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt="">
<p class="FPF_b">{{groupModel.GroupName?groupModel.GroupName:''}}</p>
</div>
<div class="sumMainTitle FPF_s">绑定手机号</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-shouji1" :style="{color: name_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b" @focus="name_bline=true" @blur="name_bline=false"
onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" autocomplete="new-password"
v-model="mobileNumber" style="background-color:transparent !important;" type="text"
placeholder="请输入手机号" />
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div> </div>
<div v-if="isShow==2" class="phoneLogin login_Div>"> <div class="error-msg">
<div class="logo_box"> <div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
<img style="width: 40px;" src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt=""> </div>
<p class="FPF_b">{{groupModel.GroupName?groupModel.GroupName:''}}</p> <div class="login-commonBotm">
<i class="icon-login-password iconfont icon-yanzhengma"
:style="{color: pwd_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b phoneValidate" maxlength="4" @focus="pwd_bline=true"
onkeyup="value=value.replace(/[^\d]/g,'')" @blur="pwd_bline=false" v-model="code"
autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码"
@keyup.enter="doBind" />
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode" class="FPF_s">获取验证码</span>
<span v-show="!show" class="count FPF_s">{{count}}s重新获取</span>
</div> </div>
<div class="sumMainTitle FPF_s">绑定手机号</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-shouji1" :style="{color: name_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b" @focus="name_bline=true" @blur="name_bline=false" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" autocomplete="new-password" v-model="mobileNumber" style="background-color:transparent !important;" type="text" placeholder="请输入手机号"/>
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-yanzhengma" :style="{color: pwd_bline==true?'#E95252':'#000000'}"></i>
<input class="input FPF_b phoneValidate" maxlength="4" @focus="pwd_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')" @blur="pwd_bline=false" v-model="code" autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="doBind"/>
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode" class="FPF_s">获取验证码</span>
<span v-show="!show" class="count FPF_s">{{count}}s重新获取</span>
</div>
</div>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div>
</div>
<input type="button" class="sLoginBtn" @click="doBind" value="确认绑定"/>
</div> </div>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
</div>
<input type="button" class="sLoginBtn" @click="doBind" value="确认绑定" />
</div>
<div v-if="isShow==3" class="phoneLogin login_Div"> <div v-if="isShow==3" class="phoneLogin login_Div">
<div class="logo_box"> <div class="logo_box">
<img style="width: 40px;" src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt=""> <img style="width: 40px;"
<p>{{groupModel.GroupName?groupModel.GroupName:''}}</p> src="http://staticfile.oytour.com/Upload/CompanyImage/20181219/636808340326373827.png" alt="">
</div> <p>{{groupModel.GroupName?groupModel.GroupName:''}}</p>
<div class="sumMainTitle FPF_s">修改密码</div> </div>
<div class="login-commonBotm"> <div class="sumMainTitle FPF_s">修改密码</div>
<i class="icon-login-name iconfont icon-shouji1" :style="{color: name_bline==true?'#E95252':'#000000'}"></i> <div class="login-commonBotm">
<input class="input FPF_b" @focus="name_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" @blur="name_bline=false" autocomplete="new-password" v-model="mobileNumber" style="background-color:transparent !important;" type="text" placeholder="请输入手机号"/> <i class="icon-login-name iconfont icon-shouji1" :style="{color: name_bline==true?'#E95252':'#000000'}"></i>
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div> <input class="input FPF_b" @focus="name_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')"
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div> maxlength="11" @blur="name_bline=false" autocomplete="new-password" v-model="mobileNumber"
</div> style="background-color:transparent !important;" type="text" placeholder="请输入手机号" />
<div class="error-msg"> <div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div> <div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div> </div>
<div class="login-commonBotm"> <div class="error-msg">
<i class="icon-login-password iconfont icon-mima" :style="{color: pwd_bline==true?'#E95252':'#000000'}"></i> <div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
<input class="input FPF_b" @focus="pwd_bline=true" @blur="pwd_bline=false" autocomplete="new-password" maxlength="20" v-model="password" style="background-color:transparent !important" type="password" placeholder="请输入新密码"/> </div>
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div> <div class="login-commonBotm">
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div> <i class="icon-login-password iconfont icon-mima" :style="{color: pwd_bline==true?'#E95252':'#000000'}"></i>
</div> <input class="input FPF_b" @focus="pwd_bline=true" @blur="pwd_bline=false" autocomplete="new-password"
maxlength="20" v-model="password" style="background-color:transparent !important" type="password"
placeholder="请输入新密码" />
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
</div>
<div class="login-commonBotm btValidate"> <div class="login-commonBotm btValidate">
<i class="icon-login-password iconfont icon-yanzhengma" :style="{color: validate_bline==true?'#E95252':'#000000'}"></i> <i class="icon-login-password iconfont icon-yanzhengma"
<input class="input FPF_b phoneValidate" maxlength="4" onkeyup="value=value.replace(/[^\d]/g,'')" @focus="validate_bline=true" @blur="validate_bline=false" v-model="code" autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="changePwd"/> :style="{color: validate_bline==true?'#E95252':'#000000'}"></i>
<div class="pwd_bline_left" :class="validate_bline==true?'_bline_w':''"></div> <input class="input FPF_b phoneValidate" maxlength="4" onkeyup="value=value.replace(/[^\d]/g,'')"
<div class="pwd_bline_right" :class="validate_bline==true?'_bline_w':''"></div> @focus="validate_bline=true" @blur="validate_bline=false" v-model="code" autocomplete="new-password"
<div class="validatCode"> style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="changePwd" />
<span v-show="show" @click="getCode" class="FPF_s">获取验证码</span> <div class="pwd_bline_left" :class="validate_bline==true?'_bline_w':''"></div>
<span v-show="!show" class="count FPF_s">{{count}}s重新获取</span> <div class="pwd_bline_right" :class="validate_bline==true?'_bline_w':''"></div>
</div> <div class="validatCode">
</div> <span v-show="show" @click="getCode" class="FPF_s">获取验证码</span>
<div class="forgetPw"> <span v-show="!show" class="count FPF_s">{{count}}s重新获取</span>
<div class="error-msg" style="float:left;width:auto;"> </div>
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div>
</div>
<span @click="goLogin" class="FPF_s">去登录</span>
</div>
<input type="button" class="sLoginBtn changeBtn" @click="changePwd" value="确认修改"/>
</div> </div>
<div class="jitang "> <div class="forgetPw">
<p><sup class="iconfont icon-quotation"></sup><span class="FPF_s">職場上成功者與失敗者最大的分別就是,前者找機會,後者找藉口,今日的你痛恨每天上班「度日如年」,將來的你會感激經歷過這一切,你練成了更強大的自己,玻璃心不再怕碎。</span></p> <div class="error-msg" style="float:left;width:auto;">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
</div>
<span @click="goLogin" class="FPF_s">去登录</span>
</div> </div>
<input type="button" class="sLoginBtn changeBtn" @click="changePwd" value="确认修改" />
</div>
<div class="jitang ">
<p><sup class="iconfont icon-quotation"></sup><span
class="FPF_s">職場上成功者與失敗者最大的分別就是,前者找機會,後者找藉口,今日的你痛恨每天上班「度日如年」,將來的你會感激經歷過這一切,你練成了更強大的自己,玻璃心不再怕碎。</span></p>
</div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import Carousel from "./public/Carousel" import Carousel from "./public/Carousel"
export default { export default {
data(){ data() {
return{ return {
speed: 3000, speed: 3000,
imgList: [ imgList: [{
{ src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190923020945469.jpg',
src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190923020945469.jpg', text: '京都独旅之秋',
text: '京都独旅之秋', text1: '旅宿权威柏井寿的私房赏枫秘境',
text1: '旅宿权威柏井寿的私房赏枫秘境', url: 'http://www.oytour.com/#/JuanDetails?id=70'
url: 'http://www.oytour.com/#/JuanDetails?id=70' },
}, {
{ src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190920035420544.jpg',
src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190920035420544.jpg', text: '邂逅北海道',
text: '邂逅北海道', text1: '看见 北海道 之美',
text1: '看见 北海道 之美', url: 'http://www.oytour.com/#/FoodImg4'
url: 'http://www.oytour.com/#/FoodImg4' },
}, {
{ src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190920035420528.jpg',
src: 'http://staticfile.oytour.com/New/Upload/Cloud/2019-09/20190920035420528.jpg', text: '自由土耳其',
text: '自由土耳其', text1: '翱翔天际 感受星月魅力',
text1: '翱翔天际 感受星月魅力', url: 'http://www.oytour.com/#/JuanDetails?id=70'
url: 'http://www.oytour.com/#/JuanDetails?id=70' },
],
userInfo: {
name: "",
password: "",
Domain: ""
}, },
], groupModel: "",
userInfo: {
name: "",
password: "", password: "",
Domain:"" mobileNumber: "",
}, code: "",
groupModel:"", mobileCodeType: 1,
password: "", show: true,
mobileNumber: "", count: "",
code: "", timer: null,
mobileCodeType: 1, isShow: 1,
show: true, vedioCanPlay: false,
count: "", fixStyle: "",
timer: null, nameIsShow: false,
isShow: 1, passwordIsShow: false,
vedioCanPlay: false, nameErrorMsg: "",
fixStyle: "", passwordErrorMsg: "",
nameIsShow: false, name_bline: false,
passwordIsShow: false, pwd_bline: false,
nameErrorMsg: "", validate_bline: false,
passwordErrorMsg: "", loginState: 0,
name_bline: false, height: 0,
pwd_bline: false, clock: null,
validate_bline: false, crtIndex: 0,
loginState: 0, checkedAotu: false,
height:0,
clock:null,
crtIndex:0,
checkedAotu: false,
}
},components:{
'my-carousel': Carousel
},methods:{
//初始化数据
initData() {
//判断是否是线上环境
if (!this.isOnline()) {
this.userInfo.name = "18117845617";
this.userInfo.password = "123456";
} }
this.userInfo.Domain =window.location.hostname
}, },
doLogin() { components: {
if (this.userInfo.name == "") { 'my-carousel': Carousel
this.nameIsShow = true; },
this.nameErrorMsg = "请输入用户名"; methods: {
return; //初始化数据
} else if (this.userInfo.password == "") { initData() {
this.passwordIsShow = true; //判断是否是线上环境
this.passwordErrorMsg = "请输入密码"; if (!this.isOnline()) {
return; this.userInfo.name = "18117845617";
} else { this.userInfo.password = "123456";
this.nameIsShow = false; }
this.passwordIsShow = false; this.userInfo.Domain = window.location.hostname
} },
this.loginState = 1; doLogin() {
var msg = { if (this.userInfo.name == "") {
EmAccount: this.userInfo.name, this.nameIsShow = true;
EmPassword: this.userInfo.password, this.nameErrorMsg = "请输入用户名";
Domain: this.userInfo.Domain return;
}; } else if (this.userInfo.password == "") {
this.apipost( this.passwordIsShow = true;
"admin_get_EmployeeLogin", this.passwordErrorMsg = "请输入密码";
msg, return;
response => { } else {
var jsonData = response.data; this.nameIsShow = false;
//未绑定手机号码 this.passwordIsShow = false;
if (jsonData.resultCode == 10006) { }
this.loginState = 1;
var msg = {
EmAccount: this.userInfo.name,
EmPassword: this.userInfo.password,
Domain: this.userInfo.Domain
};
this.apipost(
"admin_get_EmployeeLogin",
msg,
response => {
var jsonData = response.data;
//未绑定手机号码
if (jsonData.resultCode == 10006) {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: "请绑定手机号",
showClose: false,
duration: 3000
});
this.isShow = 2;
} else if (jsonData.resultCode == 1) {
//登录成功
let autoLogin = this.checkedAotu ? {
acc: this.userInfo.name,
pwd: this.userInfo.password,
} : null;
localStorage.autoLogin = JSON.stringify(autoLogin)
var userData = jsonData.data;
var userJson = JSON.stringify(userData);
localStorage.removeItem('navTabs')
localStorage.removeItem('orderObj')
localStorage.userInfo = userJson;
let firstTire = []
userData.UserMenu.forEach(x => {
if (x.MenuUrl != '/' && x.MenuUrl!='') {
firstTire.push(x.MenuName)
} else {
x.MenuUrl='';
firstTire.push(x.MenuName);
}
})
//UserMenu
this.$cookie.set("account", this.userInfo.name);
this.$cookie.set("EmployeeId", userData.EmployeeId);
this.$cookie.set("RB_Branch_id", userData.RB_Branch_id);
this.$cookie.set("RB_Group_id", userData.RB_Group_id);
localStorage.menu = JSON.stringify(firstTire)
this.loginState = 0;
this.$router.push({
path: "/personalCenter"
});
} else {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: response.data.message,
showClose: false,
duration: 3000
});
this.loginState = 0;
}
},
err => {}
);
},
getCode() {
var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
//电话
var phone = this.mobileNumber.replace(/^\s+|\s+$/gm, "");
if (!phoneReg.test(phone)) {
this.nameIsShow = true;
this.nameErrorMsg = "请输入有效的手机号码!";
return false;
} else {
this.nameIsShow = false;
}
const TIME_COUNT = 60;
this.code = "";
if (!this.timer) {
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
let msg = {
mobileNumber: this.mobileNumber,
mobileCodeType: this.mobileCodeType
};
this.apipost("user_get_moblieNumber_code", msg, res => {
if (res.data.resultCode == 1) {} else {
this.$notify.error({ this.$notify.error({
title: "提示", title: "提示",
customClass: "msgTips", customClass: "msgTips",
message: "请绑定手机号", message: res.data.message,
showClose: false, showClose: false,
duration: 3000 duration: 3000
}); });
this.isShow = 2; }
} else if (jsonData.resultCode == 1) { });
//登录成功 },
let autoLogin = this.checkedAotu ? { doBind() {
acc: this.userInfo.name, if (this.mobileNumber == "") {
pwd: this.userInfo.password, this.nameIsShow = true;
} : null ; this.nameErrorMsg = "请输入手机号";
localStorage.autoLogin = JSON.stringify(autoLogin) return;
var userData = jsonData.data; } else if (this.code == "") {
var userJson = JSON.stringify(userData); this.passwordIsShow = true;
localStorage.removeItem('navTabs') this.passwordErrorMsg = "请输入验证码";
localStorage.removeItem('orderObj') return;
localStorage.userInfo = userJson; }
let firstTire = [] let msg = {
userData.UserMenu.forEach(x=>{ account: this.userInfo.name,
if(x.MenuUrl=='') { password: this.userInfo.password,
firstTire.push(x.MenuName) mobileNumber: this.mobileNumber,
} code: this.code
}) };
//UserMenu this.apipost("user_account_bind_moblieNumber", msg, res => {
this.$cookie.set("account", this.userInfo.name); if (res.data.resultCode == 1) {
this.$cookie.set("EmployeeId", userData.EmployeeId); this.isShow = 1;
this.$cookie.set("RB_Branch_id", userData.RB_Branch_id);
this.$cookie.set("RB_Group_id", userData.RB_Group_id);
localStorage.menu=JSON.stringify(firstTire)
this.loginState = 0; this.loginState = 0;
// let previousPathInfo = localStorage.previousPathInfo ? JSON.parse(localStorage.previousPathInfo) : '' this.userInfo.name = this.mobileNumber;
// if (previousPathInfo) {
// let path = previousPathInfo.path.indexOf('login') === -1 ? previousPathInfo.path : 'index'
// let query = previousPathInfo.query ? previousPathInfo.query : {}
// this.$router.push({ path: "/"+ path, query: query });
// }else {
// this.$router.push({ path: "/index" });
// }
this.$router.push({ path: "/personalCenter" });
//登录成功后跳转页面
// this.$notify.success({
// title:'提示',
// customClass:'msgTips',
// message: '登陆成功',
// showClose: false,
// duration:1000
// });
} else { } else {
this.$notify.error({ this.$notify.error({
title: "提示", title: "提示",
customClass: "msgTips", customClass: "msgTips",
message: response.data.message, message: res.data.message,
showClose: false, showClose: false,
duration: 3000 duration: 3000
}); });
this.loginState = 0;
} }
}, });
err => {} },
); getGroup() { //获取集团
}, let Domain = window.location.hostname
getCode() { this.apipost('admin_get_GetModelByDomain', {
var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/; 'Domain': Domain
//电话 }, res => {
var phone = this.mobileNumber.replace(/^\s+|\s+$/gm, ""); this.groupModel = res.data.data;
if (!phoneReg.test(phone)) { document.title = "欢迎使用 " + this.groupModel.GroupName + " ERP系统";
this.nameIsShow = true; }, err => {})
this.nameErrorMsg = "请输入有效的手机号码!"; },
return false; updatePwd() {
} else { this.isShow = 3;
this.nameIsShow = false; this.mobileCodeType = 2;
} },
const TIME_COUNT = 60; changePwd() {
this.code = ""; let msg = {
if (!this.timer) { password: this.password,
this.count = TIME_COUNT; mobileNumber: this.mobileNumber,
this.show = false; code: this.code
this.timer = setInterval(() => { };
if (this.count > 0 && this.count <= TIME_COUNT) { this.apipost("user_change_password_by_mobileNumber", msg, res => {
this.count--; if (res.data.resultCode == 1) {
this.isShow = 1;
this.$notify.success({
title: "提示",
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
} else { } else {
this.show = true; this.$notify.error({
clearInterval(this.timer); title: "提示",
this.timer = null; customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
} }
}, 1000); });
} },
let msg = { goLogin() {
mobileNumber: this.mobileNumber, this.isShow = 1;
mobileCodeType: this.mobileCodeType
};
this.apipost("user_get_moblieNumber_code", msg, res => {
if (res.data.resultCode == 1) {
} else {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
},
doBind() {
if (this.mobileNumber == "") {
this.nameIsShow = true;
this.nameErrorMsg = "请输入手机号";
return;
} else if (this.code == "") {
this.passwordIsShow = true;
this.passwordErrorMsg = "请输入验证码";
return;
} }
let msg = {
account: this.userInfo.name,
password: this.userInfo.password,
mobileNumber: this.mobileNumber,
code: this.code
};
this.apipost("user_account_bind_moblieNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.loginState = 0;
this.userInfo.name = this.mobileNumber;
} else {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
}, },
getGroup() { //获取集团 mounted() {
let Domain= window.location.hostname this.initData()
this.apipost('admin_get_GetModelByDomain',{'Domain':Domain}, res => { this.getGroup()
this.groupModel = res.data.data;
document.title="欢迎使用 "+this.groupModel.GroupName+" ERP系统";
}, err => {})
},
updatePwd() {
this.isShow = 3;
this.mobileCodeType = 2;
}, },
changePwd() { created() {
let msg = { let autoLogin = localStorage.autoLogin ? JSON.parse(localStorage.autoLogin) : null
password: this.password, this.userInfo.name = autoLogin ? autoLogin.acc : ''
mobileNumber: this.mobileNumber, this.userInfo.password = autoLogin ? autoLogin.pwd : ''
code: this.code this.checkedAotu = autoLogin ? true : false
};
this.apipost("user_change_password_by_mobileNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.$notify.success({
title: "提示",
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
} else {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
},
goLogin() {
this.isShow = 1;
} }
},mounted(){
this.initData()
this.getGroup()
},created(){
let autoLogin = localStorage.autoLogin ? JSON.parse(localStorage.autoLogin) : null
this.userInfo.name = autoLogin ? autoLogin.acc : ''
this.userInfo.password = autoLogin ? autoLogin.pwd : ''
this.checkedAotu = autoLogin ? true : false
} }
}
</script> </script>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment