Parcourir la source

点击行号显示 数据

“yueshang” il y a 1 an
Parent
commit
85014a2e9d
1 fichiers modifiés avec 64 ajouts et 5 suppressions
  1. 64 5
      src/pages/netStructPicture/newTitle/SlcCheck.vue

+ 64 - 5
src/pages/netStructPicture/newTitle/SlcCheck.vue

@@ -135,9 +135,11 @@
             </el-table-column>
             <el-table-column prop="line_no" label="行号" width="80">
               <template #default="scope">
-                <span style="color: #255ce7; cursor: pointer">{{
-                  scope.row.line_no
-                }}</span>
+                <span
+                  style="color: #255ce7; cursor: pointer"
+                  @click="lineNoClick(scope.row)"
+                  >{{ scope.row.line_no }}</span
+                >
               </template>
             </el-table-column>
             <el-table-column prop="parse_result" label="描述" />
@@ -193,6 +195,29 @@
         >
       </div>
     </el-dialog>
+    <!-- 点击行号 -->
+    <el-dialog
+      v-model="lineNoShow"
+      width="50vw"
+      append-to-body
+      draggable
+    >
+      <template #header>
+        <div class="my-header">
+          <div class="title">SCD源XML查看</div>
+        </div>
+      </template>
+      <div class="line-title"> {{ lineNoTitle }}</div>
+      <el-scrollbar height="500px">
+        <div class="main-cont-line">
+          <div class="main-line">
+            <div v-for="(item, index) in lineNoData" :key="index" :class="{'click-line':item.includes(clicklineNOData)}">
+              {{ item }}
+            </div>
+          </div>
+        </div>
+      </el-scrollbar>
+    </el-dialog>
   </div>
 </template>
 
@@ -213,7 +238,7 @@ import FolderNotchOne from "@/assets/image/sclFile/FolderNotchOne.png";
 import FolderOpentop from "@/assets/image/sclFile/FolderOpentop.png";
 import merge from "@/assets/image/sclFile/merge.png";
 import expand from "@/assets/image/sclFile/expand.png";
-import { scdExpTableData } from "@/api/scdCheck/scdCheck2";
+import { scdExpTableData, scdLineSourcexml } from "@/api/scdCheck/scdCheck2";
 const props = defineProps({
   nowScdId: {
     type: String,
@@ -264,7 +289,7 @@ const reload = () => {
     slc.getScdByIdFromMission({
       pageno: 1,
       pagesize: 20,
-      scd_id: scdid.value,
+      scd_id: 1380000372,
     }), //获取表格的全部数据resultList
     slc.getScdByIdTree({ scd_id: 1380000372 }), //获取侧边栏树的数据treeList
     // systemRow.getChildren({ code: "voltage_level" }),
@@ -416,6 +441,21 @@ const excelPort = () => {
     }
   });
 };
+//点击行号
+const lineNoData = ref(null);
+const lineNoShow = ref(false);
+const lineNoTitle = ref("");
+const clicklineNOData = ref('')
+const lineNoClick = async (val) => {
+  lineNoShow.value = true;
+  clicklineNOData.value = val.line_no;
+  lineNoTitle.value = val.parse_result;
+  const res = await scdLineSourcexml({
+    scd_id: 1380000372,
+    lineno: val.line_no,
+  });
+  lineNoData.value = res.data;
+};
 onMounted(() => {
   reload();
 });
@@ -716,4 +756,23 @@ em {
     border-bottom: 1px solid #409eff;
   }
 }
+.main-line {
+  margin-top: -20px;
+  &>div:first-child{
+    padding-top: 40px;
+  }
+}
+.line-title {
+  text-align: center;
+  color: #e50505;
+  height: 40px;
+  line-height: 40px;
+  border-bottom: 1px solid #cbccd3;
+  margin-top: -20px;
+}
+.click-line{
+  background: #4d4d86;
+  color: #fff;
+  margin-right: 20px;
+}
 </style>