实现接口部分功能
This commit is contained in:
@@ -75,6 +75,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
|
||||
import { getDataList } from '/@/api/customerService/report';
|
||||
|
||||
// 定义接口
|
||||
interface TableDataRow {
|
||||
@@ -107,49 +108,6 @@ interface TableData {
|
||||
param: TableDataParam;
|
||||
}
|
||||
|
||||
// 模拟数据
|
||||
const dateList: TableDataRow[] = [
|
||||
{
|
||||
infoId: 434569527,
|
||||
loginName: 'demo',
|
||||
ipaddr: '10',
|
||||
loginLocation: '8',
|
||||
browser: '5',
|
||||
os: '3',
|
||||
status: 2,
|
||||
msg: '15',
|
||||
loginTime: '2025-11-22',
|
||||
module: '95%',
|
||||
platform: '抖音',
|
||||
},
|
||||
{
|
||||
infoId: 424569527,
|
||||
loginName: 'demo',
|
||||
ipaddr: '12',
|
||||
loginLocation: '9',
|
||||
browser: '6',
|
||||
os: '4',
|
||||
status: 3,
|
||||
msg: '18',
|
||||
loginTime: '2025-11-22',
|
||||
module: '92%',
|
||||
platform: '小红书',
|
||||
},
|
||||
{
|
||||
infoId: 414569527,
|
||||
loginName: 'demo',
|
||||
ipaddr: '8',
|
||||
loginLocation: '6',
|
||||
browser: '4',
|
||||
os: '2',
|
||||
status: 1,
|
||||
msg: '12',
|
||||
loginTime: '2025-11-22',
|
||||
module: '98%',
|
||||
platform: '快手',
|
||||
},
|
||||
];
|
||||
|
||||
// 响应式数据
|
||||
const queryRef = ref<FormInstance>();
|
||||
const ids = ref<number[]>([]);
|
||||
@@ -174,15 +132,11 @@ const dataList = async () => {
|
||||
try {
|
||||
tableData.loading = true;
|
||||
|
||||
// 实际API调用
|
||||
// const res = await logList(tableData.param);
|
||||
// tableData.data = res.data.list;
|
||||
// tableData.total = res.data.total;
|
||||
const res = await getDataList(tableData.param);
|
||||
console.log(res);
|
||||
|
||||
// 模拟数据 - 添加延迟避免DOM操作错误
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
tableData.data = dateList;
|
||||
tableData.total = dateList.length;
|
||||
tableData.data = res.data.list;
|
||||
tableData.total = res.data.total;
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
ElMessage.error('获取数据失败');
|
||||
|
||||
Reference in New Issue
Block a user