|
@@ -11,7 +11,9 @@
|
|
|
<p class="label">回传方式</p>
|
|
|
<a-select class="full-width" v-model:value="query.report_module">
|
|
|
<a-select-option key="all" :value="''">全部</a-select-option>
|
|
|
- <a-select-option key="channel" value="channel">按站点回传</a-select-option>
|
|
|
+ <a-select-option key="channel" value="channel"
|
|
|
+ >按站点回传</a-select-option
|
|
|
+ >
|
|
|
<a-select-option key="ad" value="ad">按计划回传</a-select-option>
|
|
|
</a-select>
|
|
|
</div>
|
|
@@ -34,7 +36,7 @@
|
|
|
:minValue="1"
|
|
|
@change="(val) => onCellChange(record, 'rate', val)"
|
|
|
/>
|
|
|
- </template>-->
|
|
|
+ </template> -->
|
|
|
<template #module="{ record }">
|
|
|
<p>{{ moduleType[record.report_module] }}</p>
|
|
|
</template>
|
|
@@ -46,8 +48,12 @@
|
|
|
<p>止:{{ record.end_time }}</p>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <a-button type="primary" @click="initBackData(record)">回传配置</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="getLogs(record)">操作日志</a-button>
|
|
|
+ <a-button type="primary" @click="initBackData(record)">
|
|
|
+ 回传配置
|
|
|
+ </a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="getLogs(record)">
|
|
|
+ 操作日志
|
|
|
+ </a-button>
|
|
|
</template>
|
|
|
<!-- <template #operte="{ text, record }">
|
|
|
<p
|
|
@@ -56,27 +62,16 @@
|
|
|
>
|
|
|
<a>复制监测链接</a>
|
|
|
</p>
|
|
|
- </template>-->
|
|
|
+ </template> -->
|
|
|
</a-table>
|
|
|
<!-- 站点回传配置drawer -->
|
|
|
- <a-drawer v-model:visible="visible" title="回传配置" width="40%" class="drawer-back-config">
|
|
|
- <a-form :layout="formState.layout" :model="formState" v-bind="formItemLayout">
|
|
|
- <a-form-item label=" 回传条件">
|
|
|
- <a-select v-model:value="formState.condition" placeholder="请选择">
|
|
|
- <a-select-option value="当日金额不少于30元">当日金额不少于30元</a-select-option>
|
|
|
- <a-select-option value="充值金额不小于30元">充值金额不小于30元</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="回传比例">
|
|
|
- <a-input addon-after="%" v-model:value="formState.rate" placeholder="请输入回传比例" />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item :wrapper-col="buttonItemLayout.wrapperCol">
|
|
|
- <a-button type="primary" @click="kuaishouFormSubmit">确定</a-button>
|
|
|
- <span style="padding:20px;"></span>
|
|
|
- <a-button type="primary" @click="kuaishouFormCanel">取消</a-button>
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
- <!-- <div class="wrap-box">
|
|
|
+ <a-drawer
|
|
|
+ v-model:visible="visible"
|
|
|
+ title="回传配置"
|
|
|
+ width="40%"
|
|
|
+ class="drawer-back-config"
|
|
|
+ >
|
|
|
+ <div class="wrap-box">
|
|
|
<p class="title">回传方式</p>
|
|
|
<a-radio-group
|
|
|
v-model:value="report_module"
|
|
@@ -191,17 +186,17 @@
|
|
|
</a-button>
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
- </div>-->
|
|
|
+ </div>
|
|
|
</a-drawer>
|
|
|
<!--回传日志-->
|
|
|
- <a-drawer
|
|
|
- title="日志详情"
|
|
|
+ <a-drawer title="日志详情"
|
|
|
placement="right"
|
|
|
:closable="true"
|
|
|
width="80%"
|
|
|
- v-model:visible="visibleLog"
|
|
|
- >
|
|
|
- <log-list :visible="visibleLog" :channel_id="curChannel_id"></log-list>
|
|
|
+ v-model:visible="visibleLog">
|
|
|
+ <log-list :visible="visibleLog" :channel_id="curChannel_id">
|
|
|
+
|
|
|
+ </log-list>
|
|
|
</a-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -215,7 +210,6 @@ import {
|
|
|
reactive,
|
|
|
ref,
|
|
|
toRefs,
|
|
|
- UnwrapRef
|
|
|
} from "vue";
|
|
|
import EditableCell from "@/components/edit-cell/index.vue";
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
@@ -235,11 +229,7 @@ import {
|
|
|
setOfficialBackConfig,
|
|
|
onUpdateOfficialReportType,
|
|
|
} from "../../api/index";
|
|
|
-interface FormState {
|
|
|
- layout: "horizontal" | "vertical" | "inline";
|
|
|
- condition: string;
|
|
|
- rate: string;
|
|
|
-}
|
|
|
+
|
|
|
const Account = defineComponent({
|
|
|
components: {
|
|
|
ToolBar,
|
|
@@ -251,7 +241,6 @@ const Account = defineComponent({
|
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
|
const { store } = useApp();
|
|
|
const state = reactive({
|
|
|
- kuaishouRate:"",
|
|
|
platforms: computed(() => store.getters.platforms),
|
|
|
list: ref<IOfficials[]>([]),
|
|
|
columns: TableColumnOfAccount,
|
|
@@ -289,15 +278,11 @@ const Account = defineComponent({
|
|
|
showConfig: false,
|
|
|
visible: false,
|
|
|
saving: false,
|
|
|
- visibleLog: false,
|
|
|
- curChannel_id: 0,
|
|
|
+ visibleLog:false,
|
|
|
+ curChannel_id:0,
|
|
|
currentTab: 0,
|
|
|
});
|
|
|
- const formState: UnwrapRef<FormState> = reactive({
|
|
|
- layout: "horizontal",
|
|
|
- rate: "100",
|
|
|
- condition: "",
|
|
|
- });
|
|
|
+
|
|
|
const onSearch = (fields: Record<string, string>) => {
|
|
|
const { name } = fields;
|
|
|
state.query.official_name = name;
|
|
@@ -326,37 +311,29 @@ const Account = defineComponent({
|
|
|
|
|
|
onMounted(onLoadOfficials);
|
|
|
|
|
|
- const initBackData = async (item: any) => {
|
|
|
- console.log(item)
|
|
|
- formState.rate=item.rate
|
|
|
- state.visible = true;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // try {
|
|
|
- // const { data } = await getOfficialBackConfig(item.channel_id,'kuaishou');
|
|
|
- // state.ad_config.channel_id = data.ad_config.channel_id;
|
|
|
- // state.ad_config.id = data.ad_config.id;
|
|
|
- // state.ad_config.rate = data.ad_config.rate;
|
|
|
- // state.report_module = data.report_module;
|
|
|
- // state.showConfig = data.report_module == "ad" ? false : true;
|
|
|
- // state.report_channel_id = +data.channel_id;
|
|
|
- // let list = data.channel_configs.map((r: PlanBack) => {
|
|
|
- // r.price = r.extra?.price;
|
|
|
- // r.float_rate = r.extra?.float_rate;
|
|
|
- // r.back_on = !!Number(r.back_on);
|
|
|
- // return r;
|
|
|
- // });
|
|
|
- // list.length > 0
|
|
|
- // ? (state.hasPopFormData = true)
|
|
|
- // : (state.hasPopFormData = false);
|
|
|
- // state.popForm = list;
|
|
|
-
|
|
|
- // } catch (error) {
|
|
|
- // console.log("error happened in get back plan data:", error.message);
|
|
|
- // }
|
|
|
+ const initBackData = async (item: IOfficials) => {
|
|
|
+ try {
|
|
|
+ const { data } = await getOfficialBackConfig(item.channel_id,'kuaishou');
|
|
|
+ state.ad_config.channel_id = data.ad_config.channel_id;
|
|
|
+ state.ad_config.id = data.ad_config.id;
|
|
|
+ state.ad_config.rate = data.ad_config.rate;
|
|
|
+ state.report_module = data.report_module;
|
|
|
+ state.showConfig = data.report_module == "ad" ? false : true;
|
|
|
+ state.report_channel_id = +data.channel_id;
|
|
|
+ let list = data.channel_configs.map((r: PlanBack) => {
|
|
|
+ r.price = r.extra?.price;
|
|
|
+ r.float_rate = r.extra?.float_rate;
|
|
|
+ r.back_on = !!Number(r.back_on);
|
|
|
+ return r;
|
|
|
+ });
|
|
|
+ list.length > 0
|
|
|
+ ? (state.hasPopFormData = true)
|
|
|
+ : (state.hasPopFormData = false);
|
|
|
+ state.popForm = list;
|
|
|
+ state.visible = true;
|
|
|
+ } catch (error) {
|
|
|
+ console.log("error happened in get back plan data:", error.message);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const onTabChange = (key: number) => {
|
|
@@ -365,7 +342,7 @@ const Account = defineComponent({
|
|
|
|
|
|
const onRateChange = () => {
|
|
|
const { rate, channel_id } = state.ad_config;
|
|
|
- setChannelRate({ rate, channel_id, report_platform: 'kuaishou' }).then((res) => {
|
|
|
+ setChannelRate({ rate, channel_id,report_platform:'kuaishou' }).then((res) => {
|
|
|
onLoadOfficials();
|
|
|
message.success("修改回传比例成功!");
|
|
|
state.visible = false;
|
|
@@ -383,23 +360,6 @@ const Account = defineComponent({
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const formItemLayout = computed(() => {
|
|
|
- const { layout } = formState;
|
|
|
- return layout === "horizontal"
|
|
|
- ? {
|
|
|
- labelCol: { span: 4 },
|
|
|
- wrapperCol: { span: 14 },
|
|
|
- }
|
|
|
- : {};
|
|
|
- });
|
|
|
- const buttonItemLayout = computed(() => {
|
|
|
- const { layout } = formState;
|
|
|
- return layout === "horizontal"
|
|
|
- ? {
|
|
|
- wrapperCol: { span: 14, offset: 4 },
|
|
|
- }
|
|
|
- : {};
|
|
|
- });
|
|
|
const onSaveConfig = () => {
|
|
|
let { id, back_on, rate, condition, price, float_rate } =
|
|
|
state.popForm[state.currentTab];
|
|
@@ -417,7 +377,7 @@ const Account = defineComponent({
|
|
|
condition,
|
|
|
price,
|
|
|
float_rate,
|
|
|
- report_platform: 'kuaishou'
|
|
|
+ report_platform:'kuaishou'
|
|
|
};
|
|
|
|
|
|
setOfficialBackConfig(data)
|
|
@@ -433,12 +393,7 @@ const Account = defineComponent({
|
|
|
state.saving = false;
|
|
|
});
|
|
|
};
|
|
|
- const kuaishouFormSubmit = () => {
|
|
|
|
|
|
- }
|
|
|
- const kuaishouFormCanel=()=>{
|
|
|
- state.visible = false;
|
|
|
- }
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
loading,
|
|
@@ -451,11 +406,6 @@ const Account = defineComponent({
|
|
|
onRateChange,
|
|
|
onSaveConfig,
|
|
|
onReportModuleChange,
|
|
|
- formState,
|
|
|
- formItemLayout,
|
|
|
- buttonItemLayout,
|
|
|
- kuaishouFormSubmit,
|
|
|
- kuaishouFormCanel
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -469,9 +419,9 @@ const Account = defineComponent({
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- getLogs(record: any) {
|
|
|
- this.curChannel_id = record.channel_id;
|
|
|
- this.visibleLog = true;
|
|
|
+ getLogs(record:any){
|
|
|
+ this.curChannel_id = record.channel_id;
|
|
|
+ this.visibleLog = true;
|
|
|
},
|
|
|
},
|
|
|
});
|