yanghao před 1 měsícem
rodič
revize
a685fa8288

+ 194 - 181
src/views/pms/device/monitor/RangeSetting.vue

@@ -256,14 +256,21 @@
 </template>
 
 <script setup>
-import { ref, reactive, watch, nextTick, computed } from 'vue';
+import { ref, reactive, watch, nextTick, computed } from 'vue'
 import { useI18n } from 'vue-i18n'
-import {
 const { t } = useI18n()
-  Search, FolderOpened, Monitor, Plus, Check,
-  Edit, Delete, InfoFilled, Clock
-} from '@element-plus/icons-vue';
-import { ElMessage, ElMessageBox, ElNotification } from 'element-plus';
+import {
+  Search,
+  FolderOpened,
+  Monitor,
+  Plus,
+  Check,
+  Edit,
+  Delete,
+  InfoFilled,
+  Clock
+} from '@element-plus/icons-vue'
+import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
 
 // 属性卡片组件(使用slot)
 const PropertyCard = {
@@ -392,42 +399,42 @@ const PropertyCard = {
     // 获取数据类型显示名称
     getTypeName(type) {
       const types = {
-        'integer': '整数',
-        'float': '浮点数',
-        'boolean': '布尔值'
-      };
-      return types[type] || type;
+        integer: '整数',
+        float: '浮点数',
+        boolean: '布尔值'
+      }
+      return types[type] || type
     },
     // 获取数据类型标签样式
     getTypeTagType(type) {
       const types = {
-        'integer': 'primary',
-        'float': 'success',
-        'boolean': 'warning'
-      };
-      return types[type] || 'info';
+        integer: 'primary',
+        float: 'success',
+        boolean: 'warning'
+      }
+      return types[type] || 'info'
     },
     // 处理上下限变化
     handleLimitChange() {
-      this.$emit('update-property', { ...this.property });
+      this.$emit('update-property', { ...this.property })
     },
     // 处理布尔值变化
     handleBooleanChange() {
-      this.$emit('update-property', { ...this.property });
+      this.$emit('update-property', { ...this.property })
     },
     // 格式化日期
     formatDate(timestamp) {
-      if (!timestamp) return '未更新';
-      const date = new Date(timestamp);
-      return date.toLocaleString();
+      if (!timestamp) return '未更新'
+      const date = new Date(timestamp)
+      return date.toLocaleString()
     }
   }
-};
+}
 
 // 生成唯一ID
 const generateId = () => {
-  return Date.now().toString(36) + Math.random().toString(36).substr(2, 8);
-};
+  return Date.now().toString(36) + Math.random().toString(36).substr(2, 8)
+}
 
 // 设备树形结构数据
 const deviceTreeData = ref([
@@ -471,24 +478,24 @@ const deviceTreeData = ref([
       }
     ]
   }
-]);
+])
 
 // 树形结构配置
 const treeProps = {
   children: 'children',
   label: 'label'
-};
+}
 
 // 状态管理
