Parcourir la source

文件查阅信息无法记录——切换文件修订历史

shenqilong il y a 1 an
Parent
commit
f3bfc94c70
1 fichiers modifiés avec 12 ajouts et 2 suppressions
  1. 12 2
      src/views/component/fileTraining/index.vue

+ 12 - 2
src/views/component/fileTraining/index.vue

@@ -325,7 +325,10 @@ export default {
         },
         },
         hadLoadedFile (v) {
         hadLoadedFile (v) {
             // 计时开始,添加查看记录
             // 计时开始,添加查看记录
-            this.handleAdd(this.curZid || this.leftData[0]?.zId, 0)
+            if (!this.curZid) {
+                this.handleAdd(this.leftData[0]?.zId, 0)
+            }
+
             this.setBrowseTime()
             this.setBrowseTime()
             this.hadLoad = true
             this.hadLoad = true
         },
         },
@@ -369,6 +372,12 @@ export default {
 
 
         toggleActive (activity, index) {
         toggleActive (activity, index) {
             if (this.activeIndex === index) { return }
             if (this.activeIndex === index) { return }
+            // 切换文件修订历史时,保存上一个文件查看记录,新增当前文件查看记录
+            if (this.browseTime && this.browseTime > 0 && this.timeId) {
+                this.handleUpdate()
+                this.handleAdd(this.curZid || this.leftData[0]?.zId, 0)
+            }
+
             this.activeIndex = index
             this.activeIndex = index
             this.digData = activity
             this.digData = activity
             this.fileShow(activity)
             this.fileShow(activity)
@@ -421,7 +430,8 @@ export default {
                         id_: this.timeId
                         id_: this.timeId
                     },
                     },
                     param: {
                     param: {
-                        shi_chang_: this.browseTime
+                        // shi_chang_: this.browseTime
+                        shi_chang_: 20
                     }
                     }
                 }]
                 }]
             }
             }