Jelajahi Sumber

巡检结果调整

lipenghui 3 minggu lalu
induk
melakukan
2aa7bc0a3a

+ 1 - 1
src/locales/en.ts

@@ -997,7 +997,7 @@ export default {
     sortHolder:'Please enter sort holder',
     InspectionStandards:'IS',
     stanHolder:'Please enter inspections standards',
-    isException:'IsException',
+    isException:'InspectResult',
     exceptionDes:'ExceptionDes',
     inspectTime:'InspectionTime',
     createName:'creator',

+ 1 - 1
src/locales/zh-CN.ts

@@ -992,7 +992,7 @@ export default {
     sortHolder:'请输入排序',
     InspectionStandards:'巡检标准',
     stanHolder:'请输入巡检标准',
-    isException:'是否异常',
+    isException:'巡检结果',
     exceptionDes:'异常描述',
     inspectTime:'巡检时间',
     createName:'创建人',

+ 2 - 2
src/views/pms/inspect/order/WriteOrder.vue

@@ -71,7 +71,7 @@
                 <el-form-item
                   :label="t('inspect.exceptionDes')"
                   prop="description"
-                  :rules="formData[tabIndex][currentStep[tabIndex]].ifNormal ? descriptionRule : []"
+                  :rules="formData[tabIndex][currentStep[tabIndex]].ifNormal ?  []: descriptionRule"
                 >
                   <el-input
                     v-model="formData[tabIndex][currentStep[tabIndex]].description"
@@ -207,7 +207,7 @@ const isStepValid = (tabIndex) => {
     return false
   }
   if (
-    formData[tabIndex][current].ifNormal &&
+    !formData[tabIndex][current].ifNormal &&
     (formData[tabIndex][current].description === undefined ||
       formData[tabIndex][current].description === null ||
       formData[tabIndex][current].description === '')

+ 30 - 24
src/views/pms/stat/rhkb.vue

@@ -157,7 +157,8 @@ const materialData = ref({})
 const orderSevenData = ref({})
 const safe = ref()
 /** 获取统计数据 */
-const getStats = async () => {
+const getStats =  () => {
+  initYwcbChart()
   // 获取基础统计数据
   IotStatApi.getDeviceCount().then((res) => {
     device.value = res
@@ -173,38 +174,43 @@ const getStats = async () => {
   })
   IotStatApi.getMaintenanceStatus().then((res) => {
     status.value = res
-    initCharts()
+    // initCharts()
   })
   IotStatApi.getMaintenanceTodayStatus().then((res) => {
     todayStatus.value = res
-    initCharts()
+    initTopChart()
   })
+
   IotStatApi.getDeviceStatusCount().then((res) => {
     typeData.value = res
-    initCharts()
+    initDeviceStatusCharts()
   })
   IotStatApi.getSafeCount().then((res) => {
     safe.value = res
   })
   IotStatApi.getMaterial().then((res) => {
     materialData.value = res
-    initCharts();
+    initMaterials()
   })
+
   IotStatApi.getOrderSeven().then((res) => {
-    debugger
     orderSevenData.value = res
     initQxChart();
   })
 }
 
-/** 初始化图表 */
-const initCharts = () => {
-  // 设备数量统计
-  echarts.init(statusChartRef.value).setOption({
+const initMaterials = () => {
+
+  echarts.init(materialChartRef.value).setOption({
     tooltip: {
       trigger: 'item'
     },
     legend: {
+      // top: '5%',
+      // right: '10%',
+      // align: 'left',
+      // orient: 'vertical',
+      // icon: 'circle'
       orient: 'horizontal',  // 水平排列图例项
       bottom: '0%',         // 放置在底部
       icon: 'circle'
@@ -230,21 +236,20 @@ const initCharts = () => {
         labelLine: {
           show: false
         },
-        data: typeData.value
+        data: materialData.value
       }
     ]
   })
+}
 
-  echarts.init(materialChartRef.value).setOption({
+/** 初始化图表 */
+const initDeviceStatusCharts = () => {
+  // 设备数量统计
+  echarts.init(statusChartRef.value).setOption({
     tooltip: {
       trigger: 'item'
     },
     legend: {
-      // top: '5%',
-      // right: '10%',
-      // align: 'left',
-      // orient: 'vertical',
-      // icon: 'circle'
       orient: 'horizontal',  // 水平排列图例项
       bottom: '0%',         // 放置在底部
       icon: 'circle'
@@ -270,10 +275,12 @@ const initCharts = () => {
         labelLine: {
           show: false
         },
-        data: materialData.value
+        data: typeData.value
       }
     ]
   })
+
+
 }
 
 /** 初始化消息统计图表 */
@@ -307,7 +314,7 @@ const fetchChartData = async () => {
 }
 
 // 初始化图表配置
-const initChart = async () => {
+const initYwcbChart = async () => {
   if (!chartContainer.value) return
 
   // 获取数据
@@ -585,7 +592,6 @@ const generateMonths = () => {
 
 const initQxChart = () => {
   if (!qxRef.value) return
-debugger
   qxInstance = echarts.init(qxRef.value)
   debugger
   const option = {
@@ -692,10 +698,10 @@ const resizeQxChart = () => qxInstance?.resize()
 /** 初始化 */
 onMounted(() => {
   getStats()
-  initChart()
-  initTopChart()
-  initActiveChart()
-  initQxChart()
+  // initChart()
+  // initTopChart()
+  // initActiveChart()
+  // initQxChart()
   window.addEventListener('resize', resizeQxChart)
   // fetchTop()
   window.addEventListener('resize', () => topInstance?.resize())