页面权限

This commit is contained in:
2026-03-09 15:02:09 +08:00
parent ef230b3836
commit 418c29095b
55 changed files with 391 additions and 150 deletions

View File

@@ -56,19 +56,22 @@ router.beforeEach((to, from, next) => {
isRelogin.show = true isRelogin.show = true
// 获取字典数据 add by 芋艿 // 获取字典数据 add by 芋艿
store.dispatch('dict/loadDictDatas') store.dispatch('dict/loadDictDatas')
// 获取部门权限
store.dispatch('GetLevel')
// 判断当前用户是否已拉取完 user_info 信息 // 判断当前用户是否已拉取完 user_info 信息
store.dispatch('GetInfo').then(userInfo => { store.dispatch('GetInfo').then(userInfo => {
isRelogin.show = false isRelogin.show = false
// 触发 GenerateRoutes 事件时,将 menus 菜单树传递进去 // 触发 GenerateRoutes 事件时,将 menus 菜单树传递进去
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => { store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
// 根据 roles 权限生成可访问的路由表 // 根据 roles 权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表
const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/' const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/'
store.commit('permission/SET_DEFAULT_PATH', defaultPath) store.commit('permission/SET_DEFAULT_PATH', defaultPath)
if (to.path === '/' || to.matched.length === 0) { // 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页
if (to.path === '/') {
next({ path: defaultPath, replace: true }) next({ path: defaultPath, replace: true })
} else { } else {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成,当前页刷新时保留 to 的路径
} }
}) })
}).catch(err => { }).catch(err => {

View File

@@ -64,13 +64,13 @@ export const constantRoutes = [
component: (resolve) => require(["@/views/error/401"], resolve), component: (resolve) => require(["@/views/error/401"], resolve),
hidden: true, hidden: true,
}, },
{ // {
path: "/", // path: "/",
// component: () => import('@/views/choicePart'), // // component: () => import('@/views/choicePart'),
component: () => import("@/views/home"), // component: () => import("@/views/home"),
hidden: true, // hidden: true,
meta: { requireToken: true }, // meta: { requireToken: true },
}, // },
// { // {
// path: "/operatingRevenue", // path: "/operatingRevenue",
// // component: () => import('@/views/choicePart'), // // component: () => import('@/views/choicePart'),

View File

@@ -19,6 +19,8 @@ const getters = {
sidebarRouters:state => state.permission.sidebarRouters, sidebarRouters:state => state.permission.sidebarRouters,
defaultPath: state => state.permission.defaultPath, defaultPath: state => state.permission.defaultPath,
// 数据字典 // 数据字典
dict_datas: state => state.dict.dictDatas dict_datas: state => state.dict.dictDatas,
// 部门层级
levelList: state => state.user.levelList
} }
export default getters export default getters

View File

@@ -1,5 +1,6 @@
import {login, logout, getInfo, socialLogin, smsLogin} from '@/api/login' import {login, logout, getInfo, socialLogin, smsLogin} from '@/api/login'
import {setToken, removeToken} from '@/utils/auth' import {setToken, removeToken} from '@/utils/auth'
import {getLevelStruc} from '@/api/cockpit'
const user = { const user = {
state: { state: {
@@ -7,7 +8,8 @@ const user = {
name: '', name: '',
avatar: '', avatar: '',
roles: [], roles: [],
permissions: [] permissions: [],
levelList:[]
}, },
mutations: { mutations: {
@@ -28,6 +30,9 @@ const user = {
}, },
SET_PERMISSIONS: (state, permissions) => { SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions state.permissions = permissions
},
SET_LEVEL_LIST: (state, levelList) => {
state.levelList = levelList
} }
}, },
@@ -122,7 +127,21 @@ const user = {
}) })
}) })
}, },
// 获取层级
GetLevel({ commit, state }) {
return new Promise((resolve, reject) => {
getLevelStruc().then(res => {
// 如果未加载到数据,则直接返回
if (!res || !res.data) {
return;
}
commit('SET_LEVEL_LIST', res.data)
resolve()
})
}).catch(error => {
reject(error)
})
},
// 退出系统 // 退出系统
LogOut({ commit, state }) { LogOut({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="changeBase"> <div class="changeBase">
<div class="base-item" @click="handleClick(index)" v-for="(item, index) in buttonList" :key="item" <div class="base-item" @click="handleClick(item.id)" v-for="(item) in buttonLevelList" :key="item.id"
:style="{ zIndex: activeButton === index ? 10 : 1 }"> :style="{ zIndex: activeButton === item.id ? 10 : 1 }">
<img :src="activeButton === index ? imgMap.bgBase[item] : imgMap.base[item]" :alt="`${item}基地`" :title="item"> <img :src="activeButton === item.id ? item.bgImg : item.img" :alt="`${item.name}基地`" :title="item.name">
</div> </div>
</div> </div>
</template> </template>
@@ -33,80 +33,69 @@ export default {
props: { props: {
factory: { factory: {
type: [String, Number], type: [String, Number],
default: 5, // 新映射中“宜兴”对应序号7 default: undefined,
validator: (val) => [5, 2, 7, 3, 8, 9, 10].includes(val) // 校验序号范围匹配新的baseNameToIndexMap validator: (val) => [5, 2, 7, 3, 8, 9, 10, 6].includes(val) // 校验序号范围匹配新的baseNameToIndexMap
}
},
// 计算属性响应式levelList变化时会自动更新
computed: {
buttonLevelList() {
// 核心:通过$store.getters获取定义的getter
let arr = []
this.$store.getters.levelList.forEach(item => {
this.buttonList.forEach(item2 => {
if (item2.id === item.id) {
arr.push(item2)
}
})
})
this.activeButton = arr[0].id
return arr
} }
}, },
data() { data() {
return { return {
activeButton: 5, // 初始化默认选中索引2对应buttonList中的“宜兴” activeButton: undefined,
buttonList: ['合肥', '桐城', '宜兴', '自贡', '漳州', '洛阳', '秦皇岛', '宿迁'], // 匹配截图顺序 buttonList:[
imgMap: { {id: 5, name: '合肥', img: baseHefei, bgImg: bgBaseHefei},
base: { {id: 2, name: '桐城', img: baseTongcheng, bgImg: bgBaseTongcheng},
合肥: baseHefei, {id: 7, name: '宜兴', img: baseYixing, bgImg: bgBaseYixing},
桐城: baseTongcheng, {id: 3, name: '自贡', img: baseZigong, bgImg: bgBaseZigong},
宜兴: baseYixing, {id: 8, name: '漳州', img: baseZhangzhou, bgImg: bgBaseZhangzhou},
自贡: baseZigong, {id: 9, name: '洛阳', img: baseLuoyang, bgImg: bgBaseLuoyang},
漳州: baseZhangzhou, {id: 10, name: '秦皇岛', img: baseQinhuangdao, bgImg: bgBaseQinhuangdao},
洛阳: baseLuoyang, {id: 6, name: '宿迁', img: baseSuqian, bgImg: bgBaseSuqian}
秦皇岛: baseQinhuangdao, ],
宿迁: baseSuqian
},
bgBase: {
合肥: bgBaseHefei,
桐城: bgBaseTongcheng,
宜兴: bgBaseYixing,
自贡: bgBaseZigong,
漳州: bgBaseZhangzhou,
洛阳: bgBaseLuoyang,
秦皇岛: bgBaseQinhuangdao,
宿迁: bgBaseSuqian
}
},
baseNameToIndexMap: { // 新的名称→序号映射
宜兴: 7,
漳州: 8,
自贡: 3,
桐城: 2,
洛阳: 9,
合肥: 5,
秦皇岛: 10, // 补充
宿迁: 6 // 补充
}
}; };
}, },
watch: { watch: {
// 监听父组件传递的factory变化同步本地选中索引 // 监听父组件传递的factory变化同步本地选中索引
factory: { factory: {
handler(newVal) { handler(newVal) {
// 根据新的baseNameToIndexMap找到对应的基地名称 console.log('watch factory=======================:', newVal);
const targetName = Object.keys(this.baseNameToIndexMap).find(name => this.baseNameToIndexMap[name] === newVal); if (newVal) {
// 根据名称找到buttonList中的索引 this.activeButton = newVal;
const targetIndex = this.buttonList.indexOf(targetName); }
// 合法索引则更新,否则默认选中宜兴 // // 根据新的baseNameToIndexMap找到对应的基地名称
this.activeButton = targetIndex > -1 ? targetIndex : 2; // const targetName = Object.keys(this.baseNameToIndexMap).find(name => this.baseNameToIndexMap[name] === newVal);
console.log('当前选中基地:', this.buttonList[this.activeButton], '序号:', newVal); // // 根据名称找到buttonList中的索引
// const targetIndex = this.buttonList.indexOf(targetName);
// // 合法索引则更新,否则默认选中宜兴
// this.activeButton = targetIndex > -1 ? targetIndex : 2;
// console.log('当前选中基地:', this.buttonList[this.activeButton], '序号:', newVal);
}, },
immediate: true // 初始化立即执行 // immediate: true // 初始化立即执行
},
// 监听本地选中索引变化,向父组件发送事件
activeButton(newVal) {
const selectedName = this.buttonList[newVal];
const selectedIndex = this.baseNameToIndexMap[selectedName] || 5; // 默认返回宜兴的序号7
this.$emit('baseChange', selectedIndex);
} }
}, },
methods: { methods: {
handleClick(index) { handleClick(id) {
this.activeButton = index; this.activeButton = id;
}, this.$emit('baseChange', id);
getIndexByName(name) {
return this.baseNameToIndexMap[name] || 5;
} }
}, },
mounted() { mounted() {
// 初始化时触发事件传递默认选中的宜兴序号7 // 初始化时触发事件传递默认选中的宜兴序号7
this.$emit('baseChange', 5); // this.$emit('baseChange', 5);
} }
}; };
</script> </script>

View File

@@ -114,6 +114,7 @@ export default {
monthAnalysis: [], monthAnalysis: [],
ytdAnalysis: [], ytdAnalysis: [],
trend: [], trend: [],
factory:null
}; };
}, },
@@ -185,7 +186,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -89,7 +89,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
this.$router.push({ this.$router.push({
path: 'expenseAnalysisBase', path: 'expenseAnalysisBase',
query: { // 使用query传递参数推荐也可使用params query: { // 使用query传递参数推荐也可使用params

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -174,7 +174,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -91,7 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'fullCostAnalysisBase', path: 'fullCostAnalysisBase',

View File

@@ -111,7 +111,7 @@ export default {
dateData:{}, dateData:{},
levelId:undefined, levelId:undefined,
index: '毛利率', index: '毛利率',
factory: 1, factory: null,
monthData: {}, monthData: {},
ytdData: {}, ytdData: {},
monthAnalysis: [], monthAnalysis: [],
@@ -188,7 +188,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'grossMarginBase', path: 'grossMarginBase',

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
index: '加工成品率', index: '加工成品率',
monthData: undefined, monthData: undefined,
@@ -184,7 +184,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
relatedMon: {}, relatedMon: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'netPriceAnalysisBase', path: 'netPriceAnalysisBase',

View File

@@ -91,8 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'operatingRevenueBase', path: 'operatingRevenueBase',

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -174,7 +174,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -91,6 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -108,7 +108,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory:0, factory:null,
dateData:{}, dateData:{},
index: '营业收入', index: '营业收入',
monthData: undefined, monthData: undefined,
@@ -157,7 +157,7 @@ export default {
transformOrigin: "left top", transformOrigin: "left top",
// overflow: hidden; // overflow: hidden;
}; };
}, }
}, },
watch: { watch: {
clientWidth(val) { clientWidth(val) {
@@ -188,7 +188,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
console.log('this.$route.query.dateData', this.$route.query.dateData); console.log('this.$route.query.dateData', this.$route.query.dateData);
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -173,7 +173,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -92,7 +92,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
})(); })();
}; };
console.log(this.$route.query.name, 'name'); console.log(this.$route.query.name, 'name');
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -88,7 +88,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -166,7 +166,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -184,7 +184,13 @@ export default {
})(); })();
}; };
console.log('this.$route.query.factory', this.$route.query.factory); console.log('this.$route.query.factory', this.$route.query.factory);
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,6 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,6 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -104,7 +104,7 @@ export default {
timer: null, timer: null,
beilv: 1, beilv: 1,
month: '', month: '',
factory: 5, factory: null,
value: 100, value: 100,
dateData: {}, dateData: {},
trendName: '加工燃料成本', trendName: '加工燃料成本',
@@ -184,7 +184,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
trendName: '加工制造费用成本', trendName: '加工制造费用成本',
monData: {}, monData: {},
@@ -176,7 +176,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,7 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -185,7 +185,13 @@ export default {
}; };
console.log('this.$route.query.factory', this.$route.query.factory); console.log('this.$route.query.factory', this.$route.query.factory);
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
trendName: '加工燃料成本', trendName: '加工燃料成本',
monData: {}, monData: {},
@@ -176,7 +176,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,7 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -105,7 +105,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -179,7 +179,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -88,7 +88,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -160,7 +160,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -98,7 +98,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: this.baseUrl, path: this.baseUrl,

View File

@@ -107,7 +107,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
index: '原片成品率', index: '原片成品率',
monthData: undefined, monthData: undefined,
@@ -187,7 +187,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -87,7 +87,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -173,7 +173,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -175,7 +175,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -87,7 +87,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -109,7 +109,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
relatedMon: {}, relatedMon: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -89,7 +89,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -297,7 +297,6 @@ export default {
) )
.then(() => { .then(() => {
console.log(this.redirect, this.$route.query.redirect, 'this.redirect'); console.log(this.redirect, this.$route.query.redirect, 'this.redirect');
this.$router.push({ path: this.redirect || '/' }).catch(() => { }); this.$router.push({ path: this.redirect || '/' }).catch(() => { });
}) })
.catch(() => { .catch(() => {