Browse Source

首页门禁管理显示最近30条数据

master
z_yu 2 years ago
parent
commit
de750b76af
  1. 7
      src/api/home/securityDoor/securityDoor.js
  2. 10
      src/views/components/SecurityDoor.vue

7
src/api/home/securityDoor/securityDoor.js

@ -1,9 +1,10 @@
import request from '@/utils/request'
export function securitydoor() {
export function securitydoor(params) {
return request({
url: 'api/securitydoor/storeroom',
method: 'get'
url: 'api/securitydoor/initSecurityDoorLog',
method: 'get',
params
})
}
export default { securitydoor }

10
src/views/components/SecurityDoor.vue

@ -8,9 +8,9 @@
</p>
</h3>
<el-table ref="table" style="min-width: 100%;" :height="height" :data="tableData" class="warehose-el-table" stripe>
<el-table-column prop="update_time" label="时间" align="center" min-width="60">
<el-table-column prop="createTime" label="时间" align="center" min-width="60">
<template slot-scope="scope">
<div>{{ scope.row.update_time | parseTime }}</div>
<div>{{ scope.row.createTime | parseTime }}</div>
</template>
</el-table-column>
<el-table-column label="库房" align="center" min-width="30">
@ -104,9 +104,9 @@ export default {
}
},
getSecuritydoor() {
securitydoor().then((data) => {
if (data && data.length > 0) {
this.tableData.splice(0, data.length, ...data)
securitydoor({ page: 1, size: 30 }).then((data) => {
if (data.content && data.content.length > 0) {
this.tableData.splice(0, data.content.length, ...data.content)
}
})
}

Loading…
Cancel
Save