Explorar o código

头条 人群包 页面

jiayufei %!s(int64=4) %!d(string=hai) anos
pai
achega
1cabadeed1

+ 4 - 2
src/views/modules/account-config/account-config.vue

@@ -273,7 +273,7 @@ export default {
                 },
                 {
                     title: '出价(元)',
-                    dataIndex: 'adCpaBid',
+                    dataIndex: 'adCpaBidStr',
                     align: 'center'
                 },
                 {
@@ -345,7 +345,8 @@ export default {
                 bid: this.modContent,
                 budget: this.budgetContent,
                 adId: record.adId ? record.adId : '',
-                id: record.id
+                id: record.id,
+                cost: record.cost
             };
             let paramsData = new FormData();
             if (type === 'mod') {
@@ -366,6 +367,7 @@ export default {
                 paramsData.append('type', 2);
                 paramsData.append('budget', defaultList.budget);
                 paramsData.append('id', defaultList.id);
+                paramsData.append('cost', defaultList.cost);
             }
             this.handlePopoverChange(paramsData);
         },

+ 59 - 16
src/views/modules/account-config/components/configuration-modal.vue

@@ -292,31 +292,31 @@
                             <radio-check v-model="configForm.adSelectAge" :options="ageArr" @change="getAgeSelect"></radio-check>
                         </a-form-model-item>
                         <a-form-model-item label="自定义人群">
-                            <a-radio-group v-model="configForm.adRetargetingTagsInclude" button-style="solid">
+                            <a-radio-group v-model="configForm.customPerson" button-style="solid">
                                 <a-radio-button value="NONE">不限</a-radio-button>
                                 <a-radio-button value="a">自定义人群</a-radio-button>
                             </a-radio-group>
                         </a-form-model-item>
-                        <a-form-model-item v-if="configForm.adRetargetingTagsInclude === 'a'" label="定向逻辑">
+                        <a-form-model-item v-if="configForm.customPerson === 'a'" label="定向逻辑">
                             <a-radio-group v-model="configForm.directionalLogic" button-style="solid" @change="handleDirectionalLogic">
                                 <a-radio-button value="1">定向</a-radio-button>
                                 <a-radio-button value="2">排除</a-radio-button>
                                 <a-radio-button value="3">同时定向排除</a-radio-button>
                             </a-radio-group>
                         </a-form-model-item>
-                        <div v-if="configForm.adRetargetingTagsInclude === 'a' && configForm.directionalLogic === '1'" class="adver-position-radio">
+                        <div v-if="configForm.customPerson === 'a' && configForm.directionalLogic === '1'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="direct" packtype="directional" multitype="alone" :defaultlist="directionalData"></directional-logic>
+                                <directional-logic ref="direct" packtype="directional" multitype="alone" :defaultlist="directionalData" :updatelistinclude="configForm.adRetargetingTagsInclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
                             </div>
                         </div>
-                        <div v-if="configForm.adRetargetingTagsInclude === 'a' && configForm.directionalLogic === '2'" class="adver-position-radio">
+                        <div v-if="configForm.customPerson === 'a' && configForm.directionalLogic === '2'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="exclude" packtype="exclude" multitype="alone" :defaultlist="directionalData"></directional-logic>
+                                <directional-logic ref="exclude" packtype="exclude" multitype="alone" :defaultlist="directionalData" :updatelistexclude="configForm.adRetargetingTagsExclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
                             </div>
                         </div>
-                        <div v-if="configForm.adRetargetingTagsInclude === 'a' && configForm.directionalLogic === '3'" class="adver-position-radio">
+                        <div v-if="configForm.customPerson === 'a' && configForm.directionalLogic === '3'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="twoway" packtype="twoway" multitype="all" :defaultlist="directionalData"></directional-logic>
+                                <directional-logic ref="twoway" packtype="twoway" multitype="all" :defaultlist="directionalData" :updatelistinclude="configForm.adRetargetingTagsInclude" :updatelistexclude="configForm.adRetargetingTagsExclude" @selection-direct-event="handleDirectEvent" @selection-exclude-event="handleExcludeEvent"></directional-logic>
                             </div>
                         </div>
                         <a-form-model-item label="媒体定向">
@@ -437,10 +437,6 @@
                                     <span>{{ packageMessageDetail[0].replacePlate }}</span>
                                 </div>
                                 <div class="content-substance-singal">
-                                    <span class="singal-spn">平台:</span>
-                                    <span>广告计划</span>
-                                </div>
-                                <div class="content-substance-singal">
                                     <span class="singal-spn">智能放量:</span>
                                     <span>{{ packageMessageDetail[0].replaceEnabled }}</span>
                                 </div>
@@ -1031,7 +1027,7 @@ export default {
                 adGender: 'NONE', // 定向-性别
                 adAge: '', // 定向-年龄
                 adSelectAge: ['NONE'],
-                adRetargetingTagsInclude: 'NONE', // 定向-自定义
+                customPerson: 'NONE', // 定向-自定义
                 adSuperiorPopularityType: 'NONE', // 定向-媒体定向
                 adPlatform: 'NONE', // 定向-平台
                 adAc: 'NONE', // 定向-网络
@@ -1057,6 +1053,8 @@ export default {
                 creativeThirdIndustryId: '', // 创意分类
                 creativeThirdIndustryIds: [], // 创意分类
                 adKeywords: [], // 创意标签
+                adRetargetingTagsInclude: [],
+                adRetargetingTagsExclude: [],
                 creativeCallToAction: '', // 行动号召
                 creativeLabel: undefined // 倡议标签
             }
@@ -1173,6 +1171,22 @@ export default {
                 console.log(error, 'eeee');
             });
         },
