# up history table
This commit is contained in:
parent
27db1ba5d4
commit
13cfaeba7b
|
@ -55,6 +55,7 @@ export default {
|
|||
getDevices() {
|
||||
fetchDeviceList().then(response => {
|
||||
this.deviceList = response.data.results
|
||||
console.log(this.deviceList)
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="deviceList"
|
||||
:data="historyList"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
prop="oid"
|
||||
label="序号"
|
||||
min-width="80">
|
||||
</el-table-column>
|
||||
|
@ -24,12 +24,33 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { fetchLogStatisticHistory } from '@/api/counter'
|
||||
export default {
|
||||
name: 'LogHistoryTable'
|
||||
name: 'LogHistoryTable',
|
||||
data() {
|
||||
return {
|
||||
listLoading: true,
|
||||
historyList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getLogStatisticHistory() {
|
||||
fetchLogStatisticHistory().then(response => {
|
||||
this.historyList = response.data.results
|
||||
this.historyList.forEach((item, index) => {
|
||||
item.oid = index + 1
|
||||
})
|
||||
this.listLoading = false
|
||||
// console.log(this.historyList)
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getLogStatisticHistory()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
|
||||
</style>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<log-history-table></log-history-table>
|
||||
<log-history-table :historyList="historyList"></log-history-table>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row :gutter="32">
|
||||
|
@ -63,7 +63,11 @@ import BarChart from './components/BarChart'
|
|||
import TransactionTable from './components/TransactionTable'
|
||||
import TodoList from './components/TodoList'
|
||||
import BoxCard from './components/BoxCard'
|
||||
import { fetchDeviceLogStatistic, fetchDeviceInfoStatistic } from '@/api/counter'
|
||||
import
|
||||
{
|
||||
fetchDeviceLogStatistic,
|
||||
fetchDeviceInfoStatistic
|
||||
} from '@/api/counter'
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
|
@ -104,7 +108,9 @@ export default {
|
|||
totalCount: 0,
|
||||
dailyCount: 0,
|
||||
onlineCount: 0,
|
||||
offlineCount: 0
|
||||
offlineCount: 0,
|
||||
historyList: [],
|
||||
historyLoading: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -116,7 +122,6 @@ export default {
|
|||
const infoData = response.data
|
||||
this.onlineCount = infoData['online_count']
|
||||
this.offlineCount = infoData['offline_count']
|
||||
console.log(this.totalCount)
|
||||
})
|
||||
},
|
||||
getDeviceLogStatistic() {
|
||||
|
@ -124,7 +129,6 @@ export default {
|
|||
const logData = response.data
|
||||
this.totalCount = logData['total_count']
|
||||
this.dailyCount = logData['daily_count']
|
||||
console.log(this.onlineCount)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue