|
@@ -34,7 +34,10 @@
|
|
|
:scroll="{ x: 1500 }"
|
|
|
>
|
|
|
<template #switch="{ text, record }">
|
|
|
- <a-switch v-model:checked="record.enable" @change="switchMethod(record)" />
|
|
|
+ <a-switch
|
|
|
+ v-model:checked="record.enable"
|
|
|
+ @change="switchMethod(record)"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template #external_url="{ text, record }">
|
|
|
<p @click="onGo(record)"><a>前往落地页链接</a></p>
|
|
@@ -43,6 +46,7 @@
|
|
|
<template #cpa_bid="{ text, record }">
|
|
|
<editable-cell
|
|
|
:text="text"
|
|
|
+ title="预算"
|
|
|
@change="(val) => onCellChange(record, 'cpa_bid', val)"
|
|
|
/>
|
|
|
</template>
|
|
@@ -50,6 +54,7 @@
|
|
|
<template #budget="{ text, record }">
|
|
|
<editable-cell
|
|
|
:text="text"
|
|
|
+ title="出价"
|
|
|
@change="(val) => onCellChange(record, 'budget', val)"
|
|
|
/>
|
|
|
</template>
|
|
@@ -73,7 +78,7 @@ import {
|
|
|
getCustomColumn,
|
|
|
adChangeMoney,
|
|
|
adChangeCrem,
|
|
|
- statusChange
|
|
|
+ statusChange,
|
|
|
} from "@/api";
|
|
|
|
|
|
import { ADPlanItem, PageOptions } from "@/types/api";
|
|
@@ -85,6 +90,7 @@ const PutAdPlan = defineComponent({
|
|
|
},
|
|
|
setup() {
|
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
|
+ let list: any[] = [];
|
|
|
const state = reactive({
|
|
|
platform: "platform1",
|
|
|
list: ref<ADPlanItem[]>([]),
|
|
@@ -92,7 +98,8 @@ const PutAdPlan = defineComponent({
|
|
|
loading,
|
|
|
picker: [],
|
|
|
tablePageOptions,
|
|
|
- columns: TableColumnOfPutAdPlan,
|
|
|
+ columns: list,
|
|
|
+ defaultColumns: TableColumnOfPutAdPlan,
|
|
|
});
|
|
|
|
|
|
const onSearch = async (fields: Record<string, string>) => {
|
|
@@ -143,6 +150,7 @@ const PutAdPlan = defineComponent({
|
|
|
} = {
|
|
|
title: item.desc,
|
|
|
dataIndex: item.name,
|
|
|
+ width: 150
|
|
|
};
|
|
|
if (item.name == "external_url") {
|
|
|
lolumnItem.slots = { customRender: "external_url" };
|
|
@@ -153,6 +161,8 @@ const PutAdPlan = defineComponent({
|
|
|
|
|
|
columns.push(lolumnItem);
|
|
|
});
|
|
|
+ state.columns = [];
|
|
|
+ state.columns.push(...state.defaultColumns);
|
|
|
state.columns.push(...columns);
|
|
|
});
|
|
|
|
|
@@ -167,6 +177,7 @@ const PutAdPlan = defineComponent({
|
|
|
meta.value = res.data.meta;
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
return { ...toRefs(state), handleTableChange, onSearch };
|
|
|
},
|
|
|
methods: {
|
|
@@ -180,29 +191,32 @@ const PutAdPlan = defineComponent({
|
|
|
if (dataIndex == "cpa_bid") {
|
|
|
adChangeCrem({ ad_id, bid: value })
|
|
|
.then((res) => {
|
|
|
- location.reload();
|
|
|
+ this.$message.success("修改成功!");
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
- location.reload();
|
|
|
+ //location.reload();
|
|
|
});
|
|
|
}
|
|
|
if (dataIndex == "budget") {
|
|
|
adChangeMoney({ ad_id, budget: value })
|
|
|
.then((res) => {
|
|
|
- location.reload();
|
|
|
+ this.$message.success("修改成功!");
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
- location.reload();
|
|
|
+ //location.reload();
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- switchMethod(record:any){
|
|
|
+ switchMethod(record: any) {
|
|
|
console.log(record);
|
|
|
let ad_id = record.ad_id;
|
|
|
- statusChange({ ad_id, status: record.enable?'enable':'disable' }).then(res=>{
|
|
|
- this.$message.error('修改广告状态成功!');
|
|
|
- })
|
|
|
- }
|
|
|
+ statusChange({
|
|
|
+ ad_id,
|
|
|
+ status: record.enable ? "disable" : "enable",
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message.success("修改广告状态成功!");
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|