This commit is contained in:
lingling 2025-02-20 13:35:16 +08:00
commit 0f76fd36bc
4 changed files with 207 additions and 181 deletions

View File

@ -42,23 +42,5 @@ export interface ListParams {
* @returns
*/
export function lists(params: ListParams) {
return axios.post<jobuser>('/api/v1/withdraw/lists',params);
return axios.post<jobuser>('/admin/api/v1/withdraw/lists',params);
}
// /**
// *
// * @param id 拉黑
// * @returns
// */
// export function getBlack(id: string) {
// return axios.post<Black>('/api/v1/jobuser/getBlack', { id });
// }
// /**
// *
// * @param id 洗白
// * @returns
// */
// export function getOutBlack(id: string) {
// return axios.post<Black>('/api/v1/jobuser/getOutBlack', { id });
// }

View File

@ -3,54 +3,132 @@
<Breadcrumb :items="['menu.withdraw', 'menu.withdraw.list']" />
<a-card class="general-card" :title="$t('menu.withdraw.list')">
<a-table :data="data">
<template #columns>
<a-table-column title="用户id" data-index="user_id"></a-table-column>
<a-table-column title="用户名称" data-index="username"></a-table-column>
<a-table-column title="转账金额" data-index="money"></a-table-column>
<a-table-column title="状态" data-index="status" filterable="filters: [{
text: 'London',
value: 'London',
<a-row>
<a-col :flex="1">
<a-form :model="queryParams" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }"
label-align="left">
<a-row :gutter="16">
<a-col :span="8">
<a-form-item field="name" :label="'用户名'">
<a-input v-model="queryParams.username" :placeholder="'请输入用户名'" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item field="updatedat" label="交易时间">
<a-range-picker v-model="queryParams.updatedat" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item field="status" :label="'交易类型'">
<a-select v-model="queryParams.status" :options="[
{
label: '全部',
value: -1,
},
{
label: '申请中',
value: 1,
},{
label: '已到账',
value: 2
}, {
text: 'Paris',
value: 'Paris',
},],
filter: (value, row) => row.address.includes(value),"></a-table-column>
<a-table-column title="操作时间" data-index="createtime2"></a-table-column>
<a-table-column title="操作">
<template #cell="{ record }">
<a-button v-if="record.status == '申请中'" @click="showConfirm(record.id)">审批</a-button>
label: '已驳回',
value: 3,
}]" :placeholder="'请选择交易类型'" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-col :flex="'86px'" style="text-align: right">
<a-space :size="18">
<a-button type="primary" @click="getAll">
<template #icon>
<icon-search />
</template>
</a-table-column>
查询
</a-button>
<a-button @click="reset">
<template #icon>
<icon-refresh />
</template>
重置
</a-button>
</a-space>
</a-col>
</a-row>
<div class="table-container">
<div class="table-content">
<a-table :data="data" :summary="summary" :pagination="false" :sticky-header="0" :scroll="{ y: 'calc(100vh - 375px)' }">
<template #columns>
<a-table-column title="账号" data-index="username"></a-table-column>
<a-table-column title="交易类型" data-index="status_text"></a-table-column>
<a-table-column title="交易时间" data-index="createtime2"></a-table-column>
<a-table-column title="交易金额" data-index="amount"></a-table-column>
<a-table-column title="订单编号" data-index="id"></a-table-column>
</template>
</a-table>
</div>
<div class="summary-container">
<div>
合计{{ addNum }}
</div>
</div>
<div class="pagination-container">
<a-pagination
v-model:current="pagination.current"
v-model:page-size="pagination.pageSize"
:total="pagination.total"
:page-size-options="pagination.pageSizeOptions"
:show-jumper="pagination.showJumper"
:show-page-size="pagination.showPageSize"
:show-total="pagination.showTotal"
@change="handleTableChange"
@page-size-change="handlePageSizeChange"
/>
</div>
</div>
</a-card>
</div>
</template>
<script lang="ts" setup>
import { computed, ref, reactive, watch, nextTick, onMounted } from 'vue';
import { PaginationProps,TableChangeExtra } from '@arco-design/web-vue';
import { lists } from '@/api/withdraw';
import { Modal } from '@arco-design/web-vue';
import { Message } from '@arco-design/web-vue';
const columns = [
{
title: 'Name',
dataIndex: 'name',
},
{
title: 'Salary',
dataIndex: 'salary',
},
{
title: 'Address',
dataIndex: 'address',
},
{
title: 'Email',
dataIndex: 'email',
},
];
import { login } from '@/api/user';
const queryParams = ref({
username: "",
status: -1,
updatedat: [],
current: 1,
pageSize: 10,
});
const addNum = ref(0);
const pagination = reactive<PaginationProps>({
current: 1, //
pageSize: 10, //
total: 0, //
pageSizeOptions: [10, 20, 50, 100,10000],
showJumper: true,
showPageSize: true,
showTotal: true,
})
//
const handlePageSizeChange = (pageSize: number) => {
pagination.current = 1;
pagination.pageSize = pageSize;
queryParams.value.current = 1;
queryParams.value.pageSize = pageSize;
getAll();
}
interface DataItem {
user_id: string;
username: string;
@ -58,48 +136,65 @@ interface DataItem {
status: string;
createtime2: string;
}
let data = ref<DataItem[]>([])
//
const modal_visible=ref(false)
//id
const show_group_id=ref(0)
const show_group=(id:number)=>{
show_group_id.value=id
modal_visible.value=true
//
const handleTableChange = (page:number) => {
pagination.current = page;
queryParams.value.current = page;
getAll();
};
// const handleTableChange = (current) => {
// const pager = { ...pagination };
// pager.current = pag.current;
// pagination.current = pager.current;
// console.log(current)
// queryParams.value.current = pagination.current;
// queryParams.value.pageSize = pagination.pageSize;
// getAll();
// }
// const showConfirm = (id: string) => {
// Modal.confirm({
// title: '',
// content: '',
// okText: '',
// cancelText: '',
// onOk: () => handleBlock(id),
// onCancel: () => Message.info(''),
// });
// };
//
const summary = () => {
let amount = 0;
data.value.forEach(record => {
amount += record.amount;
})
addNum.value = amount;
}
//
const getColorStyle = (column, record) => {
if (['amount'].includes(column.dataIndex)) {
return {color: record[column.dataIndex] > 0 ? 'red' : 'green'}
}
return undefined
}
const showConfirm = (id: string) => {
Modal.confirm({
title: '操作提醒',
content: '是否同意该用户的提现申请',
okText: '同意',
cancelText: '拒绝',
onOk: () => handleBlock(id),
onCancel: () => Message.info('取消操作'),
});
};
const handleBlock = (id: string) => {
// getBlack(id).then(res => {
// console.log(res.status)
// if (res.status == 'success') {
// getAll();
// Message.success('')
// } else {
// Message.error('')
// }
// })
};
const queryParams = ref({
black: null,
username: null
});
const getAll = () => {
lists(queryParams.value).then(res => {
data.value = res.data;
})
//
const reset=()=>{
queryParams.value.username="";
queryParams.value.status=-1;
queryParams.value.updatedat=[];
getAll();
}
//
const getAll = async() => {
const res= await lists(queryParams.value);
if (res.code == 200) {
data.value = res.data.data;
pagination.total = res.data.total;
summary();
}
};
onMounted(async () => {
getAll()
@ -108,91 +203,40 @@ onMounted(async () => {
<style lang="less" scoped>
.table-container {
height: calc(100vh - 320px);
}
.table-content {
flex: 1;
overflow: hidden;
}
.arco-table {
height: 100%;
overflow-y: auto;
}
.pagination-container {
display: flex;
justify-content: flex-end;
padding: 10px;
background-color: white;
border-top: 1px solid #e8e8e8;
}
.arco-table {
overflow: hidden;
}
.container {
padding: 0 20px 20px 20px;
}
.left-side {
flex: 1;
overflow: auto;
}
.right-side {
width: 280px;
margin-left: 16px;
}
.panel {
background-color: var(--color-bg-2);
border-radius: 4px;
overflow: auto;
}
:deep(.panel-border) {
margin-bottom: 0;
border-bottom: 1px solid rgb(var(--gray-2));
}
.moduler-wrap {
border-radius: 4px;
background-color: var(--color-bg-2);
:deep(.text) {
font-size: 12px;
.summary-container{
background-color: rgb(223, 226, 224);
text-align: center;
color: rgb(var(--gray-8));
}
:deep(.wrapper) {
margin-bottom: 8px;
text-align: center;
cursor: pointer;
&:last-child {
.text {
margin-bottom: 0;
}
}
&:hover {
.icon {
color: rgb(var(--arcoblue-6));
background-color: #e8f3ff;
}
.text {
color: rgb(var(--arcoblue-6));
}
}
}
:deep(.icon) {
display: inline-block;
width: 32px;
height: 32px;
margin-bottom: 4px;
color: rgb(var(--dark-gray-1));
line-height: 32px;
font-size: 16px;
text-align: center;
background-color: rgb(var(--gray-1));
border-radius: 4px;
}
}
</style>
<style lang="less" scoped>
// responsive
.mobile {
.container {
display: block;
}
.right-side {
// display: none;
width: 100%;
margin-left: 0;
margin-top: 16px;
}
font-size: 20px;
}
</style>

View File

@ -1,5 +1,5 @@
export default {
'menu.profile.basic': 'User List',
'menu.withdraw.list': '提现记录',
'menu.withdraw.list': '账变明细',
};

View File

@ -1,5 +1,5 @@
export default {
'menu.profile.basic': 'User List',
'menu.withdraw.list': '提现记录',
'menu.withdraw.list': '账变明细',
};