| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- 设å¤è¿è¡æ»è§ --> |
| | | <template> |
| | | <div> |
| | | <div class="page"> |
| | | <echart-module id="'page-left'" :config="chartConfig" :datas="chartData" class="page-left"></echart-module> |
| | | <div class="page-right"> |
| | | <div class="form-item"> |
| | | <label>å¯ç¨æ¶é¿(å¹´)</label> |
| | | <span>{{deviceData.usedYears}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ
鿬¡æ°</label> |
| | | <span>{{deviceData.faultCount}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ
鿥æ</label> |
| | | <span>{{ deviceData.faultDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ ¡åæ¥æ</label> |
| | | <span>{{deviceData.lastCalibrationDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡æ ¡åæ¥æ</label> |
| | | <span>{{deviceData.nextCalibrationDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¡åæ»ç»è®º</label> |
| | | <span :class="formatColorStyle(deviceData.calibrateStatus)">{{ deviceData.calibrateStatus }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿æ ¸æ¥æ¥æ</label> |
| | | <span>{{deviceData.lastExamineDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡æ ¸æ¥æ¥æ</label> |
| | | <span>{{deviceData.nextExamineDate}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æ ¸æ¥æ»ç»è®º</label> |
| | | <span :class="formatColorStyle(deviceData.examineStatus)">{{deviceData.examineStatus}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>设å¤è¿è¡ç¶æ</label> |
| | | <span :class="formatColorStyle(deviceData.deviceStatus)">{{deviceData.deviceStatus}}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æè¿ç»´æ¤æ¥æ</label> |
| | | <span>{{ deviceData.maintenanceDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>䏿¬¡ç»´æ¤æ¥æ</label> |
| | | <span>{{ deviceData.nextMaintenanceDate }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>ç»´æ¤ç±»å</label> |
| | | <span>{{ deviceData.maintenanceType }}</span> |
| | | </div> |
| | | <div class="form-item"> |
| | | <label>æµé项ç®</label> |
| | | <span>{{ deviceData.insProduct }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import EchartModule from '@/components/Echart/echart.vue' |
| | | import {device} from "@/api/cnas/resourceDemand/device"; |
| | | |
| | | export default { |
| | | components: { EchartModule }, |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chartConfig: { |
| | | height: '', |
| | | isLoading: true, |
| | | type: 'gauge' |
| | | }, |
| | | chartData: { |
| | | formatter: "å·²è¿æ ¡åæ¥æç¾åæ¯: {c}%", |
| | | color: [ |
| | | [0.3, '#21a700'], |
| | | [0.7, '#0066ff'], |
| | | [1, '#d80000'] |
| | | ], |
| | | value: 0, |
| | | }, |
| | | form: { |
| | | value1: '' |
| | | }, |
| | | formData: { |
| | | usedAge: 12 |
| | | }, |
| | | //è®¾å¤æ°æ®æ¶é |
| | | deviceData: { |
| | | |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | //è·åè®¾å¤æ
éçä¿¡æ¯ |
| | | this.getDeviceInfo(this.clickNodeVal.value); |
| | | }, |
| | | methods: { |
| | | formatColorStyle(status) { |
| | | if (status == null || status == "" || status == undefined) { |
| | | return "" |
| | | } |
| | | let styleStr = '' |
| | | switch (status) { |
| | | case "åæ ¼": |
| | | styleStr = 'success' |
| | | break; |
| | | case "ä¸åæ ¼": |
| | | styleStr = 'failed' |
| | | break; |
| | | case "å
¶ä»": |
| | | styleStr = 'other' |
| | | break; |
| | | case "æ£å¸¸": |
| | | styleStr = 'success' |
| | | break; |
| | | case "ç»´ä¿®": |
| | | styleStr = 'other' |
| | | break; |
| | | case "åç¨": |
| | | styleStr = 'stop' |
| | | break; |
| | | case "æ¥åº": |
| | | styleStr = 'failed' |
| | | break; |
| | | } |
| | | return styleStr; |
| | | }, |
| | | //è·å设å¤è¿è¡æ»è§ä¿¡æ¯ |
| | | getDeviceInfo(deviceId) { |
| | | device({deviceId: deviceId}).then(res => { |
| | | if (res.code == 200) { |
| | | this.deviceData = res.data |
| | | this.chartData.value = res.data.progress |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |
| | | // çå¬ç¹å»el-treeçæ°æ®ï¼è¿è¡æ°æ®å·æ° |
| | | clickNodeVal(newVal) { |
| | | // æ¯å¦åå¨valueï¼åå¨value代表为ä¸çº§ |
| | | if (this.clickNodeVal.value) { |
| | | this.getDeviceInfo(newVal.value) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .page { |
| | | width: 100%; |
| | | height: 100vh; |
| | | display: flex; |
| | | } |
| | | |
| | | .page-left { |
| | | width: 420px; |
| | | height: 420px; |
| | | margin-top: 40px; |
| | | margin-right: 40px; |
| | | } |
| | | |
| | | .page-right { |
| | | flex: 1; |
| | | height: calc(100% - 200px); |
| | | overflow: scroll; |
| | | /* background: red; */ |
| | | } |
| | | |
| | | .form-item { |
| | | line-height: 42px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .page-right label { |
| | | color: #999; |
| | | width: 110px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .el-radio__input.is-disabled+span.el-radio__label { |
| | | color: #606266 !important; |
| | | } |
| | | |
| | | .success { |
| | | color: #21a700 |
| | | } |
| | | |
| | | .failed { |
| | | color: #d80000 |
| | | } |
| | | |
| | | .other { |
| | | color: #e8a849; |
| | | } |
| | | |
| | | .stop { |
| | | color: #909399; |
| | | } |
| | | </style> |