chenbaoxin 4 mesiacov pred
rodič
commit
8de782c9dc

+ 3 - 2
src/components/CalendarHeatmap/index.vue

@@ -46,9 +46,10 @@ const initChart = () => {
     myChart = echarts.init(chart.value);
     const option = {
       tooltip: {
-        position: "top",
+        position: "left",
+        enterable:true,
         formatter: (params) => {
-       const { data } = params;
+          const { data } = params;
           const { x, y, objs } = data;
           const valueDetails = objs.map(obj => 
             obj.value.map(val => `${obj.name}:${val.min} - ${val.max}`).join('<br/>')

+ 7 - 8
src/layout/index.vue

@@ -175,8 +175,10 @@ left: 50%;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
   z-index: 1000;
   display: none;
+  flex-wrap: nowrap;
   flex-direction: column;
-   min-width: 150px;
+  white-space: nowrap
+   /* min-width: 150px; */
 }
 
 .dropdown-item {
@@ -214,20 +216,17 @@ left: 50%;
 }
 
 .active::after {
-  content: " ";
+content: " ";
   position: absolute;
-  left: var(--after-left, 70px);
-  /* 默认值为 70px */
+  left: 50%;
+  transform: translateX(-50%);
   width: var(--after-width, 74px);
-  /* 默认值为 94px */
   height: 3px;
-
   bottom: 3px;
   /* bottom: -19px; */
   /* transform: rotate(180deg); */
   border-radius: 8px;
-  box-shadow: 0px -6px 10px 0px rgb(2, 251, 188),
-    0px -4px 16px 0px rgb(2, 251, 188);
+  box-shadow: 0px -6px 10px 0px rgb(2, 251, 188), 0px -4px 16px 0px rgb(2, 251, 188);
   background: rgb(2, 251, 188);
 }
 </style>

+ 1 - 1
src/views/FileManagement/index.vue

@@ -273,7 +273,7 @@ const submitData = async (data: DataItem) => {
     });
     return false;
   }
-  if (!!!data.file && !!!form.value.id) {
+  if (!!!data.file && !!!form.value.id&&data.file.length==0) {
     ElMessage({
       message: `请选择要上传的文件`,
       type: "error",

+ 33 - 9
src/views/HealthSettings/index.vue

@@ -28,24 +28,26 @@
                     class="custom-time-input"
                   v-model="scope.row.deviation_value[0]"
                   :disabled="scope.$index == 0"
-                  @blur="() => saveEdit(scope.row, `deviation_value-${0}`)"
+                  @focus="recordTap(scope.row.deviation_value[0])"
+                  @blur="() => saveEdit(scope.row, `deviation_value-${0}`, scope.$index)"
                   @keyup.enter="
-                    () => saveEdit(scope.row, `deviation_value-${0}`)
+                    () => saveEdit(scope.row, `deviation_value-${0}`, scope.$index)
                   "
-                  @input="validateInput(scope.row,0)"
+                  @input="validateInput(scope.row,0, scope.$index)"
                 />
               </div>
               <div class="warnLine"></div>
               <div>
                 <el-input
                   v-model="scope.row.deviation_value[1]"
+                   @focus="recordTap(scope.row.deviation_value[1])"
                   :disabled="scope.$index == tableData.length - 1"
-                  @blur="() => saveEdit(scope.row, `deviation_value-${1}`)"
+                  @blur="() => saveEdit(scope.row, `deviation_value-${1}`, scope.$index)"
                   @keyup.enter="
-                    () => saveEdit(scope.row, `deviation_value-${1}`)
+                    () => saveEdit(scope.row, `deviation_value-${1}`, scope.$index)
                   "
                   class="custom-time-input"
-                                    @input="validateInput(scope.row,1)"
+                                    @input="validateInput(scope.row,1, scope.$index)"
 
                 />
               </div>
@@ -218,9 +220,31 @@ const editingCell = ref({ row: null, column: null });
 const editCell = (rowIndex: number, column: string) => {
   editingCell.value = { row: rowIndex, column: column };
 };
-
-const saveEdit = (row, column) => {
+let recordValue=ref(null)
+let recordTap=(val:string)=>{
+recordValue.value=val
+}
+const saveEdit = (row, column,rowIndex) => {
   console.log("Saving data:", row, column);
+      // 确保值不超过后面所有输入框的值
+  // for (let i = rowIndex + 1; i < tableData.value.length; i++) {
+  //   const nextValue = parseFloat(tableData.value[i].deviation_value[0]);
+  //   if (!isNaN(nextValue) && parseFloat(row.deviation_value[0]) > nextValue) {
+  //      tableData.value[rowIndex].deviation_value[0]=recordValue.value
+  //       return false;
+
+  //   }
+  // }
+
+  // // 确保值不小于前面所有输入框的值
+  // for (let i = rowIndex - 1; i >= 0; i--) {
+  //   const prevValue = parseFloat(tableData.value[i].deviation_value[1]);
+  //   if (!isNaN(prevValue) && parseFloat(row.deviation_value[1]) < prevValue) {
+  //           tableData.value[rowIndex].deviation_value[1]=recordValue.value
+
+  //     return false;
+  //   }
+  // }
   // 在这里处理保存逻辑,例如发送请求到服务器
   editingCell.value = { row: null, column: null };
   healthySetUpdate({
@@ -230,7 +254,7 @@ const saveEdit = (row, column) => {
     ElMessage.success("操作成功!");
   });
 };
-const validateInput = (row, index) => {
+const validateInput = (row, index,rowIndex) => {
   let value = row.deviation_value[index];
   value = value.replace(/[^0-9.]/g, ""); // 只允许输入数字和小数点
 

+ 16 - 4
src/views/HealthStatusAnalysis/index.vue

@@ -140,11 +140,11 @@
     <div class="right">
       <div class="right-top">
         <s-title :type="2" titleText="运行工况分析"></s-title>
-        <div class="run-status">
+        <div class="run-status fullClass" >
           <div class="status-text">运行状态</div>
           <img src="@/assets/img/4.png" alt="" srcset="" />
           <div :class="['status-result', 'status-result' + runStatusColor]">
-            {{ runStatusText }}
+            {{ runStatusText }}贵金属的高房价市房管局水电费规划局
           </div>
         </div>
         <div class="history-all">
@@ -220,8 +220,14 @@
                   <el-table-column
                     width="200"
                     property="deviation_percentage"
-                    label="偏离百分比"
-                  />
+                    label="偏离百分比">
+                      <template #default="scope">
+            
+                        <div >
+                          {{ scope.row.deviation_percentage }}%
+                        </div>
+                    </template>
+                  </el-table-column>
                   <el-table-column
                     width="200"
                     property="address"
@@ -844,6 +850,12 @@ const healthColor = (status: string) => {
 </script>
 
 <style scoped>
+.status-text{
+    white-space: nowrap
+}
+.fullClass{
+  width: 100% !important;
+}
 .all-page {
   display: grid;
   grid-template-columns: 58% 1% 41%;

+ 1 - 1
src/views/MaintenanceStrategyAssistance/his.vue

@@ -82,7 +82,7 @@
             align="center"
           >
               <template v-slot="scope">
-              <span>{{ scope.row.lifetime }}</span>
+              <span>{{ scope.row.lifetime }}</span>
             </template>
           </el-table-column>
           <el-table-column label="维修策略及更换建议" align="center">

+ 1 - 1
src/views/MaintenanceStrategyAssistance/view.vue

@@ -84,7 +84,7 @@
             align="center"
           >
               <template v-slot="scope">
-              <span>{{ scope.row.lifetime }}</span>
+              <span>{{ scope.row.lifetime }}</span>
             </template>
           </el-table-column>
           <el-table-column label="维修策略及更换建议" align="center">

+ 19 - 2
src/views/OperationalReliabilityPrediction/index.vue

@@ -59,7 +59,7 @@
           <div class="info-item">
             近期故障概率:
             <span class="info-value">
-              {{ currentBtn.short_term_failure_probability }}</span
+              {{ formattedShortTermFailureProbability }}</span
             >
           </div>
           <div class="info-item">
@@ -188,7 +188,7 @@ const seriesData = ref([
   },
 ]);
 const devicesArr = ref([]);
-const gridLeft = ref(32);
+const gridLeft = ref(36);
 const gridRight = ref(65);
 const forecast_result = ref("");
 const currentBtn = ref("");
@@ -204,6 +204,22 @@ const btnTab = (index: number, item: any) => {
     ...item.reliability_forecast,
   };
 };
+const formatPercentage = (value: string) => {
+  // 去掉百分号
+  const numericValue = parseFloat(value.replace('%', ''));
+  // 检查是否为数字
+  if (isNaN(numericValue)) {
+    return value; // 如果不是数字,返回原始值
+  }
+  // 取小数点后两位并加上百分号
+  return numericValue.toFixed(2) + '%';
+};
+
+// 计算属性来格式化 short_term_failure_probability
+const formattedShortTermFailureProbability = computed(() => {
+  const value = currentBtn.value.short_term_failure_probability;
+  return typeof value === 'string' ? formatPercentage(value) : '-';
+});
 onMounted(() => {
   let source = 1;
   const pageId = route.query.id;
@@ -242,6 +258,7 @@ onMounted(() => {
         ...result.devices[0],
         ...result.devices[0].maintenance_suggestion,
         ...result.devices[0].reliability_forecast,
+
       };
       seriesData.value = [
         {