Преглед изворни кода

问题(sunzehao提交)修改

wangb пре 5 месеци
родитељ
комит
b8d4845f3c

+ 24 - 15
src/views/IntegratedAlarm/alarmConfig/components/custom_components.vue

@@ -274,7 +274,7 @@
         >
           <el-table
             ref="multipleTableRef"
-            :max-height="650"
+            :max-height="550"
             width="100%"
             :data="state.alarmMapList"
             @selection-change="handleSelectionChange"
@@ -297,7 +297,6 @@
               prop="name"
               align="center"
               width="200px"
-              show-overflow-tooltip
               column-key="name"
               :filters="getFilters('name')"
               :filter-method="filterHandler"
@@ -306,12 +305,11 @@
               label="排查步骤"
               prop="troubleMethod"
               align="left"
-              show-overflow-tooltip
             >
               <template #default="scope">
-                <template v-if="Array.isArray(scope.row.troubleMethod)">
+                <template v-if="Array.isArray(splitStr(scope.row.troubleMethod))">
                   <p
-                    v-for="(item, index) in scope.row.troubleMethod"
+                    v-for="(item, index) in splitStr(scope.row.troubleMethod)"
                     :key="index"
                   >
                     {{ index + 1 }}. {{ item }}
@@ -326,12 +324,11 @@
               label="检修方案"
               prop="processMethod"
               align="left"
-              show-overflow-tooltip
             >
               <template #default="scope">
-                <template v-if="Array.isArray(scope.row.processMethod)">
+                <template v-if="Array.isArray(splitStr(scope.row.processMethod))">
                   <p
-                    v-for="(item, index) in scope.row.processMethod"
+                    v-for="(item, index) in splitStr(scope.row.processMethod)"
                     :key="index"
                   >
                     {{ index + 1 }}. {{ item }}
@@ -347,11 +344,10 @@
               prop="tools"
               align="left"
               width="120px"
-              show-overflow-tooltip
             >
               <template #default="scope">
-                <template v-if="Array.isArray(scope.row.tools)">
-                  <p v-for="(item, index) in scope.row.tools" :key="index">
+                <template v-if="Array.isArray(splitStr(scope.row.tools))">
+                  <p v-for="(item, index) in splitStr(scope.row.tools)" :key="index">
                     {{ index + 1 }}. {{ item }}
                   </p>
                 </template>
@@ -364,12 +360,10 @@
               label="备品备件"
               prop="spareParts"
               align="left"
-              width="120px"
-              show-overflow-tooltip
             >
               <template #default="scope">
-                <template v-if="Array.isArray(scope.row.spareParts)">
-                  <p v-for="(item, index) in scope.row.spareParts" :key="index">
+                <template v-if="Array.isArray(splitStr(scope.row.spareParts))">
+                  <p v-for="(item, index) in splitStr(scope.row.spareParts)" :key="index">
                     {{ index + 1 }}. {{ item }}
                   </p>
                 </template>
@@ -658,6 +652,16 @@ const form = ref({
   uniformCode: "",
 });
 