-const searchQuery = ref('');
-const deviceTree = ref(null);
-const selectedNode = ref(null);
-const properties = ref([]);
-const saveLoading = ref(false);
-const dialogLoading = ref(false);
-const propertyDialogVisible = ref(false);
-const isEditing = ref(false);
-const currentEditIndex = ref(-1);
+const searchQuery = ref('')
+const deviceTree = ref(null)
+const selectedNode = ref(null)
+const properties = ref([])
+const saveLoading = ref(false)
+const dialogLoading = ref(false)
+const propertyDialogVisible = ref(false)
+const isEditing = ref(false)
+const currentEditIndex = ref(-1)
 
 // 属性表单数据
 const currentProperty = reactive({
@@ -503,7 +510,7 @@ const currentProperty = reactive({
   description: '',
   required: false,
   updatedAt: null
-});
+})
 
 // 属性表单验证规则
 const propertyRules = {
@@ -516,9 +523,7 @@ const propertyRules = {
     { pattern: /^[a-zA-Z0-9_]+$/, message: '标识只能包含字母、数字和下划线', trigger: 'blur' },
     { max: 30, message: '属性标识不能超过30个字符', trigger: 'blur' }
   ],
-  dataType: [
-    { required: true, message: '请选择数据类型', trigger: 'change' }
-  ],
+  dataType: [{ required: true, message: '请选择数据类型', trigger: 'change' }],
   minValue: [
     {
       required: () => currentProperty.dataType !== 'boolean',
@@ -531,15 +536,15 @@ const propertyRules = {
       trigger: 'blur',
       validator: (rule, value, callback) => {
         if (currentProperty.dataType === 'boolean') {
-          return callback();
+          return callback()
         }
         if (value === null || value === undefined) {
-          return callback(new Error('请输入最小值'));
+          return callback(new Error('请输入最小值'))
         }
         if (currentProperty.maxValue !== null && value > currentProperty.maxValue) {
-          return callback(new Error('最小值不能大于最大值'));
+          return callback(new Error('最小值不能大于最大值'))
         }
-        callback();
+        callback()
       }
     }
   ],
@@ -555,30 +560,30 @@ const propertyRules = {
       trigger: 'blur',
       validator: (rule, value, callback) => {
         if (currentProperty.dataType === 'boolean') {
-          return callback();
+          return callback()
         }
         if (value === null || value === undefined) {
-          return callback(new Error('请输入最大值'));
+          return callback(new Error('请输入最大值'))
         }
         if (currentProperty.minValue !== null && value < currentProperty.minValue) {
-          return callback(new Error('最大值不能小于最小值'));
+          return callback(new Error('最大值不能小于最小值'))
         }
-        callback();
+        callback()
       }
     }
   ]
-};
+}
 
 // 过滤节点方法
 const filterNode = (value, data) => {
-  if (!value) return true;
-  return data.label.toLowerCase().includes(value.toLowerCase());
-};
+  if (!value) return true
+  return data.label.toLowerCase().includes(value.toLowerCase())
+}
 
 // 监听搜索关键词变化
 watch(searchQuery, (value) => {
-  deviceTree.value?.filter(value);
-});
+  deviceTree.value?.filter(value)
+})
 
 // 处理节点选择
 const handleNodeSelect = (data) => {
@@ -592,28 +597,31 @@ const handleNodeSelect = (data) => {
         cancelButtonText: '取消',
         type: 'warning'
       }
-    ).then(() => {
-      loadNodeProperties(data);
-    }).catch(() => {
-      // 取消切换,恢复之前的选择
-      nextTick(() => {
-        deviceTree.value.setCurrentKey(selectedNode.value?.id);
-      });
-    });
+    )
+      .then(() => {
+        loadNodeProperties(data)
+      })
+      .catch(() => {
+        // 取消切换,恢复之前的选择
+        nextTick(() => {
+          deviceTree.value.setCurrentKey(selectedNode.value?.id)
+        })
+      })
   } else {
-    loadNodeProperties(data);
+    loadNodeProperties(data)
   }
-};
+}
 
 // 加载节点属性
 const loadNodeProperties = (data) => {
-  selectedNode.value = data;
+  selectedNode.value = data
   // 模拟API加载属性数据
-  saveLoading.value = true;
+  saveLoading.value = true
 
   setTimeout(() => {
     // 根据不同节点加载不同的属性示例数据
-    if (data.id === 'dev11') { // 室内温度计
+    if (data.id === 'dev11') {
+      // 室内温度计
       properties.value = [
         {
           id: generateId(),
@@ -650,8 +658,9 @@ const loadNodeProperties = (data) => {
           required: true,
           updatedAt: Date.now()
         }
-      ];
-    } else if (data.id === 'cat1') { // 温度设备分类
+      ]
+    } else if (data.id === 'cat1') {
+      // 温度设备分类
       properties.value = [
         {
           id: generateId(),
@@ -677,165 +686,169 @@ const loadNodeProperties = (data) => {
           description: '设备存储的环境温度范围',
           updatedAt: Date.now() - 86400000
         }
-      ];
+      ]
     } else {
       // 其他节点的默认属性
-      properties.value = [];
+      properties.value = []
     }
 
-    saveLoading.value = false;
+    saveLoading.value = false
     ElNotification({
       title: '已加载',
       message: `已加载 ${data.label} 的 ${properties.value.length} 个属性`,
       duration: 1500,
       position: 'bottom-right'
-    });
-  }, 600);
-};
+    })
+  }, 600)
+}
 
 // 检查是否有未保存的更改
