This commit is contained in:
李远 2026-03-24 09:45:43 +08:00
parent fe641618e1
commit 4f0ba2fa59
12 changed files with 374 additions and 8 deletions

View File

@ -0,0 +1,6 @@
import { request } from '@/api';
// 获取跟单记录列表
export const getFollowListApi = (params: any) => {
return request.get('/orderRecords/followList', {...params})
}

View File

@ -0,0 +1,6 @@
import { request } from '@/api';
// 获取带单记录列表
export const getLeadListApi = (params: any) => {
return request.get('/orderRecords/singleList', {...params})
}

View File

@ -349,11 +349,27 @@ const staticMenuList = ref<ElMenuItem[]>(
path: 'agent', // index="agent"
icon: 'UserFilled', // <UserFilled />
children: [
//
//
{
id: 132,
label: '客户列表',
path: '/agent/customerList', // index="13-2"
icon: ''
},
//
//
{
id: 133,
label: '客户交易订单',
path: '/agent/customerTradeOrder', // index="13-3"
icon: ''
},
//
{
id: 135,
label: '客户资金流水',
path: '/agent/customerCapitalFlow', // index="13-5"
icon: ''
},
]
},
//

View File

@ -334,6 +334,43 @@ const routes = [
},
]
},
//代理管理
{
path: 'agent',
name: 'Agent',
meta: {
title: '代理管理', // 左侧菜单显示的标题
},
children: [
//客户列表
{
path: 'customerList',
name: 'CustomerList',
component: () => import('@/views/agent/customerList/index.vue'),
meta: {
title: '客户列表', // 左侧菜单显示的标题
}
},
//客户交易订单
{
path: 'customerTradeOrder',
name: 'CustomerTradeOrder',
component: () => import('@/views/agent/customerTradeOrder/index.vue'),
meta: {
title: '客户交易订单', // 左侧菜单显示的标题
}
},
//客户资金流水
{
path: 'customerCapitalFlow',
name: 'CustomerCapitalFlow',
component: () => import('@/views/agent/customerCapitalFlow/index.vue'),
meta: {
title: '客户资金流水', // 左侧菜单显示的标题
}
},
]
},
]
},
{

View File

@ -0,0 +1,5 @@
<template>
<div>
客户资金流水
</div>
</template>

View File

@ -0,0 +1,5 @@
<template>
<div>
客户列表
</div>
</template>

View File

@ -0,0 +1,5 @@
<template>
<div>
客户交易订单
</div>
</template>

View File

@ -1,5 +1,119 @@
<template>
<div>
跟单记录
<div class="follow-record">
<!-- 搜索 -->
<FollowRecordSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
@reset="handleReset">
<template #button="{ form }">
<el-button type="primary" @click="handleExport()">
导出
</el-button>
</template>
</FollowRecordSearch>
<!-- 表格 -->
<FollowRecordTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
<!-- 分页 -->
<FollowRecordPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
@change="handleChange" />
</div>
</template>
<script setup lang="ts">
//
import FollowRecordSearch from '@/components/common/Search.vue'
import FollowRecordTable from '@/components/common/Table.vue'
import FollowRecordPagination from '@/components/common/Pagination.vue'
//
import { search, tableColumns } from './options'
//
import { getFollowListApi } from '@/api/modules/personalized/followRecord'
//
import { exportToExcel } from '@/utils/exportToExcel'
/**
* @description: 定义搜索数据
*/
const searchOptions = ref(search)
const searchForm = ref({
orderNo: '',
startTime: '',
endTime: '',
})
/**
* @description: 定义表格数据
*/
const tableTree = ref([])
const tableColumnsOptions = ref(tableColumns)
/**
* @description: 定义分页数据
*/
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(0)
/**
* @description: 定义公共请求数据方法
*/
const getFollowList = async () => {
const params = {
page: currentPage.value,
page_size: pageSize.value,
start_time: searchForm.value.startTime.length > 0 ? `${searchForm.value.startTime} 0:00:00` : '2026-01-01 0:00:00',
end_time: searchForm.value.endTime.length > 0 ? `${searchForm.value.endTime} 23:59:59` : '2026-03-01 23:59:59',
order_no: searchForm.value.orderNo,
}
const data: any = await getFollowListApi(params)
// table
tableTree.value = data.data.map((item: any) => ({
orderNo: item.order_id,
followAccount: item.user.username,
symbol: item.variety_id,
tradeQty: item.num,
tradeTime: item.created_at,
closeProfit: '后续添加'
}))
//
total.value = data.total
currentPage.value = data.current_page
pageSize.value = Number(data.per_page)
}
/**
* @description: 页面加载完成需要请求的数据
*/
onMounted(() => {
getFollowList()
})
/**
* @description: 定义搜索方法
*/
const handleSearch = async () => {
console.log("搜索");
getFollowList()
}
const handleReset = () => {
console.log('重置搜索')
searchForm.value = {
orderNo: '',
startTime: '',
endTime: '',
}
getFollowList()
}
const handleExport = () => {
exportToExcel({
tableData: tableTree.value,
columns: tableColumnsOptions.value,
title: '导出跟单记录',
defaultFileNamePrefix: '跟单记录',
})
}
/**
* @description: 定义分页方法
*/
const handleChange = (page: { currentPage: number, size: number }) => {
currentPage.value = page.currentPage
}
</script>

View File

@ -0,0 +1,29 @@
export const search = [
// 订单号
{ prop: 'orderNo', label: '订单号', type: 'input' as const, placeholder: '请输入订单号',width: '200px' },
//开始时间
{
prop: 'startTime', label: '开始时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
valueFormat: 'YYYY-MM-DD', placeholder: '请选择开始时间', width: '150px'
},
//结束时间
{
prop: 'endTime', label: '结束时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
valueFormat: 'YYYY-MM-DD', placeholder: '请选择结束时间', width: '150px'
},
]
export const tableColumns = [
// 订单号
{ prop: 'orderNo', label: '订单号' },
// 跟单账户
{ prop: 'followAccount', label: '跟单账户' },
// 交易品种
{ prop: 'symbol', label: '交易品种' },
// 交易数量
{ prop: 'tradeQty', label: '交易数量' },
// 交易时间
{ prop: 'tradeTime', label: '交易时间' },
// 平仓盈亏
{ prop: 'closeProfit', label: '平仓盈亏' },
]

View File

@ -1,5 +1,119 @@
<template>
<div>
带单记录
<div class="follow-record">
<!-- 搜索 -->
<LeadRecordSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
@reset="handleReset">
<template #button="{ form }">
<el-button type="primary" @click="handleExport()">
导出
</el-button>
</template>
</LeadRecordSearch>
<!-- 表格 -->
<LeadRecordTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
<!-- 分页 -->
<LeadRecordPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
@change="handleChange" />
</div>
</template>
<script setup lang="ts">
//
import LeadRecordSearch from '@/components/common/Search.vue'
import LeadRecordTable from '@/components/common/Table.vue'
import LeadRecordPagination from '@/components/common/Pagination.vue'
//
import { search, tableColumns } from './options'
//
import { getFollowListApi } from '@/api/modules/personalized/followRecord'
//
import { exportToExcel } from '@/utils/exportToExcel'
/**
* @description: 定义搜索数据
*/
const searchOptions = ref(search)
const searchForm = ref({
orderNo: '',
startTime: '',
endTime: '',
})
/**
* @description: 定义表格数据
*/
const tableTree = ref([])
const tableColumnsOptions = ref(tableColumns)
/**
* @description: 定义分页数据
*/
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(0)
/**
* @description: 定义公共请求数据方法
*/
const getFollowList = async () => {
const params = {
page: currentPage.value,
page_size: pageSize.value,
start_time: searchForm.value.startTime.length > 0 ? `${searchForm.value.startTime} 0:00:00` : '2026-01-01 0:00:00',
end_time: searchForm.value.endTime.length > 0 ? `${searchForm.value.endTime} 23:59:59` : '2026-03-01 23:59:59',
order_no: searchForm.value.orderNo,
}
const data: any = await getFollowListApi(params)
// table
tableTree.value = data.data.map((item: any) => ({
orderNo: item.order_id,
followAccount: item.user.username,
symbol: item.variety_id,
tradeQty: item.num,
tradeTime: item.created_at,
closeProfit: '后续添加'
}))
//
total.value = data.total
currentPage.value = data.current_page
pageSize.value = Number(data.per_page)
}
/**
* @description: 页面加载完成需要请求的数据
*/
onMounted(() => {
getFollowList()
})
/**
* @description: 定义搜索方法
*/
const handleSearch = async () => {
console.log("搜索");
getFollowList()
}
const handleReset = () => {
console.log('重置搜索')
searchForm.value = {
orderNo: '',
startTime: '',
endTime: '',
}
getFollowList()
}
const handleExport = () => {
exportToExcel({
tableData: tableTree.value,
columns: tableColumnsOptions.value,
title: '导出带单记录',
defaultFileNamePrefix: '带单记录',
})
}
/**
* @description: 定义分页方法
*/
const handleChange = (page: { currentPage: number, size: number }) => {
currentPage.value = page.currentPage
}
</script>

View File

@ -0,0 +1,29 @@
export const search = [
// 订单号
{ prop: 'orderNo', label: '订单号', type: 'input' as const, placeholder: '请输入订单号',width: '200px' },
//开始时间
{
prop: 'startTime', label: '开始时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
valueFormat: 'YYYY-MM-DD', placeholder: '请选择开始时间', width: '150px'
},
//结束时间
{
prop: 'endTime', label: '结束时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
valueFormat: 'YYYY-MM-DD', placeholder: '请选择结束时间', width: '150px'
},
]
export const tableColumns = [
// 订单号
{ prop: 'orderNo', label: '订单号' },
// 跟单账户
{ prop: 'followAccount', label: '跟单账户' },
// 交易品种
{ prop: 'symbol', label: '交易品种' },
// 交易数量
{ prop: 'tradeQty', label: '交易数量' },
// 交易时间
{ prop: 'tradeTime', label: '交易时间' },
// 平仓盈亏
{ prop: 'closeProfit', label: '平仓盈亏' },
]

View File

@ -13,7 +13,7 @@
<PositionStatTable :table-data="tableTree" :columns="tableColumnsOptions" row-key="id" />
<!-- 分页 -->
<PositionStatPagination :current-page="currentPage" :page-size="pageSize" :total="total" @change="handleChange" />
<PositionStatPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total" @change="handleChange" />
</div>
</template>