dodo hold 2 jaren geleden
bovenliggende
commit
617b64e4fe

+ 8 - 6
src/api/taobao.ts

@@ -20,19 +20,21 @@ export interface UpdateConfigModel {
     tk_whitelist_regular: string;
     tk_blacklist_regular: string;
     multi_token_regular: string;
-    
+
     jd_limit_per_ip_24h: number;
     tk_limit_per_ip_24h: number;
-    
+
     cpsIgnorePercentageCity: string;
     cps_limit_per_ip_24h: number;
-    
-    pdd_limit_per_ip_24h:number;
+
+    pdd_limit_per_ip_24h: number;
     pddIgnorePercentageCity: string;
     pddIgnorePercentage: number;
-}
-
 
+    ks_limit_per_ip_24h: number;
+    ksIgnorePercentageCity: string;
+    ksIgnorePercentage: number;
+}
 
 export interface UpdateConfigRes {
     msg?: string;

+ 28 - 7
src/views/settings/config.vue

@@ -54,6 +54,13 @@
                                         <a-input v-model="formData.cpsIgnorePercentageCity" />
                                     </a-form-item>
 
+
+                                    <a-form-item field="cps_limit_per_ip_24h" label="24小时转链次数(CPS)"
+                                        :rules="[{ required: true }]">
+                                        <a-input-number v-model="formData.cps_limit_per_ip_24h" :min="0"
+                                            placeholder="同ip在24小时内可转链的次数。" />
+                                    </a-form-item>
+
                                 </a-tab-pane>
                                 <a-tab-pane key="tb" title="淘宝">
 
@@ -97,13 +104,6 @@
                                             placeholder="同ip在24小时内可转链的次数。" />
                                     </a-form-item>
 
-
-                                    <a-form-item field="cps_limit_per_ip_24h" label="24小时转链次数(TK)"
-                                        :rules="[{ required: true }]">
-                                        <a-input-number v-model="formData.cps_limit_per_ip_24h" :min="0"
-                                            placeholder="同ip在24小时内可转链的次数。" />
-                                    </a-form-item>
-
                                 </a-tab-pane>
                                 <a-tab-pane key="jd" title="京东">
                                     <a-form-item field="jdIgnorePercentage" label="放弃流量" :rules="[{ required: true }]">
@@ -136,6 +136,23 @@
                                     </a-form-item>
 
                                 </a-tab-pane>
+                                <a-tab-pane key="ks" title="快手">
+                                    <a-form-item field="ksIgnorePercentage" label="放弃流量" :rules="[{ required: true }]">
+                                        <a-input-number v-model="formData.ksIgnorePercentage" :min="0" :max="100"
+                                            placeholder="主动放弃流量,0-100,举例:10 = 放弃10%" />
+                                    </a-form-item>
+
+                                    <a-form-item field="ksIgnorePercentageCity" label="流量控制-城市">
+                                        <a-input v-model="formData.ksIgnorePercentageCity" />
+                                    </a-form-item>
+
+                                    <a-form-item field="ks_limit_per_ip_24h" label="24小时转链次数"
+                                        :rules="[{ required: true }]">
+                                        <a-input-number v-model="formData.ks_limit_per_ip_24h" :min="0"
+                                            placeholder="同ip在24小时内可转链的次数。" />
+                                    </a-form-item>
+
+                                </a-tab-pane>
                             </a-tabs>
                             <a-form-item>
                                 <a-space>
@@ -210,6 +227,10 @@ const formData = ref<UpdateConfigModel>({
     pddIgnorePercentageCity: '',
     pddIgnorePercentage: 0,
 
+    ks_limit_per_ip_24h: 0,
+    ksIgnorePercentageCity: '',
+    ksIgnorePercentage: 0,
+
 });
 
 const showRegularTester = ref<boolean>(false);

+ 25 - 2
src/views/taobao/bill_dailys.vue

@@ -95,7 +95,10 @@
 
             <a-table row-key="id" :loading="loading" :pagination="pagination" :summary="true" summary-text="汇总"
                 :columns="(cloneColumns as TableColumnData[])" :scroll="scroll" :scrollbar="scrollbar"
-                :data="renderData" :bordered="false" :size="size" :load-more="loadMore" @page-change="onPageChange">
+                :data="renderData" :bordered="false" :size="size" :load-more="loadMore" @page-change="onPageChange"
+                @page-size-change="onPageSizeChange">
+
+
                 <template #xAxis="{ record }">
                     {{ dayjs(record.belongTime).format('YYYY-MM-DD') }}
                 </template>
@@ -190,6 +193,13 @@ const basePagination: Pagination = {
 };
 const pagination = reactive({
     ...basePagination,
+    showTotal: true,
+    showJumper: true,
+    showMore: true,
+    showPageSize: true,
+    pageSizeOptions: [10, 20, 30, 31, 50, 100, 200, 500],
+    sizePageSize: true,
+
 });
 const densityList = computed(() => [
     {
@@ -286,12 +296,14 @@ const toAmount = (val: any): any => {
 const fetchData = async (
     params: TkSettleBillsParams = {
         current: 1,
-        pageSize: 30,
+        pageSize: basePagination.pageSize,
         sort: 'belongTime',
         order: 'descending',
     }
 ) => {
+    console.log(basePagination, params)
     setLoading(true);
+
     try {
         console.log(params)
         if (params.keyword) {
@@ -385,6 +397,17 @@ const onPageChange = (current: number) => {
         current
     });
 };
+const onPageSizeChange = (current: number) => {
+    basePagination.pageSize = current;
+    pagination.pageSize = current;
+    fetchData({
+        ...basePagination,
+        ...formModel.value,
+        pageSize: current,
+        current: 1,
+    });
+};
+
 fetchData({ ...formModel.value } as unknown as TkSettleBillsParams);
 const reset = () => {
     formModel.value = generateFormModel();

+ 1 - 0
src/views/taobao/components/categories-percent.vue

@@ -86,6 +86,7 @@ import dayjs from 'dayjs';
 import useLoading from '@/hooks/loading';
 import { defineProps, ref } from 'vue';
 import { DailyLogRecord, ChartDataResponse, ReportParams, queryReportChartData } from '@/api/app';
+import { TkReportRecord, TkReportParams, queryTkReportChartData } from '@/api/taobao';
 
 // 使用 defineProps 来定义并接收 props
 const props = defineProps<{

+ 3 - 1
src/views/taobao/report_daily.vue

@@ -330,7 +330,7 @@ const pagination = reactive({
     showJumper: true,
     showMore: true,
     showPageSize: true,
-    pageSizeOptions: [10, 20, 30, 31, 50, 100, 200],
+    pageSizeOptions: [10, 20, 30, 31, 50, 100, 200, 500],
     sizePageSize: true,
 
 });
@@ -765,6 +765,7 @@ const fetchData = async (
 ) => {
     setLoading(true);
     try {
+        console.log(params)
         const { data } = await queryTkReportDailys(params);
         console.log(data);
         if (!data) return;
@@ -864,6 +865,7 @@ const onPageSizeChange = (current: number) => {
     fetchData({
         ...basePagination,
         ...formModel.value,
+        pageSize: current,
         current: 1,
     });
 };