飞天云平台-国产化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
6.0 KiB

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
  1. <template>
  2. <div style="height: calc(100vh - 232px);">
  3. <div class="head-container">
  4. <div class="head-search">
  5. <el-select v-model="query.doorCodes" clearable size="small" placeholder="门禁列表选择" class="filter-item" style="width: 140px;" @change="crud.toQuery">
  6. <i slot="prefix" class="iconfont icon-zhuangtai" />
  7. <el-option v-for="item in doorOptions" :key="item.key" :label="item.display_name" :value="item.key" />
  8. </el-select>
  9. <date-range-picker v-model="blurryTime" class="date-item" />
  10. <rrOperation>
  11. <template v-slot:right>
  12. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
  13. </template>
  14. </rrOperation>
  15. </div>
  16. <crudOperation :permission="permission">
  17. <template v-slot:right>
  18. <el-button :loading="crud.downloadLoading" size="mini" @click="doExport">
  19. <i class="iconfont icon-daochu" />
  20. 导出
  21. </el-button>
  22. </template>
  23. </crudOperation>
  24. </div>
  25. <div class="container-wrap">
  26. <span class="right-top-line" />
  27. <span class="left-bottom-line" />
  28. <el-table ref="table" v-loading="crud.loading" highlight-current-row style="width: 100%;" height="calc(100vh - 330px)" :data="crud.data" @selection-change="crud.selectionChangeHandler">
  29. <el-table-column type="index" label="序号" width="55" align="center" />
  30. <el-table-column prop="dev_sn" label="门禁设备" />
  31. <el-table-column prop="person_name" label="通行人员" />
  32. <el-table-column prop="pass_direction" label="进出方向">
  33. <template slot-scope="scope">
  34. <div>{{ scope.row.pass_direction === 1?'进':'出' }}</div>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="pass_type" label="进出凭证类型">
  38. <template slot-scope="scope">
  39. <div>{{ scope.row.pass_type === 1 ? '证号':'身份证/一卡通/读者证' }}</div>
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="pass_card" label="卡号" />
  43. <el-table-column prop="pass_time" label="时间">
  44. <template slot-scope="scope">
  45. <div>{{ scope.row.pass_time | parseTime }}</div>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <!--分页组件-->
  50. <pagination v-if="crud.data.length !== 0" />
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import crudFace from '@/api/faceRecognition/index'
  56. import { FetchDeviceTreeByType } from '@/api/deviceVI/index'
  57. import CRUD, { presenter, header, crud } from '@crud/crud'
  58. import rrOperation from '@crud/RR.operation'
  59. import crudOperation from '@crud/CRUD.operation'
  60. import pagination from '@crud/Pagination'
  61. import DateRangePicker from '@/components/DateRangePicker'
  62. import { exportFile } from '@/utils/index'
  63. import qs from 'qs'
  64. import { mapGetters } from 'vuex'
  65. export default {
  66. name: 'PersonInfoManage',
  67. components: { pagination, crudOperation, rrOperation, DateRangePicker },
  68. cruds() {
  69. return CRUD({ title: '门禁日志', url: 'api/accessLog/initAccessControlLog', crudMethod: { ...crudFace }, optShow: {
  70. add: false,
  71. edit: false,
  72. del: false,
  73. reset: false,
  74. download: false,
  75. group: false
  76. }})
  77. },
  78. mixins: [presenter(), header(), crud()],
  79. data() {
  80. return {
  81. permission: {
  82. add: ['admin', 'column:add'],
  83. edit: ['admin', 'column:edit'],
  84. del: ['admin', 'column:del']
  85. },
  86. doorOptions: [
  87. ],
  88. blurryTime: []
  89. }
  90. },
  91. computed: {
  92. ...mapGetters([
  93. 'baseApi',
  94. 'user'
  95. ])
  96. },
  97. created() {
  98. this.getDeviceTreeByType()
  99. },
  100. mounted() {
  101. },
  102. methods: {
  103. getDeviceTreeByType() {
  104. const params = {
  105. 'libcode': this.user.fonds.fondsNo,
  106. 'deviceType': 3
  107. }
  108. FetchDeviceTreeByType(params).then(res => {
  109. this.doorOptions = res
  110. }).catch(() => {
  111. })
  112. },
  113. [CRUD.HOOK.beforeRefresh]() {
  114. this.crud.query.libcode = this.user.fonds.fondsNo
  115. if (this.blurryTime) {
  116. this.crud.query.startTime = this.blurryTime[0]
  117. this.crud.query.endTime = this.blurryTime[1]
  118. } else {
  119. this.crud.query.startTime = null
  120. this.crud.query.endTime = null
  121. }
  122. },
  123. [CRUD.HOOK.afterRefresh]() {
  124. },
  125. resetQuery() {
  126. this.blurryTime = null
  127. this.crud.query.startTime = null
  128. this.crud.query.endTime = null
  129. this.crud.query.doorCodes = null
  130. this.crud.toQuery()
  131. },
  132. doExport() {
  133. console.log('doExport', this.crud.page.total)
  134. if (this.crud.page.total >= 10000) {
  135. this.handleExport('导出数据大于10000条,时间可能较长')
  136. } else {
  137. this.handleExport('此操作将导出所有数据')
  138. }
  139. },
  140. handleExport(message) {
  141. this.crud.downloadLoading = true
  142. this.$confirm(message + '<span>你是否还要继续?</span>', '提示', {
  143. confirmButtonText: '继续',
  144. cancelButtonText: '取消',
  145. type: 'warning',
  146. dangerouslyUseHTMLString: true
  147. }).then(() => {
  148. const params = {
  149. 'libcode': this.user.fonds.fondsNo,
  150. 'doorCodes': this.crud.query.doorCodes,
  151. 'startTime': this.blurryTime.length !== 0 ? this.blurryTime[0].split(' ')[0] : null,
  152. 'endTime': this.blurryTime.length !== 0 ? this.blurryTime[1].split(' ')[0] : null
  153. }
  154. console.log('exportFile', params)
  155. exportFile(this.baseApi + '/api/accessLog/downloadAccessControlLog?' + qs.stringify(params, { indices: false, allowDots: true, skipNulls: false }))
  156. this.crud.downloadLoading = false
  157. }).catch(() => {
  158. console.log('取消')
  159. this.crud.downloadLoading = false
  160. })
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. ::v-deep .el-pagination{
  167. margin: 24px 0 10px 0 !important
  168. }
  169. </style>