+        handleSelectionAloneEvent(list) {
+            if (this.configForm.directionalLogic === '1') {
+                this.configForm.adRetargetingTagsInclude = list && list.join(',');
+                this.configForm.adRetargetingTagsExclude = [];
+            }
+            else if (this.configForm.directionalLogic === '2') {
+                this.configForm.adRetargetingTagsExclude = list && list.join(',');
+                this.configForm.adRetargetingTagsInclude = [];
+            }
+        },
+        handleDirectEvent(list) {
+            this.configForm.adRetargetingTagsInclude = list && list.join(',');
+        },
+        handleExcludeEvent(list) {
+            this.configForm.adRetargetingTagsExclude = list && list.join(',');
+        },
         handleDirectionalLogic(e) {
             console.log(e.target.value, 'e--e--e--e--e--e--e--e');
             const selectValue = e.target.value;
@@ -1200,8 +1214,8 @@ export default {
             defaultData.forEach(item => {
                 item.replaceSex = item.audience.gender === 'NONE' ? '不限' : item.audience.gender === 'GENDER_FEMALE' ? '女' : '男';
                 item.replaceEnabled = item.audience.auto_extend_enabled === 1 ? '开启' : '不开启';
-                item.replacePlate = item.audience.length ? item.audience.platform.join(',') : '暂无';
-                item.replaceCitys = item.audience.length ? item.audience.cityNames.join(',') : '暂无';
+                item.replacePlate = item.audience.platform.length ? item.audience.platform.join(',') : '暂无';
+                item.replaceCitys = item.audience.cityNames.length ? item.audience.cityNames.join(',') : '暂无';
                 this.ageArr.forEach(val => {
                     if (item.audience.age && item.audience.age.includes(val.value)) {
                         ageUpdateList.push(val.label);
@@ -1456,10 +1470,39 @@ export default {
                             this.listArr = detailData.adCity.split(',');
                             this.configForm.adSelectCity = detailData.adCity.split(',');
                         }, 200);
+                        getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', {accountId: detailData.accountId}).then(result => {
+                            if (result.code === 0) {
+                                console.log(result, 'result--8888888888888888888888888888888-result');
+                                result.result.forEach(item => {
+                                    item.key = item.custom_audience_id;
+                                });
+                                this.directionalData = result.result;
+                                if (detailData.adRetargetingTagsInclude && detailData.adRetargetingTagsExclude) {
+                                    this.configForm.customPerson = 'a';
+                                    this.configForm.directionalLogic = '3';
+                                    this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude.split(',').map(item => Number(item));
+                                    this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
+                                }
+                                else if (detailData.adRetargetingTagsInclude && !detailData.adRetargetingTagsExclude) {
+                                    this.configForm.customPerson = 'a';
+                                    this.configForm.directionalLogic = '1';
+                                    this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude.split(',').map(item => Number(item));
+                                }
+                                else if (!detailData.adRetargetingTagsInclude && detailData.adRetargetingTagsExclude) {
+                                    this.configForm.customPerson = 'a';
+                                    this.configForm.directionalLogic = '2';
+                                    this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
+                                }
+                            }
+                            else {
+                                this.$message.error(result.message);
+                            }
+                        }).catch(error => {
+                            console.log(error, 'eeee');
+                        });
                         this.configForm.adGender = detailData.adGender || 'NONE';
                         this.configForm.adLocationType = detailData.adLocationType;
                         this.configForm.adSelectAge = detailData.adAge.split(',');
-                        this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
                         this.configForm.adSuperiorPopularityType = detailData.adSuperiorPopularityType;
                         this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adAc = detailData.adAc;

+ 50 - 27
src/views/modules/account-config/components/directional-logic/directional-logic.vue

@@ -9,7 +9,7 @@
                             :columns="columns"
                             :data-source="tableDataAllDirect"
                             :row-selection="rowSelectionAllDirect"
-                            :scroll="{y: 300}"
+                            :scroll="{y: 200}"
                             :pagination="false"
                         >
                         </a-table>
@@ -20,7 +20,7 @@
                             :columns="columns"
                             :data-source="tableDataAllExclude"
                             :row-selection="rowSelectionAllExclude"
-                            :scroll="{y: 300}"
+                            :scroll="{y: 200}"
                             :pagination="false"
                         >
                         </a-table>
@@ -129,6 +129,18 @@ export default {
             default: () => {
                 return [];
             }
+        },
+        updatelistinclude: {
+            type: Array,
+            default: () => {
+                return [];
+            }
+        },
+        updatelistexclude: {
+            type: Array,
+            default: () => {
+                return [];
+            }
         }
     },
     data() {
@@ -228,7 +240,7 @@ export default {
             return {
                 onChange: (selectedRowKeys, selectedRows) => {
                     console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
-                    this.tableSelectDirectIds = selectedRowKeys;
+                    this.tableSelectDirectIds = selectedRows && selectedRows.map(item => item.key);
                     this.tableSelectDirectData = selectedRows;
                 },
                 selectedRowKeys: this.tableSelectDirectIds,
@@ -245,7 +257,7 @@ export default {
             return {
                 onChange: (selectedRowKeys, selectedRows) => {
                     console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
-                    this.tableSelectExcludeIds = selectedRowKeys;
+                    this.tableSelectExcludeIds = selectedRows && selectedRows.map(item => item.key);
                     this.tableSelectExcludeData = selectedRows;
                 },
                 selectedRowKeys: this.tableSelectExcludeIds,
@@ -257,31 +269,20 @@ export default {
                     }
                 })
             };
-        },
-        // allSelection() {
-        //     const {tableSelectExcludeIds} = this;
-        //     return {
-        //         handleDirectProps: record => ({
-        //             props: {
-        //                 disabled: tableSelectExcludeIds.includes(record.key),
-        //                 name: record.name
-        //             }
-        //         })
-        //     }
-        // },
-        // allSelectionTwo() {
-        //     const {tableSelectDirectIds} = this;
-        //     return {
-        //         handleExcludeProps: record => ({
-        //             props: {
-        //                 disabled: tableSelectDirectIds.includes(record.key),
-        //                 name: record.name
-        //             }
-        //         })
-        //     }
-        // }
+        }
     },
     watch: {
+        updatelistinclude(newVal) {
+            if (newVal) {
+                console.log(newVal, '---00---000----000');
+                this.tableSelectDirectIds = newVal;
+            }
+        },
+        updatelistexclude(newVal) {
+            if (newVal) {
+                this.tableSelectExcludeIds = newVal;
+            }
+        },
         defaultlist(newVal) {
             if (newVal) {
                 console.log(newVal, '----newVal--val');
@@ -324,6 +325,25 @@ export default {
         this.updateTableAllExclude = this.defaultlist;
         this.tableDataAlone = this.defaultlist;
         this.updateTreeDataAlone = this.defaultlist;
+
+        this.tableSelectDirectIds = this.updatelistinclude;
+        this.tableSelectExcludeIds = this.updatelistexclude;
+        console.log(this.updatelistinclude, this.updatelistexclude, '--------');
+        console.log(this.updateTableAllDirect, 'this.updateTableAllDirect');
+        this.updateTableAllDirect.forEach(item => {
+            this.updatelistinclude.forEach(val => {
+                if (item.key === val) {
+                    this.tableSelectDirectData.push(item);
+                }
+            });
+        });
+        this.updateTableAllExclude.forEach(item => {
+            this.updatelistexclude.forEach(val => {
+                if (item.key === val) {
+                    this.tableSelectExcludeData.push(item);
+                }
+            });
+        });
     },
     methods: {
         handleTabsChange(e) {
@@ -347,14 +367,17 @@ export default {
         handleRowSelection(selectedRowKeys, selectedRows) {
             this.tableSelectIds = selectedRowKeys;
             this.selectRightData = selectedRows;
+            this.$emit('selection-alone-event', selectedRowKeys);
         },
         handleSelectionDirect(selectedRowKeys, selectedRows) {
             this.tableSelectDirectIds = selectedRowKeys;
             this.tableSelectDirectData = selectedRows;
+            this.$emit('selection-direct-event', selectedRowKeys);
         },
         handleSelectionExclude(selectedRowKeys, selectedRows) {
             this.tableSelectExcludeIds = selectedRowKeys;
             this.tableSelectExcludeData = selectedRows;
+            this.$emit('selection-exclude-event', selectedRowKeys);
         },
         handleDelTree(list, type, style) {
             if (type === 'alone') {