Selaa lähdekoodia

头条 人群包 页面

jiayufei 4 vuotta sitten
vanhempi
commit
ca746433ca

+ 27 - 11
src/views/modules/account-config/components/configuration-modal.vue

@@ -306,17 +306,17 @@
                         </a-form-model-item>
                         <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" :updatelistinclude="configForm.adRetargetingTagsInclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic ref="direct" packtype="directional" multitype="alone" :defaultlist="directionalData" :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
                             </div>
                         </div>
                         <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" :updatelistexclude="configForm.adRetargetingTagsExclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic ref="exclude" packtype="exclude" multitype="alone" :defaultlist="directionalData" :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
                             </div>
                         </div>
                         <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" :updatelistinclude="configForm.adRetargetingTagsInclude" :updatelistexclude="configForm.adRetargetingTagsExclude" @selection-direct-event="handleDirectEvent" @selection-exclude-event="handleExcludeEvent"></directional-logic>
+                                <directional-logic ref="twoway" packtype="twoway" multitype="all" :defaultlist="directionalData" :updatelistinclude="configForm.updateGetingInclude" :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent" @selection-exclude-event="handleExcludeEvent"></directional-logic>
                             </div>
                         </div>
                         <a-form-model-item label="媒体定向">
@@ -362,6 +362,7 @@
                                 <a-radio-button value="3G">3G</a-radio-button>
                                 <a-radio-button value="4G">4G</a-radio-button>
                             </a-radio-group>
+                            <!-- <radio-check v-model="configForm.adSelectAge" :options="adAcList" @change="getAgeSelect"></radio-check> -->
                         </a-form-model-item>
                         <a-form-model-item label="已安装用户">
                             <a-radio-group v-model="configForm.adHideIfExists" button-style="solid">
@@ -829,6 +830,7 @@ export default {
         return {
             directionalData: [],
             selectPackageTabs: '1',
+            adAcList: [],
             adHideIfConvertedDataOption: [ // 过滤已转化用户option
                 {
                     id: 'NO_EXCLUDE',
@@ -1053,8 +1055,10 @@ export default {
                 creativeThirdIndustryId: '', // 创意分类
                 creativeThirdIndustryIds: [], // 创意分类
                 adKeywords: [], // 创意标签
-                adRetargetingTagsInclude: [],
-                adRetargetingTagsExclude: [],
+                updateGetingInclude: [],
+                updateGetingExclude: [],
+                adRetargetingTagsInclude: '',
+                adRetargetingTagsExclude: '',
                 creativeCallToAction: '', // 行动号召
                 creativeLabel: undefined // 倡议标签
             }
@@ -1173,18 +1177,24 @@ export default {
         },
         handleSelectionAloneEvent(list) {
             if (this.configForm.directionalLogic === '1') {
+                this.configForm.updateGetingInclude = list;
                 this.configForm.adRetargetingTagsInclude = list && list.join(',');
-                this.configForm.adRetargetingTagsExclude = [];
+                this.configForm.adRetargetingTagsExclude = '';
+                this.configForm.updateGetingExclude = [];
             }
             else if (this.configForm.directionalLogic === '2') {
+                this.configForm.updateGetingExclude = list;
                 this.configForm.adRetargetingTagsExclude = list && list.join(',');
-                this.configForm.adRetargetingTagsInclude = [];
+                this.configForm.updateGetingInclude = [];
+                this.configForm.adRetargetingTagsInclude = '';
             }
         },
         handleDirectEvent(list) {
+            this.configForm.updateGetingInclude = list;
             this.configForm.adRetargetingTagsInclude = list && list.join(',');
         },
         handleExcludeEvent(list) {
+            this.configForm.updateGetingExclude = list;
             this.configForm.adRetargetingTagsExclude = list && list.join(',');
         },
         handleDirectionalLogic(e) {
@@ -1480,18 +1490,24 @@ export default {
                                 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));
+                                    this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
+                                    this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
+                                    this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
+                                    this.configForm.updateGetingInclude = detailData.adRetargetingTagsInclude.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));
+                                    this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
+                                    this.configForm.updateGetingExclude = [];
+                                    this.configForm.updateGetingInclude = 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));
+                                    this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
+                                    this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
+                                    this.configForm.updateGetingInclude = [];
                                 }
                             }
                             else {

+ 53 - 28
src/views/modules/account-config/components/directional-logic/directional-logic.vue

@@ -272,17 +272,17 @@ export default {
         }
     },
     watch: {
-        updatelistinclude(newVal) {
-            if (newVal) {
-                console.log(newVal, '---00---000----000');
-                this.tableSelectDirectIds = newVal;
-            }
-        },
-        updatelistexclude(newVal) {
-            if (newVal) {
-                this.tableSelectExcludeIds = newVal;
-            }
-        },
+        // 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');
@@ -316,7 +316,7 @@ export default {
                 this.tableSelectIds = [];
                 this.selectRightData = [];
             }
-        },
+        }
     },
     mounted() {
         this.tableDataAllDirect = this.defaultlist;
@@ -325,25 +325,50 @@ 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);
-                }
+        console.log(this.updatelistinclude, this.updatelistexclude, '--00--00--00--0--555555');
+        if (this.updatelistinclude.length && this.updatelistexclude.length) {
+            this.tableSelectDirectIds = [...this.updatelistinclude];
+            this.tableSelectExcludeIds = [...this.updatelistexclude];
+            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);
-                }
+            this.updateTableAllExclude.forEach(item => {
+                this.updatelistexclude.forEach(val => {
+                    if (item.key === val) {
+                        this.tableSelectExcludeData.push(item);
+                    }
+                });
+            });
+        }
+        else if (this.updatelistinclude.length && !this.updatelistexclude.length) {
+            console.log(11111);
+            this.tableSelectIds = [...this.updatelistinclude];
+            this.updateTableAllDirect.forEach(item => {
+                this.updatelistinclude.forEach(val => {
+                    if (item.key === val) {
+                        this.selectRightData.push(item);
+                    }
+                });
             });
-        });
+        }
+        else if (!this.updatelistinclude.length && this.updatelistexclude.length) {
+            console.log(222222);
+            this.tableSelectIds = [...this.updatelistexclude];
+            this.updateTableAllDirect.forEach(item => {
+                this.updatelistexclude.forEach(val => {
+                    if (item.key === val) {
+                        this.selectRightData.push(item);
+                    }
+                });
+            });
+            console.log(this.selectRightData, 'this.selectRightData--this.selectRightData');
+        }
     },
     methods: {
         handleTabsChange(e) {