Pārlūkot izejas kodu

添加更多投放数据

gdy96 4 gadi atpakaļ
vecāks
revīzija
2275a793c6

+ 16 - 1
src/api/index.ts

@@ -162,4 +162,19 @@ export const onStopDeliveryBook = (id: number) => {
  */
 export const getCustomColumn = () => {
   return axios("/ad/adFields");
-};
+};
+
+/**
+ * @description: 获取更多投放数据
+ */
+export const getDeliveryMoreStatList = (
+  query: Partial<{
+    start_time: string;
+    end_time: string;
+    official_name: string;
+    book_name: string;
+    page: number;
+  }> = { page: 1 }
+): AxiosPromise<IList<deliveryPlanItem>> => {
+  return axios("/delivery/moreStat", { params: query });
+}

+ 12 - 1
src/router/async.ts

@@ -45,13 +45,24 @@ const PutData: RouteConfig = {
   component: () => import("@/views/put/put-data.vue"),
 };
 
+const PutDataMore: RouteConfig = {
+  name: "PutDataMore",
+  path: "datamore",
+  meta: {
+    title: "更多投放数据",
+    activeMenu: "/put/data",
+  },
+  hidden: true,
+  component: () => import("@/views/put/put-data-more.vue"),
+};
+
 export const PutManager: RouteConfig = {
   name: "PutManager",
   path: "/put",
   meta: {
     title: "投放管理",
   },
-  children: [PutBook, PutAdAccount, PutAdPlan, PutData],
+  children: [PutBook, PutAdAccount, PutAdPlan, PutData, PutDataMore],
   component: () => import("@/views/put/index.vue"),
 };
 

+ 133 - 0
src/types/api.d.ts

@@ -122,6 +122,139 @@ export interface deliveryPlanItem {
   d30_recovery_rate: string;
 }
 