-const hasUnsavedChanges = ref(false);
+const hasUnsavedChanges = ref(false)
 
 // 监听属性变化
-watch(properties, (newVal) => {
-  hasUnsavedChanges.value = true;
-}, { deep: true });
+watch(
+  properties,
+  (newVal) => {
+    hasUnsavedChanges.value = true
+  },
+  { deep: true }
+)
 
 // 显示添加属性对话框
 const showAddPropertyDialog = () => {
-  resetPropertyForm();
-  isEditing.value = false;
-  currentProperty.id = generateId();
-  propertyDialogVisible.value = true;
+  resetPropertyForm()
+  isEditing.value = false
+  currentProperty.id = generateId()
+  propertyDialogVisible.value = true
 
   // 自动聚焦到第一个输入框
   nextTick(() => {
-    const firstInput = document.querySelector('.property-dialog .el-input__inner');
-    if (firstInput) firstInput.focus();
-  });
-};
+    const firstInput = document.querySelector('.property-dialog .el-input__inner')
+    if (firstInput) firstInput.focus()
+  })
+}
 
 // 显示编辑属性对话框
 const showEditPropertyDialog = (index, property) => {
-  resetPropertyForm();
-  isEditing.value = true;
-  currentEditIndex.value = index;
+  resetPropertyForm()
+  isEditing.value = true
+  currentEditIndex.value = index
 
   // 复制属性数据到表单
-  Object.assign(currentProperty, { ...property });
+  Object.assign(currentProperty, { ...property })
 
-  propertyDialogVisible.value = true;
+  propertyDialogVisible.value = true
   nextTick(() => {
-    const firstInput = document.querySelector('.property-dialog .el-input__inner');
-    if (firstInput) firstInput.focus();
-  });
-};
+    const firstInput = document.querySelector('.property-dialog .el-input__inner')
+    if (firstInput) firstInput.focus()
+  })
+}
 
 // 重置属性表单
 const resetPropertyForm = () => {
-  currentProperty.name = '';
-  currentProperty.code = '';
-  currentProperty.dataType = 'float';
-  currentProperty.unit = '';
-  currentProperty.minValue = null;
-  currentProperty.maxValue = null;
-  currentProperty.booleanValue = false;
-  currentProperty.description = '';
-  currentProperty.required = false;
+  currentProperty.name = ''
+  currentProperty.code = ''
+  currentProperty.dataType = 'float'
+  currentProperty.unit = ''
+  currentProperty.minValue = null
+  currentProperty.maxValue = null
+  currentProperty.booleanValue = false
+  currentProperty.description = ''
+  currentProperty.required = false
 
   // 重置表单验证
   nextTick(() => {
-    propertyForm.value?.clearValidate();
-  });
-};
+    propertyForm.value?.clearValidate()
+  })
+}
 
 // 处理数据类型变化
 const handleDataTypeChange = (type) => {
   // 根据数据类型重置相关值
   if (type === 'boolean') {
-    currentProperty.minValue = null;
-    currentProperty.maxValue = null;
+    currentProperty.minValue = null
+    currentProperty.maxValue = null
   } else if (type === 'integer') {
-    currentProperty.minValue = currentProperty.minValue !== null ? Math.round(currentProperty.minValue) : 0;
-    currentProperty.maxValue = currentProperty.maxValue !== null ? Math.round(currentProperty.maxValue) : 100;
+    currentProperty.minValue =
+      currentProperty.minValue !== null ? Math.round(currentProperty.minValue) : 0
+    currentProperty.maxValue =
+      currentProperty.maxValue !== null ? Math.round(currentProperty.maxValue) : 100
   }
-};
+}
 
 // 确认属性操作(添加或编辑)
