소스 검색

修改文字

chenbaoxin 4 달 전
부모
커밋
29c0cae0f1

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

@@ -103,7 +103,7 @@
         <el-table-column label="操作" width="240" align="center">
           <template v-slot="scope">
             <el-button class="btns" link @click="viewDetails(scope.row)"
-              >修改</el-button
+              >编辑</el-button
             >
             <el-button class="btns" link @click="toRpc(scope.row)"
               >可靠性预测</el-button

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

@@ -150,7 +150,7 @@
           </div>
         </div>
         <div class="history-all">
-          <div class="his-text">工况分类图</div>
+          <div class="his-text">历史工况记录</div>
           <div class="his-fun">
             <!-- {{ chartData }} -->
             <div class="his-time custom-time-select">

+ 15 - 0
src/views/MaintenanceStrategyAssistance/view.vue

@@ -275,6 +275,21 @@ const viewDetails = (id: number,name:string) => {
 </script>
 
 <style scoped>
+.success{
+  /* color: #4FAFFC; */
+
+}
+.dange{
+  color: #FC3F3F;
+
+}
+.warn{
+  color: #FF6100;
+
+}
+.info{
+  color: #008DFF;
+}
 .maintenance-strategy-assistance {
   color: #fff;
 }

+ 26 - 14
src/views/OperationalReliabilityPrediction/index.vue

@@ -29,7 +29,7 @@
           </div>
         </div>
         <div class="section-title">
-          <s-title :type="3" titleText="模拟可靠性预测"></s-title>
+          <s-title :type="3" :titleText="!!fileName ? '模拟可靠性预测':'可靠性预测'"></s-title>
         </div>
         <div class="info-type">
           <div
@@ -42,7 +42,7 @@
           </div>
         </div>
         <div class="info">
-          <div class="info-item">
+          <div class="info-item" v-if="!!!fileName">
             设备健康状态:
             <div class="info-value">
               <div
@@ -52,27 +52,27 @@
               </div>
             </div>
           </div>
-          <div class="info-item">
+          <div class="info-item" v-if="!!!fileName">
             预计发生故障:
-            <span class="info-value"> {{ currentBtn.expected_failure }}</span>
+            <span class="info-value"> {{ formattedText(currentBtn.expected_failure) }}</span>
           </div>
           <div class="info-item">
             近期故障概率:
             <span class="info-value">
-              {{ formattedShortTermFailureProbability }}</span
+              {{ formattedText(formattedShortTermFailureProbability) }}</span
             >
           </div>
           <div class="info-item">
             故障发生时间:
-            <span class="info-value"> {{ currentBtn.failure_time }}</span>
+            <span class="info-value"> {{ formattedText(currentBtn.failure_time) }}</span>
           </div>
           <div class="info-item">
             影响因素分析:
-            <span class="info-value"> {{ currentBtn.impact_factors }}</span>
+            <span class="info-value"> {{ formattedText(currentBtn.impact_factors) }}</span>
           </div>
           <div class="info-item">
-            剩余可时间:
-            <span class="info-value"> {{ currentBtn.remaining_lifetime }}</span>
+            剩余可时间:
+            <span class="info-value"> {{ formattedText(currentBtn.remaining_lifetime) }}</span>
           </div>
         </div>
       </div>
@@ -99,19 +99,19 @@
           <div class="suggestion-item suggestion-item-fir">
             <div class="suggestion-title">建议维修时间</div>
             <span class="suggestion-value">{{
-              currentBtn.suggested_maintenance_time
+              formattedText(currentBtn.suggested_maintenance_time)
             }}</span>
           </div>
           <div class="suggestion-item">
             <div class="suggestion-title">维修方法</div>
             <span class="suggestion-value">{{
-              currentBtn.maintenance_method
+             formattedText( currentBtn.maintenance_method)
             }}</span>
           </div>
           <div class="suggestion-item">
             <div class="suggestion-title">所需维修资源</div>
             <span class="suggestion-value">{{
-              currentBtn.required_resources
+             formattedText( currentBtn.required_resources)
             }}</span>
           </div>
         </div>
@@ -218,8 +218,11 @@ const formatPercentage = (value: string) => {
 // 计算属性来格式化 short_term_failure_probability
 const formattedShortTermFailureProbability = computed(() => {
   const value = currentBtn.value.short_term_failure_probability;
-  return typeof value === 'string' ? formatPercentage(value) : '-';
+  return typeof value === 'string' ? formatPercentage(value) : '暂无';
 });
+const formattedText = (value)=>{
+  return !!value?value:'暂无'
+}
 onMounted(() => {
   let source = 1;
   const pageId = route.query.id;
@@ -254,12 +257,21 @@ onMounted(() => {
       xAxisData.value = result.chart.x;
       forecast_result.value = result.forecast_result;
       devicesArr.value = result.devices;
-      currentBtn.value = {
+      
+      
+      if (result.devices.length==0) {
+        currentBtn.value={
+          health_status:'健康'
+        }
+        
+      }else{
+        currentBtn.value = {
         ...result.devices[0],
         ...result.devices[0].maintenance_suggestion,
         ...result.devices[0].reliability_forecast,
 
       };
+      }
       seriesData.value = [
         {
           name: "趋势",

+ 23 - 12
src/views/WarningSettings/index.vue

@@ -58,6 +58,7 @@
                   editingCell.row == scope.$index &&
                   editingCell.column == `warning_message-${tagIndex}`
                 "
+                type="textarea"
                 v-model="scope.row.warning_message[tagIndex]"
                 @blur="() => saveEdit(scope.row, `warning_message-${tagIndex}`)"
                 @keyup.enter="
@@ -88,6 +89,7 @@
                   editingCell.row == scope.$index &&
                   editingCell.column == `suggested_maintenance_time-${tagIndex}`
                 "
+                    type="textarea"
                 v-model="scope.row.suggested_maintenance_time[tagIndex]"
                 @blur="
                   () =>
@@ -131,6 +133,7 @@
                   editingCell.row == scope.$index &&
                   editingCell.column == `maintenance_method-${tagIndex}`
                 "
+                    type="textarea"
                 v-model="scope.row.maintenance_method[tagIndex]"
                 @blur="
                   () => saveEdit(scope.row, `maintenance_method-${tagIndex}`)
@@ -163,6 +166,7 @@
                   editingCell.row == scope.$index &&
                   editingCell.column == `required_resources-${tagIndex}`
                 "
+                    type="textarea"
                 v-model="scope.row.required_resources[tagIndex]"
                 @blur="
                   () => saveEdit(scope.row, `required_resources-${tagIndex}`)
@@ -377,18 +381,25 @@ const saveEdit = (row, column) => {
 
 <style scoped>
 .tag-col {
-  box-sizing: border-box;
-  border: 1px solid rgba(131, 187, 255, 0.4);
-  background: rgba(0, 122, 255, 0.1);
-  /* line-height: 30px; */
-  height: 30px;
-  padding: 10px;
-  margin: 10px;
-  display: flex;
-  align-items: center;
-  cursor: pointer;
-  justify-content: center;
-  text-align: center;
+    box-sizing: border-box;
+    border: 1px solid rgba(131, 187, 255, 0.4);
+    background: rgba(0, 122, 255, 0.1);
+    /* line-height: 30px; */
+    height: 30px;
+    padding: 10px;
+    margin: 10px;
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+    justify-content: center;
+    text-align: center;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    width: 270px;
+    display: block;
+    line-height: 9px;
+    white-space: nowrap;
+
 }
 .tag-col-no-border {
   height: 30px;