Browse Source

[FE]修改进出记录界面

xiayu3 4 years ago
parent
commit
3b46b5a167

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

15
  // 获取公司
15
  // 获取公司
16
  getcompanyTypesList () {
16
  getcompanyTypesList () {
17
    return $default.get('sp/employeeManagement/queryCompanyList')
17
    return $default.get('sp/employeeManagement/queryCompanyList')
18
  },
19
  // 获取仪表记录列表
20
  getAildenLogList(params) {
21
    return $default.get('/sp/aiIdenLogManagement/queryPageAiIdenLog?', params)
18
  }
22
  }
19

20
}
23
}
21

24

22
export default api
25
export default api

+ 9 - 32
security-protection-platform/src/modules/access/component/tab2/index.vue

162
      },
162
      },
163
      // 公司列表
163
      // 公司列表
164
      companyTypesList: [],
164
      companyTypesList: [],
165
166
      // 查询的参数
165
      // 查询的参数
166
      searchParams: {
167
        typeId: 'NOM',
168
        modelId: 'INSTRUMENT'
169
      },
167
      searchdata: {
170
      searchdata: {
168
169
        nameAsLike: '',
171
        nameAsLike: '',
170
        beginDay: '',
172
        beginDay: '',
171
        endDay: ''
173
        endDay: ''
172
      },
174
      },
173
      // 一页的数据
175
      // 一页的数据
174
      data: [
175
176
      ],
176
      data: [],
177
      // 当前页
177
      // 当前页
178
      page: 1,
178
      page: 1,
179
      limit: 10,
179
      limit: 10,
282
        this.page = 1
282
        this.page = 1
283
      }
283
      }
284
    },
284
    },
285
    // 获取进出类型
286
    // gettype () {
287
    //   accessapi.getaccesstype().then((res) => {
288
    //     this.accesstype = res.data.data
289
    //     console.log(this.accesstype)
290
    //   })
291
    // },
292
    // 查询数据
285
    // 查询仪表记录数据
293
    async search () {
286
    async search () {
294
      // 检验数据
287
      // 检验数据
295
      var flag = this.startreend(this.searchdata.beginDay, this.searchdata.endDay)
288
      var flag = this.startreend(this.searchdata.beginDay, this.searchdata.endDay)
296
      if (flag) {
289
      if (flag) {
297
        // console.log(this.page)
298
        // console.log(this.searchdata)
299
300
        var params = this.searchdata
301
        params.pageNumber = this.page
302
        params.pageSize = this.limit
303
        // console.log(params)
304
        var res = await accessapi.getaccesslist({ params: params })
305
        // console.log(res)
290
        var params = this.searchParams
291
        var res = await accessapi.getAildenLogList({ params: params })
306
        if (res.status === 200) {
292
        if (res.status === 200) {
307
          // console.log(res)
293
          console.log(res)
308
          this.data = res.data.data.data
294
          this.data = res.data.data.data
309
          // console.log(this.data)
295
          // console.log(this.data)
310
          // console.log(this.companyTypesList)
296
          // console.log(this.companyTypesList)
311
          this.data = this.data.map((item) => {
297
          this.data = this.data.map((item) => {
312
            // 处理进出时间
298
            // 处理进出时间
313
            // item.taskExecuteTime = formatDateTime(item.taskExecuteTime)
314
            // 处理相似度
315
            // item.simi = this.percentagedata(item.simi)
316
            // console.log('公司的数据是', this.companyTypesList)
317
            // console.log('公司id', item.companyId, typeof item.companyId)
318
            // console.log('公司名字是', this.companyTypesList.filter((item1) => { return item1.id === 10000 }))
319
            item.companyinfo = this.companyTypesList.filter((item1) => { return String(item1.id) === item.companyId })
299
            item.companyinfo = this.companyTypesList.filter((item1) => { return String(item1.id) === item.companyId })
320
            if (item.companyinfo.length > 0) {
300
            if (item.companyinfo.length > 0) {
321
              item.companyname = item.companyinfo[0].name
301
              item.companyname = item.companyinfo[0].name
322
            } else {
302
            } else {
323
              item.companyname = ''
303
              item.companyname = ''
324
            }
304
            }
325
326
            return item
305
            return item
327
          })
306
          })
328
307
329
          // this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
308
          // this.total = Math.ceil(res.data.data.total / res.data.data.size) * 5
330
          // console.log(this.total)
331
          this.total = res.data.data.total
309
          this.total = res.data.data.total
332
          // console.log('数据是', this.data)
333
        }
310
        }
334
      } else {
311
      } else {
335
        this.$Message.danger('开始时间不能在结束时间的后面')
312
        this.$Message.danger('开始时间不能在结束时间的后面')

security-protection-platform/src/modules/access/component/tab1/index.vue → security-protection-platform/src/modules/access/component/io-record/index.vue


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

1
<template>
1
<template>
2
  <t-tabs :animated="false" style="padding:20px">
2
  <t-tabs :animated="false" style="padding:20px">
3
    <t-tab-panel label="导航页1" panel-id="tab-1">
4
      <tab-change1></tab-change1>
3
    <t-tab-panel label="进出记录" panel-id="tab-1">
4
      <io-record></io-record>
5
    </t-tab-panel>
5
    </t-tab-panel>
6
    <t-tab-panel label="导航页2" panel-id="tab-2">
7
      <tab-change2></tab-change2>
6
    <t-tab-panel label="仪表记录" panel-id="tab-2">
7
      <instrument-record></instrument-record>
8
    </t-tab-panel>
8
    </t-tab-panel>
9
  </t-tabs>
9
  </t-tabs>
10
</template>
10
</template>
11

11

12
<script>
12
<script>
13
import tabChange1 from './component/tab1'
14
import tabChange2 from './component/tab2'
13
import ioRecord from './component/io-record'
14
import instrumentRecord from './component/instrumentRecord'
15

15

16
export default {
16
export default {
17
  components: {
17
  components: {
18
    tabChange1,
19
    tabChange2
18
    ioRecord,
19
    instrumentRecord
20
  },
20
  },
21
  data () {
21
  data () {
22
    return {
22
    return {