From bb654cea7b1666d5b3c04dbd81a074a5a502cc67 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期五, 31 五月 2024 09:36:40 +0800 Subject: [PATCH] 1、登录页实现登录窗口响应式布局,同时限制最大最小宽高 2、除设备级看板其余看板中点击技术状态以及报修故障图表后打开对应弹窗,并实现与接口联动 3、设备级看板点击保养计划按钮后打开对应弹窗并实现与后端数据联调 4、优化设备级看板折线图样式,将Y轴移至左侧,删除右侧Y轴,设置数据值在图标上的显示 --- src/views/dashboard/BranchFactorySignage.vue | 113 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 82 insertions(+), 31 deletions(-) diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue index 7cdc7b9..50480b6 100644 --- a/src/views/dashboard/BranchFactorySignage.vue +++ b/src/views/dashboard/BranchFactorySignage.vue @@ -18,31 +18,11 @@ <div id="warranty_malfunction_chart" style="width:50%;height: 420px;"></div> </div> <div class="support-plan-container"> - <div class="support-plan-item" style="background:#5FE0AF"> - <div>鏈湀涓変繚璁″垝</div> + <div v-for="(item,index) in supportPlanList" :key="index" class="support-plan-item" + :style="{background:item.backgroundColor}" @click="openMaintenanceModal(item)"> + <div>{{item.planTime}}</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:#D6BC52"> - <div>涓嬫湀涓変繚璁″垝</div> - <div class="plan-value-container"> - <div class="plan-value">{{nextMonthMaintenancePlanNum}}</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 class="plan-value">{{$data[item.planValueLabel]}}</div> <div>鍙�</div> </div> </div> @@ -62,6 +42,10 @@ </div> </dv-border-box-9> </div> + + <SignageModal :modalVisible="modalVisible" :modalTitle=modalTitle :modalDataApiUrl="modalDataApiUrl" + :modalDataApiParams="modalDataApiParams" + @closeModal="modalVisible=false"/> </div> </div> </template> @@ -69,9 +53,11 @@ <script> import signageApi from '@/api/signage' import moment from 'moment' + import SignageModal from './modules/SignageModal' export default { name: 'BranchFactorySignage', + components: { SignageModal }, props: { productionCode: { type: String, @@ -104,6 +90,32 @@ { value: '0', name: '鍋滄満' }, { value: '0', name: '杩愯' } ], + supportPlanList: [ + { + planTime: '鏈湀涓変繚璁″垝', + planValueLabel: 'thisMonthMaintenancePlanNum', + backgroundColor: '#5FE0AF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceList' + }, + { + planTime: '鏈湀瀹屾垚', + planValueLabel: 'thisMonthMaintenanceRealNum', + backgroundColor: '#409EFF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceFinishList' + }, + { + planTime: '涓嬫湀涓変繚璁″垝', + planValueLabel: 'nextMonthMaintenancePlanNum', + backgroundColor: '#D6BC52', + apiUrl: '/eam/calibrationOrder/showNextMonthMaintenanceList' + }, + { + planTime: '涓嬩笅鏈堜笁淇濊鍒�', + planValueLabel: 'nextNextMonthMaintenancePlanNum', + backgroundColor: '#58D9F9', + apiUrl: '/eam/calibrationOrder/showNextNextMonthMaintenanceList' + } + ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, nextMonthMaintenancePlanNum: 0, @@ -115,7 +127,12 @@ doubleBarChartData: {}, workshopProblemChartData: [], maintenanceConfig: {}, - problemConfig: {} + problemConfig: {}, + modalVisible: false, + modalTitle: '', + modalDataApiUrl: '', + modalTableColumns: [], + modalDataApiParams: {} } }, mounted() { @@ -184,9 +201,9 @@ .then(res => { if (res.success && res.result) { this.techConditionData = [ - { value: res.result[0].qualifiedCount, name: '鍚堟牸' }, - { value: res.result[0].disabledCount, name: '绂佺敤' }, - { value: res.result[0].limitedUseCount, name: '闄愮敤' } + { value: res.result[0].qualifiedCount, name: '鍚堟牸', technologyStatus: 'qualified' }, + { value: res.result[0].disabledCount, name: '绂佺敤', technologyStatus: 'disabled' }, + { value: res.result[0].limitedUseCount, name: '闄愮敤', technologyStatus: 'limitedUse' } ] } this.drawTechConditionChart() @@ -206,9 +223,9 @@ .then(res => { if (res.success && res.result) { this.warrantyMalfunctionData = [ - { value: res.result[0].failurTotalCount, name: '鎶ヤ慨' }, - { value: res.result[0].stopCount, name: '鍋滄満' }, - { value: res.result[0].noStopCount, name: '杩愯' } + { value: res.result[0].failurTotalCount, name: '鎶ヤ慨', isStop: '' }, + { value: res.result[0].stopCount, name: '鍋滄満', isStop: '2' }, + { value: res.result[0].noStopCount, name: '杩愯', isStop: '1' } ] } this.drawWarrantyMalfunctionChart() @@ -678,6 +695,16 @@ } this.techConditionChart.setOption(option, true) this.techConditionChart.hideLoading() + + this.techConditionChart.on('click', params => { + this.modalTitle = `鎶�鏈姸鎬侊紙${params.name}锛塦 + this.modalDataApiParams = { + technologyStatus: this.techConditionData.find(item => item.name === params.name).technologyStatus, + productionCode: this.productionCode + } + this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByTechnologyStatus' + this.modalVisible = true + }) }, /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */ @@ -757,6 +784,16 @@ } this.warrantyMalfunctionChart.setOption(option, true) this.warrantyMalfunctionChart.hideLoading() + + this.warrantyMalfunctionChart.on('click', params => { + this.modalTitle = `鎶ヤ慨鏁呴殰锛�${params.name}锛塦 + this.modalDataApiParams = { + isStop: this.warrantyMalfunctionData.find(item => item.name === params.name).isStop, + productionCode: this.productionCode + } + this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByReportRepair' + this.modalVisible = true + }) }, /* 缁樺埗杞﹂棿淇濆吇婊氬姩琛� */ @@ -1081,6 +1118,19 @@ }, /** + * 鐐瑰嚮涓変繚灞曠ず鏍忓悗鎵撳紑寮圭獥 + * @param record 鐐瑰嚮褰撳墠涓変繚淇℃伅 + */ + openMaintenanceModal(record) { + this.modalTitle = record.planTime + this.modalDataApiParams = { + productionCode: this.productionCode + } + this.modalDataApiUrl = record.apiUrl + this.modalVisible = true + }, + + /** * 绐楀彛灏哄鍙樺寲鏃惰Е鍙� * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� */ @@ -1142,6 +1192,7 @@ padding: 5px 20px; font-size: 20px; margin-bottom: 10px; + cursor: pointer; .plan-value-container { display: flex; -- Gitblit v1.9.3