+export interface deliveryPlanItem {
+  date:               string;
+  official_id:        number;
+  official_name:      string;
+  book_name:          string;
+  bid:                number;
+  cost:               number;
+  register_num:       number;
+  delivery_platform:  string;
+  register_cost:      number;
+  pay_fans_cost:      number;
+  d1_recovery_rate:   string;
+  d2_recovery_rate:   string;
+  d3_recovery_rate:   string;
+  d4_recovery_rate:   string;
+  d5_recovery_rate:   string;
+  d6_recovery_rate:   string;
+  d7_recovery_rate:   string;
+  d8_recovery_rate:   string;
+  d9_recovery_rate:   string;
+  d10_recovery_rate:  string;
+  d11_recovery_rate:  string;
+  d12_recovery_rate:  string;
+  d13_recovery_rate:  string;
+  d14_recovery_rate:  string;
+  d15_recovery_rate:  string;
+  d16_recovery_rate:  string;
+  d17_recovery_rate:  string;
+  d18_recovery_rate:  string;
+  d19_recovery_rate:  string;
+  d20_recovery_rate:  string;
+  d21_recovery_rate:  string;
+  d22_recovery_rate:  string;
+  d23_recovery_rate:  string;
+  d24_recovery_rate:  string;
+  d25_recovery_rate:  string;
+  d26_recovery_rate:  string;
+  d27_recovery_rate:  string;
+  d28_recovery_rate:  string;
+  d29_recovery_rate:  string;
+  d30_recovery_rate:  string;
+  d31_recovery_rate:  string;
+  d32_recovery_rate:  string;
+  d33_recovery_rate:  string;
+  d34_recovery_rate:  string;
+  d35_recovery_rate:  string;
+  d36_recovery_rate:  string;
+  d37_recovery_rate:  string;
+  d38_recovery_rate:  string;
+  d39_recovery_rate:  string;
+  d40_recovery_rate:  string;
+  d41_recovery_rate:  string;
+  d42_recovery_rate:  string;
+  d43_recovery_rate:  string;
+  d44_recovery_rate:  string;
+  d45_recovery_rate:  string;
+  d46_recovery_rate:  string;
+  d47_recovery_rate:  string;
+  d48_recovery_rate:  string;
+  d49_recovery_rate:  string;
+  d50_recovery_rate:  string;
+  d51_recovery_rate:  string;
+  d52_recovery_rate:  string;
+  d53_recovery_rate:  string;
+  d54_recovery_rate:  string;
+  d55_recovery_rate:  string;
+  d56_recovery_rate:  string;
+  d57_recovery_rate:  string;
+  d58_recovery_rate:  string;
+  d59_recovery_rate:  string;
+  d60_recovery_rate:  string;
+  d61_recovery_rate:  string;
+  d62_recovery_rate:  string;
+  d63_recovery_rate:  string;
+  d64_recovery_rate:  string;
+  d65_recovery_rate:  string;
+  d66_recovery_rate:  string;
+  d67_recovery_rate:  string;
+  d68_recovery_rate:  string;
+  d69_recovery_rate:  string;
+  d70_recovery_rate:  string;
+  d71_recovery_rate:  string;
+  d72_recovery_rate:  string;
+  d73_recovery_rate:  string;
+  d74_recovery_rate:  string;
+  d75_recovery_rate:  string;
+  d76_recovery_rate:  string;
+  d77_recovery_rate:  string;
+  d78_recovery_rate:  string;
+  d79_recovery_rate:  string;
+  d80_recovery_rate:  string;
+  d81_recovery_rate:  string;
+  d82_recovery_rate:  string;
+  d83_recovery_rate:  string;
+  d84_recovery_rate:  string;
+  d85_recovery_rate:  string;
+  d86_recovery_rate:  string;
+  d87_recovery_rate:  string;
+  d88_recovery_rate:  string;
+  d89_recovery_rate:  string;
+  d90_recovery_rate:  string;
+  d91_recovery_rate:  string;
+  d92_recovery_rate:  string;
+  d93_recovery_rate:  string;
+  d94_recovery_rate:  string;
+  d95_recovery_rate:  string;
+  d96_recovery_rate:  string;
+  d97_recovery_rate:  string;
+  d98_recovery_rate:  string;
+  d99_recovery_rate:  string;
+  d100_recovery_rate: string;
+  d101_recovery_rate: string;
+  d102_recovery_rate: string;
+  d103_recovery_rate: string;
+  d104_recovery_rate: string;
+  d105_recovery_rate: string;
+  d106_recovery_rate: string;
+  d107_recovery_rate: string;
+  d108_recovery_rate: string;
+  d109_recovery_rate: string;
+  d110_recovery_rate: string;
+  d111_recovery_rate: string;
+  d112_recovery_rate: string;
+  d113_recovery_rate: string;
+  d114_recovery_rate: string;
+  d115_recovery_rate: string;
+  d116_recovery_rate: string;
+  d117_recovery_rate: string;
+  d118_recovery_rate: string;
+  d119_recovery_rate: string;
+  d120_recovery_rate: string;
+}
+
 export interface IPlatform {
   desc: string;
   name: string;

+ 145 - 0
src/views/_pageOptions/table-put.ts

@@ -137,6 +137,151 @@ export const TableColumnOfPutData = [
   },
 ];
 
