Bläddra i källkod

前端:历史任务优化,为空判断后再取长度

baichengfei 4 år sedan
förälder
incheckning
068699b754
1 ändrade filer med 14 tillägg och 14 borttagningar
  1. 14 14
      src/dashoo.cn/frontend_web/src/components/workflow/wfmultihistory.vue

+ 14 - 14
src/dashoo.cn/frontend_web/src/components/workflow/wfmultihistory.vue

@@ -115,24 +115,24 @@ export default {
         params
       })
         .then(res => {
-          console.log('多-多历史任务', res.data)
-          console.log('22222222222')
+          // console.log('多-多历史任务', res.data)
           // _this.historyTask = res.data.items
-          this.tmp_historyTask = res.data.items
-          let useridstr = ''
-          for (let i = 0; i < this.tmp_historyTask.length; i++) {
-            if (this.tmp_historyTask[i].assignee !== '') {
-              useridstr = useridstr + this.tmp_historyTask[i].assignee + ','
+          if (res.data.items) {
+            this.tmp_historyTask = res.data.items
+            let userIdStr = ''
+            for (let i = 0; i < this.tmp_historyTask.length; i++) {
+              if (this.tmp_historyTask[i].assignee !== '') {
+                userIdStr = userIdStr + this.tmp_historyTask[i].assignee + ','
+              }
+              if (this.tmp_historyTask[i].users !== '') {
+                userIdStr = userIdStr + this.tmp_historyTask[i].users + ','
+              }
             }
-            if (this.tmp_historyTask[i].users !== '') {
-              useridstr = useridstr + this.tmp_historyTask[i].users + ','
+            if (userIdStr) {
+              userIdStr = userIdStr.substring(0, userIdStr.length - 1)
+              this.getuserlist(userIdStr)
             }
           }
-          if (useridstr) {
-            console.log(useridstr.length, '22222222222')
-            useridstr = useridstr.substring(0, useridstr.length - 1)
-            this.getuserlist(useridstr)
-          }
         })
         .catch(err => {
           // handle error