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

监考待审-从详情返回列表定位到当前选中的行

deason пре 2 година
родитељ
комит
17db39ad48
1 измењених фајлова са 38 додато и 7 уклоњено
  1. 38 7
      src/modules/oe/views/awaitingAudit.vue

+ 38 - 7
src/modules/oe/views/awaitingAudit.vue

@@ -222,7 +222,7 @@
                 <el-button
                   v-show="currentPagePrivileges.SNAPSHOT_DETAILS"
                   type="text"
-                  @click="gotoCaptureDetail(scope.row.dataId)"
+                  @click="gotoCaptureDetail(scope.row)"
                   >{{ scope.row.dataId }}</el-button
                 >
                 <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">
@@ -346,7 +346,7 @@
                     >
                   </el-col>
                 </el-row>
-                <el-row class="operateRow">
+                <el-row v-if="scope.row.isWarn" class="operateRow">
                   <el-col :span="24">
                     <el-dropdown>
                       <el-button
@@ -498,8 +498,30 @@ import _ from "lodash";
 export default {
   components: { commonFormVue },
   mixins: [pagePrivilege],
+  beforeRouteEnter(to, from, next) {
+    next((vm) => {
+      if (from.params?.checkedRows) {
+        const unwatch = vm.$watch("tableData", (tableData = []) => {
+          tableData.forEach((d) => {
+            vm.$refs["multipleTable"]?.toggleRowSelection(
+              d,
+              from.params.checkedRows.includes(d.dataId)
+            );
+          });
+          if (unwatch) {
+            unwatch();
+          }
+        });
+      }
+    });
+  },
+  beforeRouteLeave(to, from, next) {
+    to.params.checkedRows = this.routeSelectedIds;
+    next();
+  },
   data() {
     return {
+      routeSelectedIds: [],
       total: 0,
       tableLoading: false,
       exportLoading: false,
@@ -821,7 +843,7 @@ export default {
           });
         });
     },
-    gotoCaptureDetail(examRecordDataId) {
+    gotoCaptureDetail(row) {
       if (!this.form.examId) {
         this.$notify({
           title: "警告",
@@ -833,10 +855,19 @@ export default {
       }
       let pendingOperate = !this.currentPagePrivileges.PENDING_OPERATE;
       let searchParam = JSON.stringify(this.form);
-      this.$router.push({
-        path: "/oe/captureDetail/" + examRecordDataId + "/awaitingAudit",
-        // name: "captureDetail",
-        query: { pendingOperate, searchParam },
+
+      this.routeSelectedIds = [];
+      this.routeSelectedIds.push(row.dataId);
+      this.$refs["multipleTable"]?.toggleRowSelection(row, true);
+      this.$nextTick(() => {
+        /** checkbox UI选中状态延迟 */
+        setTimeout(() => {
+          this.$router.push({
+            path: "/oe/captureDetail/" + row.dataId + "/awaitingAudit",
+            // name: "captureDetail",
+            query: { pendingOperate, searchParam },
+          });
+        }, 200);
       });
     },
     backFill() {