ソースを参照

[FE]进出记录联调

liuwenxun 4 年 前
コミット
d73f053c1c

+ 7 - 0
security-protection-platform/src/api/access/index.js

@ -8,6 +8,13 @@ const api = {
8 8

9 9
  getaccesstype () {
10 10
    return $http.get('/access/getaccesstype')
11
  },
12
  getOneInAndOutRecord (params) {
13
    return $default.get('/sp/inAndOutRecord/queryOneInAndOutRecord', params)
14
  },
15
  // 获取公司
16
  getcompanyTypesList () {
17
    return $default.get('sp/employeeManagement/queryCompanyList')
11 18
  }
12 19

13 20
}

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

@ -2,14 +2,15 @@
2 2
  <div class="access">
3 3

4 4
    <div class="access_header">
5

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

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

15 16
      <!-- <div>
@ -21,7 +22,7 @@
21 22
      </div> -->
22 23
      <div class="alarm_people">
23 24
        <span class="title">员工 : </span>
24
        <t-input v-model="searchdata.relateEmployeeNameAsLike" placeholder="员工姓名、编号关键字" style="width: 200px"></t-input>
25
        <t-input v-model="searchdata.nameAsLike" placeholder="员工姓名" style="width: 200px"></t-input>
25 26
      </div>
26 27

27 28
    </div>
@ -42,17 +43,17 @@
42 43

43 44
    <t-table :data="data" line @selection-change="handleSelectionChange">
44 45
      <t-table-column type="selection" width="34px"></t-table-column>
45
      <t-table-column label="姓名" prop="relateEmployeeRoleName" width="60px">
46
      <t-table-column label="姓名" prop="employeeName" width="60px">
46 47
      </t-table-column>
47 48
      <t-table-column label="员工编号" prop="employeeCode" width="80px">
48 49
      </t-table-column>
49
      <t-table-column label="公司" prop="organizationName" width="94px">
50
      <t-table-column label="公司" prop="companyname" width="94px">
50 51
      </t-table-column>
51
      <t-table-column label="部门" prop="orgName" width="94px">
52
      <t-table-column label="部门" prop="organizationName" width="94px">
52 53
      </t-table-column>
53 54
      <t-table-column label="职务" prop="employeePositionZh" width="80px">
54 55
      </t-table-column>
55
      <t-table-column l="相似度" prop="similarity" width="75px">
56
      <t-table-column prop="simi" l="相似度" width="75px">
56 57
      </t-table-column>
57 58
      <t-table-column label="进出时间" prop="taskExecuteTime" width="160px">
58 59
      </t-table-column>
@ -60,7 +61,7 @@
60 61
      </t-table-column>
61 62
      <t-table-column label="终端名称" prop="resourceToolName" width="97px">
62 63
      </t-table-column>
63
      <t-table-column label="终端编号" prop="resourceToolCode" width="72px">
64
      <t-table-column label="终端编号" prop="resourceToolCode" width="90px">
64 65
      </t-table-column>
65 66
      <t-table-column label="操作" width="80px">
66 67
        <template slot-scope="scope">
@ -71,7 +72,7 @@
71 72
    </t-table>
72 73

73 74
    <!-- 分页 -->
74
    <t-pager :total="total" :current="page" show-elevator class="pager" @on-change="onChange"></t-pager>
75
    <t-pager :total="total" :current="page" :page-size="limit" show-elevator class="pager" @on-change="onChange"></t-pager>
75 76

76 77
    <!-- 模态框 -->
77 78
    <t-modal :visibled.sync="detail_modal" title="识别详情" width="840px" height="538px">
@ -81,36 +82,42 @@
81 82
          <div class="detail_item1">
82 83
            <div>抓拍图片</div>
83 84
            <div>
84
              <img :src="rowdata.idenVideoUrl" alt="" srcset="" style="width:100%;height:100%">
85
              <img :src="rowdata.pictureInfo.fileUrl" alt="" srcset="" style="width:100%;height:100%">
85 86
            </div>
86 87
          </div>
87 88
          <div class="detail_item2">