+export const TableColumnOfMoreStat = [
+  {
+    fixed: "left",
+    title: "日期",
+    dataIndex: "date",
+    width: 100,
+  },
+  {
+    fixed: "left",
+    title: "公众号名称",
+    dataIndex: "official_name",
+    width: 150,
+  },
+  {
+    fixed: "left",
+    title: "书名",
+    dataIndex: "book_name",
+  },
+  {
+    fixed: "left",
+    title: "bid",
+    dataIndex: "bid",
+  },
+  { title: "1日回本率", dataIndex: "d1_recovery_rate", width: 150 },
+  { title: "2日回本率", dataIndex: "d2_recovery_rate", width: 150 },
+  { title: "3日回本率", dataIndex: "d3_recovery_rate", width: 150 },
+  { title: "4日回本率", dataIndex: "d4_recovery_rate", width: 150 },
+  { title: "5日回本率", dataIndex: "d5_recovery_rate", width: 150 },
+  { title: "6日回本率", dataIndex: "d6_recovery_rate", width: 150 },
+  { title: "7日回本率", dataIndex: "d7_recovery_rate", width: 150 },
+  { title: "8日回本率", dataIndex: "d8_recovery_rate", width: 150 },
+  { title: "9日回本率", dataIndex: "d9_recovery_rate", width: 150 },
+  { title: "10日回本率", dataIndex: "d10_recovery_rate", width: 150 },
+  { title: "11日回本率", dataIndex: "d11_recovery_rate", width: 150 },
+  { title: "12日回本率", dataIndex: "d12_recovery_rate", width: 150 },
+  { title: "13日回本率", dataIndex: "d13_recovery_rate", width: 150 },
+  { title: "14日回本率", dataIndex: "d14_recovery_rate", width: 150 },
+  { title: "15日回本率", dataIndex: "d15_recovery_rate", width: 150 },
+  { title: "16日回本率", dataIndex: "d16_recovery_rate", width: 150 },
+  { title: "17日回本率", dataIndex: "d17_recovery_rate", width: 150 },
+  { title: "18日回本率", dataIndex: "d18_recovery_rate", width: 150 },
+  { title: "19日回本率", dataIndex: "d19_recovery_rate", width: 150 },
+  { title: "20日回本率", dataIndex: "d20_recovery_rate", width: 150 },
+  { title: "21日回本率", dataIndex: "d21_recovery_rate", width: 150 },
+  { title: "22日回本率", dataIndex: "d22_recovery_rate", width: 150 },
+  { title: "23日回本率", dataIndex: "d23_recovery_rate", width: 150 },
+  { title: "24日回本率", dataIndex: "d24_recovery_rate", width: 150 },
+  { title: "25日回本率", dataIndex: "d25_recovery_rate", width: 150 },
+  { title: "26日回本率", dataIndex: "d26_recovery_rate", width: 150 },
+  { title: "27日回本率", dataIndex: "d27_recovery_rate", width: 150 },
+  { title: "28日回本率", dataIndex: "d28_recovery_rate", width: 150 },
+  { title: "29日回本率", dataIndex: "d29_recovery_rate", width: 150 },
+  { title: "30日回本率", dataIndex: "d30_recovery_rate", width: 150 },
+  { title: "31日回本率", dataIndex: "d31_recovery_rate", width: 150 },
+  { title: "32日回本率", dataIndex: "d32_recovery_rate", width: 150 },
+  { title: "33日回本率", dataIndex: "d33_recovery_rate", width: 150 },
+  { title: "34日回本率", dataIndex: "d34_recovery_rate", width: 150 },
+  { title: "35日回本率", dataIndex: "d35_recovery_rate", width: 150 },
+  { title: "36日回本率", dataIndex: "d36_recovery_rate", width: 150 },
+  { title: "37日回本率", dataIndex: "d37_recovery_rate", width: 150 },
+  { title: "38日回本率", dataIndex: "d38_recovery_rate", width: 150 },
+  { title: "39日回本率", dataIndex: "d39_recovery_rate", width: 150 },
+  { title: "40日回本率", dataIndex: "d40_recovery_rate", width: 150 },
+  { title: "41日回本率", dataIndex: "d41_recovery_rate", width: 150 },
+  { title: "42日回本率", dataIndex: "d42_recovery_rate", width: 150 },
+  { title: "43日回本率", dataIndex: "d43_recovery_rate", width: 150 },
+  { title: "44日回本率", dataIndex: "d44_recovery_rate", width: 150 },
+  { title: "45日回本率", dataIndex: "d45_recovery_rate", width: 150 },
+  { title: "46日回本率", dataIndex: "d46_recovery_rate", width: 150 },
+  { title: "47日回本率", dataIndex: "d47_recovery_rate", width: 150 },
+  { title: "48日回本率", dataIndex: "d48_recovery_rate", width: 150 },
+  { title: "49日回本率", dataIndex: "d49_recovery_rate", width: 150 },
+  { title: "50日回本率", dataIndex: "d50_recovery_rate", width: 150 },
+  { title: "51日回本率", dataIndex: "d51_recovery_rate", width: 150 },
+  { title: "52日回本率", dataIndex: "d52_recovery_rate", width: 150 },
+  { title: "53日回本率", dataIndex: "d53_recovery_rate", width: 150 },
+  { title: "54日回本率", dataIndex: "d54_recovery_rate", width: 150 },
+  { title: "55日回本率", dataIndex: "d55_recovery_rate", width: 150 },
+  { title: "56日回本率", dataIndex: "d56_recovery_rate", width: 150 },
+  { title: "57日回本率", dataIndex: "d57_recovery_rate", width: 150 },
+  { title: "58日回本率", dataIndex: "d58_recovery_rate", width: 150 },
+  { title: "59日回本率", dataIndex: "d59_recovery_rate", width: 150 },
+  { title: "60日回本率", dataIndex: "d60_recovery_rate", width: 150 },
+  { title: "61日回本率", dataIndex: "d61_recovery_rate", width: 150 },
+  { title: "62日回本率", dataIndex: "d62_recovery_rate", width: 150 },
+  { title: "63日回本率", dataIndex: "d63_recovery_rate", width: 150 },
+  { title: "64日回本率", dataIndex: "d64_recovery_rate", width: 150 },
+  { title: "65日回本率", dataIndex: "d65_recovery_rate", width: 150 },
+  { title: "66日回本率", dataIndex: "d66_recovery_rate", width: 150 },
+  { title: "67日回本率", dataIndex: "d67_recovery_rate", width: 150 },
+  { title: "68日回本率", dataIndex: "d68_recovery_rate", width: 150 },
+  { title: "69日回本率", dataIndex: "d69_recovery_rate", width: 150 },
+  { title: "70日回本率", dataIndex: "d70_recovery_rate", width: 150 },
+  { title: "71日回本率", dataIndex: "d71_recovery_rate", width: 150 },
+  { title: "72日回本率", dataIndex: "d72_recovery_rate", width: 150 },
+  { title: "73日回本率", dataIndex: "d73_recovery_rate", width: 150 },
+  { title: "74日回本率", dataIndex: "d74_recovery_rate", width: 150 },
+  { title: "75日回本率", dataIndex: "d75_recovery_rate", width: 150 },
+  { title: "76日回本率", dataIndex: "d76_recovery_rate", width: 150 },
+  { title: "77日回本率", dataIndex: "d77_recovery_rate", width: 150 },
+  { title: "78日回本率", dataIndex: "d78_recovery_rate", width: 150 },
+  { title: "79日回本率", dataIndex: "d79_recovery_rate", width: 150 },
+  { title: "80日回本率", dataIndex: "d80_recovery_rate", width: 150 },
+  { title: "81日回本率", dataIndex: "d81_recovery_rate", width: 150 },
+  { title: "82日回本率", dataIndex: "d82_recovery_rate", width: 150 },
+  { title: "83日回本率", dataIndex: "d83_recovery_rate", width: 150 },
+  { title: "84日回本率", dataIndex: "d84_recovery_rate", width: 150 },
+  { title: "85日回本率", dataIndex: "d85_recovery_rate", width: 150 },
+  { title: "86日回本率", dataIndex: "d86_recovery_rate", width: 150 },
+  { title: "87日回本率", dataIndex: "d87_recovery_rate", width: 150 },
+  { title: "88日回本率", dataIndex: "d88_recovery_rate", width: 150 },
+  { title: "89日回本率", dataIndex: "d89_recovery_rate", width: 150 },
+  { title: "90日回本率", dataIndex: "d90_recovery_rate", width: 150 },
+  { title: "91日回本率", dataIndex: "d91_recovery_rate", width: 150 },
+  { title: "92日回本率", dataIndex: "d92_recovery_rate", width: 150 },
+  { title: "93日回本率", dataIndex: "d93_recovery_rate", width: 150 },
+  { title: "94日回本率", dataIndex: "d94_recovery_rate", width: 150 },
+  { title: "95日回本率", dataIndex: "d95_recovery_rate", width: 150 },
+  { title: "96日回本率", dataIndex: "d96_recovery_rate", width: 150 },
+  { title: "97日回本率", dataIndex: "d97_recovery_rate", width: 150 },
+  { title: "98日回本率", dataIndex: "d98_recovery_rate", width: 150 },
+  { title: "99日回本率", dataIndex: "d99_recovery_rate", width: 150 },
+  { title: "100日回本率", dataIndex: "d100_recovery_rate", width: 150 },
+  { title: "101日回本率", dataIndex: "d101_recovery_rate", width: 150 },
+  { title: "102日回本率", dataIndex: "d102_recovery_rate", width: 150 },
+  { title: "103日回本率", dataIndex: "d103_recovery_rate", width: 150 },
+  { title: "104日回本率", dataIndex: "d104_recovery_rate", width: 150 },
+  { title: "105日回本率", dataIndex: "d105_recovery_rate", width: 150 },
+  { title: "106日回本率", dataIndex: "d106_recovery_rate", width: 150 },
+  { title: "107日回本率", dataIndex: "d107_recovery_rate", width: 150 },
+  { title: "108日回本率", dataIndex: "d108_recovery_rate", width: 150 },
+  { title: "109日回本率", dataIndex: "d109_recovery_rate", width: 150 },
+  { title: "110日回本率", dataIndex: "d110_recovery_rate", width: 150 },
+  { title: "111日回本率", dataIndex: "d111_recovery_rate", width: 150 },
+  { title: "112日回本率", dataIndex: "d112_recovery_rate", width: 150 },
+  { title: "113日回本率", dataIndex: "d113_recovery_rate", width: 150 },
+  { title: "114日回本率", dataIndex: "d114_recovery_rate", width: 150 },
+  { title: "115日回本率", dataIndex: "d115_recovery_rate", width: 150 },
+  { title: "116日回本率", dataIndex: "d116_recovery_rate", width: 150 },
+  { title: "117日回本率", dataIndex: "d117_recovery_rate", width: 150 },
+  { title: "118日回本率", dataIndex: "d118_recovery_rate", width: 150 },
+  { title: "119日回本率", dataIndex: "d119_recovery_rate", width: 150 },
+  { title: "120日回本率", dataIndex: "d120_recovery_rate", width: 150 },
+];
+
 export const TableColumnOfPutAdPlan = [
   {
     fixed: "left",

+ 75 - 0
src/views/put/put-data-more.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="page-wrap page-wrap-put-books">
+    <tool-bar
+      :text="['official_name', 'book_name']"
+      :label="['公众号名称', '书名']"
+      @confirm="onSearch"
+      v-model:loading="inSearching"
+    >
+      <template #picker>
+        <p class="label">日期</p>
+        <a-range-picker />
+      </template>
+    </tool-bar>
+    <a-table :columns="columns" :data-source="list" :scroll="{x: 18500}"></a-table>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, reactive, toRefs, ref } from "vue";
+
+import ToolBar from "@/components/tool-bar/index.vue";
+
+import { TableColumnOfMoreStat } from "../_pageOptions/table-put";
+
+import { getDeliveryMoreStatList } from "@/api";
+import usePagination from "@/hooks/usePagination";
+
+import { deliveryPlanItem, PageOptions } from "@/types/api";
+
+const PutData = defineComponent({
+  components: {
+    ToolBar,
+  },
+  setup() {
+    let { loading, meta, tablePageOptions } = usePagination();
+    const state = reactive({
+      list: ref<deliveryPlanItem[]>([]),
+      columns: TableColumnOfMoreStat,
+      inSearching: false,
+    });
+    const onSearch = async (fields: Record<string, string>) => {
+      try {
+        const { official_name, book_name, start_time, end_time } = fields;
+        const { data } = await getDeliveryMoreStatList({
+          start_time,
+          end_time,
+          official_name,
+          book_name,
+          page: 1,
+        });
+        state.list = data.list;
+        meta.value = data.meta;
+      } catch (e) {
+        console.log(e);
+      } finally {
+        console.log(state.inSearching);
+        state.inSearching = false;
+      }
+    };
+    getDeliveryMoreStatList().then((res) => {
+      state.list = res.data.list;
+    });
+    const handleTableChange = (pagination: PageOptions) => {
+      const { current, pageSize, total } = pagination;
+      getDeliveryMoreStatList({ page: current }).then((res) => {
+        state.list = res.data.list;
+        meta.value = res.data.meta;
+      });
+    };
+    return { ...toRefs(state), onSearch, handleTableChange, meta };
+  },
+});
+
+export default PutData;
+</script>

+ 9 - 4
src/views/put/put-data.vue

@@ -13,7 +13,9 @@
     </tool-bar>
     <a-table :columns="columns" :data-source="list" :scroll="{x: 1800}">
       <template #operator="data">
-        <div @click="more(data)">更多</div>
+        <div class="confirm-button">
+          <a-button type="link" @click="more(data.record)">更多</a-button>
+        </div>
       </template>
     </a-table>
   </div>
@@ -30,12 +32,14 @@ import { getDeliveryStatList } from "@/api";
 import usePagination from "@/hooks/usePagination";
 
 import { deliveryPlanItem, PageOptions } from "@/types/api";
+import useApp from "@/hooks/useApp";
 
 const PutData = defineComponent({
   components: {
     ToolBar,
   },
   setup() {
+    const { router } = useApp();
     let { loading, meta, tablePageOptions } = usePagination();
     const state = reactive({
       list: ref<deliveryPlanItem[]>([]),
@@ -71,10 +75,11 @@ const PutData = defineComponent({
         meta.value = res.data.meta;
       });
     };
-    const more = () => {
-      
+    const more = (data: any) => {
+      console.log(data.date);
+      router.push({ path: "/put/datamore" });
     };
-    return { ...toRefs(state), onSearch, handleTableChange, meta };
+    return { ...toRefs(state), onSearch, handleTableChange, meta, more };
   },
 });