From a144a18ab582fd3a8c945cba60bc364dbe7f31e8 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期四, 28 三月 2024 16:59:55 +0800 Subject: [PATCH] 1、新增点击设备运行状态图标跳转至设备监控页面并根据状态及当前层级筛选页面对应数据 2、新增点击设备利用率的横向柱状图跳转至统计分析页面并根据所点击层级筛选页面对应数据 3、解决router.push以及router.replace跳转后报错 --- src/views/dashboard/BranchFactorySignage.vue | 68 +++++++++++++++++---------------- 1 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue index 5c2e663..7699025 100644 --- a/src/views/dashboard/BranchFactorySignage.vue +++ b/src/views/dashboard/BranchFactorySignage.vue @@ -8,7 +8,9 @@ <!--</div>--> <div class="content-container"> <div style="width: 25%" class="left-col"> - <slot name="back_nav"></slot> + <div class="back-nav" @click="$emit('backToLastSignage','Index')" v-if="userType===4"> + <dv-decoration-7>涓婁竴绾�</dv-decoration-7> + </div> <dv-border-box-9 style="padding: 40px 20px 0"> <!--<div class="first-title">M D C 鍏� 缃� 鎬� 鏁� : 6 0 3 鍙�</div>--> <div id="running_state_chart" style="width:100%;height: 400px;"></div> @@ -79,6 +81,9 @@ productionCode: { type: String, default: '' + }, + userType: { + type: Number } }, data() { @@ -113,28 +118,6 @@ barChartData: [], doubleBarChart: '', doubleBarChartData: {}, - supportPlanList: [ - { - label: '鏈湀涓変繚璁″垝', - value: 299, - background: '#719D8E' - }, - { - label: '鏈湀瀹屾垚', - value: 229, - background: '#409EFF' - }, - { - label: '涓嬫湀涓変繚璁″垝', - value: 319, - background: '#A8985D' - }, - { - label: '涓嬩笅鏈堜笁淇濊鍒�', - value: 329, - background: '#58D9F9' - } - ], maintenanceConfig: {}, problemConfig: {} } @@ -143,10 +126,6 @@ window.addEventListener('resize', this.handleWindowResize) this.drawCharts() this.getChartDataByApi() - }, - activated() { - console.log('瑙﹀彂activated') - this.handleWindowResize() }, beforeDestroy() { window.removeEventListener('resize', this.handleWindowResize) @@ -167,8 +146,8 @@ getRunningStateDataByApi() { signageApi.getEquipmentStatusStatisticsApi(this.productionCode) .then(res => { - if (res.success) this.runningStateData = res.result - this.drawRunningStateChart() + if (res.success) this.runningStateData = res.result.list + this.drawRunningStateChart(res.result.producitonId) }) }, @@ -271,7 +250,7 @@ }, /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */ - drawRunningStateChart() { + drawRunningStateChart(productionId) { this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) const option = { height: 300, @@ -351,6 +330,14 @@ ] } this.runningStateChart.setOption(option, true) + + this.runningStateChart.on('click', params => { + console.log('params', params) + this.$router.push({ + name: 'mdc-base-DeviceBaseInfo', + params: { signageData: params.data, productionId } + }) + }) }, /* 缁樺埗璁惧鍒╃敤鐜囪兌鍥婂浘 */ @@ -544,14 +531,18 @@ this.efficiencyChart.setOption(option, true) this.efficiencyChart.on('click', params => { - // 鐐瑰嚮瑙﹀彂鐨勪负鏌辩姸浣擄紝闄ゆ闄ゅ鏄爣棰� if (params.componentType === 'series') { console.log('seriesParams===========', params) - + const productionId = this.efficiencyData.find(item => item.productionCode === params.name).productionId + const tierName = this.efficiencyData.find(item => item.productionCode === params.name).name + this.$router.push({ + name: 'mdc-base-StatisticsChart', + params: { isEquipment: false, productionId, tierName } + }) } else { console.log('yAxisParams===========', params) - this.$emit('switchToBranchFactory', params.value) + this.$emit('switchToNextSignage', { signageName: 'WorkshopSection', productionCode: params.value }) } }) }, @@ -1018,6 +1009,17 @@ justify-content: space-between; .left-col { + .back-nav { + width: 100px; + height: 30px; + color: #eee; + position: absolute; + top: 25px; + left: 25px; + cursor: pointer; + z-index: 9999 + } + .first-title { color: #00A8AC; font-size: 20px; -- Gitblit v1.9.3