|
|
@@ -48,6 +48,9 @@
|
|
|
</template>
|
|
|
{{ $t('searchTable.operation.create') }}
|
|
|
</a-button>
|
|
|
+ <a-button type="outline" @click="handleRechargeAllOnlineAccountUsage">
|
|
|
+ 重置账号当日分配权重
|
|
|
+ </a-button>
|
|
|
</a-space>
|
|
|
</a-col>
|
|
|
<a-col :span="12" style="
|
|
|
@@ -289,7 +292,7 @@ import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import dayjs from 'dayjs';
|
|
|
import useLoading from '@/hooks/loading';
|
|
|
-import { queryPddPool, PddPoolRecord, PddPoolParams, PddUpdateAccountModel, PddUpdateAccount, UpdateCookieWithIdModel, updateCookiesWithId } from '@/api/pdd';
|
|
|
+import { queryPddPool, PddPoolRecord, PddPoolParams, PddUpdateAccountModel, PddUpdateAccount, UpdateCookieWithIdModel, updateCookiesWithId, rechargeAllOnlineAccountUsage } from '@/api/pdd';
|
|
|
import { Pagination } from '@/types/global';
|
|
|
import { Modal, Message } from '@arco-design/web-vue';
|
|
|
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
|
@@ -574,10 +577,10 @@ const search = () => {
|
|
|
} as unknown as PddPoolParams);
|
|
|
};
|
|
|
const onPageChange = (current: number) => {
|
|
|
- fetchData({
|
|
|
- ...basePagination,
|
|
|
+ fetchData({
|
|
|
+ ...basePagination,
|
|
|
...formModel.value,
|
|
|
- current
|
|
|
+ current
|
|
|
} as unknown as PddPoolParams);
|
|
|
};
|
|
|
|
|
|
@@ -695,6 +698,33 @@ const handleCookieCancel = () => {
|
|
|
cookieFormRef.value?.resetFields();
|
|
|
};
|
|
|
|
|
|
+const handleRechargeAllOnlineAccountUsage = async () => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认提示',
|
|
|
+ content: '确定要重置所有账号当日分配权重吗?',
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ async onOk() {
|
|
|
+ setLoading(true);
|
|
|
+ try {
|
|
|
+ const data = await rechargeAllOnlineAccountUsage();
|
|
|
+ console.log(data);
|
|
|
+ if (data.code === 200) {
|
|
|
+ Message.success(`重置成功!共处理 ${data.count} 个账号`);
|
|
|
+ search(); // 刷新列表
|
|
|
+ } else {
|
|
|
+ Message.error(data.msg || '重置失败');
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.error(err);
|
|
|
+ Message.error('重置失败');
|
|
|
+ } finally {
|
|
|
+ setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
watch(
|
|
|
() => columns.value,
|
|
|
(val) => {
|