zjf
2023-03-03 bafa9dff4d9880c562f4d3a7b83bd4c1129240c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
export default {
  components: {},
  data () {
    return {
      // 详情数据
      taskID: '',
      detailIndex: -1,
      taskDetailShow: false
    }
  },
 
  mounted () {},
 
  methods: {
    // 关闭详情页
    closeBtn () {
      this.taskDetailShow = false
    },
    // 点击显示详情
    showDetailView (val, index, result) {
      this.taskID = val.taskId
      this.detailIndex = index
      this.taskDetailShow = true
      if (result) {
        result()
      }
    },
    detailHandle (data) {
      if (data.index === 0 || data.index) {
        // 是否完成勾选
        if (data.type === 'title-check') {
          this.$set(this.list[data.index], 'checked', data.value)
        } else if (data.type === 'delete') {
          this.list.splice(data.index, 1)
        } else if (data.type === 'change-stop-time') {
          const stopTime = new Date(data.value).getTime() / 1000 + 86399
          if (stopTime > new Date(new Date()).getTime() / 1000) {
            this.list[data.index].isEnd = false
          } else {
            this.list[data.index].isEnd = true
          }
          this.list[data.index].stopTime = data.value
        } else if (data.type === 'change-priority') {
          this.list[data.index].priority = data.value.id
        } else if (data.type === 'change-name') {
          this.list[data.index].name = data.value
        } else if (data.type === 'change-comments') {
          const commentCount = this.list[data.index].commentCount
          if (data.value === 'add') {
            this.list[data.index].commentCount = commentCount + 1
          } else {
            this.list[data.index].commentCount = commentCount - 1
          }
        } else if (data.type === 'change-sub-task') {
          this.list[data.index].childWCCount = data.value.subdonecount
          this.list[data.index].childAllCount = data.value.allcount
        }
      }
    }
  },
 
  deactivated: function () {}
 
}