|
|
@@ -0,0 +1,144 @@
|
|
|
+<template>
|
|
|
+ <div class="p-2">
|
|
|
+ <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
|
|
+ :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
+ <div v-show="showSearch" class="mb-[10px]">
|
|
|
+ <el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
|
|
|
+ <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="70px">
|
|
|
+ <el-form-item label="设备名称" prop="deviceName">
|
|
|
+ <el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+
|
|
|
+ <el-card shadow="never">
|
|
|
+ <div class="table-content">
|
|
|
+ <el-table v-loading="loading" :data="flowRateList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column label="" align="left" prop="" width="10"/>
|
|
|
+ <el-table-column label="设备ID" align="left" prop="deviceId" width="180"/>
|
|
|
+ <el-table-column label="设备名称" align="left" prop="deviceName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="设备SN" align="left" prop="deviceSn" width="250"/>
|
|
|
+ <el-table-column label="设备MAC" align="left" prop="deviceMac" width="180"/>
|
|
|
+ <el-table-column label="总人数" align="center" prop="totalNum" width="120"/>
|
|
|
+ <el-table-column label="今日人数" align="center" prop="todayNum" width="120"/>
|
|
|
+ <el-table-column label="昨日人数" align="center" prop="yesterdayNum" width="120"/>
|
|
|
+ <el-table-column label="本周人数" align="center" prop="weekNum" width="120"/>
|
|
|
+ <el-table-column label="本月人数" align="center" prop="monthNum" width="120"/>
|
|
|
+ <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tooltip content="人流列表" placement="top">
|
|
|
+ <el-button link type="primary" icon="Position" @click="handleInfo(scope.row)"
|
|
|
+ v-hasPermi="['device:visitorsFlowRate:query']"></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList"/>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="ChatRecord" lang="ts">
|
|
|
+import {listVisitorsFlowRateCount,} from '@/api/smsb/device/visitors_flow_rate';
|
|
|
+import {VisitorsFlowRateVO,VisitorsFlowRateForm,VisitorsFlowRateQuery} from "@/api/smsb/device/visitors_flow_rate_types";
|
|
|
+
|
|
|
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+
|
|
|
+const flowRateList = ref<VisitorsFlowRateVO[]>([]);
|
|
|
+const buttonLoading = ref(false);
|
|
|
+const loading = ref(true);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref<Array<string | number>>([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+
|
|
|
+const queryFormRef = ref<ElFormInstance>();
|
|
|
+const chatRecordFormRef = ref<ElFormInstance>();
|
|
|
+
|
|
|
+const dialog = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
+const initFormData: VisitorsFlowRateForm = {
|
|
|
+ id: undefined,
|
|
|
+ deviceId: undefined,
|
|
|
+ deviceName: undefined,
|
|
|
+}
|
|
|
+const data = reactive<PageData<VisitorsFlowRateForm, VisitorsFlowRateQuery>>({
|
|
|
+ form: {...initFormData},
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ difyId: undefined,
|
|
|
+ name: undefined,
|
|
|
+ deviceId: undefined,
|
|
|
+ deviceName: undefined,
|
|
|
+ params: {}
|
|
|
+ },
|
|
|
+ rules: {}
|
|
|
+});
|
|
|
+
|
|
|
+const {queryParams, form, rules} = toRefs(data);
|
|
|
+
|
|
|
+/** 查询问答记录列表 */
|
|
|
+const getList = async () => {
|
|
|
+ loading.value = true;
|
|
|
+ const res = await listVisitorsFlowRateCount(queryParams.value);
|
|
|
+ flowRateList.value = res.rows;
|
|
|
+ total.value = res.total;
|
|
|
+ loading.value = false;
|
|
|
+}
|
|
|
+const handleInfo = async (row?: VisitorsFlowRateVO) => {
|
|
|
+ const deviceName = row.deviceName;
|
|
|
+ // 跳转页面 /source/push/review?id=1898991996092481537&type=approval&taskId=1898992031169445891
|
|
|
+ proxy.$router.push('/device/pc/visitorsFlowRate?deviceName=' + deviceName);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/** 取消按钮 */
|
|
|
+const cancel = () => {
|
|
|
+ reset();
|
|
|
+ dialog.visible = false;
|
|
|
+}
|
|
|
+
|
|
|
+/** 表单重置 */
|
|
|
+const reset = () => {
|
|
|
+ form.value = {...initFormData};
|
|
|
+ chatRecordFormRef.value?.resetFields();
|
|
|
+}
|
|
|
+
|
|
|
+/** 搜索按钮操作 */
|
|
|
+const handleQuery = () => {
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+/** 重置按钮操作 */
|
|
|
+const resetQuery = () => {
|
|
|
+ queryFormRef.value?.resetFields();
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+
|
|
|
+/** 多选框选中数据 */
|
|
|
+const handleSelectionChange = (selection: VisitorsFlowRateVO[]) => {
|
|
|
+ ids.value = selection.map(item => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+});
|
|
|
+</script>
|