From 952a20f1c005d80e9bf881287c40e6f4e4266a0b Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期三, 12 三月 2025 15:34:52 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/views/CNAS/resourceDemand/device/component/operationOverview.vue |  220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 220 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/operationOverview.vue b/src/views/CNAS/resourceDemand/device/component/operationOverview.vue
new file mode 100644
index 0000000..7f87754
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/operationOverview.vue
@@ -0,0 +1,220 @@
+<!-- 璁惧杩愯鎬昏 -->
+<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 "姝e父":
+          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锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+      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>

--
Gitblit v1.9.3