AreaStatisticTable.vue
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
<CardNvue :title="t('PreMenu.regionalStatistics')" :auto-height="true">
<template #content>
<view class="table">
<view class="table-head">
<view class="table-head-item">
<text class="table-head-item-text">{{ t('table.areaName') }}</text>
</view>
<view class="table-head-item">
<text class="table-head-item-text">{{ t('PreMallIndex.CustomerNum') }}</text>
</view>
<view class="table-head-item">
<text class="table-head-item-text">{{ t('PreGateIndex.attentionVisitors') }}</text>
</view>
<view class="table-head-item last-table">
<text class="table-head-item-text">{{ t('PreGateIndex.avgValidDwellTime') }}</text>
</view>
</view>
<view class="table-body" v-if="tableList.length >0">
<view class="table-body-item" v-for="(item,index) in tableList" :key="index">
<view class="table-body-item-value table-body-item-name">
<text class="table-body-item-value-text" lines="1">{{item.gateName}}</text>
</view>
<view class="table-body-item-value">
<text class="table-body-item-value-text">{{item.customerCount}}</text>
</view>
<view class="table-body-item-value">
<text class="table-body-item-value-text">{{item.attentionVisitors}}</text>
</view>
<view class="table-body-item-value">
<text class="table-body-item-value-text">{{formatSeconds(item.avgValidDwellTime)}}</text>
</view>
</view>
</view>
<view class="p-empty" v-else style="margin-top: 40rpx;">
<image class="p-empty-img" src="/static/common/empty.png" mode=""></image>
<text class="p-empty-text chart-text">{{ t('maintenance.monitor.project.empty.text') }}</text>
</view>
</view>
</template>
</CardNvue>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import CardNvue from './Card.nvue';
import {
getGateStatisticsApi
} from '@/api'
import {
formatSeconds
} from '@/utils'
import {
t
} from '@/plugins/index.js'
const tableList = ref([])
onMounted(() => {
// initTableList()
})
const options = ref({})
const initData = (params)=>{
options.value = params
initTableList()
}
defineExpose({
initData
})
const initTableList = async () => {
try {
const params = {
accountIds: options.value.accountId,
endDate: options.value.endDate,
startDate: options.value.startDate,
mallId: options.value.storeId
}
const {
data
} = await getGateStatisticsApi(params)
tableList.value = data
} catch (e) {
console.log(e)
}
}
</script>
<style lang="scss">
@import '../../../styles/table.scss'
</style>