¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page-container"> |
| | | <div class="content-container"> |
| | | <div style="width: 30%" class="left-col"> |
| | | <div class="back-nav" @click="$emit('backToLastSignage','BranchFactory')" v-if="userType>=3"> |
| | | <dv-decoration-7>ä¸ä¸çº§</dv-decoration-7> |
| | | </div> |
| | | <dv-border-box-9 style="padding: 15px"> |
| | | <div id="tech_condition_chart" style="width:100%;height: 240px;"></div> |
| | | <div id="warranty_malfunction_chart" style="width:100%;height: 240px;"></div> |
| | | <div style="display: flex;"> |
| | | |
| | | <div style="flex:0.5;display: flex;flex-direction:column;align-items: center"> |
| | | <dv-decoration-11 style="width:90%;height:60px;color: #ccc;font-size: 20px">ä¸ä¿è®¡å</dv-decoration-11> |
| | | <div class="support-plan-container"> |
| | | <div class="support-plan-item" style="background:#67C23A"> |
| | | <div>ä¸ä¿æ¬æè®¡å</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{thisMonthMaintenancePlanNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | <div class="support-plan-item" style="background:#409EFF"> |
| | | <div>æ¬æå®æé</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{thisMonthMaintenanceRealNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | <div class="support-plan-item" style="background:#E6A23C"> |
| | | <div>å»¶æ</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{nextMonthMaintenancePlanNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | <div class="support-plan-item" style="background:#F56C6C"> |
| | | <div>è¶
æ</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | <div class="support-plan-item" style="background:#719D8E"> |
| | | <div>ä¸æè®¡å</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | <div class="support-plan-item" style="background:#58D9F9"> |
| | | <div>ä¸ä¸æè®¡å</div> |
| | | <div class="plan-value-container"> |
| | | <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div> |
| | | <div>å°</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="flex:0.5;display: flex;justify-content: center"> |
| | | <dv-decoration-11 style="width:90%;height:60px;color: #ccc;font-size: 20px">äºä¿è®¡å</dv-decoration-11> |
| | | </div> |
| | | </div> |
| | | </dv-border-box-9> |
| | | </div> |
| | | |
| | | <div style="width: 38%" class="middle-col"> |
| | | <dv-border-box-9 style="padding: 15px"> |
| | | <div id="running_state_chart" style="width:100%;height: 400px;"></div> |
| | | <div id="line_chart" style="width:100%;height: 400px;"></div> |
| | | </dv-border-box-9> |
| | | </div> |
| | | <div style="width: 30%"> |
| | | <dv-border-box-9 style="padding: 15px"> |
| | | <a-form layout="inline" @keyup.enter.native="$emit('switchToNextSignage', { signageName: 'Equipment', productionCode: equipmentId })"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <!--<a-input v-model="equipmentId" size="large"></a-input>--> |
| | | <a-auto-complete |
| | | v-model="equipmentId" |
| | | placeholder="åè½¦é®æ¥è¯¢" |
| | | :allowClear="true" |
| | | size="large" |
| | | /> |
| | | </a-form-item> |
| | | </a-form> |
| | | <div style="display: flex;flex-wrap: wrap"> |
| | | <div id="gauge_chart1" style="width:50%;height: 200px;"></div> |
| | | <div id="gauge_chart2" style="width:50%;height: 200px;"></div> |
| | | <div id="gauge_chart3" style="width:50%;height: 200px;"></div> |
| | | <div id="gauge_chart4" style="width:50%;height: 200px;"></div> |
| | | </div> |
| | | <div id="bar_chart" style="width:100%;height: 330px;"></div> |
| | | </dv-border-box-9> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import signageApi from '@/api/signage' |
| | | import moment from 'moment' |
| | | |
| | | export default { |
| | | name: 'WorkshopSectionSignage', |
| | | props: { |
| | | productionCode: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | userType: { |
| | | type: Number |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | runningStateChart: '', |
| | | runningStateData: [ |
| | | { value: '0', name: 'å
³æº' }, |
| | | { value: '0', name: 'æ¥è¦' }, |
| | | { value: '0', name: 'å¾
æº' }, |
| | | { value: '0', name: 'è¿è¡' } |
| | | ], |
| | | techConditionChart: '', |
| | | techConditionData: [ |
| | | { value: '0', name: 'åæ ¼' }, |
| | | { value: '0', name: 'ç¦ç¨' }, |
| | | { value: '0', name: 'éç¨' } |
| | | ], |
| | | warrantyMalfunctionChart: '', |
| | | warrantyMalfunctionData: [ |
| | | { value: '0', name: 'æ¥ä¿®' }, |
| | | { value: '0', name: 'åæº' }, |
| | | { value: '0', name: 'è¿è¡' } |
| | | ], |
| | | thisMonthMaintenancePlanNum: 0, |
| | | thisMonthMaintenanceRealNum: 0, |
| | | nextMonthMaintenancePlanNum: 0, |
| | | nextNextMonthMaintenancePlanNum: 0, |
| | | lineChart: '', |
| | | lineChartData: [], |
| | | gaugeChart1: '', |
| | | gaugeChart2: '', |
| | | gaugeChart3: '', |
| | | gaugeChart4: '', |
| | | gaugeChartData1: [], |
| | | gaugeChartData2: [], |
| | | gaugeChartData3: [], |
| | | gaugeChartData4: [], |
| | | barChart: '', |
| | | barChartData: [ |
| | | { |
| | | name: '2640221', |
| | | value: 20 |
| | | }, |
| | | { |
| | | name: '2640222', |
| | | value: 40 |
| | | }, |
| | | { |
| | | name: '2640223', |
| | | value: 70 |
| | | }, |
| | | { |
| | | name: '2640224', |
| | | value: 30 |
| | | }, |
| | | { |
| | | name: '2640225', |
| | | value: 35 |
| | | }, |
| | | { |
| | | name: '2640226', |
| | | value: 80 |
| | | }, |
| | | { |
| | | name: '2640227', |
| | | value: 40 |
| | | }, |
| | | { |
| | | name: '12640220', |
| | | value: 60 |
| | | }, |
| | | { |
| | | name: '12640221', |
| | | value: 40 |
| | | }, |
| | | { |
| | | name: '12640222', |
| | | value: 35 |
| | | } |
| | | ], |
| | | equipmentId: '' |
| | | } |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | this.drawCharts() |
| | | this.getChartDataByApi() |
| | | }, |
| | | activated() { |
| | | console.log('触åactivated') |
| | | this.handleWindowResize() |
| | | if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) |
| | | }, |
| | | methods: { |
| | | getChartDataByApi() { |
| | | this.getTechConditionDataByApi() |
| | | this.getWarrantyMalfunctionDataByApi() |
| | | this.getRunningStateDataByApi() |
| | | this.getMonthMaintenanceNumByApi() |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·åææ¯ç¶æ */ |
| | | getTechConditionDataByApi() { |
| | | signageApi.getEquipmentTechnologyStatusListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.techConditionData = [ |
| | | { value: res.result[0].qualifiedCount, name: 'åæ ¼' }, |
| | | { value: res.result[0].disabledCount, name: 'ç¦ç¨' }, |
| | | { value: res.result[0].limitedUseCount, name: 'éç¨' } |
| | | ] |
| | | } |
| | | this.drawTechConditionChart() |
| | | }) |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·åè®¾å¤æ¥ä¿®æ
é */ |
| | | getWarrantyMalfunctionDataByApi() { |
| | | signageApi.getReportRepairEquipmentListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.warrantyMalfunctionData = [ |
| | | { value: res.result[0].failurTotalCount, name: 'æ¥ä¿®' }, |
| | | { value: res.result[0].stopCount, name: 'åæº' }, |
| | | { value: res.result[0].noStopCount, name: 'è¿è¡' } |
| | | ] |
| | | } |
| | | this.drawWarrantyMalfunctionChart() |
| | | }) |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·å设å¤è¿è¡ç¶æ */ |
| | | getRunningStateDataByApi() { |
| | | signageApi.getEquipmentStatusStatisticsApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success) this.runningStateData = res.result |
| | | this.drawRunningStateChart() |
| | | }) |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·åä¸ä¿è®¡å */ |
| | | getMonthMaintenanceNumByApi() { |
| | | signageApi.getThisMonthMaintenanceListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.thisMonthMaintenancePlanNum = res.result[0].totalCount |
| | | }) |
| | | signageApi.getThisMonthMaintenanceFinishListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.thisMonthMaintenanceRealNum = res.result[0].totalCount |
| | | }) |
| | | signageApi.getNextMonthMaintenanceList(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.nextMonthMaintenancePlanNum = res.result[0].totalCount |
| | | }) |
| | | signageApi.getNextNextMonthMaintenanceListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.nextNextMonthMaintenancePlanNum = res.result[0].totalCount |
| | | }) |
| | | }, |
| | | |
| | | /* ç»å¶å¾è¡¨æ±æ»æ¹æ³ */ |
| | | drawCharts() { |
| | | this.drawRunningStateChart() |
| | | this.drawTechConditionChart() |
| | | this.drawWarrantyMalfunctionChart() |
| | | this.drawLineChart() |
| | | this.drawGaugeChart() |
| | | this.drawBarChart() |
| | | }, |
| | | |
| | | /* ç»å¶ææ¯ç¶æé¥¼å¾ */ |
| | | drawTechConditionChart() { |
| | | this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart')) |
| | | const option = { |
| | | title: { |
| | | show: true, // æ¯å¦æ¾ç¤ºæ é¢ï¼é»è®¤ä¸ºtrue |
| | | text: 'ææ¯ç¶æ', // 主æ é¢ææ¬ |
| | | x: 'left', // æ 颿°´å¹³å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'left'ã'center'ã'right'æå
·ä½çæ°´å¹³åæ å¼ |
| | | y: 'top', // æ é¢åç´å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'top'ã'bottom'ã'center'æå
·ä½çåç´åæ å¼ |
| | | textStyle: { |
| | | // 主æ é¢ææ¬æ ·å¼ |
| | | fontSize: 18, |
| | | fontWeight: 'normal', |
| | | color: '#00A8AC' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}(${params.percent}%)` |
| | | } |
| | | } |
| | | }, |
| | | legend: { |
| | | top: 'bottom', |
| | | orient: 'horizontal', |
| | | right: 0, |
| | | // bottom: "0", |
| | | itemWidth: 14, |
| | | itemHeight: 14, |
| | | icon: 'roundRect', |
| | | itemGap: 15, |
| | | textStyle: { |
| | | color: 'inherit', |
| | | fontSize: 14, |
| | | padding: [0, 0, 0, 0] |
| | | }, |
| | | data: ['åæ ¼', 'ç¦ç¨', 'éç¨'] |
| | | }, |
| | | grid: { |
| | | containLabel: true |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'pie', |
| | | // selectedMode: "single", |
| | | radius: ['40%', '60%'], |
| | | center: ['50%', '50%'], |
| | | color: [ |
| | | '#0AA012', |
| | | '#237E48', |
| | | '#757160' |
| | | ], |
| | | label: { |
| | | position: 'outside', |
| | | show: true, |
| | | color: 'inherit', |
| | | // textBorderColor: 'inherit', |
| | | // textBorderWidth: 1, |
| | | fontSize: 16, |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}` |
| | | } |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: true, |
| | | length2: 15, |
| | | length: 15 |
| | | }, |
| | | data: this.techConditionData |
| | | } |
| | | ] |
| | | } |
| | | this.techConditionChart.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶è®¾å¤æ¥ä¿®æ
éé¥¼å¾ */ |
| | | drawWarrantyMalfunctionChart() { |
| | | this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart')) |
| | | const option = { |
| | | title: { |
| | | show: true, // æ¯å¦æ¾ç¤ºæ é¢ï¼é»è®¤ä¸ºtrue |
| | | text: 'è®¾å¤æ¥ä¿®æ
é', // 主æ é¢ææ¬ |
| | | x: 'left', // æ 颿°´å¹³å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'left'ã'center'ã'right'æå
·ä½çæ°´å¹³åæ å¼ |
| | | y: 'top', // æ é¢åç´å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'top'ã'bottom'ã'center'æå
·ä½çåç´åæ å¼ |
| | | textStyle: { |
| | | // 主æ é¢ææ¬æ ·å¼ |
| | | fontSize: 18, |
| | | fontWeight: 'normal', |
| | | color: '#00A8AC' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}(${params.percent}%)` |
| | | } |
| | | } |
| | | }, |
| | | legend: { |
| | | top: 'bottom', |
| | | orient: 'horizontal', |
| | | right: 0, |
| | | // bottom: "0", |
| | | itemWidth: 14, |
| | | itemHeight: 14, |
| | | icon: 'roundRect', |
| | | itemGap: 15, |
| | | textStyle: { |
| | | color: 'inherit', |
| | | fontSize: 14, |
| | | padding: [0, 0, 0, 0] |
| | | }, |
| | | data: ['æ¥ä¿®', 'åæº', 'è¿è¡'] |
| | | }, |
| | | grid: { |
| | | containLabel: true |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'pie', |
| | | // selectedMode: "single", |
| | | radius: ['40%', '60%'], |
| | | center: ['50%', '50%'], |
| | | color: [ |
| | | '#00CED1', |
| | | '#B85B38', |
| | | '#A8985D' |
| | | ], |
| | | label: { |
| | | position: 'outside', |
| | | show: true, |
| | | color: 'inherit', |
| | | // textBorderColor: 'inherit', |
| | | // textBorderWidth: 1, |
| | | fontSize: 16, |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}` |
| | | } |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: true, |
| | | length2: 15, |
| | | length: 15 |
| | | }, |
| | | data: this.warrantyMalfunctionData |
| | | } |
| | | ] |
| | | } |
| | | this.warrantyMalfunctionChart.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶è®¾å¤è¿è¡ç¶æç«ç°é¥¼å¾ */ |
| | | drawRunningStateChart() { |
| | | this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) |
| | | const option = { |
| | | title: { |
| | | show: true, // æ¯å¦æ¾ç¤ºæ é¢ï¼é»è®¤ä¸ºtrue |
| | | text: '设å¤ç¶æ', // 主æ é¢ææ¬ |
| | | x: 'left', // æ 颿°´å¹³å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'left'ã'center'ã'right'æå
·ä½çæ°´å¹³åæ å¼ |
| | | y: 'top', // æ é¢åç´å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'top'ã'bottom'ã'center'æå
·ä½çåç´åæ å¼ |
| | | textStyle: { |
| | | // 主æ é¢ææ¬æ ·å¼ |
| | | fontSize: 18, |
| | | fontWeight: 'normal', |
| | | color: '#00A8AC' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}(${params.percent}%)` |
| | | } |
| | | } |
| | | }, |
| | | legend: { |
| | | top: 'bottom', |
| | | orient: 'horizontal', |
| | | right: 0, |
| | | // bottom: "0", |
| | | itemWidth: 14, |
| | | itemHeight: 14, |
| | | icon: 'roundRect', |
| | | itemGap: 15, |
| | | textStyle: { |
| | | color: 'inherit', |
| | | fontSize: 14, |
| | | padding: [0, 0, 0, 0] |
| | | }, |
| | | data: ['å
³æº', 'æ¥è¦', 'å¾
æº', 'è¿è¡'] |
| | | }, |
| | | grid: { |
| | | containLabel: true |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'pie', |
| | | // roseType: 'angle', // ç«ç°å¾ |
| | | // selectedMode: "single", |
| | | radius: ['35%', '55%'], |
| | | center: ['50%', '50%'], |
| | | color: [ |
| | | '#686869', |
| | | '#AA6349', |
| | | '#968A5E', |
| | | '#5D975D' |
| | | ], |
| | | label: { |
| | | position: 'outside', |
| | | show: true, |
| | | color: 'inherit', |
| | | // textBorderColor: 'inherit', |
| | | // textBorderWidth: 1, |
| | | fontSize: 30, |
| | | formatter: function(params) { |
| | | if (params.name !== '') { |
| | | return `${params.name}:${params.value}` |
| | | } |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: true, |
| | | length2: 20, |
| | | length: 30 |
| | | }, |
| | | data: this.runningStateData |
| | | } |
| | | ] |
| | | } |
| | | this.runningStateChart.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶æçº¿å¾ */ |
| | | drawLineChart() { |
| | | this.lineChart = this.$echarts.init(document.getElementById('line_chart')) |
| | | const newData = { |
| | | xAxis: ['3æ19æ¥', '3æ20æ¥', '3æ21æ¥', '3æ22æ¥', '3æ23æ¥', '3æ24æ¥', '3æ25æ¥'], |
| | | yAxis: [ |
| | | { |
| | | name: 'å©ç¨ç', |
| | | value: [200, 600, 550, 360, 520, 520, 630, 780, 230, 420, 650, 700] |
| | | }, |
| | | { |
| | | name: 'å¼å¨ç', |
| | | value: [230, 630, 440, 400, 740, 800, 600, 900, 700, 400, 700, 400] |
| | | }, |
| | | { |
| | | name: '弿ºç', |
| | | value: [900, 700, 400, 700, 800, 605, 730, 600, 700, 900, 400, 605] |
| | | } |
| | | ], |
| | | yAxisName: 'å7天å©ç¨ç' |
| | | } |
| | | let legendData = [] |
| | | let seriesData = [] |
| | | let colorArr = ['#09F39E', '#A5F10D', '#09B3F6'] |
| | | legendData = newData.yAxis.map((item) => item.name) |
| | | seriesData = newData.yAxis.map((item1, index1) => { |
| | | return { |
| | | name: item1.name, |
| | | type: 'line', |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | itemStyle: { |
| | | color: colorArr[index1] |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | yAxisIndex: 1, |
| | | data: item1.value // æçº¿å¾çæ°æ® |
| | | } |
| | | }) |
| | | const option = { |
| | | grid: { |
| | | containLabel: true, |
| | | bottom: '1%', |
| | | top: '15%', |
| | | left: '2%', |
| | | right: '1%' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | legend: { |
| | | top: 20, |
| | | right: 'center', |
| | | data: legendData, |
| | | itemGap: 10, |
| | | textStyle: { |
| | | fontSize: 14, |
| | | color: '#ccc' |
| | | } |
| | | }, |
| | | xAxis: { |
| | | triggerEvent: true, |
| | | data: newData.xAxis || [], |
| | | axisLabel: { |
| | | interval: 0, |
| | | show: true, |
| | | fontSize: 12, |
| | | color: '#50729A' |
| | | // rotate: -30, |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | show: true, |
| | | alignWithLabel: true |
| | | } |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | name: newData.yAxisName, |
| | | nameTextStyle: { |
| | | color: '#00A8AC', |
| | | fontSize: 18, |
| | | padding: [0, 0, 0, 80] |
| | | }, |
| | | nameGap: 30, |
| | | type: 'value', |
| | | position: 'left', |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: '#3E4A82' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: 'value', |
| | | position: 'right', |
| | | splitNumber: 5, |
| | | axisLabel: { |
| | | show: true, |
| | | color: '#50729A' |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | show: true |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: '#3E4A82' |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | series: seriesData, |
| | | // dataZoom: { |
| | | // show: false, |
| | | // startValue: 0, // ä»å¤´å¼å§ã |
| | | // endValue: 5 // 䏿¬¡æ§å±ç¤ºå 个 |
| | | // } |
| | | } |
| | | this.lineChart.setOption(option, true) |
| | | // if (newData.xAxis.length <= 6) return |
| | | // this.lineChartCarouselTime = setInterval(() => { |
| | | // this.barChartData.push(this.barChartData.shift()) |
| | | // newData.xAxis.push(newData.xAxis.shift()) |
| | | // newData.yAxis.forEach(item => item.value.push(item.value.shift())) |
| | | // this.$nextTick(() => { |
| | | // this.lineChart.setOption(option, true) |
| | | // }) |
| | | // }, 3000) |
| | | }, |
| | | |
| | | /* ç»å¶ä»ªè¡¨çå¾è¡¨ */ |
| | | drawGaugeChart() { |
| | | const option = { |
| | | title: { |
| | | show: true, // æ¯å¦æ¾ç¤ºæ é¢ï¼é»è®¤ä¸ºtrue |
| | | text: '', // 主æ é¢ææ¬ |
| | | x: 'center', // æ 颿°´å¹³å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'left'ã'center'ã'right'æå
·ä½çæ°´å¹³åæ å¼ |
| | | y: 'top', // æ é¢åç´å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'top'ã'bottom'ã'center'æå
·ä½çåç´åæ å¼ |
| | | textStyle: { |
| | | // 主æ é¢ææ¬æ ·å¼ |
| | | fontSize: 18, |
| | | fontWeight: 'normal', |
| | | color: '#00A8AC', |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | formatter: '{a} <br/>{b} : {c}%' |
| | | }, |
| | | grid: { |
| | | left: '1%', |
| | | top: '1%', |
| | | right: '10%', |
| | | bottom: '1%' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'å©ç¨ç', |
| | | type: 'gauge', |
| | | radius: '80%', |
| | | center: ['50%', '60%'], // é»è®¤å
¨å±å±
ä¸ |
| | | pointer: { |
| | | width: 6, |
| | | length: '50%', |
| | | itemStyle: { |
| | | color: 'inherit' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | length: 10, |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 2 |
| | | } |
| | | }, |
| | | axisTick: { |
| | | length: 5, |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 1 |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: false, |
| | | fontSize: 18, |
| | | formatter: function(value) { |
| | | return value + '%' |
| | | } |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { // 屿§lineStyleæ§å¶çº¿æ¡æ ·å¼ |
| | | color: [ //表çé¢è² |
| | | [0.3, '#E7781E'],//0-30%å¤çé¢è² |
| | | [0.7, '#C5C039'],//30%-60%å¤çé¢è² |
| | | [1, '#21C77F']//90%-100%å¤çé¢è² |
| | | ], |
| | | width: 15//表ç宽度 |
| | | } |
| | | }, |
| | | detail: { |
| | | formatter: '{score|{value}%}', |
| | | offsetCenter: [0, '50%'], |
| | | height: 30, |
| | | rich: { |
| | | score: { |
| | | fontSize: 20 |
| | | } |
| | | } |
| | | }, |
| | | data: [{ value: 100 }] |
| | | } |
| | | ] |
| | | } |
| | | this.drawGaugeChart1(option) |
| | | this.drawGaugeChart2(option) |
| | | this.drawGaugeChart3(option) |
| | | this.drawGaugeChart4(option) |
| | | }, |
| | | |
| | | /* ç»å¶å©ç¨ç仪表çå¾è¡¨ */ |
| | | drawGaugeChart1(opt) { |
| | | this.gaugeChart1 = this.$echarts.init(document.getElementById('gauge_chart1')) |
| | | const option = Object.assign({}, opt) |
| | | option.title.text = 'å©ç¨ç' |
| | | this.gaugeChart1.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶å¼å¨ç仪表çå¾è¡¨ */ |
| | | drawGaugeChart2(opt) { |
| | | this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2')) |
| | | const option = Object.assign({}, opt) |
| | | option.title.text = 'å¼å¨ç' |
| | | this.gaugeChart2.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶å¼æºç仪表çå¾è¡¨ */ |
| | | drawGaugeChart3(opt) { |
| | | this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3')) |
| | | const option = Object.assign({}, opt) |
| | | option.title.text = '弿ºç' |
| | | this.gaugeChart3.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶OEE仪表çå¾è¡¨ */ |
| | | drawGaugeChart4(opt) { |
| | | this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4')) |
| | | const option = Object.assign({}, opt) |
| | | option.title.text = 'OEE' |
| | | this.gaugeChart4.setOption(option, true) |
| | | }, |
| | | |
| | | /* ç»å¶åæ±å¾ */ |
| | | drawBarChart() { |
| | | this.barChart = this.$echarts.init(document.getElementById('bar_chart')) |
| | | const xAisData = this.barChartData.map(item => item.name) |
| | | const option = { |
| | | height: 260, |
| | | title: { |
| | | show: true, // æ¯å¦æ¾ç¤ºæ é¢ï¼é»è®¤ä¸ºtrue |
| | | text: 'ä¸ä¸ªæOEE', // 主æ é¢ææ¬ |
| | | x: 'center', // æ 颿°´å¹³å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'left'ã'center'ã'right'æå
·ä½çæ°´å¹³åæ å¼ |
| | | y: 'top', // æ é¢åç´å®æ¾ä½ç½®ï¼å¯éå¼ä¸º'top'ã'bottom'ã'center'æå
·ä½çåç´åæ å¼ |
| | | textStyle: { |
| | | // 主æ é¢ææ¬æ ·å¼ |
| | | fontSize: 18, |
| | | fontWeight: 'normal', |
| | | color: '#00A8AC', |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | }, |
| | | // backgroundColor: 'rgba(9, 24, 48, 0.5)', |
| | | borderColor: 'rgba(75, 253, 238, 0.4)', |
| | | textStyle: { |
| | | // color: '#CFE3FC' |
| | | }, |
| | | borderWidth: 1 |
| | | }, |
| | | grid: { |
| | | top: '15%', |
| | | left: '6%', |
| | | right: '3%' |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | // name: 'ä¸ä¸ªæOEE', |
| | | // nameLocation: 'middle', |
| | | // nameGap: 40, // xè½´name䏿¨ªåæ 轴线çé´è· |
| | | type: 'category', |
| | | data: xAisData, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | show: true, // æ¯å¦æ¾ç¤ºå»åº¦æ ç¾ï¼é»è®¤æ¾ç¤º |
| | | interval: 0, // åæ è½´å»åº¦æ ç¾çæ¾ç¤ºé´éï¼å¨ç±»ç®è½´ä¸ææï¼é»è®¤ä¼éç¨æ ç¾ä¸éå ççç¥é´éæ¾ç¤ºæ ç¾ï¼å¯ä»¥è®¾ç½®æ0å¼ºå¶æ¾ç¤ºæææ ç¾ï¼å¦æè®¾ç½®ä¸º1ï¼è¡¨ç¤ºãéä¸ä¸ªæ ç¾æ¾ç¤ºä¸ä¸ªæ ç¾ãï¼å¦æå¼ä¸º2ï¼è¡¨ç¤ºé两个æ ç¾æ¾ç¤ºä¸ä¸ªæ ç¾ï¼ä»¥æ¤ç±»æ¨ã |
| | | // rotate: this.barChartData.length >= 5 ? -30 : 0, // å»åº¦æ ç¾æè½¬çè§åº¦ï¼å¨ç±»ç®è½´çç±»ç®æ ç¾æ¾ç¤ºä¸ä¸çæ¶åå¯ä»¥éè¿æè½¬é²æ¢æ ç¾ä¹é´éå ï¼æè½¬çè§åº¦ä»-90度å°90度 |
| | | inside: false, // å»åº¦æ ç¾æ¯å¦æå
ï¼é»è®¤æå¤ |
| | | margin: 6 // å»åº¦æ ç¾ä¸è½´çº¿ä¹é´çè·ç¦» |
| | | }, |
| | | axisTick: { |
| | | show: true, |
| | | alignWithLabel: true |
| | | } |
| | | }], |
| | | yAxis: [ |
| | | { |
| | | // name: 'æ°é', |
| | | // nameLocation: 'middle', |
| | | // nameGap: 30, // xè½´name䏿¨ªåæ 轴线çé´è· |
| | | position: 'left', |
| | | axisLabel: { |
| | | formatter: '{value}', |
| | | color: '#50729A' |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,0.12)' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | position: 'right', |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#50729A' |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | series: [{ |
| | | type: 'bar', |
| | | data: this.barChartData, |
| | | barWidth: '25%', |
| | | itemStyle: { |
| | | color: '#129FC6', |
| | | barBorderRadius: [10, 10, 10, 10] |
| | | }, |
| | | label: { |
| | | show: false, |
| | | lineHeight: 10, |
| | | formatter: params => { |
| | | if (+params.value === 0) return '' |
| | | else return params.value |
| | | }, |
| | | position: 'inside', |
| | | textStyle: { |
| | | color: '#50729A', |
| | | fontSize: 18 |
| | | } |
| | | } |
| | | }], |
| | | dataZoom: { |
| | | show: false, |
| | | startValue: 0, // ä»å¤´å¼å§ã |
| | | endValue: 5 // 䏿¬¡æ§å±ç¤ºå 个 |
| | | } |
| | | } |
| | | option.title.text = `${moment().subtract(1, 'months').format('M')}æOEE` |
| | | this.barChart.setOption(option, true) |
| | | if (this.barChartData.length <= 6) return |
| | | this.barChartCarouselTime = setInterval(() => { |
| | | this.barChartData.push(this.barChartData.shift()) |
| | | xAisData.push(xAisData.shift()) |
| | | this.$nextTick(() => { |
| | | this.barChart.setOption(option, true) |
| | | }) |
| | | }, 3000) |
| | | }, |
| | | |
| | | /** |
| | | * çªå£å°ºå¯¸ååæ¶è§¦å |
| | | * è°æ´å¾è¡¨å°ºå¯¸ä»¥éåºå辨ç |
| | | */ |
| | | handleWindowResize() { |
| | | if (this.techConditionChart) this.techConditionChart.resize() |
| | | if (this.warrantyMalfunctionChart) this.warrantyMalfunctionChart.resize() |
| | | if (this.runningStateChart) this.runningStateChart.resize() |
| | | if (this.lineChart) this.lineChart.resize() |
| | | if (this.gaugeChart1) this.gaugeChart1.resize() |
| | | if (this.gaugeChart2) this.gaugeChart2.resize() |
| | | if (this.gaugeChart3) this.gaugeChart3.resize() |
| | | if (this.gaugeChart4) this.gaugeChart4.resize() |
| | | if (this.barChart) this.barChart.resize() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .page-container { |
| | | .page-title { |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | flex-wrap: wrap; |
| | | color: #fff; |
| | | margin-bottom: 10px; |
| | | |
| | | .workshop-nav { |
| | | width: 120px; |
| | | height: 40px; |
| | | font-size: 12px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | .content-container { |
| | | padding-top: 5px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .left-col { |
| | | .back-nav { |
| | | width: 100px; |
| | | height: 30px; |
| | | color: #eee; |
| | | position: absolute; |
| | | top: 50px; |
| | | left: 10px; |
| | | cursor: pointer; |
| | | z-index: 9999 |
| | | } |
| | | |
| | | .support-plan-container { |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | flex-wrap: wrap; |
| | | color: #fff; |
| | | padding-top: 5px; |
| | | |
| | | .support-plan-item { |
| | | border-radius: 3px; |
| | | width: 45%; |
| | | padding: 5px 10px; |
| | | margin-bottom: 10px; |
| | | |
| | | .plan-value-container { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | .plan-value { |
| | | margin-right: 20px; |
| | | font-size: 30px; |
| | | color: #EAC910; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .middle-col { |
| | | .first-title { |
| | | color: #00A8AC; |
| | | font-size: 20px; |
| | | text-align: center; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .ant-form.ant-form-inline { |
| | | text-align: center; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | /deep/ .ant-form .ant-form-item-label label { |
| | | color: #fff; |
| | | font-size: 18px; |
| | | } |
| | | |
| | | /deep/ .ant-select-selection { |
| | | background: transparent !important; |
| | | } |
| | | |
| | | /deep/ .ant-select-selection__clear { |
| | | background: transparent !important; |
| | | color: #fff; |
| | | } |
| | | |
| | | /deep/ .ant-input { |
| | | border: 1px solid #689ACA; |
| | | color: #fff; |
| | | background: transparent !important; |
| | | } |
| | | </style> |