88 89
            <div>识别结果</div>
89 90
            <div>
90 91
              <div>
91
                <img :src="rowdata.idenPictureUrl" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
92
                <!-- 修改-->
93
                <img src="" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
92 94
                <div class="bottomimg">抓拍图片</div>
93 95
              </div>
94 96
              <div>
97
                <!-- 修改-->
95 98
                <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
96 99
              </div>
97 100
              <div>
98
                <img :src="rowdata.headerUrl" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
101
                <img :src="rowdata.alarmInfo.headerImage" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
99 102
                <div class="bottomimg">人脸底库</div>
100 103
              </div>
101 104
            </div>
102 105
            <div class="describe">
103 106
              <div>
104
                <t-icon icon="user-outline"></t-icon> {{ rowdata.relateEmployeeRoleName }}({{ rowdata.code }})
107
                <t-icon icon="user-outline"></t-icon>
108
                {{ rowdata.alarmInfo.employeeName }}({{ rowdata.alarmInfo.employeeCode }})
105 109
              </div>
106 110
              <div>
107
                <t-icon icon="map-marker"></t-icon> {{ rowdata.terminalPosition }}
111
                <t-icon icon="map-marker"></t-icon>
112
                {{ rowdata.alarmInfo.terminalPosition || '--' }}
108 113
              </div>
109 114
              <div>
110
                <t-icon icon="clock-outline"></t-icon> {{ rowdata.taskExecuteTime }}
115
                <t-icon icon="clock-outline"></t-icon>
116
                {{ rowdata.alarmInfo.taskExecuteTime }}
111 117
              </div>
112 118
              <div>
113
                <t-icon icon="team-outline"></t-icon> 相似度:{{ rowdata.similarity }}
119
                <t-icon icon="team-outline"></t-icon> 相似度:
120
                {{ rowdata.alarmInfo.simi }}
114 121
              </div>
115 122
            </div>
116 123
          </div>
@ -126,9 +133,9 @@
126 133

127 134
<script>
128 135
import accessapi from '@/api/access'
129
import formatDateTime from '@/utils/formatDateTime.js'
130 136

