Explorar el Código

[FE]AI报警处理,AI报警角标,进出记录查询修改

liuwenxun %!s(int64=4) %!d(string=hace) años
padre
commit
a2092e7db9

+ 1 - 1
security-protection-platform/src/layout/components/Sidebar/Logo.vue

@ -22,7 +22,7 @@ export default {
22 22
      required: true
23 23
    }
24 24
  },
25
  data() {
25
  data () {
26 26
    return {
27 27
      title: 'Vue Element Admin',
28 28
      logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'

+ 33 - 8
security-protection-platform/src/layout/components/Sidebar/SidebarItem.vue

@ -6,7 +6,7 @@ import FixiOSBug from './FixiOSBug'
6 6
7 7
let onlyOneChild = null
8 8
9
function hasOneShowingChild(children = [], parent) {
9
function hasOneShowingChild (children = [], parent) {
10 10
  const showingChildren = children.filter(item => {
11 11
    if (item.hidden) {
12 12
      return false
@ -31,7 +31,7 @@ function hasOneShowingChild(children = [], parent) {
31 31
  return false
32 32
}
33 33
34
function resolvePath(basePath, routePath) {
34
function resolvePath (basePath, routePath) {
35 35
  // if (isExternal(routePath)) {
36 36
  //   return routePath
37 37
  // }
@ -61,16 +61,38 @@ export default {
61 61
      default: ''
62 62
    }
63 63
  },
64
  render(h, { props }) {
64
  render (h, { props }) {
65 65
    const item = props.item
66
67
    // AI报警里的数字可以通过meta来传
68
66 69
    const defaultTitle = 'No Title'
67 70
    if (item.hidden) return null
68 71
    if (hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow) {
69 72
      const icon = onlyOneChild.meta && onlyOneChild.meta.icon ? <t-icon icon={onlyOneChild.meta.icon} /> : ''
73
74
      if (item.path === '/alarm') {
75
        // console.log(item.children[0].meta)
76
        const confirmedCount = item.children[0].meta.confirmedCount
77
        const unconfirmedCount = item.children[0].meta.unconfirmedCount
78
        return (
79
          <t-menu-item name={resolvePath(props.basePath, onlyOneChild.path)}>
80
            { icon}
81
            <span class="menu-text">{onlyOneChild.meta && onlyOneChild.meta.title || defaultTitle}</span>
82
83
            <t-badge color="danger" count={unconfirmedCount} max={99}></t-badge>
84
            <span style="margin-right:5px;">  </span>
85
            <t-badge color="danger" count={confirmedCount} max={99}></t-badge>
86
87
          </t-menu-item>
88
        )
89
      }
90
70 91
      return (
71 92
        <t-menu-item name={resolvePath(props.basePath, onlyOneChild.path)}>
72
          { icon }
73
          <span class="menu-text">{ onlyOneChild.meta && onlyOneChild.meta.title || defaultTitle}</span>
93
          { icon}
94
          <span class="menu-text">{onlyOneChild.meta && onlyOneChild.meta.title || defaultTitle}</span>
95
74 96
        </t-menu-item>
75 97
      )
76 98
    } else {
@ -89,10 +111,10 @@ export default {
89 111
      return (
90 112
        <t-submenu ref="subMenu" name={resolvePath(props.basePath, item.path)}>
91 113
          <template slot="title">
92
            { icon }
93
            <span class="menu-title">{ item.meta.title || defaultTitle }</span>
114
            {icon}
115
            <span class="menu-title">{item.meta.title || defaultTitle}</span>
94 116
          </template>
95
          { sidebarItems }
117
          { sidebarItems}
96 118
        </t-submenu>
97 119
      )
98 120
    }
@ -106,4 +128,7 @@ export default {
106 128
    display: none;
107 129
  }
108 130
}
131
.menu-text {
132
  margin-right: 5px;
133
}
109 134
</style>

+ 7 - 13
security-protection-platform/src/layout/components/Sidebar/index.vue

@ -5,13 +5,7 @@
5 5
      <t-icon icon="format-indent-decrease-outline" />
6 6
    </div>
7 7
    <t-scroll-bar style="height:100%">
8
      <t-menu
9
        :active-name="activeMenu"
10
        :collapse="isCollapse"
11
        mode="vertical"
12
        type="light"
13
        @on-select="handleMenuSelect"
14
      >
8
      <t-menu :active-name="activeMenu" :collapse="isCollapse" mode="vertical" type="light" @on-select="handleMenuSelect">
15 9
        <sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" />
16 10
      </t-menu>
17 11
    </t-scroll-bar>
@ -31,7 +25,7 @@ export default {
31 25
      'permission_routes',
32 26
      'sidebar'
33 27
    ]),
34
    activeMenu() {
28
    activeMenu () {
35 29
      const route = this.$route
36 30
      const { meta, path } = route
37 31
      // if set path, the sidebar will highlight the path you set
@ -40,21 +34,21 @@ export default {
40 34
      }
41 35
      return path
42 36
    },
43
    showLogo() {
37
    showLogo () {
44 38
      return this.$store.state.settings.sidebarLogo
45 39
    },
46
    variables() {
40
    variables () {
47 41
      return variables
48 42
    },
49
    isCollapse() {
43
    isCollapse () {
50 44
      return !this.sidebar.opened
51 45
    }
52 46
  },
53 47
  methods: {
54
    handleMenuSelect(name) {
48
    handleMenuSelect (name) {
55 49
      this.$router.push(name)
56 50
    },
57
    handleSidebarCollapse() {
51
    handleSidebarCollapse () {
58 52
      this.$store.dispatch('app/toggleSideBar')
59 53
    }
60 54
  }

+ 3 - 3
security-protection-platform/src/modules/access/index.vue

@ -4,12 +4,12 @@
4 4
    <div class="access_header">
5 5
      <div>
6 6
        <span class="title">开始时间 : </span>
7
        <t-date-picker :confirm="false" v-model="searchdata.starttime" placeholder="请选择开始时间" style="width:200px;height:32px"></t-date-picker>
7
        <t-date-picker :confirm="false" v-model="searchdata.beginTime" placeholder="请选择开始时间" style="width:200px;height:32px"></t-date-picker>
8 8
      </div>
9 9

10 10
      <div>
11 11
        <span class="title">结束时间 : </span>
12
        <t-date-picker :confirm="false" v-model="searchdata.endtime" placeholder="请选择结束时间" style="width:200px;height:32px"></t-date-picker>
12
        <t-date-picker :confirm="false" v-model="searchdata.endTime" placeholder="请选择结束时间" style="width:200px;height:32px"></t-date-picker>
13 13
      </div>
14 14

15 15
      <!-- <div>
@ -208,7 +208,7 @@ export default {
208 208
        var params = this.searchdata
209 209
        params.pageNumber = this.page
210 210
        params.pageSize = this.limit
211
        // console.log(params)
211
        console.log(params)
212 212
        var res = await accessapi.getaccesslist({ params: params })
213 213
        // console.log(res)
214 214
        if (res.status === 200) {

+ 7 - 5
security-protection-platform/src/modules/aialarm/index.vue

@ -147,9 +147,9 @@
147 147
          </div>
148 148
        </div>
149 149
        <div v-if="clickdetail==1">
150
          <div v-if="alarmDetailData.statusZh!='END'" class="radio">
150
          <div v-if="alarmDetailData.status!='END'" class="radio">
151 151
            <div>报警处理 : </div>
152
            <div v-if="alarmDetailData.statusZh=='INI'">
152
            <div v-if="alarmDetailData.status=='INI'">
153 153
              <t-radio-group v-model="status">
154 154
                <t-radio label="RUN">
155 155

@ -163,7 +163,7 @@
163 163
              </t-radio-group>
164 164
            </div>
165 165

166
            <div v-if="alarmDetailData.statusZh=='RUN'||alarmDetailData.statusZh=='FAL'">
166
            <div v-if="alarmDetailData.status=='RUN'||alarmDetailData.status=='FAL'">
167 167
              <t-radio-group v-model="status">
168 168
                <t-radio label="END">关闭</t-radio>
169 169
              </t-radio-group>
@ -328,7 +328,7 @@ export default {
328 328
      // 判断是否选择了单选框
329 329
      if (this.status) {
330 330
        // 向后端发送数据
331
        this.alarmdispose(this.currentdata.data.workTaskId, this.status)
331
        this.alarmdispose(this.alarmDetailData.workTaskId, this.status)
332 332
        // console.log(this.status)
333 333
        // 关闭模态框
334 334
        this.details_modal = false
@ -340,8 +340,10 @@ export default {
340 340
    async alarmdispose (id, status, processMemo) {
341 341
      const dict = { 'END': '已解决', 'RUN': '处理中', 'FAL': '误报' }
342 342

343
      console.log(id, status, dict[status])
344

343 345
      var res = await aialarmapi.dispose({ 'workTaskId': id, 'status': status, 'processMemo': dict.status })
344
      // console.log(res)
346
      console.log(res)
345 347
      if (res.status === 200) {
346 348
        this.$Message.success('操作成功')
347 349
        this.data[this.currentdata.index].status = res.data.data.status

+ 1 - 1
security-protection-platform/src/routes.js

@ -102,7 +102,7 @@ export const constantRoutes = [
102 102
        name: 'ai_alarm',
103 103
        path: '',
104 104
        component: () => import(/* webpackChunkName: "alarm" */ './modules/aialarm/index.vue'),
105
        meta: { title: 'AI报警', icon: 'bell' }
105
        meta: { title: 'AI报警', icon: 'bell', unconfirmedCount: 10, confirmedCount: 100 }
106 106
      }
107 107
    ]
108 108
  }, {