|
@@ -1,73 +1,104 @@
|
|
<template>
|
|
<template>
|
|
<div class="page-wrap page-wrap-account">
|
|
<div class="page-wrap page-wrap-account">
|
|
- <tool-bar :text="['account_id', 'email', 'user_name', 'plan_name', 'ad_group_name']"
|
|
|
|
- :label="['账户ID', '邮箱', '用户名', '计划名称', '广告组名称']">
|
|
|
|
|
|
+ <tool-bar
|
|
|
|
+ :text="['account_name', 'email', 'ad_name', 'campaign_name']"
|
|
|
|
+ :label="['账户名', '邮箱', '计划名称', '广告组名称']"
|
|
|
|
+ >
|
|
<template #picker>
|
|
<template #picker>
|
|
<p class="label">日期</p>
|
|
<p class="label">日期</p>
|
|
<a-range-picker />
|
|
<a-range-picker />
|
|
</template>
|
|
</template>
|
|
- <div class="tool-bar-item">
|
|
|
|
|
|
+ <!-- <div class="tool-bar-item">
|
|
<p class="label">计划状态</p>
|
|
<p class="label">计划状态</p>
|
|
<a-select class="full-width">
|
|
<a-select class="full-width">
|
|
<a-select-option value="status1">状态一</a-select-option>
|
|
<a-select-option value="status1">状态一</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</tool-bar>
|
|
</tool-bar>
|
|
- <a-table :columns="columns"
|
|
|
|
- :data-source="list"
|
|
|
|
- :scroll="{ x: 2500 }"></a-table>
|
|
|
|
|
|
+ <a-table
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data-source="list"
|
|
|
|
+ :pagination="tablePageOptions"
|
|
|
|
+ :loading="loading.value"
|
|
|
|
+ @change="handleTableChange"
|
|
|
|
+ rowKey="id"
|
|
|
|
+ :scroll="{ x: 2500 }"
|
|
|
|
+ ></a-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import { defineComponent, reactive, toRefs } from "vue";
|
|
|
|
|
|
+import { defineComponent, reactive, toRefs, ref } from "vue";
|
|
|
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
|
|
+import usePagination from "@/hooks/usePagination";
|
|
|
|
+import {
|
|
|
|
+ TableColumnOfPutAdPlan,
|
|
|
|
+ ALLCloumnList,
|
|
|
|
+} from "../_pageOptions/table-put";
|
|
|
|
|
|
-import { TableColumnOfPutAdPlan } from "../_pageOptions/table-put";
|
|
|
|
|
|
+import { getADPlanlist } from "@/api";
|
|
|
|
+
|
|
|
|
+import { ADPlanItem, PageOptions } from "@/types/api";
|
|
|
|
|
|
const PutAdPlan = defineComponent({
|
|
const PutAdPlan = defineComponent({
|
|
components: {
|
|
components: {
|
|
ToolBar,
|
|
ToolBar,
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
- const data = reactive({
|
|
|
|
|
|
+ let { loading, meta, tablePageOptions } = usePagination();
|
|
|
|
+ const state = reactive({
|
|
platform: "platform1",
|
|
platform: "platform1",
|
|
- list: [],
|
|
|
|
|
|
+ list: ref<ADPlanItem[]>([]),
|
|
|
|
+ inSearching: false,
|
|
|
|
+ loading,
|
|
|
|
+ tablePageOptions,
|
|
columns: TableColumnOfPutAdPlan,
|
|
columns: TableColumnOfPutAdPlan,
|
|
- customColumns: [
|
|
|
|
- {
|
|
|
|
- title: "计划名称",
|
|
|
|
- dataIndex: "plan_name",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: "计划状态",
|
|
|
|
- dataIndex: "plan_status",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: "计划预算(元)",
|
|
|
|
- dataIndex: "plan_money",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: "出价",
|
|
|
|
- dataIndex: "price",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: "计划ID",
|
|
|
|
- dataIndex: "plan_id",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
});
|
|
});
|
|
-
|
|
|
|
- // TODO 动态column需要根据具体接口来决定如何写逻辑
|
|
|
|
-
|
|
|
|
- data.columns.push(...(data.customColumns as any[]));
|
|
|
|
-
|
|
|
|
- console.log(data.columns);
|
|
|
|
-
|
|
|
|
- return { ...toRefs(data) };
|
|
|
|
|
|
+ state.columns.push(...(ALLCloumnList as any[]));
|
|
|
|
+ const onSearch = async (fields: Record<string, string>) => {
|
|
|
|
+ try {
|
|
|
|
+ const {
|
|
|
|
+ email,
|
|
|
|
+ account_name,
|
|
|
|
+ ad_name,
|
|
|
|
+ status,
|
|
|
|
+ begin_date,
|
|
|
|
+ end_date,
|
|
|
|
+ campaign_name,
|
|
|
|
+ } = fields;
|
|
|
|
+ const { data } = await getADPlanlist({
|
|
|
|
+ email,
|
|
|
|
+ account_name,
|
|
|
|
+ ad_name,
|
|
|
|
+ status,
|
|
|
|
+ begin_date,
|
|
|
|
+ end_date,
|
|
|
|
+ campaign_name,
|
|
|
|
+ page: 1,
|
|
|
|
+ });
|
|
|
|
+ state.list = data.list;
|
|
|
|
+ meta = data.meta;
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ } finally {
|
|
|
|
+ console.log(state.inSearching);
|
|
|
|
+ state.inSearching = false;
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ getADPlanlist().then((res) => {
|
|
|
|
+ state.list = res.data.list;
|
|
|
|
+ });
|
|
|
|
+ const handleTableChange = (pagination: PageOptions) => {
|
|
|
|
+ const { current, pageSize, total } = pagination;
|
|
|
|
+ getADPlanlist({ page: current }).then((res) => {
|
|
|
|
+ state.list = res.data.list;
|
|
|
|
+ meta = res.data.meta;
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ return { ...toRefs(state), handleTableChange };
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
export default PutAdPlan;
|
|
export default PutAdPlan;
|
|
-</script>
|
|
|
|
|
|
+</script>
|