131 137
export default {
138

132 139
  data () {
133 140
    return {
134 141
      // 进出类型
@ -140,14 +147,19 @@ export default {
140 147
      // 模态框显示
141 148
      detail_modal: false,
142 149
      // 当前行数据
143
      rowdata: {},
150
      rowdata: {
151
        alarmInfo: {},
152
        pictureInfo: {}
153
      },
154
      // 公司列表
155
      companyTypesList: [],
144 156

145 157
      // 查询的参数
146 158
      searchdata: {
147 159

148
        relateEmployeeNameAsLike: '',
149
        beginTime: '',
150
        endTime: ''
160
        nameAsLike: '',
161
        beginDay: '',
162
        endDay: ''
151 163
      },
152 164
      // 一页的数据
153 165
      data: [
@ -162,18 +174,42 @@ export default {
162 174

163 175
  mounted () {
164 176
    // this.gettype()
165
    this.search()
177
    this.getcompanyTypesList()
178
    // this.search()
166 179
  },
167 180
  methods: {
168 181
    // 表格中的选择数据
169 182
    handleSelectionChange (val) {
170 183
      this.selectdata = val
171 184
    },
185
    // 获取公司
186
    async getcompanyTypesList () {
187
      var res = await accessapi.getcompanyTypesList()
188
      // console.log('公司信息是', res)
189
      if (res.status === 200) {
190
        this.companyTypesList = res.data.data
191
        this.search()
192
      } else {
193
        this.$Message.danger('获取数据失败')
194
      }
195
    },
172 196
    // 点击详情
173
    handleClick (scope) {
174
      this.detail_modal = true
175
      this.rowdata = scope.row
176
      console.log(this.rowdata)
197
    async handleClick (scope) {
198
      // this.rowdata = scope.row
199
      // console.log(this.rowdata)
200
      // console.log('id是', scope.row.aiIdenLogId)
201
      var res = await accessapi.getOneInAndOutRecord({ params: { aiIdenLogId: scope.row.aiIdenLogId } })
202

203
      if (res.data.success) {
204
        this.detail_modal = true
205
        // this.rowdata = res.data.data
206
        this.rowdata.pictureInfo = res.data.data.pictureInfo
207
        this.rowdata.alarmInfo = res.data.data.alarmInfo
208
        // console.log(res.data.data)
209
        // console.log('详情数据是', this.rowdata)
210
      } else {
211
        this.$Message.danger('获取数据失败')
212
      }
177 213
    },
178 214
    // 分页
179 215
    onChange (val) {
@ -199,7 +235,7 @@ export default {
199 235
    // 查询数据
200 236
    async search () {
201 237
      // 检验数据
202
      var flag = this.startreend(this.searchdata.beginTime, this.searchdata.endTime)
238
      var flag = this.startreend(this.searchdata.beginDay, this.searchdata.endDay)
203 239
      if (flag) {
204 240
        // console.log(this.page)
205 241
        // console.log(this.searchdata)
@ -207,21 +243,49 @@ export default {
207 243
        var params = this.searchdata
208 244
        params.pageNumber = this.page
209 245
        params.pageSize = this.limit
210
        console.log(params)
246
        // console.log(params)
211 247
        var res = await accessapi.getaccesslist({ params: params })
212 248
        // console.log(res)
213 249
        if (res.status === 200) {
214
          console.log(res)
250
          // console.log(res)
215 251
          this.data = res.data.data.data
216
          this.data = this.data.map((item) => { item.taskExecuteTime = formatDateTime(item.taskExecuteTime); return item })
217
          console.log(this.data)
218
          this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
252
          this.data = this.data.map((item) => {
253
            // 处理进出时间
254
            // item.taskExecuteTime = formatDateTime(item.taskExecuteTime)
255
            // 处理相似度
256
            // item.simi = this.percentagedata(item.simi)
257
            // console.log('公司的数据是', this.companyTypesList)
258
            // console.log('公司id', item)
259
            // console.log('公司名字是', this.companyTypesList.filter((item1) => { return item1.id === 10000 }))
260
            item.companyinfo = this.companyTypesList.filter((item1) => { return item1.id === item.companyId })
261
            if (item.companyinfo.length > 0) {
262
              item.companyname = item.companyinfo[0].name
263
            } else {
264
              item.companyname = ''
265
            }
266

267
            return item
268
          })
269

270
          // this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
271
          // console.log(this.total)
272
          this.total = res.data.data.total
273
          // console.log('数据是', this.data)
219 274
        }
220 275
      } else {
221 276
        this.$Message.danger('开始时间不能在结束时间的后面')
222 277
      }
223 278
    },
224 279

280
    percentagedata (point) {
281
      if (point === 0) {
282
        return 0
283
      }
284
      var str = Number(point * 100).toFixed(1)
285
      str += '%'
286
      return str
287
    },
288

225 289
    // 重置数据
226 290
    reset () {
227 291
      for (var index in this.searchdata) {

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

@ -82,7 +82,7 @@
82 82
    </t-table>
83 83

84 84
    <!-- 分页 -->
85
    <t-pager :total="total" :current="page" show-elevator class="pager" @on-change="onChange"></t-pager>
85
    <t-pager :total="total" :current="page" :page-size="limit" show-elevator class="pager" @on-change="onChange"></t-pager>
86 86

87 87
    <!-- 模态框-->
88 88
    <t-modal :visibled.sync="details_modal" :title="clickdetail==0?'报警详情':'报警处理'" width="732px">
@ -390,8 +390,9 @@ export default {
390 390
          this.data = res.data.data.data
391 391
          this.data = this.data.map((item) => { item.aiIdenTime = formatDateTime(item.aiIdenTime); return item })
392 392
          console.log(this.data)
393

394
          this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
393
          console.log('数据是', res)
394
          // this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
395
          this.total = res.data.data.total
395 396
        } else {
396 397
          this.$Message.danger('数据获取失败')
397 398
        }