-const propertyForm = ref(null);
+const propertyForm = ref(null)
 const confirmPropertyAction = () => {
   propertyForm.value.validate((valid) => {
     if (valid) {
-      dialogLoading.value = true;
+      dialogLoading.value = true
 
       // 模拟API请求延迟
       setTimeout(() => {
-        const newProperty = { ...currentProperty };
-        newProperty.updatedAt = Date.now();
+        const newProperty = { ...currentProperty }
+        newProperty.updatedAt = Date.now()
 
         if (isEditing.value) {
           // 编辑现有属性
-          properties.value.splice(currentEditIndex.value, 1, newProperty);
-          ElMessage.success('属性已更新');
+          properties.value.splice(currentEditIndex.value, 1, newProperty)
+          ElMessage.success('属性已更新')
         } else {
           // 添加新属性
-          properties.value.push(newProperty);
+          properties.value.push(newProperty)
           // 更新节点的属性计数
           if (selectedNode.value) {
-            selectedNode.value.propertyCount = (selectedNode.value.propertyCount || 0) + 1;
+            selectedNode.value.propertyCount = (selectedNode.value.propertyCount || 0) + 1
           }
-          ElMessage.success('新属性已添加');
+          ElMessage.success('新属性已添加')
         }
 
-        dialogLoading.value = false;
-        propertyDialogVisible.value = false;
-      }, 500);
+        dialogLoading.value = false
+        propertyDialogVisible.value = false
+      }, 500)
     }
-  });
-};
+  })
+}
 
 // 处理属性更新
 const handlePropertyUpdate = (index, updatedProperty) => {
-  updatedProperty.updatedAt = Date.now();
-  properties.value.splice(index, 1, updatedProperty);
-};
+  updatedProperty.updatedAt = Date.now()
+  properties.value.splice(index, 1, updatedProperty)
+}
 
 // 处理属性删除
 const handlePropertyDelete = (index) => {
-  const property = properties.value[index];
-  ElMessageBox.confirm(
-    `确定要删除属性"${property.name}"吗?此操作不可撤销。`,
-    '确认删除',
-    {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'danger'
-    }
-  ).then(() => {
-    properties.value.splice(index, 1);
-    // 更新节点的属性计数
-    if (selectedNode.value) {
-      selectedNode.value.propertyCount = Math.max(0, (selectedNode.value.propertyCount || 0) - 1);
-    }
-    ElMessage.success('属性已删除');
-  }).catch(() => {
-    // 取消删除
-  });
-};
+  const property = properties.value[index]
+  ElMessageBox.confirm(`确定要删除属性"${property.name}"吗?此操作不可撤销。`, '确认删除', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'danger'
+  })
+    .then(() => {
+      properties.value.splice(index, 1)
+      // 更新节点的属性计数
+      if (selectedNode.value) {
+        selectedNode.value.propertyCount = Math.max(0, (selectedNode.value.propertyCount || 0) - 1)
+      }
+      ElMessage.success('属性已删除')
+    })
+    .catch(() => {
+      // 取消删除
+    })
+}
 
 // 保存所有属性配置
 const saveAllProperties = () => {
   if (properties.value.length === 0) {
-    ElMessage.warning('没有可保存的属性');
-    return;
+    ElMessage.warning('没有可保存的属性')
+    return
   }
 
-  saveLoading.value = true;
+  saveLoading.value = true
 
   // 模拟API保存
   setTimeout(() => {
-    saveLoading.value = false;
-    hasUnsavedChanges.value = false;
+    saveLoading.value = false
+    hasUnsavedChanges.value = false
 
     ElNotification({
       title: '保存成功',
@@ -843,44 +856,44 @@ const saveAllProperties = () => {
       type: 'success',
       duration: 2000,
       position: 'bottom-right'
-    });
-  }, 800);
-};
+    })
+  }, 800)
+}
 
 // 返回操作
 const handleBack = () => {
   if (hasUnsavedChanges.value) {
-    ElMessageBox.confirm(
-      '当前有未保存的修改,离开页面将丢失这些更改,是否继续?',
-      '确认离开',
-      {
-        confirmButtonText: '离开',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }
-    ).then(() => {
+    ElMessageBox.confirm('当前有未保存的修改,离开页面将丢失这些更改,是否继续?', '确认离开', {
+      confirmButtonText: '离开',
+      cancelButtonText: '取消',
+      type: 'warning'
+    }).then(() => {
       // 实际应用中这里会执行路由跳转
-      ElMessage.info('已返回上一页');
-    });
+      ElMessage.info('已返回上一页')
+    })
   } else {
     // 实际应用中这里会执行路由跳转
-    ElMessage.info('已返回上一页');
+    ElMessage.info('已返回上一页')
   }
-};
+}
 
 // 页面加载时默认选中第一个设备
