|
@@ -7,32 +7,11 @@
|
|
|
@confirm="onSearch"
|
|
|
@cancel="onCancel"
|
|
|
>
|
|
|
- <!-- <div class="tool-bar-item">
|
|
|
- <p class="label">小说平台</p>
|
|
|
- <a-select class="full-width" v-model:value="query.platform">
|
|
|
- <a-select-option
|
|
|
- v-for="platform in platforms"
|
|
|
- :key="platform.value"
|
|
|
- :value="platform.value"
|
|
|
- >{{ platform.label }}</a-select-option
|
|
|
- >
|
|
|
- </a-select>
|
|
|
- </div> -->
|
|
|
- <!-- <div class="tool-bar-item">
|
|
|
- <p class="label">回传状态</p>
|
|
|
- <a-select class="full-width" v-model:value="query.report_status">
|
|
|
- <a-select-option :key="-1" :value="-1">全部</a-select-option>
|
|
|
- <a-select-option :key="1" :value="1">开启</a-select-option>
|
|
|
- <a-select-option :key="0" :value="0">关闭</a-select-option>
|
|
|
- </a-select>
|
|
|
- </div> -->
|
|
|
<div class="tool-bar-item">
|
|
|
<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>
|
|
@@ -55,7 +34,7 @@
|
|
|
:minValue="1"
|
|
|
@change="(val) => onCellChange(record, 'rate', val)"
|
|
|
/>
|
|
|
- </template> -->
|
|
|
+ </template>-->
|
|
|
<template #module="{ record }">
|
|
|
<p>{{ moduleType[record.report_module] }}</p>
|
|
|
</template>
|
|
@@ -67,12 +46,8 @@
|
|
|
<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
|
|
@@ -81,16 +56,27 @@
|
|
|
>
|
|
|
<a>复制监测链接</a>
|
|
|
</p>
|
|
|
- </template> -->
|
|
|
+ </template>-->
|
|
|
</a-table>
|
|
|
<!-- 站点回传配置drawer -->
|
|
|
- <a-drawer
|
|
|
- v-model:visible="visible"
|
|
|
- title="回传配置"
|
|
|
- width="40%"
|
|
|
- class="drawer-back-config"
|
|
|
- >
|
|
|
- <div class="wrap-box">
|
|
|
+ <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">
|
|
|
<p class="title">回传方式</p>
|
|
|
<a-radio-group
|
|
|
v-model:value="report_module"
|
|
@@ -205,17 +191,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>
|
|
@@ -229,6 +215,7 @@ import {
|
|
|
reactive,
|
|
|
ref,
|
|
|
toRefs,
|
|
|
+ UnwrapRef
|
|
|
} from "vue";
|
|
|
import EditableCell from "@/components/edit-cell/index.vue";
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
@@ -248,7 +235,11 @@ import {
|
|
|
setOfficialBackConfig,
|
|
|
onUpdateOfficialReportType,
|
|
|
} from "../../api/index";
|
|
|
-
|
|
|
+interface FormState {
|
|
|
+ layout: "horizontal" | "vertical" | "inline";
|
|
|
+ condition: string;
|
|
|
+ rate: string;
|
|
|
+}
|
|
|
const Account = defineComponent({
|
|
|
components: {
|
|
|
ToolBar,
|
|
@@ -260,6 +251,7 @@ 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,
|
|
@@ -297,11 +289,15 @@ 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;
|
|
@@ -330,29 +326,37 @@ const Account = defineComponent({
|
|
|
|
|
|
onMounted(onLoadOfficials);
|
|
|
|
|
|
- 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 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 onTabChange = (key: number) => {
|
|
@@ -361,7 +365,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;
|
|
@@ -379,6 +383,23 @@ 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];
|
|
@@ -396,7 +417,7 @@ const Account = defineComponent({
|
|
|
condition,
|
|
|
price,
|
|
|
float_rate,
|
|
|
- report_platform:'kuaishou'
|
|
|
+ report_platform: 'kuaishou'
|
|
|
};
|
|
|
|
|
|
setOfficialBackConfig(data)
|
|
@@ -412,7 +433,12 @@ const Account = defineComponent({
|
|
|
state.saving = false;
|
|
|
});
|
|
|
};
|
|
|
+ const kuaishouFormSubmit = () => {
|
|
|
|
|
|
+ }
|
|
|
+ const kuaishouFormCanel=()=>{
|
|
|
+ state.visible = false;
|
|
|
+ }
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
loading,
|
|
@@ -425,6 +451,11 @@ const Account = defineComponent({
|
|
|
onRateChange,
|
|
|
onSaveConfig,
|
|
|
onReportModuleChange,
|
|
|
+ formState,
|
|
|
+ formItemLayout,
|
|
|
+ buttonItemLayout,
|
|
|
+ kuaishouFormSubmit,
|
|
|
+ kuaishouFormCanel
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -438,9 +469,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;
|
|
|
},
|
|
|
},
|
|
|
});
|