瀏覽代碼

[FE]实现AI报警的角标交互

liuwenxun 4 年之前
父節點
當前提交
4dc762760a

+ 12 - 0
security-protection-platform/src/layout/components/Sidebar/index.vue

32
      'permission_routes',
32
      'permission_routes',
33
      'sidebar'
33
      'sidebar'
34
    ]),
34
    ]),
35
    isFollow () {
36
      // 需要检测的数据
37
      // console.log('state是', this.$store.state.alarm.count)
38
      return this.$store.state.alarm.count
39
    },
35
    activeMenu () {
40
    activeMenu () {
36
      const route = this.$route
41
      const route = this.$route
37
      const { meta, path } = route
42
      const { meta, path } = route
52
    }
57
    }
53
58
54
  },
59
  },
60
  watch: {
61
    isFollow (newVal, oldVal) {
62
      // console.log('我发生改变了')
63
      this.getAiAlarmCount()
64
    }
65
  },
55
  created () {
66
  created () {
56
    this.getAiAlarmCount()
67
    this.getAiAlarmCount()
57
  },
68
  },
63
      this.$store.dispatch('app/toggleSideBar')
74
      this.$store.dispatch('app/toggleSideBar')
64
    },
75
    },
65
    async getAiAlarmCount () {
76
    async getAiAlarmCount () {
77
      // console.log('数据是:', this.$store.state.alarm.count)
66
      let res = await aialarmapi.getAiAlarmCount()
78
      let res = await aialarmapi.getAiAlarmCount()
67
79
68
      this.AiAlarmCount = res.data.data
80
      this.AiAlarmCount = res.data.data

+ 1 - 0
security-protection-platform/src/modules/aialarm/index.vue

350
        this.loading = false
350
        this.loading = false
351
        // 关闭模态框
351
        // 关闭模态框
352
        this.details_modal = false
352
        this.details_modal = false
353
        this.$store.commit('alarm/add', 1)
353
        // this.data[this.currentdata.index].status = res.data.data.status
354
        // this.data[this.currentdata.index].status = res.data.data.status
354
        // if (res.data.data.status === 'END') {
355
        // if (res.data.data.status === 'END') {
355
        //   this.data[this.currentdata.index].processTime = res.data.data.doneDate
356
        //   this.data[this.currentdata.index].processTime = res.data.data.doneDate

+ 22 - 0
security-protection-platform/src/store/modules/alarm.js

1
const state = {
2
  count: 1
3
}
4

5
const mutations = {
6

7
  add (state, i) {
8
    state.count = state.count + i
9
  }
10
}
11

12
const actions = {
13

14
}
15

16
export default {
17
  namespaced: true,
18
  state,
19
  mutations,
20
  actions
21
}
22