500


Application Version: 0.9.13.0318

[FE]AI报警接口联调 · a889ee32f4 - Nuosi Git Service
Selaa lähdekoodia

[FE]AI报警接口联调

liuwenxun 4 vuotta sitten
vanhempi
commit
a889ee32f4

+ 25 - 3
security-protection-platform/.aid/mock/aialarm.js

@ -11,7 +11,7 @@ const { data } = Mock.mock({
11 11
      equipment_number: 's00001',
12 12
      equipment_location: '1#风场SVG室',
13 13
      alarm_time: '@date("yyyy-MM-dd HH:mm:ss")',
14
      Handler: '@cname',
14
      'Handler|1': ['张三', '李四', '王五', '何六'],
15 15
      processing_time: '@date("yyyy-MM-dd HH:mm:ss")',
16 16
      picture_url: 'http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg',
17 17
      video_url: 'https://video.pearvideo.com/mp4/adshort/20201113/cont-1706887-15482034_adpkg-ad_hd.mp4'
@ -27,6 +27,7 @@ module.exports = [
27 27
    type: 'func',
28 28
    response: (option) => {
29 29
      const TypeName = ['身份异常', '穿戴异常', '潜在危险', '违规违章', '仪表异常']
30
      const handlername = ['张三', '李四', '王五', '何六']
30 31
      //获取page
31 32
      var page = getQuery(option.url, 'page')
32 33
      //获取limit
@ -39,22 +40,30 @@ module.exports = [
39 40
      //获取报警类型
40 41
      var typeid = getQuery(option.url, 'typeid')
41 42

43
      //获取报警人
44
      var handler = getQuery(option.url, 'handler')
45
      // console.log('报警人:', handler)
46

42 47
      var start = (page - 1) * limit
43 48
      var end = page * limit
44 49
      // console.log(option)
45 50

46 51
      var result = data
52
      // console.log(result)
47 53

48 54
      if (typeid) {
49 55
        result = result.filter((item) => { return item.type == TypeName[parseInt(typeid)] })
50 56
      }
51 57

52 58
      if (starttime) {
53
        result = result.filter((item) => { return +new Date(item.time) >= starttime })
59
        result = result.filter((item) => { return +new Date(item.alarm_time) >= starttime })
54 60
      }
55 61

56 62
      if (endtime) {
57
        result = result.filter((item) => { return +new Date(item.time) <= endtime })
63
        result = result.filter((item) => { return +new Date(item.alarm_time) <= endtime })
64
      }
65
      if (handler) {
66
        result = result.filter((item) => { return item.Handler == handlername[parseInt(handler)] })
58 67
      }
59 68

60 69

@ -79,6 +88,19 @@ module.exports = [
79 88
    }
80 89
  },
81 90
  {
91
    url: '/aialarm/getaialarmhandler',
92
    method: 'get',
93
    type: 'func',
94
    response: () => {
95
      return Mock.mock({
96
        'data|4': [{
97
          'id|+1': 0,
98
          'alarmhandler|+1': ['张三', '李四', '王五', '何六'],
99
        }]
100
      })
101
    }
102
  },
103
  {
82 104
    url: /\/aialarm\/dispose/,
83 105
    method: 'put',
84 106
    type: 'func',

+ 3 - 4
security-protection-platform/src/api/access/index.js

@ -1,10 +1,9 @@
1 1
import http from '@/http'
2
const { $http } = http
3

2
const { $http, $default } = http
4 3

5 4
const api = {
6 5
  getaccesslist (params) {
7
    return $http.get('/access/getaccesslist', params)
6
    return $default.get('/sp/inAndOutRecord/queryPageInAndOutRecord', params)
8 7
  },
9 8

10 9
  getaccesstype () {
@ -13,4 +12,4 @@ const api = {
13 12

14 13
}
15 14

16
export default api
15
export default api

+ 11 - 9
security-protection-platform/src/api/aialarm/index.js

@ -1,21 +1,23 @@
1 1
import http from '@/http'
2
const { $http } = http
3

2
const { $default, $http } = http
4 3

5 4
const api = {
5
  // 获取报警记录列表
6 6
  getaialarmlist (params) {
7
    return $http.get('/aialarm/getaialarmlist/', params)
7
    return $default.get('/sp/aiAlarmManage/queryPageAiAlarm', params)
8 8
  },
9

10
  // 获取报警类型查询下拉框
9 11
  getaialarmtype () {
10
    return $http.get('/aialarm/getaialarmtype')
12
    return $default.get('/sp/charSpec/getCharSpecList?charSpecCode=AI_ALARM_TYPE')
13
  },
14
  getaialarmhandler () {
15
    return $http.get('/aialarm/getaialarmhandler')
11 16
  },
12 17
  dispose (params) {
13
    return $http.put('/aialarm/dispose/', params)
18
    return $default.post('/sp/aiAlarmManage/changeTaskStatus', params)
14 19
  }
15 20

16

17

18

19 21
}
20 22

21
export default api
23
export default api

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

@ -12,59 +12,56 @@
12 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
      <div>
15
      <!-- <div>
16 16
        <span class="title">进出类型 : </span>
17 17
        <t-select v-model="searchdata.typeid" style="width:200px;height:32px">
18 18
          <t-option v-for="item in accesstype" :value="item.id" :key="item.id">{{ item.name }}</t-option>
19 19

20 20
        </t-select>
21
      </div> -->
22
      <div class="alarm_people">
23
        <span class="title">员工 : </span>
24
        <t-input v-model="searchdata.relateEmployeeNameAsLike" placeholder="员工姓名、编号关键字" style="width: 200px"></t-input>
21 25
      </div>
22 26

23 27
    </div>
24 28

25 29
    <div class="access_header">
26
      <div class="alarm_people">
27
        <span class="title">员工 : </span>
28
        <t-input v-model="searchdata.username" placeholder="员工姓名、编号关键字" style="width: 200px"></t-input>
30

31
      <!-- 导出excel -->
32
      <div>
33
        <t-button color="primary" icon="upload" style="width:128px;height:32px" class="upload">导出至Excel</t-button>
29 34
      </div>
30 35

31 36
      <div>
32 37
        <t-button color="primary" @click="btnsearch">查询</t-button>
33 38
        <t-button @click="reset">重置</t-button>
34 39
      </div>
35
    </div>
36
    <!-- 导出excel -->
37
    <div>
38
      <t-button color="primary" icon="upload" style="width:128px;height:32px" class="upload">导出至Excel</t-button>
40

39 41
    </div>
40 42

41 43
    <t-table :data="data" line @selection-change="handleSelectionChange">
42 44
      <t-table-column type="selection" width="34px"></t-table-column>
43
      <t-table-column label="进出类型" width="80px">
44
        <template slot-scope="scope">
45
          <t-tag v-if="scope.row.type=== '离开'" state="info">{{ scope.row.type }}</t-tag>
46
          <t-tag v-if="scope.row.type=== '进入'" state="success">{{ scope.row.type }}</t-tag>
47
        </template>
48
      </t-table-column>
49
      <t-table-column label="姓名" prop="employee_name" width="66px">
45

46
      <t-table-column label="姓名" prop="relateEmployeeRoleName" width="60px">
50 47
      </t-table-column>
51
      <t-table-column label="员工编号" prop="employee_number" width="80px">
48
      <t-table-column label="员工编号" prop="code" width="80px">
52 49
      </t-table-column>
53
      <t-table-column label="公司" prop="company" width="69px">
50
      <t-table-column label="公司" prop="orgName" width="94px">
54 51
      </t-table-column>
55
      <t-table-column label="部门" prop="department" width="94px">
52
      <t-table-column label="部门" prop="orgName" width="94px">
56 53
      </t-table-column>
57 54
      <t-table-column label="职务" prop="job" width="80px">
58 55
      </t-table-column>
59 56
      <t-table-column label="相似度" prop="similarity" width="75px">
60 57
      </t-table-column>
61
      <t-table-column label="进出时间" prop="time" width="169px">
58
      <t-table-column label="进出时间" prop="taskExecuteTime" width="160px">
62 59
      </t-table-column>
63
      <t-table-column label="位置" prop="location" width="122px">
60
      <t-table-column label="位置" prop="terminalPosition" width="122px">
64 61
      </t-table-column>
65
      <t-table-column label="终端名称" prop="terminal_name" width="97px">
62
      <t-table-column label="终端名称" prop="resourceToolName" width="97px">
66 63
      </t-table-column>
67
      <t-table-column label="终端编号" prop="terminal_number" width="72px">
64
      <t-table-column label="终端编号" prop="resourceToolCode" width="72px">
68 65
      </t-table-column>
69 66
      <t-table-column label="操作" width="80px">
70 67
        <template slot-scope="scope">
@ -85,33 +82,33 @@
85 82
          <div class="detail_item1">
86 83
            <div>抓拍图片</div>
87 84
            <div>
88
              <img :src="rowdata.arrest_main_url" alt="" srcset="" style="width:100%;height:100%">
85
              <img :src="rowdata.idenVideoUrl" alt="" srcset="" style="width:100%;height:100%">
89 86
            </div>
90 87
          </div>
91 88
          <div class="detail_item2">
92 89
            <div>识别结果</div>
93 90
            <div>
94 91
              <div>
95
                <img :src="rowdata.arrest_part_url" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
92
                <img :src="rowdata.idenPictureUrl" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
96 93
                <div class="bottomimg">抓拍图片</div>
97 94
              </div>
98 95
              <div>
99 96
                <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
100 97
              </div>
101 98
              <div>
102
                <img :src="rowdata.face_url" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
99
                <img :src="rowdata.headerUrl" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
103 100
                <div class="bottomimg">人脸底库</div>
104 101
              </div>
105 102
            </div>
106 103
            <div class="describe">
107 104
              <div>
108
                <t-icon icon="user-outline"></t-icon> {{ rowdata.employee_name }}({{ rowdata.employee_number }})
105
                <t-icon icon="user-outline"></t-icon> {{ rowdata.relateEmployeeRoleName }}({{ rowdata.code }})
109 106
              </div>
110 107
              <div>
111
                <t-icon icon="map-marker"></t-icon> {{ rowdata.location }}
108
                <t-icon icon="map-marker"></t-icon> {{ rowdata.terminalPosition }}
112 109
              </div>
113 110
              <div>
114
                <t-icon icon="clock-outline"></t-icon> {{ rowdata.time }}
111
                <t-icon icon="clock-outline"></t-icon> {{ rowdata.taskExecuteTime }}
115 112
              </div>
116 113
              <div>
117 114
                <t-icon icon="team-outline"></t-icon> 相似度:{{ rowdata.similarity }}
@ -130,6 +127,7 @@
130 127

131 128
<script>
132 129
import accessapi from '@/api/access'
130
import formatDateTime from '@/utils/formatDateTime.js'
133 131

134 132
export default {
135 133
  data () {
@ -147,10 +145,10 @@ export default {
147 145

148 146
      // 查询的参数
149 147
      searchdata: {
150
        typeid: '',
151
        username: '',
152
        starttime: '',
153
        endtime: ''
148

149
        relateEmployeeNameAsLike: '',
150
        beginTime: '',
151
        endTime: ''
154 152
      },
155 153
      // 一页的数据
156 154
      data: [
@ -164,7 +162,7 @@ export default {
164 162
  },
165 163

166 164
  mounted () {
167
    this.gettype()
165
    // this.gettype()
168 166
    this.search()
169 167
  },
170 168
  methods: {
@ -193,31 +191,32 @@ export default {
193 191
      }
194 192
    },
195 193
    // 获取进出类型
196
    gettype () {
197
      accessapi.getaccesstype().then((res) => {
198
        this.accesstype = res.data.data
199
        console.log(this.accesstype)
200
      })
201
    },
194
    // gettype () {
195
    //   accessapi.getaccesstype().then((res) => {
196
    //     this.accesstype = res.data.data
197
    //     console.log(this.accesstype)
198
    //   })
199
    // },
202 200
    // 查询数据
203 201
    async search () {
204 202
      // 检验数据
205
      var flag = this.startreend(this.searchdata.starttime, this.searchdata.endtime)
203
      var flag = this.startreend(this.searchdata.beginTime, this.searchdata.endTime)
206 204
      if (flag) {
207 205
        // console.log(this.page)
208 206
        // console.log(this.searchdata)
209 207

210 208
        var params = this.searchdata
211
        params.page = this.page
212
        params.limit = this.limit
213
        console.log(params)
209
        params.pageNumber = this.page
210
        params.pageSize = this.limit
211
        // console.log(params)
214 212
        var res = await accessapi.getaccesslist({ params: params })
215 213
        // console.log(res)
216 214
        if (res.status === 200) {
217 215
          console.log(res)
218
          this.data = res.data.data
219
          // console.log(this.data)
220
          this.total = Math.ceil(res.data.total / this.limit) * 5
216
          this.data = res.data.data.data
217
          this.data = this.data.map((item) => { item.taskExecuteTime = formatDateTime(item.taskExecuteTime); return item })
218
          console.log(this.data)
219
          this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
221 220
        }
222 221
      } else {
223 222
        this.$Message.danger('开始时间不能在结束时间的后面')
@ -262,7 +261,6 @@ export default {
262 261
  .upload {
263 262
    font-size: 14px;
264 263
    line-height: 22px;
265
    margin: 29px 0 25px 0;
266 264
  }
267 265
  .table th,
268 266
  .table td {
@ -273,6 +271,7 @@ export default {
273 271
    display: flex;
274 272
    justify-content: space-between;
275 273
    margin-top: 24px;
274
    margin-bottom: 24px;
276 275
    .title {
277 276
      display: inline-block;
278 277
      width: 70px;

+ 102 - 98
security-protection-platform/src/modules/aialarm/index.vue

@ -5,30 +5,36 @@
5 5
    <div class="alarm_header">
6 6
      <div>
7 7
        <span class="title">报警类型 : </span>
8
        <t-select v-model="searchdata.typeid" style="width:200px;height:32px">
9
          <t-option v-for="(item,index) in alarmtypelist" :key="index" :value="item.id">{{ item.name }}</t-option>
8
        <t-select v-model="searchdata.alarmTypeCode" style="width:200px;height:32px">
9
          <t-option v-for="item in alarmtypelist" :key="item.code" :value="item.code">{{ item.value }}</t-option>
10 10
        </t-select>
11 11
      </div>
12 12

13 13
      <div>
14 14
        <span class="title">开始时间 : </span>
15
        <t-date-picker :confirm="false" v-model="searchdata.starttime" placeholder="请选择开始时间" style="width:200px;height:32px"></t-date-picker>
15
        <t-date-picker :confirm="false" v-model="searchdata.beginTime" placeholder="请选择开始时间" style="width:200px;height:32px"></t-date-picker>
16 16
      </div>
17 17

18 18
      <div>
19 19
        <span class="title">结束时间 : </span>
20
        <t-date-picker :confirm="false" v-model="searchdata.endtime" placeholder="请选择结束时间" style="width:200px;height:32px"></t-date-picker>
20
        <t-date-picker :confirm="false" v-model="searchdata.endTime" placeholder="请选择结束时间" style="width:200px;height:32px"></t-date-picker>
21 21
      </div>
22 22

23 23
    </div>
24 24

25 25
    <div class="alarm_header">
26
      <div class="alarm_people">
26
      <!-- <div class="alarm_people">
27 27
        <span class="title">报警人 : </span>
28
        <t-select v-model="searchdata.Police" style="width:200px;height:32px">
29
          <t-option value="你好">选项1</t-option>
28
        <t-select v-model="searchdata.handler" style="width:200px;height:32px">
29
           <t-option value="你好">选项1</t-option>
30 30
          <t-option value="世界">选项2</t-option>
31
          <t-option v-for="item in aialarmhandlerlist" :value="item.id" :key="item.id">{{ item.alarmhandler }}</t-option>
31 32
        </t-select>
33
      </div> -->
34

35
      <!-- 导出excel组件 -->
36
      <div>
37
        <t-button color="primary" icon="upload" style="width:128px;height:32px" class="upload">导出至Excel</t-button>
32 38
      </div>
33 39

34 40
      <div>
@ -37,44 +43,40 @@
37 43
      </div>
38 44
    </div>
39 45

40
    <!-- 导出excel组件 -->
41
    <div>
42
      <t-button color="primary" icon="upload" style="width:128px;height:32px" class="upload">导出至Excel</t-button>
43
    </div>
44

45 46
    <!-- 表格 -->
46 47
    <t-table :data="data" line @selection-change="handleSelectionChange">
47 48
      <t-table-column type="selection" width="50"></t-table-column>
48
      <t-table-column label="状态" width="110">
49
      <t-table-column label="状态" width="100">
49 50
        <template slot-scope="scope">
50 51

51
          <t-tag v-if="scope.row.state=== '处理中'" state="info">{{ scope.row.state }}</t-tag>
52
          <t-tag v-if="scope.row.state=== '未确认'" state="warning">{{ scope.row.state }}</t-tag>
53
          <t-tag v-if="scope.row.state=== '已处理'" state="success">{{ scope.row.state }}</t-tag>
52
          <t-tag v-if="scope.row.status=== 'RUN'" state="info">处理中</t-tag>
53
          <t-tag v-if="scope.row.status=== 'INI'" state="warning">未确认</t-tag>
54
          <t-tag v-if="scope.row.status=== 'END'" state="success">已处理</t-tag>
55
          <t-tag v-if="scope.row.status=== 'FAL'" state="danger">误报</t-tag>
54 56
        </template>
55 57
      </t-table-column>
56
      <t-table-column label="报警类型" prop="type">
58
      <t-table-column label="报警类型" prop="alarmTypeName">
57 59
      </t-table-column>
58
      <t-table-column label="报警描述" prop="describe" width="110">
60
      <t-table-column label="报警描述" prop="alarmMemo" width="110">
59 61
      </t-table-column>
60
      <t-table-column label="设备名称" prop="equipment_name" width="110">
62
      <t-table-column label="设备名称" prop="resourceToolName" width="110">
61 63
      </t-table-column>
62
      <t-table-column label="设备编号" prop="equipment_number" width="90">
64
      <t-table-column label="设备编号" prop="resourceToolCode" width="90">
63 65
      </t-table-column>
64
      <t-table-column label="设备位置" prop="equipment_location" width="120">
66
      <t-table-column label="设备位置" prop="monitorSceneName" width="120">
65 67
      </t-table-column>
66
      <t-table-column label="报警时间" prop="alarm_time" width="148px">
68
      <t-table-column label="报警时间" prop="aiIdenTime" width="148px">
67 69
      </t-table-column>
68
      <t-table-column label="处理人" prop="Handler" width="70">
70
      <t-table-column label="处理人" prop="workEmployeeRoleName" width="70">
69 71
      </t-table-column>
70
      <t-table-column label="处理时间" prop="processing_time" width="148px">
72
      <t-table-column label="处理时间" prop="processTime" width="148px">
71 73
      </t-table-column>
72 74
      <t-table-column label="操作">
73 75
        <template slot-scope="scope">
74 76

75 77
          <a href="javascript:void(0)" size="sm" style="color:#0089D4" @click="handleClick(scope,0)">详情</a>
76
          <a v-if="scope.row.state=='处理中'" style="color:#0089D4" @click="handleClick(scope,1)">关闭</a>
77
          <a v-if="scope.row.state=='未确认'" style="color:#0089D4" @click="handleClick(scope,1)">处理</a>
78
          <a v-if="scope.row.status=='RUN'||scope.row.status=='FAL'" style="color:#0089D4" @click="handleClick(scope,1)">关闭</a>
79
          <a v-if="scope.row.status=='INI'" style="color:#0089D4" @click="handleClick(scope,1)">处理</a>
78 80
        </template>
79 81
      </t-table-column>
80 82
    </t-table>
@ -90,67 +92,68 @@
90 92
          <div class="detail">
91 93
            <label class="detail_title">状态:</label>
92 94
            <div class="detail_content">
93
              <t-tag v-if="currentdata.data.state==='未确认'" state="warning">{{ currentdata.data.state }}</t-tag>
94
              <t-tag v-if="currentdata.data.state==='已处理'" state="success">{{ currentdata.data.state }}</t-tag>
95
              <t-tag v-if="currentdata.data.state==='处理中'" state="info">{{ currentdata.data.state }}</t-tag>
95
              <t-tag v-if="currentdata.data.status==='INI'" state="warning">未确认</t-tag>
96
              <t-tag v-if="currentdata.data.status==='END'" state="success">已处理</t-tag>
97
              <t-tag v-if="currentdata.data.status==='RUN'" state="info">处理中</t-tag>
98
              <t-tag v-if="currentdata.data.status==='FAL'" state="danger">误报</t-tag>
96 99
            </div>
97 100

98 101
          </div>
99 102
          <div class="detail">
100 103
            <label class="detail_title">报警类型:</label>
101
            <div class="detail_content">{{ currentdata.data.type }}</div>
104
            <div class="detail_content">{{ currentdata.data.alarmTypeName }}</div>
102 105
          </div>
103 106
          <div class="detail">
104 107
            <label class="detail_title">报警描述:</label>
105
            <div class="detail_content">{{ currentdata.data.describe }}</div>
108
            <div class="detail_content">{{ currentdata.data.alarmMemo }}</div>
106 109
          </div>
107 110
          <div class="detail">
108 111
            <label class="detail_title">报警时间:</label>
109
            <div class="detail_content">{{ currentdata.data.alarm_time }}</div>
112
            <div class="detail_content">{{ currentdata.data.aiIdenTime }}</div>
110 113
          </div>
111 114

112 115
          <div class="detail">
113 116
            <label class="detail_title">设备编号:</label>
114
            <div class="detail_content">{{ currentdata.data.equipment_name }}</div>
117
            <div class="detail_content">{{ currentdata.data.resourceToolCode }}</div>
115 118
          </div>
116 119
          <div class="detail">
117 120
            <label class="detail_title">设备位置:</label>
118
            <div class="detail_content">{{ currentdata.data.equipment_location }}</div>
121
            <div class="detail_content">{{ currentdata.data.monitorSceneName }}</div>
119 122
          </div>
120 123

121 124
          <div class="detail">
122 125
            <label class="detail_title">处理人:</label>
123
            <div class="detail_content">{{ currentdata.data.Handler }}</div>
126
            <div class="detail_content">{{ currentdata.data.workEmployeeRoleName }}</div>
124 127
          </div>
125 128

126 129
          <div class="detail">
127 130
            <label class="detail_title">处理时间:</label>
128
            <div>{{ currentdata.data.processing_time }}</div>
131
            <div>{{ currentdata.data.processTime }}</div>
129 132
          </div>
130 133
        </div>
131 134

132 135
        <div class="details_item2">
133 136
          <div>
134 137
            <div>识别图片</div>
135
            <div><img :src="currentdata.data.picture_url" alt="" srcset="" style="width:100%;height:100%"></div>
138
            <div><img :src="currentdata.data.idenPictureUrl" alt="" srcset="" style="width:100%;height:100%"></div>
136 139
          </div>
137 140
          <div>
138 141
            <div>识别视频</div>
139 142
            <div>
140
              <video :src="currentdata.data.video_url" class="video" controls></video>
143
              <video :src="currentdata.data.idenVideoUrl" class="video" controls></video>
141 144
            </div>
142 145
          </div>
143 146
        </div>
144 147
        <div v-if="clickdetail==1">
145
          <div v-if="currentdata.data.state!='已处理'" class="radio">
148
          <div v-if="currentdata.data.status!='END'" class="radio">
146 149
            <div>报警处理 : </div>
147
            <div v-if="currentdata.data.state=='未确认'">
148
              <t-radio-group v-model="msg">
149
                <t-radio label="确认">
150
            <div v-if="currentdata.data.status=='INI'">
151
              <t-radio-group v-model="status">
152
                <t-radio label="RUN">
150 153

151 154
                  <span>确认</span>
152 155
                </t-radio>
153
                <t-radio label="误判">
156
                <t-radio label="FAL">
154 157

155 158
                  <span>误判</span>
156 159
                </t-radio>
@ -158,9 +161,9 @@
158 161
              </t-radio-group>
159 162
            </div>
160 163

161
            <div v-if="currentdata.data.state=='处理中'">
162
              <t-radio-group v-model="msg">
163
                <t-radio label="关闭">关闭</t-radio>
164
            <div v-if="currentdata.data.status=='RUN'||currentdata.data.status=='FAL'">
165
              <t-radio-group v-model="status">
166
                <t-radio label="END">关闭</t-radio>
164 167
              </t-radio-group>
165 168

166 169
            </div>
@ -188,21 +191,22 @@
188 191
<script>
189 192

190 193
import aialarmapi from '@/api/aialarm'
194
import formatDateTime from '@/utils/formatDateTime.js'
191 195
export default {
192 196

193 197
  data () {
194 198
    return {
195 199
      searchdata: {
196
        typeid: '', // 报警类型
197
        Police: '', // 报警人
198
        starttime: '', // 开始时间
199
        endtime: '' // 结束时间
200
        alarmTypeCode: '', // 报警类型
201
        beginTime: '', // 开始时间
202
        endTime: '' // 结束时间
200 203
      },
201 204
      // 报警类型
202 205
      alarmtypelist: [],
203 206
      // 报警人
207
      aialarmhandlerlist: [],
204 208
      // 模态框中的单选按钮
205
      msg: '',
209
      status: '',
206 210
      // 模态框
207 211
      details_modal: false,
208 212
      // 当前行的数据
@ -215,20 +219,23 @@ export default {
215 219
      // 判断是详情还是处理
216 220
      clickdetail: 0,
217 221
      // 一页的数据
218
      data: [
219
        orkTaskId': '202012031206570506796', // {
220
        //   state: '处理中',
221
        //   type: '身份异常',
222
        //   describe: '未授权车辆',
223
        //   equipment_name: '1#人脸终端',
224
        //   equipment_number: 's00001',
225
        //   equipment_location: '1#风场SVG室',
226
        //   alarm_time: '2020-09-21 16:07:09',
227
        //   Handler: '张三',
228
        //   processing_time: '2020-09-21 16:07:09',
229

230
        // },
231

222
      data: [{
223
        'workTaskId': '202012031206570506796', orkTaskId': '202012031206570506796', //
224
        'status': 'INI', // 状态
225
        'statusTime': '2020-12-03T04:06:58.000+0000', // 状态时间
226
        'processMemo': null, // 处理详情
227
        'alarmTypeCode': 'HAT', // 报警类型
228
        'alarmMemo': '没戴安全帽', // 报警描述
229
        'resourceToolName': null, // 设备名称
230
        'resourceToolCode': null, // 设备编号
231
        'monitorSceneName': '一号工地', // 设备位置
232
        'aiIdenTime': '2020-12-03T04:06:58.000+0000', // 报警时间l
233
        'targetEmployeeRoleId': '1001',
234
        'workEmployeeRoleId': '90001', // 处理人
235
        'processTime': '', // 处理时间
236
        'idenPictureUrl': 'http://pic/2970', // 图片url
237
        'idenVideoUrl': 'http://video/8989' // 视频url
238
      }
232 239
      ],
233 240
      // 页数
234 241
      page: 1,
@ -254,12 +261,12 @@ export default {
254 261
      this.clickdetail = val
255 262
      // 去除模态框中的单选项
256 263

257
      this.msg = ''
264
      this.status = ''
258 265

259 266
      this.details_modal = true // 打开模态框
260 267
      this.currentdata.data = scope.row // 获取当前行的数据
261 268
      this.currentdata.index = scope.$index // 获取当前行的索引
262
      console.log(this.currentdata.data)
269
      // console.log(this.currentdata.data)
263 270
    },
264 271

265 272
    // 未确认状态的模态框的确认按钮 || 处理中状态的模态框的确认按钮
@ -267,9 +274,11 @@ export default {
267 274
      // 获取单选框中的值
268 275
      // console.log(this.msg)
269 276
      // 判断是否选择了单选框
270
      if (this.msg) {
277
      if (this.status) {
271 278
        // 向后端发送数据
272
        this.alarmdispose(this.currentdata.data.id, this.msg)
279
        this.alarmdispose(this.currentdata.data.workTaskId, this.status)
280
        // console.log(this.status)
281
        // console.log(this.currentdata.data.workTaskId)
273 282
        // 关闭模态框
274 283
        this.details_modal = false
275 284
      } else {
@ -277,32 +286,21 @@ export default {
277 286
      }
278 287
    },
279 288

280
    async alarmdispose (id, msg) {
281
      var res = await aialarmapi.dispose({ 'id': id, 'msg': msg })
282
      console.log(res)
289
    async alarmdispose (id, status, processMemo) {
290
      const dict = { 'END': '已解决', 'RUN': '处理中', 'FAL': '误报' }
291

292
      var res = await aialarmapi.dispose({ 'workTaskId': id, 'status': status, 'processMemo': dict.status })
293
      // console.log(res)
283 294
      if (res.status === 200) {
295
        this.$Message.success('操作成功')
284 296
        // console.log(res.data.data)
285
        this.judgeradio(msg)
297
        this.data[this.currentdata.index].status = res.data.data.status
298
        this.data[this.currentdata.index].processTime = res.data.data.doneDate
286 299
      } else {
287 300
        this.$Message.danger('处理失败')
288 301
      }
289 302
    },
290 303

291
    // 判断选择了哪个单选按钮
292
    judgeradio (msg) {
293
      // 未确认的模态框选择了确认
294
      if (msg === '确认') {
295
        this.data[this.currentdata.index].state = '处理中'
296
      }
297
      // 未确认的模态框选择了误判
298
      if (msg === '误判') {
299
        this.$Message.info('未确认的模态框选择了误判')
300
      }
301
      // 处理中的模态框选择了关闭按钮
302
      if (msg === '关闭') {
303
        this.data[this.currentdata.index].state = '已处理'
304
      }
305
    },
306 304
    onChange (val) {
307 305
      // console.log(val)
308 306
      this.page = val
@ -318,25 +316,27 @@ export default {
318 316
      }
319 317
    },
320 318

321
    // 获取报警类型 以及报警人
319
    // 获取报警类型
322 320
    async gettype () {
323 321
      var res = await aialarmapi.getaialarmtype()
324 322
      // console.log(res)
325 323
      if (res.status === 200) {
326
        this.alarmtypelist = res.data.data
327
        console.log(this.alarmtypelist)
324
        // this.alarmtypelist = res.data.data
325
        // console.log(this.alarmtypelist)
326
        // console.log(res.data)
327
        this.alarmtypelist = res.data
328 328
      }
329 329
    },
330 330

331 331
    // 查询数据时
332 332
    async search () {
333
      var flag = this.startreend(this.searchdata.starttime, this.searchdata.endtime)
334
      console.log(flag)
333
      var flag = this.startreend(this.searchdata.beginTime, this.searchdata.endTime)
334
      // console.log(flag)
335 335
      if (flag) {
336 336
        // 查询
337 337
        var params = this.searchdata
338
        params.page = this.page
339
        params.limit = this.limit
338
        params.pageNumber = this.page
339
        params.pageSize = this.limit
340 340

341 341
        var res = await aialarmapi.getaialarmlist({
342 342
          params: params
@ -344,8 +344,12 @@ export default {
344 344

345 345
        // console.log(res)
346 346
        if (res.status === 200) {
347
          this.data = res.data.data
348
          this.total = Math.ceil(res.data.total / this.limit) * 5
347
          this.data = res.data.data.data
348
          // console.log('数据是:', this.data)
349
          this.data = this.data.map((item) => { item.aiIdenTime = formatDateTime(item.aiIdenTime); return item })
350
          // console.log(this.data)
351

352
          this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
349 353
        } else {
350 354
          this.$Message.danger('数据获取失败')
351 355
        }
@ -393,7 +397,6 @@ export default {
393 397
  .upload {
394 398
    font-size: 14px;
395 399
    line-height: 22px;
396
    margin: 29px 0 25px 0;
397 400
  }
398 401
  .table th,
399 402
  .table td {
@ -403,6 +406,7 @@ export default {
403 406
    display: flex;
404 407
    justify-content: space-between;
405 408
    margin-top: 24px;
409
    margin-bottom: 24px;
406 410
    .title {
407 411
      display: inline-block;
408 412
      width: 70px;