|
@@ -37,11 +37,26 @@ export default {
|
|
|
loading: false,
|
|
|
tradeType: null,
|
|
|
entrustTimer: null,
|
|
|
- tableData: []
|
|
|
+ tableData: [],
|
|
|
+ menuAll:[] //所有路由菜单id
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.getSysType();
|
|
|
+ //从缓存中获取所有路由信息
|
|
|
+ let menu = JSON.parse(localStorage.getItem("saber-menuAll")).content
|
|
|
+ for (let item of menu){
|
|
|
+ this.menuAll.push(item.id)
|
|
|
+ if (item.children.length > 0){
|
|
|
+ this.getMenuId(item.children)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 删除今日业务的缓存
|
|
|
+ localStorage.removeItem('首页-今日业务')
|
|
|
+ console.log(menu,'获取的菜单id')
|
|
|
+
|
|
|
+ this.$nextTick(res=>{
|
|
|
+ this.getSysType();
|
|
|
+ });
|
|
|
},
|
|
|
mounted() {
|
|
|
// 延迟获取数据
|
|
@@ -58,9 +73,22 @@ export default {
|
|
|
clearInterval(this.entrustTimer); //关闭
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取所有路由信息id
|
|
|
+ getMenuId(array){
|
|
|
+ for (let item of array){
|
|
|
+ this.menuAll.push(item.id)
|
|
|
+ }
|
|
|
+ },
|
|
|
//点击获取图表数据
|
|
|
handleMousedown(params){
|
|
|
- this.$emit('handleMousedown',params.data)
|
|
|
+ console.log(this.menuAll,90)
|
|
|
+ if (params.data.mold == 1 && this.menuAll.includes('1499196328461225986')) {
|
|
|
+ this.$emit('handleMousedown',params.data)
|
|
|
+ }else if (params.data.mold == 2 && this.menuAll.includes('1499196328461225986')) {
|
|
|
+ this.$emit('handleMousedown',params.data)
|
|
|
+ }else if (params.data.mold == 3 && this.menuAll.includes('1673857442015977474')) {
|
|
|
+ this.$emit('handleMousedown',params.data)
|
|
|
+ }
|
|
|
},
|
|
|
//箱分布图表
|
|
|
rankingTwo(id, name, data) {
|
|
@@ -95,7 +123,7 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
);
|
|
|
- myChart.on("click", this.handleMousedown);
|
|
|
+ myChart.on("click", this.handleMousedown);
|
|
|
},
|
|
|
init() {
|
|
|
this.getSysType();
|
|
@@ -105,11 +133,17 @@ export default {
|
|
|
this.loading = true
|
|
|
// 集装箱的数据
|
|
|
bizCount({mold:1}).then(res=>{
|
|
|
+ if (!this.menuAll.includes('1499196328461225986')) {
|
|
|
+ res.data.data.flow.all = 0
|
|
|
+ }
|
|
|
this.rankingTwo('totalContainer', '集装箱:'+res.data.data.flow.all, res.data.data.flow.list)
|
|
|
// this.rankingTwo('totalContainerTwo', '集装箱总量:'+res.data.data.dept.all, res.data.data.dept.list)
|
|
|
})
|
|
|
// 散货的echarts的数据
|
|
|
bizCount({mold:2}).then(res=>{
|
|
|
+ if (!this.menuAll.includes('1499196328461225986')) {
|
|
|
+ res.data.data.flow.all = 0
|
|
|
+ }
|
|
|
this.rankingTwo('totalBulkCargo', '散货:'+res.data.data.flow.all, res.data.data.flow.list)
|
|
|
// this.rankingTwo('totalBulkCargoTwo', '散货总量:'+res.data.data.dept.all, res.data.data.dept.list)
|
|
|
})
|