|
@@ -51,6 +51,13 @@
|
|
|
<a-button type="outline" @click="handleRechargeAllOnlineAccountUsage">
|
|
<a-button type="outline" @click="handleRechargeAllOnlineAccountUsage">
|
|
|
重置账号当日分配权重
|
|
重置账号当日分配权重
|
|
|
</a-button>
|
|
</a-button>
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ status="warning"
|
|
|
|
|
+ :disabled="selectedRows.length === 0"
|
|
|
|
|
+ @click="handleBatchUpdateBalance">
|
|
|
|
|
+ 批量更新余额 ({{ selectedRows.length }})
|
|
|
|
|
+ </a-button>
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12" style="
|
|
<a-col :span="12" style="
|
|
@@ -111,7 +118,13 @@
|
|
|
|
|
|
|
|
<a-table row-key="id" :loading="loading" :pagination="pagination" :summary="true" summary-text="汇总"
|
|
<a-table row-key="id" :loading="loading" :pagination="pagination" :summary="true" summary-text="汇总"
|
|
|
:columns="(cloneColumns as TableColumnData[])" :data="renderData" :bordered="{ headerCell: true }"
|
|
:columns="(cloneColumns as TableColumnData[])" :data="renderData" :bordered="{ headerCell: true }"
|
|
|
- :row-class="getRowClass" :size="size" @page-change="onPageChange" @page-size-change="onPageSizeChange">
|
|
|
|
|
|
|
+ :row-class="getRowClass" :size="size"
|
|
|
|
|
+ v-model:selectedKeys="selectedRowKeys"
|
|
|
|
|
+ :row-selection="{
|
|
|
|
|
+ type: 'checkbox',
|
|
|
|
|
+ showCheckedAll: true
|
|
|
|
|
+ }"
|
|
|
|
|
+ @page-change="onPageChange" @page-size-change="onPageSizeChange">
|
|
|
<template #index="{ record }">
|
|
<template #index="{ record }">
|
|
|
{{ record.id }}
|
|
{{ record.id }}
|
|
|
</template>
|
|
</template>
|
|
@@ -140,6 +153,9 @@
|
|
|
<a-tag v-if="record.riskStrategy" size="small" bordered color="orange">
|
|
<a-tag v-if="record.riskStrategy" size="small" bordered color="orange">
|
|
|
{{ record.riskStrategy }}-{{ record.launchScene }}
|
|
{{ record.riskStrategy }}-{{ record.launchScene }}
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
|
|
+ <a-tag v-if="record.riskCookie" size="small" bordered color="red">
|
|
|
|
|
+ {{ record.riskCookie }}
|
|
|
|
|
+ </a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
<template #status="{ record }">
|
|
<template #status="{ record }">
|
|
|
<a-tag v-if="record.status" bordered color="green" @click="changeStatus(record.id, false)">
|
|
<a-tag v-if="record.status" bordered color="green" @click="changeStatus(record.id, false)">
|
|
@@ -254,6 +270,11 @@
|
|
|
<template #time_range="{ record }">
|
|
<template #time_range="{ record }">
|
|
|
<WorkHourModel :record="record" @change="search" />
|
|
<WorkHourModel :record="record" @change="search" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template #draw_balance="{ record }">
|
|
|
|
|
+ <a-tag bordered checkable @click="updateBalance(record)">
|
|
|
|
|
+ {{ record.draw_balance }}
|
|
|
|
|
+ </a-tag>
|
|
|
|
|
+ </template>
|
|
|
<template #hourly_calls_limit="{ record }">
|
|
<template #hourly_calls_limit="{ record }">
|
|
|
<a-tag bordered
|
|
<a-tag bordered
|
|
|
:color="record.current_hourly_calls > record.hourly_calls_limit && record.hourly_calls_limit > 0 ? 'red' : ''">
|
|
:color="record.current_hourly_calls > record.hourly_calls_limit && record.hourly_calls_limit > 0 ? 'red' : ''">
|
|
@@ -339,6 +360,15 @@ const cookieFormData = ref<UpdateCookieWithIdModel>({
|
|
|
});
|
|
});
|
|
|
const currentRecord = ref<PddPoolRecord | null>(null);
|
|
const currentRecord = ref<PddPoolRecord | null>(null);
|
|
|
|
|
|
|
|
|
|
+// 行选择相关
|
|
|
|
|
+const selectedRowKeys = ref<(string | number)[]>([]);
|
|
|
|
|
+const selectedRows = ref<PddPoolRecord[]>([]);
|
|
|
|
|
+
|
|
|
|
|
+// 监听选中的行keys变化,同步更新选中的行数据
|
|
|
|
|
+watch(selectedRowKeys, (newKeys) => {
|
|
|
|
|
+ selectedRows.value = renderData.value.filter(item => newKeys.includes(item.id));
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const basePagination: Pagination = {
|
|
const basePagination: Pagination = {
|
|
|
current: 1,
|
|
current: 1,
|
|
|
pageSize: 50,
|
|
pageSize: 50,
|
|
@@ -374,7 +404,7 @@ const columns = computed<TableColumnData[]>(() => [
|
|
|
title: '#',
|
|
title: '#',
|
|
|
dataIndex: 'index',
|
|
dataIndex: 'index',
|
|
|
slotName: 'index',
|
|
slotName: 'index',
|
|
|
- width: 50,
|
|
|
|
|
|
|
+ width: 60,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '账号名',
|
|
title: '账号名',
|
|
@@ -385,7 +415,7 @@ const columns = computed<TableColumnData[]>(() => [
|
|
|
{
|
|
{
|
|
|
title: '',
|
|
title: '',
|
|
|
slotName: 'tags',
|
|
slotName: 'tags',
|
|
|
- width: 40,
|
|
|
|
|
|
|
+ width: 60,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '工作时间',
|
|
title: '工作时间',
|
|
@@ -394,6 +424,13 @@ const columns = computed<TableColumnData[]>(() => [
|
|
|
align: 'right',
|
|
align: 'right',
|
|
|
width: 200,
|
|
width: 200,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '账户余额',
|
|
|
|
|
+ dataIndex: 'draw_balance',
|
|
|
|
|
+ slotName: 'draw_balance',
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
title: '小时调用',
|
|
title: '小时调用',
|
|
|
slotName: 'hourly_calls_limit',
|
|
slotName: 'hourly_calls_limit',
|
|
@@ -689,6 +726,29 @@ const handleCookieUpdate = async () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+const updateBalance = async (record: PddPoolRecord) => {
|
|
|
|
|
+ const args = {
|
|
|
|
|
+ id: record.id,
|
|
|
|
|
+ name: 'balance',
|
|
|
|
|
+ } as PddUpdateAccountModel;
|
|
|
|
|
+
|
|
|
|
|
+ setLoading(true);
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { data } = await PddUpdateAccount(args);
|
|
|
|
|
+ console.log(data, data.msg);
|
|
|
|
|
+ const msg = data.msg || '更新成功!';
|
|
|
|
|
+ if (data.success) {
|
|
|
|
|
+ Message.success(msg);
|
|
|
|
|
+ search();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Message.error(data.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (e) { console.log(e) }
|
|
|
|
|
+ setLoading(false);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleCookieCancel = () => {
|
|
const handleCookieCancel = () => {
|
|
|
cookieModalVisible.value = false;
|
|
cookieModalVisible.value = false;
|
|
|
cookieFormData.value = {
|
|
cookieFormData.value = {
|
|
@@ -725,6 +785,70 @@ const handleRechargeAllOnlineAccountUsage = async () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 批量更新余额
|
|
|
|
|
+const handleBatchUpdateBalance = async () => {
|
|
|
|
|
+ if (selectedRows.value.length === 0) {
|
|
|
|
|
+ Message.warning('请先选择要更新的账号');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Modal.confirm({
|
|
|
|
|
+ title: '确认提示',
|
|
|
|
|
+ content: `确定要批量更新选中的 ${selectedRows.value.length} 个账号的可提现余额吗?`,
|
|
|
|
|
+ okText: '确认',
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ async onOk() {
|
|
|
|
|
+ setLoading(true);
|
|
|
|
|
+ let successCount = 0;
|
|
|
|
|
+ let failCount = 0;
|
|
|
|
|
+ const total = selectedRows.value.length;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 串行执行每个账号的余额更新
|
|
|
|
|
+ for (let i = 0; i < selectedRows.value.length; i += 1) {
|
|
|
|
|
+ const record = selectedRows.value[i];
|
|
|
|
|
+ try {
|
|
|
|
|
+ const args = {
|
|
|
|
|
+ id: record.id,
|
|
|
|
|
+ name: 'balance',
|
|
|
|
|
+ } as PddUpdateAccountModel;
|
|
|
|
|
+
|
|
|
|
|
+ const { data } = await PddUpdateAccount(args);
|
|
|
|
|
+ if (data.success) {
|
|
|
|
|
+ successCount += 1;
|
|
|
|
|
+ Message.info(`[${i + 1}/${total}] ${record.company} 更新成功`);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ failCount += 1;
|
|
|
|
|
+ Message.error(`[${i + 1}/${total}] ${record.company} 更新失败: ${data.msg}`);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ failCount += 1;
|
|
|
|
|
+ console.error(`更新账号 ${record.company} 失败:`, e);
|
|
|
|
|
+ Message.error(`[${i + 1}/${total}] ${record.company} 更新失败`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 显示总结信息
|
|
|
|
|
+ if (successCount > 0) {
|
|
|
|
|
+ Message.success(`批量更新完成!成功: ${successCount}, 失败: ${failCount}`);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Message.error(`批量更新失败!失败: ${failCount}`);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清空选择并刷新列表
|
|
|
|
|
+ selectedRowKeys.value = [];
|
|
|
|
|
+ selectedRows.value = [];
|
|
|
|
|
+ search();
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ Message.error('批量更新过程中发生错误');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ setLoading(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
watch(
|
|
watch(
|
|
|
() => columns.value,
|
|
() => columns.value,
|
|
|
(val) => {
|
|
(val) => {
|