+const splitStr = (str) => {
+  if (/(\d+\.\s+)/.test(str)) {
+    return str
+      .split(/(\d+\.\s+)/)
+      .filter(Boolean)
+      .filter((_, index) => index % 2 !== 0);
+  }
+  return str;
+}
+
 const getExtraCharacters = (str1, str2) => {
   let result = "";
   if (str1 && str2) {
@@ -1182,6 +1186,11 @@ const closeDialog = () => {
 
   .el-table {
     margin: 5px 0;
+    .el-table__inner-wrapper{
+      // max-width: 95%;
+      width: 100%;
+      overflow-x: auto;
+    }
   }
 }
 </style>

+ 24 - 24
src/views/IntegratedAlarm/reliability/customAnalyse/index.vue

@@ -293,8 +293,6 @@ onMounted(() => {
   getfetchRelatePart();
   //   state.tHeard = dataJson.data.data.title;
   //   state.tableData = dataJson.data.data.data;
-  changeTableData(dataJson.data.data.dataList);
-  // getTableList();
 });
 const pageTitle = "预警分析";
 const store = useStore();
@@ -322,7 +320,7 @@ const state = reactive({
   tableData: [],
   tHeard: [],
   changZhan: "",
-  components: "", //部件
+  components: ["FDJ", "CLX"], //部件
   modelId: "", //型号
   alarmIds: "",
   alarmIdList: [],
@@ -375,8 +373,8 @@ const getWpArray = async () => {
   const { data } = await getWpList(state.typeVal);
   changZhanArray.value = data;
 
-  state.changZhan =
-    state.typeVal == "windturbine" ? "GJNY_SXGS_FSG_FDC_STA" : data[0]?.id;
+  state.changZhan = data[0]?.id;
+  getTableList();
 };
 // 机型
 const getequipmentmodel_list = async () => {
@@ -395,24 +393,24 @@ const modelList = computed(() => {
   //   } else {
   //     return state.modelListAll[state.changZhan];
   //   }
-  return [
-    {
-      id: "SEC-W02B-1250kW",
-      nemCode: "SEC-W02B-1250kW",
-      name: "SEC-W02B-1250kW",
-      aname: "SEC-W02B-1250kW",
-      description: "DI",
-      powerProduction: 1250,
-      windturbineManufacturerId: "SHDQ_MF",
-      photo: null,
-      unit: null,
-      cutinwindSpeed: 3,
-      ratedwindSpeed: 11,
-      cutoutwindSpeed: "25",
-      sweptArea: 5800,
-      equipmentCategory: "F",
-    },
-  ];
+  // return [
+  //   {
+  //     id: "SEC-W02B-1250kW",
+  //     nemCode: "SEC-W02B-1250kW",
+  //     name: "SEC-W02B-1250kW",
+  //     aname: "SEC-W02B-1250kW",
+  //     description: "DI",
+  //     powerProduction: 1250,
+  //     windturbineManufacturerId: "SHDQ_MF",
+  //     photo: null,
+  //     unit: null,
+  //     cutinwindSpeed: 3,
+  //     ratedwindSpeed: 11,
+  //     cutoutwindSpeed: "25",
+  //     sweptArea: 5800,
+  //     equipmentCategory: "F",
+  //   },
+  // ];
 });
 //部件列表
 const componentList = computed(() => {
@@ -593,7 +591,7 @@ watch(
   (val) => {
     let arr = val.map((item) => item.value);
     if (arr[0] && arr[0].length && arr[1] && arr[1].length) {
-      state.modelId = [arr[0][0]?.nemCode];
+      // state.modelId = [arr[0][0]?.nemCode];
       let componenDefaultSelect =
         arr[1]?.find((ele) => {
           return ele.nemCode === "FDJ";
@@ -660,6 +658,8 @@ function getTableList() {
       deviceType: state.typeVal,
     }).then((res) => {
       changeTableData(res);
+    }).catch(() =>{
+      changeTableData(dataJson.data.data.dataList);
     });
   } else {
     BASE.showMsg({

+ 7 - 6
src/views/IntegratedAlarm/reliability/historyAnalyse/index.vue

@@ -281,7 +281,6 @@ onMounted(() => {
   getfetchRelatePart();
 //   state.tHeard = dataJson.data.data.title;
 //   state.tableData = dataJson.data.data.dataList;
-    changeTableData(dataJson.data.data.dataList)
   // getTableList();
 });
 const pageTitle = "报警分析";
@@ -310,7 +309,7 @@ const state = reactive({
   tableData: [],
   tHeard: [],
   changZhan: "",
-  components: "", //部件
+  components: ["FDJ", "CLX"], //部件
   modelId: "", //型号
   alarmIds: "",
   alarmIdList: [],
@@ -338,12 +337,12 @@ const getWpArray = async () => {
   const { data } = await getWpList(state.typeVal);
   changZhanArray.value = data;
   if (state.typeVal != "booststation") {
-    state.changZhan =
-      state.typeVal == "windturbine" ? "GJNY_SXGS_FSG_FDC_STA" : "";
+    state.changZhan = data[0]?.id
+    getTableList();
+
   } else {
     state.changZhan = "";
     state.modelId = "";
-    getTableList();
   }
 };
 // 机型
@@ -562,7 +561,7 @@ watch(
     if (state.typeVal != "booststation") {
       let arr = val.map((item) => item.value);
       if (arr[0] && arr[0].length && arr[1] && arr[1].length) {
-        state.modelId = [arr[0][0]?.nemCode];
+        // state.modelId = [arr[0][0]?.nemCode];
         let componenDefaultSelect =
           arr[1]?.find((ele) => {
             return ele.nemCode === "FDJ";
@@ -631,6 +630,8 @@ function getTableList() {
       alarmType: state.typeVal,
     }).then((res) => {
       changeTableData(res)
+    }).catch(() =>{
+      changeTableData(dataJson.data.data.dataList)
     });
   } else {
     BASE.showMsg({