-watch(() => deviceTreeData.value.length, (length) => {
-  if (length > 0 && !selectedNode.value) {
-    // 尝试选择第一个设备节点
-    const firstDevice = deviceTreeData.value[0]?.children?.[0];
-    if (firstDevice) {
-      nextTick(() => {
-        handleNodeSelect(firstDevice);
-        deviceTree.value.setCurrentKey(firstDevice.id);
-      });
+watch(
+  () => deviceTreeData.value.length,
+  (length) => {
+    if (length > 0 && !selectedNode.value) {
+      // 尝试选择第一个设备节点
+      const firstDevice = deviceTreeData.value[0]?.children?.[0]
+      if (firstDevice) {
+        nextTick(() => {
+          handleNodeSelect(firstDevice)
+          deviceTree.value.setCurrentKey(firstDevice.id)
+        })
+      }
     }
-  }
-}, { immediate: true });
+  },
+  { immediate: true }
+)
 </script>
 
 <style scoped>

+ 4 - 3
src/views/pms/stat/rhkb/orderTrend.vue

@@ -1,8 +1,8 @@
 <script lang="ts" setup>
 import * as echarts from 'echarts'
 import { useI18n } from 'vue-i18n'
-import {
 const { t } = useI18n()
+import {
   ANIMATION,
   ChartData,
   createLegend,
@@ -202,8 +202,9 @@ onUnmounted(() => {
     <div class="panel-title">
       <div class="icon-decorator">
         <span></span>
-        <span></span>
-      </div>{{ t('stat.ordertrend865934-0') }}</div>
+        <span></span> </div
+      >{{ t('stat.ordertrend865934-0') }}</div
+    >
     <div ref="chartRef" class="flex-1 min-h-0"></div>
   </div>
 </template>

+ 38 - 42
src/views/pms/stat/test.vue

@@ -7,8 +7,7 @@
         icon="fa-solid:project-diagram"
         icon-bg-color="text-blue-500"
         icon-color="bg-blue-100"
-        :title="t('stat.testvue814981-0')"
-      />
+        :title="t('stat.testvue814981-0')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -16,8 +15,7 @@
         icon="fa-solid:list"
         icon-bg-color="text-pink-500"
         icon-color="bg-blue-100"
-        :title="t('stat.testvue814981-1')"
-      />
+        :title="t('stat.testvue814981-1')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -25,8 +23,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-purple-500"
         icon-color="bg-purple-100"
-        :title="t('stat.testvue814981-2')"
-      />
+        :title="t('stat.testvue814981-2')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -34,8 +31,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-purple-500"
         icon-color="bg-purple-100"
-        :title="t('stat.testvue814981-3')"
-      />
+        :title="t('stat.testvue814981-3')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -43,8 +39,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-green-500"
         icon-color="bg-green-100"
-        :title="t('stat.testvue814981-4')"
-      />
+        :title="t('stat.testvue814981-4')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -52,8 +47,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-green-500"
         icon-color="bg-green-100"
-        :title="t('stat.testvue814981-5')"
-      />
+        :title="t('stat.testvue814981-5')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -61,8 +55,7 @@
         icon="fa-solid:times-circle"
         icon-bg-color="text-yellow-500"
         icon-color="bg-yellow-100"
-        :title="t('stat.testvue814981-6')"
-      />
+        :title="t('stat.testvue814981-6')" />
     </el-col>
     <el-col v-loading="loading" :sm="3" :xs="12">
       <SummaryCard
@@ -70,8 +63,7 @@
         icon="fa-solid:award"
         icon-bg-color="text-yellow-500"
         icon-color="bg-yellow-100"
-        :title="t('stat.testvue814981-7')"
-      />
+        :title="t('stat.testvue814981-7')" />
     </el-col>
     <!-- 其他统计卡片... -->
   </el-row>
@@ -116,7 +108,9 @@
         <el-card class="chart-card" shadow="never">
           <template #header>
             <div class="flex items-center">
-              <span class="text-base font-medium text-gray-600">{{ t('stat.testvue814981-10') }}</span>
+              <span class="text-base font-medium text-gray-600">{{
+                t('stat.testvue814981-10')
+              }}</span>
             </div>
           </template>
           <div ref="repairWellChartRef" class="h-[160px]"></div>
@@ -124,7 +118,9 @@
         <el-card class="chart-card mt-1" shadow="never">
           <template #header>
             <div class="flex items-center">
-              <span class="text-base font-medium text-gray-600">{{ t('stat.testvue814981-11') }}</span>
+              <span class="text-base font-medium text-gray-600">{{
+                t('stat.testvue814981-11')
+              }}</span>
             </div>
           </template>
           <div ref="drillingWellChartRef" class="h-[160px]"></div>
@@ -136,7 +132,9 @@
         <el-card class="chart-card" shadow="never">
           <template #header>
             <div class="flex items-center">
-              <span class="text-base font-medium text-gray-600">{{ t('stat.testvue814981-12') }}</span>
+              <span class="text-base font-medium text-gray-600">{{
+                t('stat.testvue814981-12')
+              }}</span>
             </div>
           </template>
           <div ref="drillingWorkloadChartRef" class="h-[360px]"></div>
@@ -144,7 +142,9 @@
         <el-card class="chart-card mt-1" shadow="never">
           <template #header>
             <div class="flex items-center">
-              <span class="text-base font-medium text-gray-600">{{ t('stat.testvue814981-13') }}</span>
+              <span class="text-base font-medium text-gray-600">{{
+                t('stat.testvue814981-13')
+              }}</span>
             </div>
           </template>
           <div ref="repairWorkloadChartRef" class="h-[360px]"></div>
@@ -157,9 +157,9 @@
 <script setup lang="ts" name="Index">
 import * as echarts from 'echarts/core'
 import { useI18n } from 'vue-i18n'
+const { t } = useI18n()
 import { BarChart, GaugeChart, LineChart, PieChart } from 'echarts/charts' // 显式导入柱状图模块
 import {
-const { t } = useI18n()
   GridComponent,
   LegendComponent,
   TitleComponent,
@@ -175,9 +175,9 @@ import {
 } from '@/api/iot/statistics'
 import { formatDate } from '@/utils/formatTime'
 import { IotStatApi } from '@/api/pms/stat'
-import SummaryCard from "@/components/SummaryCard/index.vue";
-import {reactive, ref, onMounted, onBeforeUnmount, watch} from "vue";
-import {useUserStore} from "@/store/modules/user";
+import SummaryCard from '@/components/SummaryCard/index.vue'
+import { reactive, ref, onMounted, onBeforeUnmount, watch } from 'vue'
+import { useUserStore } from '@/store/modules/user'
 
 // TODO @super:参考下 /Users/yunai/Java/yudao-ui-admin-vue3/src/views/mall/home/index.vue,拆一拆组件
 
@@ -313,7 +313,7 @@ const drillingWorkloadChartRef = ref()
 const repairWorkloadChartRef = ref()
 
 /** 获取统计数据 */
-const getStats =  () => {
+const getStats = () => {
   initYwcbChart()
   // 获取基础统计数据
   IotStatApi.getDeviceCount().then((res) => {
@@ -351,7 +351,7 @@ const getStats =  () => {
 
   IotStatApi.getOrderSeven().then((res) => {
     orderSevenData.value = res
-    initQxChart();
+    initQxChart()
   })
 
   IotStatApi.getMaintenanceStatus().then((res) => {
@@ -375,7 +375,6 @@ const getStats =  () => {
 }
 
 const initMaterials = () => {
-
   echarts.init(materialChartRef.value).setOption({
     tooltip: {
       trigger: 'item'
@@ -386,8 +385,8 @@ const initMaterials = () => {
       // align: 'left',
       // orient: 'vertical',
       // icon: 'circle'
-      orient: 'horizontal',  // 水平排列图例项
-      bottom: '0%',         // 放置在底部
+      orient: 'horizontal', // 水平排列图例项
+      bottom: '0%', // 放置在底部
       icon: 'circle'
     },
     series: [
@@ -425,8 +424,8 @@ const initDeviceStatusCharts = () => {
       trigger: 'item'
     },
     legend: {
-      orient: 'horizontal',  // 水平排列图例项
-      bottom: '0%',         // 放置在底部
+      orient: 'horizontal', // 水平排列图例项
+      bottom: '0%', // 放置在底部
       icon: 'circle'
     },
     series: [
@@ -479,8 +478,8 @@ const fetchChartData = async () => {
   return new Promise((resolve) => {
     setTimeout(() => {
       resolve({
-        months: ['空压机','增压机','提纯撬'],
-        repairs: [10, 30, 90 ]
+        months: ['空压机', '增压机', '提纯撬'],
+        repairs: [10, 30, 90]
       })
     }, 300)
   })
@@ -534,9 +533,7 @@ const initYwcbChart = async () => {
         name: '当日运维成本',
         type: 'bar',
         itemStyle: {
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-            { offset: 0, color: '#f69606' },
-          ])
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#f69606' }])
         },
         emphasis: {
           focus: 'series'
@@ -816,7 +813,7 @@ const initQxChart = () => {
     ],
     series: orderSevenData.value.series.map((item, index) => {
       // 假设前两条曲线使用左侧 Y 轴,后两条曲线使用右侧 Y 轴
-      const yAxisIndex = index < 2 ? 0 : 1;
+      const yAxisIndex = index < 2 ? 0 : 1
       return {
         name: item.name,
         type: 'line',
@@ -852,7 +849,7 @@ const initDrillingWorkloadChart = () => {
       }
     },
     legend: {
-      data: drillingWorkloadData.value.series.map(item => item.name)
+      data: drillingWorkloadData.value.series.map((item) => item.name)
     },
     grid: {
       left: '3%',
@@ -868,7 +865,7 @@ const initDrillingWorkloadChart = () => {
       type: 'value',
       name: '进尺(米)'
     },
-    series: drillingWorkloadData.value.series.map(item => ({
+    series: drillingWorkloadData.value.series.map((item) => ({
       name: item.name,
       type: 'bar',
       data: item.data
@@ -889,7 +886,7 @@ const initRepairWorkloadChart = () => {
       }
     },
     legend: {
-      data: repairWorkloadData.value.series.map(item => item.name)
+      data: repairWorkloadData.value.series.map((item) => item.name)
     },
     grid: {
       left: '3%',
@@ -905,7 +902,7 @@ const initRepairWorkloadChart = () => {
       type: 'value',
       name: '进尺(米)'
     },
-    series: repairWorkloadData.value.series.map(item => ({
+    series: repairWorkloadData.value.series.map((item) => ({
       name: item.name,
       type: 'bar',
       data: item.data
@@ -919,5 +916,4 @@ onMounted(() => {
   initDrillingWorkloadChart()
   initRepairWorkloadChart()
 })
-
 </script>