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

调整发布动态不更新的问题

Lijy пре 2 година
родитељ
комит
97c70f8b25
1 измењених фајлова са 15 додато и 5 уклоњено
  1. 15 5
      fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

+ 15 - 5
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -1050,7 +1050,7 @@ export default {
         });
     },
     // 获取评论列表
-    gain (task,e) {
+    gain(task,e) {
         this.commentList = [];
         this.taskId = e == 1 ? task.taskId : task.id;
         this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
@@ -1077,6 +1077,7 @@ export default {
                 }
                 this.commentList = res.data
                 this.sppk(this.commentList) // 获取参与人的方法
+                this.contRoll()
             } else {
                 this.$message({
                 message: res.msg,
@@ -1098,7 +1099,6 @@ export default {
             sk.push(e.userName)
         })
         this.critic = new Set(sk)
-        console.log(this.critic, '参与人',this.critic.length)
     },
     getRelationTaskList(i,e){  //获取关联任务列表
         let eid = null
@@ -1823,9 +1823,14 @@ export default {
                     }
                 }
                 this.commentList.push(res.data)
+                console.log(this.commentList, '值☞')
                 this.sppk(this.commentList)
+                let obj = {
+                    id: this.taskIid
+                }
+                this.gain(obj)
                 this.textarea2 = ""
-                this.contRoll() // 滚动到底部
+                // this.contRoll() // 滚动到底部
             } else {
                 this.$message({
                 message: res.msg,
@@ -1842,9 +1847,14 @@ export default {
     },
     // 滚动到底部
     contRoll(){
+        // this.$nextTick(() => {
+        //     this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
+        // })
         this.$nextTick(() => {
-            this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
-        })
+            let scrollElem = this.$refs.main;
+            scrollElem.scrollTo({ top: scrollElem.scrollHeight});
+        });
+        console.log('最后执行')
     },
     sss(){
         this.$refs.addRem.style.display="none"