|
@@ -17,26 +17,43 @@
|
|
|
format="YYYY/MM/DD"
|
|
|
/>
|
|
|
</template> -->
|
|
|
- <div class="tool-bar-item" v-if="optionList.length>0">
|
|
|
+ <div class="tool-bar-item" v-if="optionList.length > 0">
|
|
|
<p class="label">计划状态</p>
|
|
|
<a-select class="full-width" v-model:value="currentSelect">
|
|
|
- <a-select-option v-for="item in optionList" :value="item.name" :key="item.name">{{item.desc}}</a-select-option>
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in optionList"
|
|
|
+ :value="item.name"
|
|
|
+ :key="item.name"
|
|
|
+ >{{ item.desc }}</a-select-option
|
|
|
+ >
|
|
|
</a-select>
|
|
|
</div>
|
|
|
</tool-bar>
|
|
|
|
|
|
<div class="table-filter">
|
|
|
- <span>筛选条件:</span>
|
|
|
- <a-range-picker
|
|
|
+ <div class="item-right">
|
|
|
+ <span>筛选条件:</span>
|
|
|
+ <a-range-picker
|
|
|
v-model:value="pickerFilter"
|
|
|
@change="switchDate"
|
|
|
:ranges="{
|
|
|
- 本日: [moment(),moment()],
|
|
|
- 本周: [moment(), moment().endOf('week')],
|
|
|
- 本月: [moment(), moment().endOf('month')],
|
|
|
+ 本日: [moment(), moment()],
|
|
|
+ 近7日: [moment().subtract(7, 'd'), moment()],
|
|
|
+ 近14日: [moment().subtract(14, 'd'), moment()],
|
|
|
+ 近30日: [moment().subtract(30, 'd'), moment()],
|
|
|
+ 近3月: [
|
|
|
+ moment()
|
|
|
+ .subtract(3, 'month')
|
|
|
+ .startOf('month'),
|
|
|
+ moment().startOf('month'),
|
|
|
+ ],
|
|
|
}"
|
|
|
format="YYYY/MM/DD"
|
|
|
/>
|
|
|
+ </div>
|
|
|
+ <a-button type="primary">
|
|
|
+ 回本数据
|
|
|
+ </a-button>
|
|
|
</div>
|
|
|
<a-table
|
|
|
:columns="columns"
|
|
@@ -72,10 +89,18 @@
|
|
|
@change="(val) => onCellChange(record, 'budget', val)"
|
|
|
/>
|
|
|
</template>
|
|
|
- <template #opertate="{ text, record }">
|
|
|
- <p @click="openDrawer(record)"><a>操作日志</a></p>
|
|
|
+ <template #opertate="{ text, record }">
|
|
|
+ <p @click="openDrawer(record)"><a>操作日志</a></p>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
+ <a-drawer
|
|
|
+ title="操作日志"
|
|
|
+ placement="right"
|
|
|
+ :closable="false"
|
|
|
+ v-model:visible="visible"
|
|
|
+ >
|
|
|
+ <put-data></put-data>
|
|
|
+ </a-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -83,7 +108,7 @@
|
|
|
import { defineComponent, reactive, toRefs, ref, unref } from "vue";
|
|
|
import moment from "moment";
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
|
-import PutData from "@/views/put/put-log.vue"
|
|
|
+import PutData from "@/views/put/put-log.vue";
|
|
|
import EditableCell from "@/components/edit-cell/index.vue";
|
|
|
import usePagination from "@/hooks/usePagination";
|
|
|
import {
|
|
@@ -97,7 +122,7 @@ import {
|
|
|
adChangeMoney,
|
|
|
adChangeCrem,
|
|
|
statusChange,
|
|
|
- getAddStatus
|
|
|
+ getAddStatus,
|
|
|
} from "@/api";
|
|
|
|
|
|
import { ADPlanItem, PageOptions } from "@/types/api";
|
|
@@ -106,28 +131,30 @@ const PutAdPlan = defineComponent({
|
|
|
components: {
|
|
|
ToolBar,
|
|
|
EditableCell,
|
|
|
- PutData
|
|
|
+ PutData,
|
|
|
},
|
|
|
setup() {
|
|
|
let { loading, meta, tablePageOptions } = usePagination();
|
|
|
- let list: any[] = [], opList: any[] = [];
|
|
|
+ let list: any[] = [],
|
|
|
+ opList: any[] = [];
|
|
|
const state = reactive({
|
|
|
platform: "platform1",
|
|
|
list: ref<ADPlanItem[]>([]),
|
|
|
inSearching: false,
|
|
|
loading,
|
|
|
- currentSelect:'AD_STATUS_DELIVERY_OK',
|
|
|
+ currentSelect: "AD_STATUS_DELIVERY_OK",
|
|
|
picker: [],
|
|
|
- pickerFilter:[],
|
|
|
+ visible: false,
|
|
|
+ pickerFilter: [],
|
|
|
tablePageOptions,
|
|
|
columns: list,
|
|
|
- optionList:opList,
|
|
|
+ optionList: opList,
|
|
|
defaultColumns: TableColumnOfPutAdPlan,
|
|
|
- fields:{}
|
|
|
+ fields: {},
|
|
|
});
|
|
|
- getAddStatus().then(res=>{
|
|
|
+ getAddStatus().then((res) => {
|
|
|
state.optionList = res.data;
|
|
|
- })
|
|
|
+ });
|
|
|
const onSearch = async (fields: Record<string, string>) => {
|
|
|
try {
|
|
|
const { email, account_name, ad_name, status, campaign_name } = fields;
|
|
@@ -143,7 +170,7 @@ const PutAdPlan = defineComponent({
|
|
|
ad_name,
|
|
|
begin_date,
|
|
|
end_date,
|
|
|
- status:state.currentSelect,
|
|
|
+ status: state.currentSelect,
|
|
|
campaign_name,
|
|
|
page: 1,
|
|
|
});
|
|
@@ -161,9 +188,9 @@ const PutAdPlan = defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const switchDate = (date:any, dateString:string) => {
|
|
|
- onSearch(state.fields)
|
|
|
- }
|
|
|
+ const switchDate = (date: any, dateString: string) => {
|
|
|
+ onSearch(state.fields);
|
|
|
+ };
|
|
|
|
|
|
getADPlanlist().then((res) => {
|
|
|
let newList: any[] = res.data.list.map((item) => {
|
|
@@ -184,7 +211,7 @@ const PutAdPlan = defineComponent({
|
|
|
} = {
|
|
|
title: item.desc,
|
|
|
dataIndex: item.name,
|
|
|
- width: 150
|
|
|
+ width: 150,
|
|
|
};
|
|
|
if (item.name == "external_url") {
|
|
|
lolumnItem.slots = { customRender: "external_url" };
|
|
@@ -194,18 +221,17 @@ const PutAdPlan = defineComponent({
|
|
|
}
|
|
|
|
|
|
columns.push(lolumnItem);
|
|
|
-
|
|
|
});
|
|
|
state.columns = [];
|
|
|
state.columns.push(...state.defaultColumns);
|
|
|
state.columns.push(...columns);
|
|
|
state.columns.push({
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'opertate',
|
|
|
- fixed: "right",
|
|
|
- slots: { customRender: "opertate" },
|
|
|
- width: 100
|
|
|
- })
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "opertate",
|
|
|
+ fixed: "right",
|
|
|
+ slots: { customRender: "opertate" },
|
|
|
+ width: 100,
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
const handleTableChange = (pagination: PageOptions) => {
|
|
@@ -220,15 +246,15 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- return { ...toRefs(state), handleTableChange, onSearch,switchDate };
|
|
|
+ return { ...toRefs(state), handleTableChange, onSearch, switchDate };
|
|
|
},
|
|
|
methods: {
|
|
|
moment,
|
|
|
onGo(record: any) {
|
|
|
window.open(record.external_url);
|
|
|
},
|
|
|
- openDrawer(record:any){
|
|
|
-
|
|
|
+ openDrawer(record: any) {
|
|
|
+ this.visible = true;
|
|
|
},
|
|
|
onCellChange(record: any, dataIndex: string, value: string) {
|
|
|
console.log(record);
|
|
@@ -266,14 +292,18 @@ const PutAdPlan = defineComponent({
|
|
|
});
|
|
|
|
|
|
export default PutAdPlan;
|
|
|
-
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.table-filter{
|
|
|
+.table-filter {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
- padding: 5px 30px 15px;
|
|
|
+ padding: 5px 0 15px;
|
|
|
align-items: center;
|
|
|
}
|
|
|
-
|
|
|
-</style>
|
|
|
+.ant-drawer-content-wrapper {
|
|
|
+ width: 80vw !important;
|
|
|
+}
|
|
|
+.item-right{
|
|
|
+ margin-right:10px;
|
|
|
+}
|
|
|
+</style>
|