From 221bb1704bb74b38655c2cd2413242885b5cc614 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期日, 28 四月 2024 09:50:55 +0800 Subject: [PATCH] 1、调整路由模式为hash模式以试图解决项目上线后刷新页面后无法正常跳转页面而出现JSON页面问题 2、首页设备级看板点击报修按钮跳转至故障报修页面并根据设备编号筛选页面对应数据 --- src/views/dashboard/EquipmentSignage.vue | 201 ++++++++++++++++++++++++++++++++++--------------- src/views/dashboard/BranchFactorySignage.vue | 4 src/mixins/JeecgListMixin.js | 3 src/components/layouts/TabLayout.vue | 4 src/router/index.js | 2 src/views/dashboard/WorkshopSectionSignage.vue | 2 src/views/eam/modules/malfunctionRepair/FaultDescriptionList.vue | 1 src/api/signage.js | 12 ++ 8 files changed, 157 insertions(+), 72 deletions(-) diff --git a/src/api/signage.js b/src/api/signage.js index 5d7a7d6..53509b8 100644 --- a/src/api/signage.js +++ b/src/api/signage.js @@ -35,6 +35,14 @@ getEquipmentAnnualEfficiencyStatisticsApi: equipmentId => getAction('/mdc/home/equipmentAnnualEfficiencyStatistics', { equipmentId }), // 宸ユ绾ц澶囨晥鐜囦华琛ㄧ洏 getEquipmentLevelEfficiencyStatisticsApi: equipmentId => getAction('/mdc/home/equipmentLevelEfficiencyStatistics', { equipmentId }), - // 璁惧绾ц澶囧垪琛� - getEquipmentListApi: productionCode => getAction('/mdc/home/equipmentList', { productionCode }) + // 璁惧绾ц澶囧垪琛紙闈炴搷浣滃伐绾ц繘鍏ワ級 + getEquipmentListApi: productionCode => getAction('/mdc/home/equipmentList', { productionCode }), + // 璁惧绾ц澶囪缁嗕俊鎭� + getEquipmentDetailsApi: equipmentId => getAction('/mdc/home/equipmentDetails', { equipmentId }), + // 璁惧绾ц澶囧垪琛紙鎿嶄綔宸ョ骇杩涘叆锛� + getAllAreaEquipmentListApi: productionCode => getAction('/eam/calibrationOrder/getAllAreaEquipmentList', { productionCode }), + // 璁惧绾ц幏鍙栨搷浣滆瘉淇℃伅 + getOperationCertificateApi: () => getAction('/eam/calibrationOrder/getOperationCertificate'), + // 璁惧绾ц澶囦俊鎭拰缁存姢淇℃伅 + getEquipmentInfoApi: equipmentNum => getAction('/eam/calibrationOrder/getAreaEquipmentList', { equipmentNum }) } \ No newline at end of file diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index c4fc0f0..ef9511f 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -433,9 +433,9 @@ &.ant-tabs-card .ant-tabs-tab { - padding: 0 20px 0 12px !important; + padding: 0 20px 0 2px !important; background-color: white !important; - margin-right: 10px !important; + /*margin-right: 10px !important;*/ .ant-tabs-close-x { width: 12px !important; diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index b5986e5..f0153a1 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -54,6 +54,9 @@ created() { if(!this.disableMixinCreated){ console.log(' -- mixin created -- ') + // 姝ゅ闇�鍦╨oadData鍑芥暟涔嬪墠灏嗗弬鏁拌缃负鎵�闇�瑕佺殑鍊硷紝鍦ㄧ粍浠朵腑鐨刢reated涓棤娉曡缃紝鍥犱负mixin鐨勭敓鍛藉懆鏈熷嚱鏁版墽琛岄『搴忎紭鍏堜簬缁勪欢鐨勭敓鍛藉懆鏈熷嚱鏁� + const { equipmentId } = this.$route.params + if(equipmentId) this.$set(this.queryParam,'equipmentNum',equipmentId) this.loadData(); //鍒濆鍖栧瓧鍏搁厤缃� 鍦ㄨ嚜宸遍〉闈㈠畾涔� this.initDictConfig(); diff --git a/src/router/index.js b/src/router/index.js index 3c6c586..8603811 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,7 +19,7 @@ } export default new Router({ - mode: 'history', + mode: 'hash', base: process.env.BASE_URL, scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue index 0324b20..6c47a0c 100644 --- a/src/views/dashboard/BranchFactorySignage.vue +++ b/src/views/dashboard/BranchFactorySignage.vue @@ -434,7 +434,7 @@ } }, xAxis: { - name: '鍗曚綅', + name: '', nameTextStyle: { color: '#fff' }, @@ -838,7 +838,7 @@ interval: yAxisInterval, axisLabel: { formatter: '{value}', - color: '#e2e9ff' + color: '#fff' }, axisTick: { show: false diff --git a/src/views/dashboard/EquipmentSignage.vue b/src/views/dashboard/EquipmentSignage.vue index 9c24579..1917eca 100644 --- a/src/views/dashboard/EquipmentSignage.vue +++ b/src/views/dashboard/EquipmentSignage.vue @@ -38,40 +38,40 @@ <dv-border-box-11 title="璁惧淇℃伅" class="info-container" style="flex:5;"> <a-descriptions :column="3"> <a-descriptions-item label="缁熶竴缂栧彿"> - {{equipmentInfo.equipmentId}} + {{equipmentInfo.num|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="ABC鏍囪瘑"> - {{equipmentInfo.ABCSymbol}} + {{equipmentInfo.abc|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="璁惧鍚嶇О"> - {{equipmentInfo.equipmentName}} + {{equipmentInfo.name|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鍨嬪彿"> - {{equipmentInfo.equipmentType}} + {{equipmentInfo.model|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="璁惧鍒嗙被"> - {{equipmentInfo.equipmentCategory}} + {{equipmentInfo.equipmentCategoryName|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="宸ュ尯"> - {{equipmentInfo.workArea}} + {{equipmentInfo.areaName|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鎿嶄綔绯荤粺"> - {{equipmentInfo.driveType}} + {{equipmentInfo.system|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="瑙勬牸"> - {{equipmentInfo.standard}} + {{equipmentInfo.specification|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="缁存姢閮ㄩ棬"> - {{equipmentInfo.depart}} + {{equipmentInfo.manageName|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="宸ユ"> - {{equipmentInfo.workshopSection}} + {{equipmentInfo.workShopName|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鎿嶄綔宸�"> - {{equipmentInfo.operator}} + {{operationCertificateInfo.realname|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="璁惧鐘舵��"> - {{equipmentInfo.equipmentStatus}} + {{equipmentInfo.equipmentStatus|equipmentInfoDisplay}} </a-descriptions-item> </a-descriptions> </dv-border-box-11> @@ -79,16 +79,16 @@ <dv-border-box-11 title="鎿嶄綔璇佷俊鎭�" class="info-container" style="flex:2;"> <a-descriptions :column="1"> <a-descriptions-item label="鎿嶄綔璇佺紪鍙�"> - {{equipmentInfo.equipmentId}} + {{operationCertificateInfo.num|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="褰撳墠鍛ㄦ湡鍒嗘暟"> - {{equipmentInfo.ABCSymbol}} + {{operationCertificateInfo.currentCycleScore|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鍙戣瘉鏃ユ湡"> - {{equipmentInfo.equipmentName}} + {{operationCertificateInfo.issueDate|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鍛ㄦ湡鎴鏃ユ湡"> - {{equipmentInfo.equipmentType}} + {{operationCertificateInfo.endTime|equipmentInfoDisplay}} </a-descriptions-item> </a-descriptions> </dv-border-box-11> @@ -96,29 +96,29 @@ <dv-border-box-11 title="缁存姢淇℃伅" class="info-container" style="flex:2;"> <a-descriptions :column="1"> <a-descriptions-item label="涓嬫涓変繚鏃ユ湡"> - {{equipmentInfo.equipmentId}} + {{equipmentInfo.nextThirdMaintenanceTime|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="涓嬫浜屼繚鏃ユ湡"> - {{equipmentInfo.ABCSymbol}} + {{equipmentInfo.nextSecondMaintenanceTime|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鎶�鏈姸鎬�"> - {{equipmentInfo.equipmentName}} + {{equipmentInfo.technology_status|equipmentInfoDisplay}} </a-descriptions-item> </a-descriptions> </dv-border-box-11> </div> <!--鍔熻兘鎸夐挳鍖哄煙--> - <div style="display: flex;height: 30%;align-items: center;padding: 0 20px;color: #eee;"> + <div style="display: flex;height: 30%;align-items: center;padding: 0 20px;color: #fff;"> <div style="display: flex;justify-content:space-evenly;flex: 1"> <div style="width: 45%;" class="info-card-container"> - <div class="info-card-title">鏈湀鎶ヤ慨鏁伴噺</div> - <div class="info-card-value" style="color: #EAC910">20</div> + <div class="info-card-title">鏈湀鎶ヤ慨娆℃暟</div> + <div class="info-card-value" style="color: #EAC910">{{equipmentInfo.repairCount|equipmentInfoDisplay}}</div> </div> <div style="width: 45%;" class="info-card-container"> - <div class="info-card-title">璁惧鐘舵�侊紙缁翠慨涓瓑锛�</div> - <div class="info-card-value">缁翠慨涓�</div> + <div class="info-card-title">璁惧鐘舵��</div> + <div class="info-card-value">{{equipmentInfo.equipmentStatus|equipmentInfoDisplay}}</div> </div> </div> @@ -133,39 +133,37 @@ <!--鍙充笅鍚勯」鏁版嵁鍥捐〃鍖哄煙--> <dv-border-box-12 style="height: 50%" class="right-bottom-row"> - <div style="display: flex;justify-content:space-evenly;height: 100%"> + <div style="display: flex;justify-content:space-evenly;height: 100%" v-show="isBelongToMdc"> <div style="display: flex;flex-wrap: wrap;width: 30%;height: 100%"> <div id="gauge_chart1" class="gauge-chart"></div> <div id="gauge_chart2" class="gauge-chart"></div> <div id="gauge_chart3" class="gauge-chart"></div> <div id="gauge_chart4" class="gauge-chart"></div> </div> - <div id="line_chart" style="width:40%;height: 100%;"></div> - <div style="width: 25%;height:100%;display: flex;align-items: center"> + <div id="line_chart" :style="{width:lineChartWidth,height: '100%'}"></div> + <div v-show="isBelongToMdc&&isDisplayEquipmentDetails" + style="width: 25%;height:100%;display: flex;align-items: center"> <a-descriptions :column="2"> <a-descriptions-item label="杩愯妯″紡"> - {{equipmentInfo.equipmentId}} + {{equipmentDetails.runModble|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="绋嬪簭鍙�"> - {{equipmentInfo.ABCSymbol}} + {{equipmentDetails.sequencenumber|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="涓昏酱杞��"> - {{equipmentInfo.equipmentName}} + {{equipmentDetails.spindlespeed|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="涓昏酱璐熻嵎"> - {{equipmentInfo.equipmentType}} - </a-descriptions-item> - <a-descriptions-item label="涓昏酱杞��"> - {{equipmentInfo.equipmentCategory}} + {{equipmentDetails.spindleload|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="涓昏酱鍊嶇巼"> - {{equipmentInfo.workArea}} + {{equipmentDetails.spindlebeilv|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="杩涚粰鍊嶇巼"> - {{equipmentInfo.driveType}} + {{equipmentDetails.feedbeilv|equipmentInfoDisplay}} </a-descriptions-item> <a-descriptions-item label="鎶ヨ淇℃伅"> - {{equipmentInfo.standard}} + {{equipmentDetails.alrmstate|equipmentInfoDisplay}} </a-descriptions-item> </a-descriptions> </div> @@ -199,20 +197,9 @@ return { equipmentId: '', equipmentList: [], - equipmentInfo: { - equipmentId: '2511563154', - ABCSymbol: '3312321421', - equipmentName: '鏈烘涓績', - equipmentType: 'CV4160', - equipmentCategory: '杞ф満', - workArea: 'A鍒嗗尯', - driveType: 'JSOWJDF', - standard: '鏃�', - depart: '杞ф満涓績', - workshopSection: '407涓�宸ユ', - operator: 'admin', - equipmentStatus: 0 - }, + equipmentInfo: {}, + operationCertificateInfo: {}, + equipmentDetails: {}, buttonList: [ { label: '澶囦欢淇℃伅' @@ -221,7 +208,8 @@ label: '淇濆吇璁″垝' }, { - label: '鎶ヤ慨' + label: '鎶ヤ慨', + pageName: 'eam-MalfunctionRepair' }, { label: '璁惧鐝', @@ -229,6 +217,7 @@ } ], lineChart: '', + lineChartWidth: '40%', lineChartData: [], gaugeChart1: '', gaugeChart2: '', @@ -240,7 +229,9 @@ openRate: 0, overallEquipmentEfficiency: 0 }, - hideLoadingDelayTime: 500 + hideLoadingDelayTime: 500, + isDisplayEquipmentDetails: false, + isBelongToMdc: true// 鏄惁鍦╩dc璁惧琛ㄤ腑 } }, created() { @@ -248,12 +239,38 @@ }, mounted() { window.addEventListener('resize', this.handleWindowResize) - this.getEquipmentListByApi() + this.getOperationCertificateByApi() + // 鎿嶄綔宸ョ骇鐢ㄦ埛杩涘叆鏃惰皟鐢ㄦ帴鍙h幏鍙杕es璁惧鍒楄〃锛屽叾浣欐儏鍐佃幏鍙杕dc璁惧鍒楄〃 + if (this.userType !== 1) this.getEquipmentListByApi() + else this.getAllAreaEquipmentListByApi() }, beforeDestroy() { window.removeEventListener('resize', this.handleWindowResize) }, + filters: { + equipmentInfoDisplay(value) { + return value ? value : '鏃�' + } + }, + watch: { + isDisplayEquipmentDetails: { + handler(newVal) { + if (newVal) this.lineChartWidth = '40%' + else this.lineChartWidth = '65%' + this.$nextTick(() => { + this.lineChart.resize() + }) + } + } + }, methods: { + getOperationCertificateByApi() { + signageApi.getOperationCertificateApi() + .then(res => { + if (res.success && res.result.length > 0) this.operationCertificateInfo = res.result[0] + }) + }, + getEquipmentListByApi() { // 棣栭〉涓�杩涘叆鍗宠澶囩骇鎴栧伐娈电骇鏃讹紝workshopSectionProductionCode涓虹┖锛岄粯璁ゆ煡璇㈢涓�涓溅闂翠腑绗竴涓伐娈典笅鐨勮澶囧垪琛� signageApi.getEquipmentListApi(this.workshopSectionProductionCode) @@ -264,22 +281,75 @@ } }) .finally(() => { - // 姝ゅ涓轰繚璇乪quipmentId姝e父璧嬪�煎悗鍐嶈皟鐢ㄦ帴鍙h幏鍙栧浘琛ㄦ暟鎹紙寮傛锛� + // 姝ゅ涓轰繚璇乪quipmentId姝e父璧嬪�煎悗鍐嶈皟鐢ㄦ帴鍙h幏鍙栧浘琛ㄦ暟鎹互鍙婅澶囪缁嗕俊鎭紙寮傛锛� this.getChartDataByApi() + this.getEquipmentInfoByApi() + this.getEquipmentDetailsByApi() }) }, + getAllAreaEquipmentListByApi() { + signageApi.getAllAreaEquipmentListApi(this.workshopSectionProductionCode) + .then(res => { + if (res.success) { + this.equipmentList = res.result + this.equipmentList.forEach(item => { + item.equipmentId = item.num + item.equipmentModel = item.model + }) + if (!this.productionCode && this.equipmentList.length > 0) this.equipmentId = this.equipmentList[0].equipmentId + } + }) + .finally(() => { + // 姝ゅ涓轰繚璇乪quipmentId姝e父璧嬪�煎悗鍐嶈皟鐢ㄦ帴鍙h幏鍙栬澶囦俊鎭拰缁存姢淇℃伅锛堝紓姝ワ級 + this.getEquipmentInfoByApi() + }) + }, + + // 鑾峰彇鍙充笂瑙掕澶囦俊鎭拰缁存姢淇℃伅 + getEquipmentInfoByApi() { + signageApi.getEquipmentInfoApi(this.equipmentId) + .then(res => { + if (res.success && res.result.length > 0) this.equipmentInfo = res.result[0] + else this.equipmentInfo = {} + }) + }, + + /* 鑾峰彇鍙充笅瑙掕澶囪缁嗕俊鎭� */ + getEquipmentDetailsByApi() { + signageApi.getEquipmentDetailsApi(this.equipmentId) + .then(res => { + if (res.success && res.result) { + this.equipmentDetails = res.result + this.isDisplayEquipmentDetails = true + } + else this.isDisplayEquipmentDetails = false + }) + }, + + /* 鍙充笅瑙掑浘琛ㄦ暟鎹幏鍙栨眹鎬绘柟娉� */ getChartDataByApi() { this.getGaugeChartDataByApi() this.getLineChartDataByApi() }, + /* 鍗曞嚮璁惧鍒楄〃涓殑璁惧鏃惰Е鍙� */ selectEquipment(record) { + // 閬垮厤鐐瑰嚮鐩稿悓璁惧閲嶅鍙戦�佽姹� if (record.equipmentId === this.equipmentId) return this.equipmentId = record.equipmentId - this.getChartDataByApi() + + // 闈炴搷浣滃伐绾ф椂闇�瑕佷紶鍏ヨ澶囩紪鍙蜂互鏌ヨ鍥捐〃鍙婅澶囧悇椤逛俊鎭暟鎹紝鎿嶄綔宸ョ骇鏃跺彲灏嗚澶囧垪琛ㄨ淇℃伅鐩存帴璧嬪�煎睍绀� + if (this.userType !== 1) { + this.getChartDataByApi() + this.getEquipmentDetailsByApi() + this.getEquipmentInfoByApi() + } else { + this.equipmentInfo = record + } }, + /* 鍗曞嚮鍙宠竟瀵艰埅鏍忓悗瑙﹀彂 */ navigateToPage(record) { if (record.pageName) { this.$router.push({ @@ -322,8 +392,12 @@ signageApi.getEquipmentLevelEfficiencyStatisticsApi(this.equipmentId) .then(res => { - if (res.success) this.gaugeChartData = res.result - this.drawGaugeChart() + if (res.success && res.result) { + this.gaugeChartData = res.result + this.isBelongToMdc = true + this.drawGaugeChart() + } + else this.isBelongToMdc = false }) }, @@ -339,8 +413,12 @@ signageApi.getEquipmentAnnualEfficiencyStatisticsApi(this.equipmentId) .then(res => { - if (res.success) this.lineChartData = res.result - this.drawLineChart() + if (res.success && res.result) { + this.lineChartData = res.result + this.isBelongToMdc = true + this.drawLineChart() + } + else this.isBelongToMdc = false }) }, @@ -357,7 +435,6 @@ fontSize: 18, fontWeight: 'normal', color: '#1AD8DE', - fontWeight: 'bold' } }, tooltip: { @@ -710,7 +787,7 @@ .equipmentId-container { height: 100%; - color: #eee; + color: #fff; display: flex; justify-content: center; align-items: center; diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index 2931790..ea84836 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -806,7 +806,6 @@ fontSize: 18, fontWeight: 'normal', color: '#1AD8DE', - fontWeight: 'bold' } }, tooltip: { @@ -996,7 +995,6 @@ fontSize: 18, fontWeight: 'normal', color: '#1AD8DE', - fontWeight: 'bold' } }, tooltip: { diff --git a/src/views/eam/modules/malfunctionRepair/FaultDescriptionList.vue b/src/views/eam/modules/malfunctionRepair/FaultDescriptionList.vue index e4a8c99..b8f69a4 100644 --- a/src/views/eam/modules/malfunctionRepair/FaultDescriptionList.vue +++ b/src/views/eam/modules/malfunctionRepair/FaultDescriptionList.vue @@ -32,7 +32,6 @@ export default { name: 'FaultDescriptionList', - mixins: [JeecgListMixin, mixinDevice], components: { }, data() { -- Gitblit v1.9.3