瀏覽代碼

[FE]进出记录联调

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

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

8

8

9
  getaccesstype () {
9
  getaccesstype () {
10
    return $http.get('/access/getaccesstype')
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
  <div class="access">
2
  <div class="access">
3

3

4
    <div class="access_header">
4
    <div class="access_header">
5

5
      <div>
6
      <div>
6
        <span class="title">开始时间 : </span>
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
      </div>
9
      </div>
9

10

10
      <div>
11
      <div>
11
        <span class="title">结束时间 : </span>
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
      </div>
14
      </div>
14

15

15
      <!-- <div>
16
      <!-- <div>
21
      </div> -->
22
      </div> -->
22
      <div class="alarm_people">
23
      <div class="alarm_people">
23
        <span class="title">员工 : </span>
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
      </div>
26
      </div>
26

27

27
    </div>
28
    </div>
42

43

43
    <t-table :data="data" line @selection-change="handleSelectionChange">
44
    <t-table :data="data" line @selection-change="handleSelectionChange">
44
      <t-table-column type="selection" width="34px"></t-table-column>
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
      </t-table-column>
47
      </t-table-column>
47
      <t-table-column label="员工编号" prop="employeeCode" width="80px">
48
      <t-table-column label="员工编号" prop="employeeCode" width="80px">
48
      </t-table-column>
49
      </t-table-column>
49
      <t-table-column label="公司" prop="organizationName" width="94px">
50
      <t-table-column label="公司" prop="companyname" width="94px">
50
      </t-table-column>
51
      </t-table-column>
51
      <t-table-column label="部门" prop="orgName" width="94px">
52
      <t-table-column label="部门" prop="organizationName" width="94px">
52
      </t-table-column>
53
      </t-table-column>
53
      <t-table-column label="职务" prop="employeePositionZh" width="80px">
54
      <t-table-column label="职务" prop="employeePositionZh" width="80px">
54
      </t-table-column>
55
      </t-table-column>
55
      <t-table-column l="相似度" prop="similarity" width="75px">
56
      <t-table-column prop="simi" l="相似度" width="75px">
56
      </t-table-column>
57
      </t-table-column>
57
      <t-table-column label="进出时间" prop="taskExecuteTime" width="160px">
58
      <t-table-column label="进出时间" prop="taskExecuteTime" width="160px">
58
      </t-table-column>
59
      </t-table-column>
60
      </t-table-column>
61
      </t-table-column>
61
      <t-table-column label="终端名称" prop="resourceToolName" width="97px">
62
      <t-table-column label="终端名称" prop="resourceToolName" width="97px">
62
      </t-table-column>
63
      </t-table-column>
63
      <t-table-column label="终端编号" prop="resourceToolCode" width="72px">
64
      <t-table-column label="终端编号" prop="resourceToolCode" width="90px">
64
      </t-table-column>
65
      </t-table-column>
65
      <t-table-column label="操作" width="80px">
66
      <t-table-column label="操作" width="80px">
66
        <template slot-scope="scope">
67
        <template slot-scope="scope">
71
    </t-table>
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
    <t-modal :visibled.sync="detail_modal" title="识别详情" width="840px" height="538px">
78
    <t-modal :visibled.sync="detail_modal" title="识别详情" width="840px" height="538px">
81
          <div class="detail_item1">
82
          <div class="detail_item1">
82
            <div>抓拍图片</div>
83
            <div>抓拍图片</div>
83
            <div>
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
            </div>
86
            </div>
86
          </div>
87
          </div>
87
          <div class="detail_item2">
88
          <div class="detail_item2">
88
            <div>识别结果</div>
89
            <div>识别结果</div>
89
            <div>
90
            <div>
90
              <div>
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
                <div class="bottomimg">抓拍图片</div>
94
                <div class="bottomimg">抓拍图片</div>
93
              </div>
95
              </div>
94
              <div>
96
              <div>
97
                <!-- 修改-->
95
                <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
98
                <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
96
              </div>
99
              </div>
97
              <div>
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
                <div class="bottomimg">人脸底库</div>
102
                <div class="bottomimg">人脸底库</div>
100
              </div>
103
              </div>
101
            </div>
104
            </div>
102
            <div class="describe">
105
            <div class="describe">
103
              <div>
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
              </div>
109
              </div>
106
              <div>
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
              </div>
113
              </div>
109
              <div>
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
              </div>
117
              </div>
112
              <div>
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
              </div>
121
              </div>
115
            </div>
122
            </div>
116
          </div>
123
          </div>
126

133

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

136

131
export default {
137
export default {
138

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

156

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

159

148
        relateEmployeeNameAsLike: '',
149
        beginTime: '',
150
        endTime: ''
160
        nameAsLike: '',
161
        beginDay: '',
162
        endDay: ''
151
      },
163
      },
152
      // 一页的数据
164
      // 一页的数据
153
      data: [
165
      data: [
162

174

163
  mounted () {
175
  mounted () {
164
    // this.gettype()
176
    // this.gettype()
165
    this.search()
177
    this.getcompanyTypesList()
178
    // this.search()
166
  },
179
  },
167
  methods: {
180
  methods: {
168
    // 表格中的选择数据
181
    // 表格中的选择数据
169
    handleSelectionChange (val) {
182
    handleSelectionChange (val) {
170
      this.selectdata = val
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
    onChange (val) {
215
    onChange (val) {
199
    // 查询数据
235
    // 查询数据
200
    async search () {
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
      if (flag) {
239
      if (flag) {
204
        // console.log(this.page)
240
        // console.log(this.page)
205
        // console.log(this.searchdata)
241
        // console.log(this.searchdata)
207
        var params = this.searchdata
243
        var params = this.searchdata
208
        params.pageNumber = this.page
244
        params.pageNumber = this.page
209
        params.pageSize = this.limit
245
        params.pageSize = this.limit
210
        console.log(params)
246
        // console.log(params)
211
        var res = await accessapi.getaccesslist({ params: params })
247
        var res = await accessapi.getaccesslist({ params: params })
212
        // console.log(res)
248
        // console.log(res)
213
        if (res.status === 200) {
249
        if (res.status === 200) {
214
          console.log(res)
250
          // console.log(res)
215
          this.data = res.data.data.data
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
      } else {
275
      } else {
221
        this.$Message.danger('开始时间不能在结束时间的后面')
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
    reset () {
290
    reset () {
227
      for (var index in this.searchdata) {
291
      for (var index in this.searchdata) {

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

82
    </t-table>
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
    <t-modal :visibled.sync="details_modal" :title="clickdetail==0?'报警详情':'报警处理'" width="732px">
88
    <t-modal :visibled.sync="details_modal" :title="clickdetail==0?'报警详情':'报警处理'" width="732px">
390
          this.data = res.data.data.data
390
          this.data = res.data.data.data
391
          this.data = this.data.map((item) => { item.aiIdenTime = formatDateTime(item.aiIdenTime); return item })
391
          this.data = this.data.map((item) => { item.aiIdenTime = formatDateTime(item.aiIdenTime); return item })
392
          console.log(this.data)
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
        } else {
396
        } else {
396
          this.$Message.danger('数据获取失败')
397
          this.$Message.danger('数据获取失败')
397
        }
398
        }