420项目:
1、大屏车间管理页面新增及编辑时随意输入车间名称调整为选择已有车间
2、增加车间看板拖拽及缩放功能权限功能
3、实现车间看板设备状态数量及图表数据由后台驱动
4、车间看板页面月、周、日利用率图表数据由后台驱动
5、车间看板页面报警信息列表数据由后台驱动
6、车间看板页面调整右侧设备状态判定,同时加入异常状态展示(设备编号背景色变为红色)
| | |
| | | export default { |
| | | // è·åæ§å¶ç³»ç»ç±»å |
| | | getDriveTypeApi: () => getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions'), |
| | | // -------------------------------------车é´çæ¿é¡µé¢-------------------------------------------- |
| | | // é¦é¡µè·å大å±å
¥å£è½¦é´å表 |
| | | getWorkshopListInHomePageApi: () => getAction('/mdc/mdcWorkshopInfo/getWorkshopList'), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢è®¾å¤å表 |
| | | getDeviceListByWorkshopIdApi: params => getAction('/mdc/mdcWorkshopInfo/workshopEquipmentList', params), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢è½¦é´è¯¦ç»ä¿¡æ¯ |
| | | getWorkshopDetailByWorkshopIdApi: id => getAction('/mdc/mdcWorkshopInfo/queryById', { id }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å¤§å±ä¿¡æ¯ |
| | | getDeviceListInWorkshopSignagePageApi: workshopId => getAction('/mdc/mdcWorkshopInfo/getBigScreenInfo', { workshopId }), |
| | | // ä¿å大å±è½¦é´è®¾å¤åæ 大å°ä¿¡æ¯ |
| | | saveDevicePositionAndSizeApi: params => putAction('/mdc/mdcWorkshopInfo/saveEquipmentCoordinate', params), |
| | | // æ¥è¯¢è½¦é´å表 |
| | | getWorkshopListApi: params => getAction('/mdc/mdcWorkshopInfo/list', params), |
| | | // æ°å¢è½¦é´ä¿¡æ¯ |
| | | addWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/add', params), |
| | | // ç¼è¾è½¦é´ä¿¡æ¯ |
| | | editWorkshopApi: params => putAction('/mdc/mdcWorkshopInfo/edit', params), |
| | | // å é¤å个车é´ä¿¡æ¯ |
| | | deleteSingleWorkshopApi: id => deleteAction('/mdc/mdcWorkshopInfo/delete', { id }), |
| | | // æ¹éå é¤è½¦é´ä¿¡æ¯ |
| | | deleteBatchWorkshopApi: ids => deleteAction('/mdc/mdcWorkshopInfo/deleteBatch', { ids }), |
| | | // æ°å¢å¤§å±è½¦é´å设å¤å
³ç³» |
| | | addDeviceInWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/addWorkshopEquipment', params), |
| | | // å é¤å个大å±è½¦é´å设å¤å
³ç³» |
| | | deleteSingleDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', params), |
| | | // æ¹éå é¤å¤§å±è½¦é´å设å¤å
³ç³» |
| | | deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params), |
| | | // -------------------------------------设å¤åæ°éå¼ç®¡ç页é¢-------------------------------------------- |
| | | // æ ¹æ®é©±å¨ç±»åè·ååæ° |
| | | getParamListByDriveTypeApi: controlSystemType => getAction(`/mdc/mdcDriveTypeParamConfig/getDriveParamOptionsByType?controlSystemType=${controlSystemType}`), |
| | |
| | | export default { |
| | | // é¦é¡µè·å大å±å
¥å£è½¦é´å表 |
| | | getWorkshopListInHomePageApi: () => getAction('/mdc/mdcWorkshopInfo/getWorkshopList'), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢è®¾å¤å表 |
| | | getDeviceListByWorkshopIdApi: params => getAction('/mdc/mdcWorkshopInfo/workshopEquipmentList', params), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢è½¦é´è¯¦ç»ä¿¡æ¯ |
| | | getWorkshopDetailByWorkshopIdApi: id => getAction('/mdc/mdcWorkshopInfo/queryById', { id }), |
| | | getWorkshopDetailByWorkshopIdApi: productionId => getAction('/mdc/mdcWorkshopInfo/queryByProductionId', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å¤§å±ä¿¡æ¯ |
| | | getDeviceListInWorkshopSignagePageApi: workshopId => getAction('/mdc/mdcWorkshopInfo/getBigScreenInfo', { workshopId }), |
| | | getDeviceListInWorkshopSignagePageApi: productionId => getAction('/mdc/mdcWorkshopInfo/getBigScreenInfo', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å½åè½¦é´ææè®¾å¤çç¶ææ°é |
| | | getDeviceStatusCountApi: productionId => getAction('/mdc/largeScreen/equipmentStatusOverview', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å½åè½¦é´ æ å©ç¨çè¶å¿ |
| | | getMonthUtilizationRateApi: productionId => getAction('/mdc/largeScreen/monthUtilizationTendency', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å½åè½¦é´ å¨ å©ç¨çè¶å¿ |
| | | getWeekUtilizationRateApi: productionId => getAction('/mdc/largeScreen/weekUtilizationTendency', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å½åè½¦é´ æ¥ å©ç¨çè¶å¿ |
| | | getDayUtilizationRateApi: productionId => getAction('/mdc/largeScreen/dayUtilizationTendency', { productionId }), |
| | | // æ ¹æ®è½¦é´idæ¥è¯¢å½å车é´è®¾å¤æ¥è¦ä¿¡æ¯ |
| | | getWorkshopAlarmInfoApi: productionId => getAction('/mdc/largeScreen/getAlarmInfo', { productionId }), |
| | | // ä¿å大å±è½¦é´è®¾å¤åæ 大å°ä¿¡æ¯ |
| | | saveDevicePositionAndSizeApi: params => putAction('/mdc/mdcWorkshopInfo/saveEquipmentCoordinate', params), |
| | | // æ¥è¯¢è½¦é´å表 |
| | | getWorkshopListApi: params => getAction('/mdc/mdcWorkshopInfo/list', params), |
| | | // æ°å¢è½¦é´ä¿¡æ¯ |
| | | addWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/add', params), |
| | | // ç¼è¾è½¦é´ä¿¡æ¯ |
| | | editWorkshopApi: params => putAction('/mdc/mdcWorkshopInfo/edit', params), |
| | | // å é¤å个车é´ä¿¡æ¯ |
| | | deleteSingleWorkshopApi: id => deleteAction('/mdc/mdcWorkshopInfo/delete', { id }), |
| | | // æ¹éå é¤è½¦é´ä¿¡æ¯ |
| | | deleteBatchWorkshopApi: ids => deleteAction('/mdc/mdcWorkshopInfo/deleteBatch', { ids }), |
| | | // æ°å¢å¤§å±è½¦é´å设å¤å
³ç³» |
| | | addDeviceInWorkshopApi: params => postAction('/mdc/mdcWorkshopInfo/addWorkshopEquipment', params), |
| | | // å é¤å个大å±è½¦é´å设å¤å
³ç³» |
| | | deleteSingleDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', params), |
| | | // æ¹éå é¤å¤§å±è½¦é´å设å¤å
³ç³» |
| | | deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params), |
| | | // è·åäºçº§è½¦é´ä¿¡æ¯ |
| | | getWorkshopListApi: () => getAction('/mdc/mdcWorkshopInfo/getProductionList') |
| | | } |
| | |
| | | ] |
| | | }, |
| | | { |
| | | path: '/WorkshopSignage/:id', |
| | | path: '/WorkshopSignage/:productionId', |
| | | component: () => import('@/views/mdc/base/WorkshopSignage.vue') |
| | | }, |
| | | { |
| | |
| | | :grid="{ gutter: [{xs: 0, sm: 24, md: 24, lg: 56, xl: 64, xxl: 80},20], xs: 1, sm: 2, md: 2, lg: 3, xl: 4, xxl: 4 }" |
| | | :data-source="workshopList"> |
| | | <a-list-item slot="renderItem" slot-scope="item, index"> |
| | | <div class="workshop-name" @click="navigateToWorkshopSignage(item.id)">{{item.workshopName}}</div> |
| | | <div class="workshop-name" @click="navigateToWorkshopSignage(item.productionId)">{{item.workshopName}}</div> |
| | | </a-list-item> |
| | | </a-list> |
| | | </div> |
| | |
| | | methods: { |
| | | /** |
| | | * éè¿è½¦é´Id跳转è³ç¸åºè½¦é´å¤§å±çæ¿ |
| | | * @param id 车é´Id |
| | | * @param productionId 车é´Id |
| | | */ |
| | | navigateToWorkshopSignage(id) { |
| | | const url = this.$router.resolve(`/WorkshopSignage/${id}`).href |
| | | navigateToWorkshopSignage(productionId) { |
| | | const url = this.$router.resolve(`/WorkshopSignage/${productionId}`).href |
| | | window.open(url, '_blank') |
| | | }, |
| | | /** |
| | |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'DayUtilizationRateTrend', |
| | | components: {}, |
| | | props: { |
| | | currentProductionId: { |
| | | type: String |
| | | }, |
| | | toDecimal2NoZero: { |
| | | type: Function |
| | | } |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getChartDataByApi() |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | if (!this.currentProductionId) return |
| | | this.getChartDataByApi() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | }, |
| | | methods: { |
| | | getChartDataByApi() { |
| | | const that = this |
| | | this.chartContainer = this.$echarts.init(document.getElementById(this.chartContainerId)) |
| | | this.initChart() |
| | | signageApi.getDayUtilizationRateApi(this.currentProductionId) |
| | | .then(res => { |
| | | console.log('res==========', res) |
| | | if (!res.success) return |
| | | that.initChart(res.result) |
| | | }) |
| | | }, |
| | | |
| | | initChart() { |
| | | const data = [ |
| | | { |
| | | 'number': 'A_1', |
| | | 'name': '1-Dç¹ç§å·¥èº', |
| | | 'count': 0.4452, |
| | | 'planCount': null, |
| | | 'rateCount': null |
| | | }, |
| | | { |
| | | 'number': 'A_2', |
| | | 'name': '2-Dæ´ä½æºå£', |
| | | 'count': 0.7642, |
| | | 'planCount': null, |
| | | 'rateCount': null |
| | | }, |
| | | { |
| | | 'number': 'A_3', |
| | | 'name': '3-Dçç§å®¤æºå£', |
| | | 'count': 0.4523, |
| | | 'planCount': null, |
| | | 'rateCount': null |
| | | }, |
| | | { |
| | | 'number': 'A_4', |
| | | 'name': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'count': 0.6987, |
| | | 'planCount': null, |
| | | 'rateCount': null |
| | | }, |
| | | { |
| | | 'number': 'A_5', |
| | | 'name': '5-D CRICåå
', |
| | | 'count': 0.8924, |
| | | 'planCount': null, |
| | | 'rateCount': null |
| | | }, |
| | | ] |
| | | const xAxisData = [] |
| | | initChart(dataObj) { |
| | | const seriesData = [] |
| | | const option = { |
| | | tooltip: { |
| | |
| | | }, |
| | | //barCategoryGap:'180%', |
| | | itemStyle: { |
| | | normal: { |
| | | barBorderRadius: '', |
| | | color: function(params) { |
| | | const colorList = [ |
| | | //1-Dç¹ç§å·¥èºåå
|
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#9cc4f6' }, |
| | | { offset: 1, color: '#538dd6' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffffa2' }, |
| | | { offset: 1, color: '#ffff01' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#97fcc5' }, |
| | | { offset: 1, color: '#0bae8d' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffbc85' }, |
| | | { offset: 1, color: '#e26c0a' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#fb78ba' }, |
| | | { offset: 1, color: '#8f0149' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //ç¯ä»¶åå
|
| | | { offset: 0, color: '#d297ff' }, |
| | | { offset: 1, color: '#7030a0' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffe491' }, |
| | | { offset: 1, color: '#8f6c00' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffb6b9' }, |
| | | { offset: 1, color: '#fd4c53' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#92cbba' }, |
| | | { offset: 1, color: '#18a387' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ff5b62' }, |
| | | { offset: 1, color: '#a02100' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#b5d5e3' }, |
| | | { offset: 1, color: '#1b8bd0' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //ä¸å°æºå£åå
|
| | | { offset: 0, color: '#ebd3ff' }, |
| | | { offset: 1, color: '#e889ff' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#D69123' }, |
| | | { offset: 1, color: '#a16900' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //ä½å导å |
| | | { offset: 0, color: '#d588c8' }, |
| | | { offset: 1, color: '#9545AE' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //ä½åå¶ç 1 4 |
| | | { offset: 0, color: '#97abd6' }, |
| | | { offset: 1, color: '#6268b2' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#d7dab2' }, |
| | | { offset: 1, color: '#b8aa15' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#e9c9b0' }, |
| | | { offset: 1, color: '#D9646A' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#a4e3d6' }, |
| | | { offset: 1, color: '#01A55E' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | |
| | | { offset: 0, color: '#2052b1' }, |
| | | { offset: 1, color: '#002b73' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //çä»¶åå
|
| | | { offset: 0, color: '#3e71e2' }, |
| | | { offset: 1, color: '#0042c8' } |
| | | ] |
| | | ), new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | //ç»æä»¶åå
|
| | | { offset: 0, color: '#99d6cf' }, |
| | | { offset: 1, color: '#21bf90' } |
| | | ] |
| | | ) |
| | | , new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | // 7-D |
| | | { offset: 0, color: '#99d6cf' }, |
| | | { offset: 1, color: '#0ad0bb' } |
| | | ] |
| | | ) |
| | | , new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#FF9297' }, |
| | | { offset: 1, color: '#FF9297' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#fb78ba' }, |
| | | { offset: 1, color: '#ff77dc' } |
| | | ] |
| | | ), |
| | | //ä¸å |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#9cc4f6' }, |
| | | { offset: 1, color: '#538dd6' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffffa2' }, |
| | | { offset: 1, color: '#ffff01' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#0bae8d' }, |
| | | { offset: 1, color: '#0bae8d' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#ffbc85' }, |
| | | { offset: 1, color: '#e26c0a' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#97abd6' }, |
| | | { offset: 1, color: '#842cb2' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#99d6cf' }, |
| | | { offset: 1, color: '#0ad0bb' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#FF9297' }, |
| | | { offset: 1, color: '#FF9297' } |
| | | ] |
| | | ), |
| | | new echarts.graphic.LinearGradient( |
| | | 0, 0, 1, 0, |
| | | [ |
| | | { offset: 0, color: '#fb78ba' }, |
| | | { offset: 1, color: '#ff77dc' } |
| | | ] |
| | | ) |
| | | ] |
| | | if (params.name == '1-Dç¹ç§å·¥èº' || params.name == 'åæ°æºä¸' || params.name == '1-Dç¹ç§å·¥èºåå
') { |
| | | return colorList[24] |
| | | } |
| | | if (params.name == '2-Dæ´ä½æºå£' || params.name == '2-Dæ´ä½æºå£åå
') { |
| | | return colorList[25] |
| | | } |
| | | if (params.name == '3-Dçç§å®¤æºå£' || params.name == 'çç§å®¤æºå£' || params.name == '3-Dåæ°æºæºå£åå
' || params.name == '3-Dåæ°æºæºå£') { |
| | | return colorList[26] |
| | | } |
| | | if (params.name == '4-Dçæ¥æºå£å·¥æ®µ' || params.name == 'ä¸å·¥æ®µ' || params.name == 'æ¯æ¶å°ç¯ä»¶åå
' || params.name == '4-Dçæ¥æºå£åå
') { |
| | | return colorList[27] |
| | | } |
| | | if (params.name == '5-D CRICåå
' || params.name == '10-Dé¨ä»¶è£
é
åå
') { |
| | | return colorList[4] |
| | | } |
| | | if (params.name == '6-D飿åå
' || params.name == '6-D飿æºå£åå
') { |
| | | return colorList[28] |
| | | } |
| | | if (params.name == '7-Dæ¶¡è½®æºå£' || params.name == '7-Dæ¶¡è½®æºå£åå
') { |
| | | return colorList[29] |
| | | } |
| | | if (params.name == '8-Dç§ç 工段' || params.name == 'ç§ç 工段' || params.name == '8-Dç§ç åå
') { |
| | | return colorList[30] |
| | | } |
| | | if (params.name == '10-Dé¨ä»¶è£
é
' || params.name == '10-Dé¨ä»¶è£
é
åå
') { |
| | | return colorList[31] |
| | | } |
| | | if (params.name == 'JD-2ååæºå ' || params.name == 'ååæºå 工段' || params.name == 'å工段') { |
| | | return colorList[8] |
| | | } |
| | | if (params.name == '10-Dç产室' || params.name == 'IGVå¶ç') { |
| | | return colorList[9] |
| | | } |
| | | |
| | | if (params.name == 'äºå·¥æ®µ') { |
| | | return colorList[10] |
| | | } |
| | | if (params.name == 'å
工段' || params.name == 'ä¸å°æºå£åå
') { |
| | | return colorList[11] |
| | | } |
| | | if (params.name == 'æ¶¡è½®å¶ç') { |
| | | return colorList[12] |
| | | } |
| | | if (params.name == 'ä½å导å') { |
| | | return colorList[13] |
| | | } |
| | | if (params.name == 'ä½åå¶ç') { |
| | | return colorList[14] |
| | | } |
| | | if (params.name == '导åå¶ç') { |
| | | return colorList[15] |
| | | } |
| | | if (params.name == 'åæ°æºäº') { |
| | | return colorList[16] |
| | | } |
| | | if (params.name == 'æ´æµä¸') { |
| | | return colorList[17] |
| | | } |
| | | if (params.name == 'æ´æµäº') { |
| | | return colorList[19] |
| | | } |
| | | if (params.name == 'ä¸å·¥æ®µ' || params.name == 'çä»¶åå
') { |
| | | return colorList[19] |
| | | } |
| | | if (params.name == 'äºå·¥æ®µ' || params.name == 'ç»æä»¶åå
') { |
| | | return colorList[20] |
| | | } |
| | | if (params.name == 'ä¸å·¥æ®µ' || params.name == 'ç¯ä»¶åå
') { |
| | | return colorList[5] |
| | | } |
| | | // build a color map as your need. |
| | | |
| | | //return colorList[params.dataIndex] |
| | | } |
| | | color: params => { |
| | | const colorList = ['#538dd6', '#ffff01', '#0bae8d', '#e26c0a', '#F6E1BE', '#7030a0', '#0ad0bb', '#FF9297', '#A40035'] |
| | | return colorList[params.dataIndex] |
| | | }, |
| | | emphasis: { |
| | | barBorderRadius: 13, |
| | |
| | | } |
| | | ] |
| | | } |
| | | data.forEach(item => { |
| | | xAxisData.push(item.name == null ? '' : item.name) |
| | | dataObj.dataList.forEach(item => { |
| | | seriesData.push({ |
| | | value: this.toDecimal2NoZero(((item.count == null ? '' : item.count) * 100) > 100 ? 100 : (((item.count == null ? '' : item.count) * 100))), |
| | | hostType: (item.number == null ? '' : item.number) |
| | | value: item.utilizationRate, |
| | | hostType: (item.productionName ? item.productionName : '') |
| | | }) |
| | | }) |
| | | option.xAxis[0].data = xAxisData |
| | | option.xAxis[0].data = dataObj.productionList |
| | | option.series[0].data = seriesData |
| | | this.chartContainer.setOption(option, true) |
| | | }, |
| | |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | config: {}, |
| | | dataSource: [] |
| | | config: {} |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | getDeviceAlarmInfoByApi() { |
| | | const that = this |
| | | that.initChart() |
| | | // signageApi.getWorkshopAlarmInfoApi() |
| | | // .then(res => { |
| | | // if (res.success) { |
| | | // that.dataSource = res.result |
| | | // that.initChart() |
| | | // } |
| | | // }) |
| | | signageApi.getWorkshopAlarmInfoApi() |
| | | .then(res => { |
| | | if (!res.success) return |
| | | that.initChart(res.result) |
| | | }) |
| | | }, |
| | | |
| | | initChart() { |
| | | initChart(dataSource = []) { |
| | | this.config = { |
| | | // indexHeader: 'åºå·', |
| | | header: ['设å¤ç¼å·', 'æ¥è¦æ¶é´', 'æ¥è¦å·'], |
| | | headerBGC: '#333', |
| | | oddRowBGC: 'transparent', |
| | | evenRowBGC: 'transparent', |
| | | // data: this.dataSource.map(item => { |
| | | // return [item.equipmentId, item.collectTime, item.alarm] |
| | | // }), |
| | | data: [['516313', 'AASDASD', 'ASDADA'], ['ASDSA', '213ASD', '1651ZS'], ['DSXC42', 'SD5846', '2316SD'], ['dasd13', '213asd', '21558xc'], ['dasads522', 'dsa4812', 'asd233'], ['123124', 'zxc32695', '42352s']], |
| | | data: dataSource.map(item => { |
| | | return [item.equipmentId, item.collectTime, item.alarmNo] |
| | | }), |
| | | // data: [['516313', 'AASDASD', 'ASDADA'], ['ASDSA', '213ASD', '1651ZS'], ['DSXC42', 'SD5846', '2316SD'], ['dasd13', '213asd', '21558xc'], ['dasads522', 'dsa4812', 'asd233'], ['123124', 'zxc32695', '42352s']], |
| | | rowNum: 2, |
| | | index: false, |
| | | // columnWidth: [300, 300], |
| | |
| | | <template> |
| | | <div> |
| | | <div class="guideline guidelineX" :style="{top:guidelineXTop+'px',display:showGuideline}"></div> |
| | | <div class="guideline guidelineY" :style="{left:guidelineYLeft+'px',display:showGuideline}"></div> |
| | | <VueDragResize |
| | | v-for="(item, index) in deviceList" |
| | | :key="item.equipmentId" |
| | |
| | | :parentW="1500" |
| | | :minw="70" |
| | | :minh="70" |
| | | :isDraggable="true" |
| | | :isResizable="true" |
| | | :isDraggable="isSwitchChecked" |
| | | :isResizable="isSwitchChecked" |
| | | :stickSize="6" |
| | | @deactivated="showGuideline = 'none'" |
| | | @deactivated="isShowGuideline = false" |
| | | > |
| | | <div class="single-device" :style="{ width: item.vw + 'px', height: item.vh + 'px' }"> |
| | | <div class="device-status"> |
| | | <div |
| | | v-if="item.equipmentStatus == 2 || item.equipmentStatus == 1" |
| | | :style="{ backgroundImage: `url(${require('@/assets/yellow.png')})` }" |
| | | class="status-image" |
| | | ></div> |
| | | <div |
| | | v-if="item.equipmentStatus == 22" |
| | | :style="{ backgroundImage: `url(${require('@/assets/red.png')})` }" |
| | | class="status-image" |
| | | ></div> |
| | | <div |
| | | v-if="item.equipmentStatus == 0" |
| | | :style="{ backgroundImage: `url(${require('@/assets/gray.png')})` }" |
| | | class="status-image" |
| | | ></div> |
| | | <div |
| | | v-if="item.equipmentStatus == 3" |
| | | :style="{ backgroundImage: `url(${require('@/assets/green.png')})` }" |
| | | class="status-image" |
| | | ></div> |
| | | <div |
| | | :style="{ backgroundImage: `url(${getImgView(item.equipmentImage) || require('@/assets/default.png')})` }" |
| | | :style="{ backgroundImage: `url(${getImgView(item.equipmentImage) || require('@/assets/WorskhopSignage/default.png')})` }" |
| | | class="device-image" |
| | | ></div> |
| | | > |
| | | <div |
| | | :style="{ backgroundImage: `url(${getCurrentDeviceStatusImage(item.oporation)})` }" |
| | | class="status-image" |
| | | ></div> |
| | | </div> |
| | | </div> |
| | | <div |
| | | :style="{ color:workshopDetails.equipmentIdColor?workshopDetails.equipmentIdColor:'#fff',marginTop:'10px' }"> |
| | | {{ item.equipmentId }} |
| | | </div> |
| | | <div :style="{backgroundColor:item.equipmentStatus!==0?'#f00':''}">{{ item.equipmentId }}</div> |
| | | </div> |
| | | </VueDragResize> |
| | | |
| | | <template v-if="isShowGuideline"> |
| | | <div class="guideline guidelineX" :style="{top:guidelineXTop+'px'}"></div> |
| | | <div class="guideline guidelineY" :style="{left:guidelineYLeft+'px'}"></div> |
| | | </template> |
| | | |
| | | <a-form layout="inline" v-has="'isCanDragAndResize'"> |
| | | <a-form-item label="åè½å¼å
³"> |
| | | <a-switch checked-children="å¼" un-checked-children="å
³" v-model="isSwitchChecked" |
| | | :disabled="isHasResizeOrDragDevice"/> |
| | | </a-form-item> |
| | | |
| | | <a-form-item label="ä¿ååæ "> |
| | | <a-button type="primary" icon="save" @click="saveDevicePositionAndSizeByApi" |
| | | :disabled="!isHasResizeOrDragDevice">ä¿å |
| | | </a-button> |
| | | </a-form-item> |
| | | </a-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import signageApi from '@/api/signage' |
| | | import VueDragResize from 'vue-drag-resize' |
| | | |
| | | export default { |
| | | name: 'DeviceDragLayout', |
| | | components: {}, |
| | | components: { |
| | | VueDragResize |
| | | }, |
| | | props: { |
| | | deviceList: { |
| | | currentProductionId: { |
| | | type: String |
| | | }, |
| | | getImgView: { |
| | | type: Function |
| | | }, |
| | | equipmentStatusList: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | showGuideline: 'none', |
| | | deviceList: [], |
| | | isShowGuideline: false, |
| | | guidelineXTop: 0, |
| | | guidelineYLeft: 0 |
| | | guidelineYLeft: 0, |
| | | isSwitchChecked: false, |
| | | isHasResizeOrDragDevice: false |
| | | } |
| | | }, |
| | | created() { |
| | | if (!this.currentProductionId) return |
| | | this.getDeviceListByApi() |
| | | }, |
| | | methods: { |
| | | // éè¿è½¦é´Idè°ç¨æ¥å£è·å设å¤ä¿¡æ¯å表 |
| | | getDeviceListByApi() { |
| | | const that = this |
| | | signageApi.getDeviceListInWorkshopSignagePageApi(that.currentProductionId).then((res) => { |
| | | if (res.success && res.result && res.result.length > 0) that.deviceList = res.result |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * è®¾å¤ææ½æç¼©æ¾æ¶è§¦åäºä»¶ |
| | | * @param newRect ææ½æç¼©æ¾åç尺寸åè·ç¦» |
| | | * @param index ææ½è®¾å¤å¨æ°ç»ä¸ç䏿 |
| | | */ |
| | | resize(newRect, index) { |
| | | this.showGuideline = 'block' |
| | | this.isShowGuideline = true |
| | | // å½è®¾å¤ç¼©æ¾æææ½åç¦ç¨switchç»ä»¶å¹¶å¼æ¾ä¿åæé®åè½ï¼é¿å
æ æè¯·æ±ï¼ |
| | | if (!this.isHasResizeOrDragDevice) { |
| | | if (this.deviceList[index].vw !== newRect.width || this.deviceList[index].vh !== newRect.height || this.deviceList[index].coordinateTop !== newRect.top || this.deviceList[index].coordinateLeft !== newRect.left) { |
| | | this.isHasResizeOrDragDevice = true |
| | | } |
| | | } |
| | | // this.isHasResizeOrDragDevice = true |
| | | this.deviceList[index].vw = newRect.width |
| | | this.deviceList[index].vh = newRect.height |
| | | this.deviceList[index].coordinateTop = newRect.top |
| | | this.deviceList[index].coordinateLeft = newRect.left |
| | | this.guidelineXTop = newRect.top + newRect.height / 2 |
| | | this.guidelineYLeft = newRect.left + newRect.width / 2 |
| | | }, |
| | | |
| | | // ç¹å»ä¿åæé®è°ç¨æ¥å£ä¿åææ½åçä½ç½®ä¸è®¾å¤å¾æ 尺寸 |
| | | saveDevicePositionAndSizeByApi() { |
| | | const that = this |
| | | signageApi.saveDevicePositionAndSizeApi(that.deviceList) |
| | | .then((res) => { |
| | | if (!res.success) return |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.isSwitchChecked = that.isHasResizeOrDragDevice = false |
| | | that.getDeviceListByApi(that.currentProductionId) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * è·åå½å设å¤ç¶æå¾ç |
| | | * @param oporation ç¶æç |
| | | * @returns {any} 设å¤ç¶æå¾çèµæº |
| | | */ |
| | | getCurrentDeviceStatusImage(oporation) { |
| | | const currentStatus = this.equipmentStatusList.find(item => item.value.includes(oporation)) |
| | | return currentStatus.statusImage |
| | | } |
| | | } |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'MonthUtilizationRateTrend', |
| | | components: {}, |
| | | props: { |
| | | currentProductionId: { |
| | | type: String |
| | | }, |
| | | toDecimal2NoZero: { |
| | | type: Function |
| | | } |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getChartDataByApi() |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | if (!this.currentProductionId) return |
| | | this.getChartDataByApi() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | }, |
| | | methods: { |
| | | getChartDataByApi() { |
| | | const that = this |
| | | this.chartContainer = this.$echarts.init(document.getElementById(this.chartContainerId)) |
| | | this.initChart() |
| | | signageApi.getMonthUtilizationRateApi(this.currentProductionId) |
| | | .then(res => { |
| | | if (!res.success) return |
| | | that.initChart(res.result) |
| | | }) |
| | | }, |
| | | |
| | | initChart() { |
| | | const data = [ |
| | | { |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'fullName': '1-Dç¹ç§å·¥èºåå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014831', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.2456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014820', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.3452, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014809', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.2453, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014798', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.5623, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014787', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.3254, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014776', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.7456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014765', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.5389, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:00' |
| | | }, |
| | | { |
| | | 'code': '000000014809', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '8æ', |
| | | 'lineRate': 0.2453, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014798', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '9æ', |
| | | 'lineRate': 0.5623, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014787', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '10æ', |
| | | 'lineRate': 0.3254, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014776', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '11æ', |
| | | 'lineRate': 0.7456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014765', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '12æ', |
| | | 'lineRate': 0.5389, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:00' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'fullName': '2-Dæ´ä½æºå£åå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014833', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.5234, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014822', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.63465, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014811', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.6747, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014800', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.8675, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014789', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.9774, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014778', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.5637, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014767', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.8565, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'fullName': '3-Dçç§å®¤æºå£åå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014834', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.6573, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014823', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.7567, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014812', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.8532, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014801', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.4352, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014790', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.3456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014779', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.1356, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014768', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.5346, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'fullName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014835', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.1333, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014824', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.5234, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014813', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.5631, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014802', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.2345, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014791', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.1333, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014780', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.3215, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014769', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.4122, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'fullName': '5-D CRICåå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014836', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.4234, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014825', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.1213, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014814', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.1245, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014803', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.2467, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014792', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.1579, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014781', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.6757, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014770', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.4563, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'fullName': null, |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014841', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '1æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014830', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014819', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '3æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014808', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '4æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014797', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '5æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014786', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '6æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014775', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '7æ', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | initChart(dataObj) { |
| | | const seriesArr = [] |
| | | const xAxisData = [] |
| | | const option = { |
| | | color: ['#538dd6', '#ffff01', '#0bae8d', '#e26c0a', '#F6E1BE', '#7030a0', '#0ad0bb', '#FF9297', '#A40035'], |
| | | tooltip: { |
| | |
| | | }, |
| | | series: [] |
| | | } |
| | | data.forEach(item1 => { |
| | | dataObj.dataList.forEach(item1 => { |
| | | const dataArr = [] |
| | | item1.list.forEach(item2 => { |
| | | item1.utilizationRateList.forEach(item2 => { |
| | | dataArr.push({ |
| | | value: this.toDecimal2NoZero(item2.lineRate * 100), |
| | | hostType: (item2.dayTime == null ? '' : item2.dayTime) |
| | | value: item2.utilizationRate, |
| | | hostType: (item2.date ? item2.date : '') |
| | | }) |
| | | xAxisData.push(item2.dayTime == null ? '' : item2.dayTime) |
| | | }) |
| | | if (item1.beltlineName == 'æ»å') { |
| | | if (item1.productionName == 'æ»å') { |
| | | seriesArr.push({ |
| | | name: item1.beltlineName, |
| | | name: item1.productionName, |
| | | type: 'line', |
| | | lineStyle: { width: 4, color: '#9cff45' }, |
| | | itemStyle: { color: '#50ff45' }, |
| | |
| | | }) |
| | | } else { |
| | | seriesArr.push({ |
| | | name: item1.fullName, |
| | | name: item1.productionName, |
| | | type: 'line', |
| | | lineStyle: { width: 2 }, |
| | | symbol: 'circle', |
| | |
| | | }) |
| | | } |
| | | }) |
| | | option.xAxis.data = Array.from(new Set(xAxisData)) |
| | | option.xAxis.data = dataObj.dateList |
| | | option.series = seriesArr |
| | | console.log(Array.from(new Set(xAxisData))) |
| | | console.log(seriesArr) |
| | | this.chartContainer.setOption(option, true) |
| | | }, |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'WeekUtilizationRateTrend', |
| | | components: {}, |
| | | props: { |
| | | currentProductionId: { |
| | | type: String |
| | | }, |
| | | toDecimal2NoZero: { |
| | | type: Function |
| | | } |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getChartDataByApi() |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | if (!this.currentProductionId) return |
| | | this.getChartDataByApi() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | }, |
| | | methods: { |
| | | getChartDataByApi() { |
| | | const that = this |
| | | this.chartContainer = this.$echarts.init(document.getElementById(this.chartContainerId)) |
| | | this.initChart() |
| | | signageApi.getWeekUtilizationRateApi(this.currentProductionId) |
| | | .then(res => { |
| | | if (!res.success) return |
| | | that.initChart(res.result) |
| | | }) |
| | | }, |
| | | |
| | | initChart() { |
| | | const data = [ |
| | | { |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'fullName': '1-Dç¹ç§å·¥èºåå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014831', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.2456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014820', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.3452, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014809', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.2453, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014798', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.5623, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014787', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.3254, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014776', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.7456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014765', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_1', |
| | | 'beltlineName': '1-Dç¹ç§å·¥èº', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.5389, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:00' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'fullName': '2-Dæ´ä½æºå£åå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014833', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.5234, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014822', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.63465, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014811', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.6747, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014800', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.8675, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014789', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.9774, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014778', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.5637, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014767', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_2', |
| | | 'beltlineName': '2-Dæ´ä½æºå£', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.8565, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'fullName': '3-Dçç§å®¤æºå£åå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014834', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.6573, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014823', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.7567, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014812', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.8532, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014801', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.4352, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014790', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.3456, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014779', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.1356, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014768', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_3', |
| | | 'beltlineName': '3-Dçç§å®¤æºå£', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.5346, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'fullName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014835', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.1333, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014824', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.5234, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014813', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.5631, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014802', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.2345, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014791', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.1333, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014780', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.3215, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014769', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_4', |
| | | 'beltlineName': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.4122, |
| | | 'processingLong': 11520.0000, |
| | | 'openingLong': 11520.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'fullName': '5-D CRICåå
', |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014836', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.4234, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014825', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.1213, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014814', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.1245, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014803', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.2467, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014792', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.1579, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014781', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.6757, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014770', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'A_5', |
| | | 'beltlineName': '5-D CRICåå
', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.4563, |
| | | 'processingLong': 0.0000, |
| | | 'openingLong': 0.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'fullName': null, |
| | | 'list': [ |
| | | { |
| | | 'code': '000000014841', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-09-28', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014830', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-09-29', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014819', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-09-30', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014808', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-10-01', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014797', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-10-02', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014786', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-10-03', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | }, |
| | | { |
| | | 'code': '000000014775', |
| | | 'factoryID': 'A', |
| | | 'beltlineID': 'æ»å', |
| | | 'beltlineName': 'æ»å', |
| | | 'dayTime': '2023-10-04', |
| | | 'lineRate': 0.0400, |
| | | 'processingLong': 3456.0000, |
| | | 'openingLong': 3456.0000, |
| | | 'collectDate': '2023-10-05 00:25:01' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | initChart(dataObj) { |
| | | const seriesArr = [] |
| | | const xAxisData = [] |
| | | const option = { |
| | |
| | | }, |
| | | series: [] |
| | | } |
| | | data.forEach(item1 => { |
| | | dataObj.dataList.forEach(item1 => { |
| | | const dataArr = [] |
| | | item1.list.forEach(item2 => { |
| | | item1.utilizationRateList.forEach(item2 => { |
| | | dataArr.push({ |
| | | value: this.toDecimal2NoZero(item2.lineRate * 100), |
| | | hostType: (item2.dayTime == null ? '' : item2.dayTime) |
| | | value: item2.utilizationRate, |
| | | hostType: (item2.date ? item2.date : '') |
| | | }) |
| | | xAxisData.push(item2.dayTime == null ? '' : item2.dayTime.slice(5)) |
| | | }) |
| | | if (item1.beltlineName == 'æ»å') { |
| | | if (item1.productionName == 'æ»å') { |
| | | seriesArr.push({ |
| | | name: item1.beltlineName, |
| | | name: item1.productionName, |
| | | type: 'line', |
| | | lineStyle: { width: 4, color: '#9cff45' }, |
| | | itemStyle: { color: '#50ff45' }, |
| | |
| | | }) |
| | | } else { |
| | | seriesArr.push({ |
| | | name: item1.fullName, |
| | | name: item1.productionName, |
| | | type: 'line', |
| | | lineStyle: { width: 2 }, |
| | | symbol: 'circle', |
| | |
| | | }) |
| | | } |
| | | }) |
| | | option.xAxis.data = Array.from(new Set(xAxisData)) |
| | | option.xAxis.data = dataObj.dateList |
| | | option.series = seriesArr |
| | | this.chartContainer.setOption(option, true) |
| | | }, |
| | |
| | | <div style="flex:1;display: flex;"> |
| | | <div class="chart-container" :id="chartContainerId"></div> |
| | | <div class="equipment-state-container"> |
| | | <div>è®¾å¤æ»æ°ï¼{{equipmentList.length}}å°</div> |
| | | <div>大修ã项修æ°éï¼{{getEquipmentMaintainCount}}å°</div> |
| | | <div v-for="(item,index) in equipmentStateList" :key="index"> |
| | | <img :src="item.imageColor"><span>{{item.label}}ï¼{{getEquipmentStateCount(item.value)}}å°</span> |
| | | <div>è®¾å¤æ»æ°ï¼{{equipmentStatusCountObj.equipmentCount}}å°</div> |
| | | <div>大修ã项修æ°éï¼{{equipmentStatusCountObj.repairCount}}å°</div> |
| | | <div> |
| | | <img :src="getStatusImageAndLabel('æ£å¸¸è¿è¡','statusImage')"><span>{{getStatusImageAndLabel('æ£å¸¸è¿è¡','label')}}ï¼{{equipmentStatusCountObj.runCount}}å°</span> |
| | | </div> |
| | | <div> |
| | | <img :src="getStatusImageAndLabel('å¾
æº','statusImage')"><span>{{getStatusImageAndLabel('å¾
æº','label')}}ï¼{{equipmentStatusCountObj.waitCount}}å°</span> |
| | | </div> |
| | | <div> |
| | | <img :src="getStatusImageAndLabel('æ¥è¦','statusImage')"><span>{{getStatusImageAndLabel('æ¥è¦','label')}}ï¼{{equipmentStatusCountObj.errorCount}}å°</span> |
| | | </div> |
| | | <div> |
| | | <img :src="getStatusImageAndLabel('å
³æº','statusImage')"><span>{{getStatusImageAndLabel('å
³æº','label')}}ï¼{{equipmentStatusCountObj.closeCount}}å°</span> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'WorkshopDeviceOverview', |
| | | components: {}, |
| | | props: { |
| | | equipmentList: { |
| | | currentProductionId: { |
| | | type: String |
| | | }, |
| | | equipmentStatusList: { |
| | | type: Array |
| | | }, |
| | | toDecimal2NoZero: { |
| | |
| | | return { |
| | | chartContainer: null, |
| | | chartContainerId: 'left-col-chart1', |
| | | equipmentStateList: [ |
| | | { |
| | | label: 'æ£å¸¸è¿è¡', |
| | | value: [3, 23], |
| | | imageColor: require('@/assets/WorskhopSignage/stateImg_green.gif') |
| | | }, |
| | | { |
| | | label: 'å¾
æº', |
| | | value: [1, 2], |
| | | imageColor: require('@/assets/WorskhopSignage/stateImg_yellow.gif') |
| | | }, |
| | | { |
| | | label: 'æ¥è¦', |
| | | value: [22], |
| | | imageColor: require('@/assets/WorskhopSignage/stateImg_red.gif') |
| | | }, |
| | | { |
| | | label: 'å
³æº', |
| | | value: [null, 0], |
| | | imageColor: require('@/assets/WorskhopSignage/stateImg_gray.gif') |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | computed: { |
| | | /* è·å设å¤å¤§ä¿®ã项修æ°é */ |
| | | getEquipmentMaintainCount() { |
| | | return this.equipmentList.filter(item => item.maintainType === 2).length |
| | | equipmentStatusCountObj: {} |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getChartDataByApi() |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | if (!this.currentProductionId) return |
| | | this.getDeviceStatusCountByApi() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | | }, |
| | | methods: { |
| | | getDeviceStatusCountByApi() { |
| | | const that = this |
| | | signageApi.getDeviceStatusCountApi(that.currentProductionId) |
| | | .then(res => { |
| | | if (!res.success) return |
| | | that.equipmentStatusCountObj = res.result |
| | | this.getChartDataByApi() |
| | | }) |
| | | }, |
| | | |
| | | getChartDataByApi() { |
| | | this.chartContainer = this.$echarts.init(document.getElementById(this.chartContainerId)) |
| | | this.initChart() |
| | | }, |
| | | |
| | | initChart() { |
| | | const data = [ |
| | | { |
| | | 'number': '20102', |
| | | 'name': '2-Dæ´ä½æºå£', |
| | | 'count': 7, |
| | | 'planCount': 14, |
| | | 'rateCount': 0.5000 |
| | | }, |
| | | { |
| | | 'number': '20103', |
| | | 'name': '3-Dçç§å®¤æºå£', |
| | | 'count': 3, |
| | | 'planCount': 9, |
| | | 'rateCount': 0.3333 |
| | | }, |
| | | { |
| | | 'number': '20104', |
| | | 'name': '4-Dçæ¥æºå£å·¥æ®µ', |
| | | 'count': 11, |
| | | 'planCount': 28, |
| | | 'rateCount': 0.3929 |
| | | }, |
| | | { |
| | | 'number': '20105', |
| | | 'name': '5-D CRICåå
', |
| | | 'count': 2, |
| | | 'planCount': 15, |
| | | 'rateCount': 0.1333 |
| | | }, |
| | | { |
| | | 'number': '20106', |
| | | 'name': '6-D飿åå
', |
| | | 'count': 6, |
| | | 'planCount': 15, |
| | | 'rateCount': 0.4000 |
| | | }, |
| | | { |
| | | 'number': '20107', |
| | | 'name': '7-Dæ¶¡è½®æºå£', |
| | | 'count': 6, |
| | | 'planCount': 17, |
| | | 'rateCount': 0.3529 |
| | | }, |
| | | { |
| | | 'number': '20109', |
| | | 'name': '9-Dé³å·¥åå
', |
| | | 'count': 2, |
| | | 'planCount': 18, |
| | | 'rateCount': 0.1111 |
| | | }, |
| | | { |
| | | 'number': null, |
| | | 'name': 'æ»ä»»å¡', |
| | | 'count': 37, |
| | | 'planCount': 116, |
| | | 'rateCount': 0.3190 |
| | | } |
| | | ] |
| | | let yAxisData1, yAxisData2, completionNum |
| | | const formatterData = [ |
| | | { |
| | | value: '', name: '宿é', itemStyle: { normal: { color: '#00923f' } }, |
| | | label: { |
| | | normal: { |
| | | show: true, |
| | | fontSize: '70%', |
| | | position: 'inside', |
| | | formatter: function() { |
| | | return completionNum + '%' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | value: '', name: 'ä»»å¡é', |
| | | itemStyle: { normal: { color: '#e67817' } }, |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | const yAxisData1 = this.toDecimal2NoZero((this.equipmentStatusCountObj.runCount / this.equipmentStatusCountObj.equipmentCount) * 100) |
| | | const yAxisData2 = 100 - yAxisData1 |
| | | const runNum = yAxisData1 |
| | | const option = { |
| | | legend: { |
| | | show: false, |
| | | bottom: 5, |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '70%' |
| | | }, |
| | | itemWidth: 12, |
| | | itemHeight: 8, |
| | | selectedMode: false, |
| | | formatter: function(name) { |
| | | var target |
| | | for (var i = 0, l = formatterData.length; i < l; i++) { |
| | | if (formatterData[i].name == name) { |
| | | target = formatterData[i].value |
| | | } |
| | | } |
| | | return name + ' ' + target |
| | | } |
| | | show: false |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | hoverAnimation: false, |
| | | data: [ |
| | | { |
| | | value: 0, name: '宿é', itemStyle: { normal: { color: '#00923f' } }, |
| | | value: 0, |
| | | name: 'è¿è¡é', |
| | | itemStyle: { color: '#00923f' }, |
| | | label: { |
| | | normal: { |
| | | show: true, |
| | | fontSize: '70%', |
| | | position: 'inside', |
| | | textBorderWidth: 0, |
| | | formatter: function() { |
| | | return completionNum + '%' |
| | | } |
| | | show: true, |
| | | fontSize: '70%', |
| | | color: '#fff', |
| | | position: 'inside', |
| | | textBorderWidth: 0, |
| | | formatter: function() { |
| | | return runNum + '%' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | value: 100, name: 'ä»»å¡é', |
| | | itemStyle: { normal: { color: '#e67817' } }, |
| | | value: 100, |
| | | name: '设å¤é', |
| | | itemStyle: { color: '#e67817' }, |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | show: false |
| | | } |
| | | } |
| | | ], |
| | | labelLine: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | show: false |
| | | }, |
| | | itemStyle: { |
| | | emphasis: { |
| | |
| | | } |
| | | ] |
| | | } |
| | | data.forEach(item => { |
| | | if (item.name === 'æ»ä»»å¡' && item.rateCount !== null) { |
| | | yAxisData1 = this.toDecimal2NoZero(item.rateCount * 100) |
| | | yAxisData2 = 100 - this.toDecimal2NoZero(item.rateCount * 100) |
| | | completionNum = yAxisData1 |
| | | formatterData[0].value = item.count |
| | | formatterData[1].value = item.planCount |
| | | } |
| | | }) |
| | | option.series[0].data[0].value = yAxisData1 |
| | | option.series[0].data[1].value = yAxisData2 |
| | | this.chartContainer.setOption(option, true) |
| | |
| | | return stateCount |
| | | }, |
| | | |
| | | getStatusImageAndLabel(label, property) { |
| | | return this.equipmentStatusList.find(item => item.label === label)[property] |
| | | }, |
| | | |
| | | /** |
| | | * çªå£å°ºå¯¸ååæ¶è§¦å |
| | | * è°æ´å¾è¡¨å°ºå¯¸ä»¥éåºå辨ç |
| | |
| | | </a-card> |
| | | </a-col> |
| | | <!-- 表ååºå --> |
| | | <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal> |
| | | <workshop-modal ref="modalForm" @ok="modalFormOk" :workshopList="workshopList"></workshop-modal> |
| | | <!--æ°å¢è½¦é´--> |
| | | <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'æ·»å å·²æè®¾å¤'"></select-device-drawer> |
| | | <!--å·²æè®¾å¤--> |
| | |
| | | import WorkshopModal from './modules/WorkshopModal' |
| | | import { filterObj } from '@/utils/util' |
| | | import moment from 'moment' |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'WorkshopSignageManagement', |
| | |
| | | queryParam1: {}, |
| | | queryParam2: {}, |
| | | dataSource1: [], |
| | | workshopList:[], |
| | | dataSource2: [], |
| | | ipagination1: { |
| | | current: 1, |
| | |
| | | return this.selectedRowKeys1.length === 0 ? 0 : 12 |
| | | }, |
| | | }, |
| | | created(){ |
| | | this.getWorkshopListByApi() |
| | | }, |
| | | methods: { |
| | | getWorkshopListByApi(){ |
| | | const that=this |
| | | signageApi.getWorkshopListApi() |
| | | .then(res=>{ |
| | | if(res.success)that.workshopList = res.result |
| | | }) |
| | | }, |
| | | |
| | | onSelectChange2(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys2 = selectedRowKeys |
| | | this.selectionRows2 = selectionRows |
| | |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item label="车é´åç§°" required prop="workshopName"> |
| | | <a-input v-model="model.workshopName" placeholder="请è¾å
¥è½¦é´åç§°"/> |
| | | <a-form-model-item label="车é´åç§°" required prop="productionId"> |
| | | <!--<a-input v-model="model.workshopName" placeholder="请è¾å
¥è½¦é´åç§°"/>--> |
| | | <a-select v-model="model.productionId" placeholder="è¯·éæ©è½¦é´" @change="handleSelectChange"> |
| | | <a-select-option v-for="item in workshopList" :key="item.id"> |
| | | {{item.productionName}} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="车é´èæ¯å¾" required prop="backgroundImage"> |
| | | <j-image-upload class="avatar-uploader" text="ä¸ä¼ " v-model="model.backgroundImage"></j-image-upload> |
| | | </a-form-model-item> |
| | | <!--<a-form-model-item label="设å¤ç¼å·é¢è²">--> |
| | | <!--<a-input type="color" v-model="model.equipmentIdColor"></a-input>--> |
| | | <!--<a-input type="color" v-model="model.equipmentIdColor"></a-input>--> |
| | | <!--</a-form-model-item>--> |
| | | <a-form-model-item label="æææ è¯"> |
| | | <a-input placeholder="请è¾å
¥æææ è¯" v-model="model.perms"/> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import api from '@/api/mdc' |
| | | import signageApi from '@/api/signage' |
| | | |
| | | export default { |
| | | name: 'WorkshopModal', |
| | | components: {}, |
| | | props: { |
| | | workshopList: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | workshopName: [ |
| | | { required: true, message: '请è¾å
¥è½¦é´åç§°!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' } |
| | | ], |
| | | id: [ |
| | | { required: true, message: '请è¾å
¥è½¦é´ç¼å·!' }, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validateRoleCode } |
| | | ], |
| | | workshopName: [{ required: true, message: 'è¯·éæ©è½¦é´!' }], |
| | | backgroundImage: [ |
| | | { required: true, message: '请ä¸ä¼ 车é´èæ¯å¾!' } |
| | | ] |
| | |
| | | this.isEdit = false |
| | | } |
| | | }, |
| | | close() { |
| | | this.$refs.form.clearValidate() |
| | | this.$emit('close') |
| | | this.visible = false |
| | | handleSelectChange(value) { |
| | | const workshopItem = this.workshopList.find(item => item.id === value) |
| | | this.model.workshopName = workshopItem.productionName |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | |
| | | let obj |
| | | if (!this.isEdit) { |
| | | console.log('è§¦åæ°å¢') |
| | | obj = api.addWorkshopApi(this.model) |
| | | obj = signageApi.addWorkshopApi(this.model) |
| | | } else { |
| | | console.log('触åä¿®æ¹') |
| | | obj = api.editWorkshopApi(this.model) |
| | | obj = signageApi.editWorkshopApi(this.model) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | validateRoleCode(rule, value, callback) { |
| | | if (/[\u4E00-\u9FA5]/g.test(value)) { |
| | | callback('车é´ç¼å·ä¸å¯è¾å
¥æ±å!') |
| | | } else { |
| | | callback() |
| | | } |
| | | close() { |
| | | this.$refs.form.clearValidate() |
| | | this.$emit('close') |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |