jiayufei 4 лет назад
Родитель
Сommit
1c982d1c11

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
   
   // axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot';//预生产
-  // axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
-  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
+  axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
+  // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 2 - 2
src/views/modules/account-config/account-config-server.js

@@ -1,3 +1,3 @@
 // export const urlAcount = 'http://118.24.244.213:8080'; // 线上
-export const urlAcount = 'http://192.168.1.43:8080'; // 子安
-// export const urlAcount = 'http://139.186.165.84:8080'; // 测试
+// export const urlAcount = 'http://192.168.1.43:8080'; // 子安
+export const urlAcount = 'http://139.186.165.84:8080'; // 测试

+ 96 - 6
src/views/modules/account-config/components/configuration-modal.vue

@@ -267,7 +267,7 @@
                 </div>
             </div>
             <div class="separate-module-con">
-                <a-tabs v-model="selectPackageTabs">
+                <a-tabs v-model="selectPackageTabs" @change="handleSelectPackageTabs">
                     <a-tab-pane key="1" tab="新建定向">
                         <p class="rock-title">用户定向</p>
                         <a-form-model-item label="地域">
@@ -319,17 +319,46 @@
                         </a-form-model-item>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '1'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="direct" packtype="directional" multitype="alone" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic
+                                    ref="direct"
+                                    packtype="directional"
+                                    multitype="alone"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '2'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="exclude" packtype="exclude" multitype="alone" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"></directional-logic>
+                                <directional-logic
+                                    ref="exclude"
+                                    packtype="exclude"
+                                    multitype="alone"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '3'" class="adver-position-radio">
                             <div style="width: 60%;">
-                                <directional-logic ref="twoway" packtype="twoway" multitype="all" :defaultlist="directionalData" :valueids="configForm.adRetargetingTagsType" :updatelistinclude="configForm.updateGetingInclude" :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent" @selection-exclude-event="handleExcludeEvent"></directional-logic>
+                                <directional-logic
+                                    ref="twoway"
+                                    packtype="twoway"
+                                    multitype="all"
+                                    :defaultlist="directionalData"
+                                    :valueids="configForm.adRetargetingTagsType"
+                                    :updatelistinclude="configForm.updateGetingInclude"
+                                    :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent"
+                                    @selection-exclude-event="handleExcludeEvent"
+                                    @clearlist="handleClearlist"
+                                >
+                                </directional-logic>
                             </div>
                         </div>
                         <a-form-model-item label="媒体定向">
@@ -555,6 +584,7 @@
                             :max="10000"
                             :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMinBidBlur"
                         />
                         <span>~</span>
                     </a-form-model-item>
@@ -566,6 +596,7 @@
                             :max="10000"
                             :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
                 </div>
@@ -578,6 +609,7 @@
                             :max="10000"
                             :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMinBidBlur"
                         />
                         <span>~</span>
                     </a-form-model-item>
@@ -589,6 +621,7 @@
                             :max="10000"
                             :step="0.01"
                             placeholder="请输入"
+                            @blur="handleAdMaxBidBlur"
                         /> 元
                     </a-form-model-item>
                     <a-form-model-item label="浮动间隔" prop="adStepBid">
@@ -1061,7 +1094,7 @@ export default {
                 productSellingPoints: [], // 商品买点
                 adBudgetMode: 'BUDGET_MODE_DAY', // 预算类型
                 adDownloadUrl: '', // 下载链接
-                accountBudget: 0, // 账户日预算
+                accountBudget: 1000, // 账户日预算
                 accountId: undefined, // 账户
                 dpLinkStartIndex: 1,
                 dpLinkEndIndex: 2,
@@ -1234,6 +1267,31 @@ export default {
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
         moment,
+        handleSelectPackageTabs(e) {
+            if (e === '1') {
+                this.configForm.adAudiencePackageId = undefined;
+                this.packageMessageDetail = [];
+            }
+            else if (e === '2') {
+                this.configForm.adDistrict = 'NONE';
+                this.listArr = [];
+                this.configForm.adLocationType = 'HOME';
+                this.configForm.adGender = 'NONE';
+                this.configForm.adSelectAge = ['NONE'];
+                this.configForm.customPerson = 'NONE';
+                this.configForm.updateGetingInclude = [];
+                this.configForm.adRetargetingTagsInclude = '';
+                this.configForm.adRetargetingTagsExclude = '';
+                this.configForm.updateGetingExclude = [];
+                this.configForm.adRetargetingTagsType = '';
+                this.configForm.adPlatform = 'NONE';
+                this.configForm.adDeviceSelectType = ['NONE'];
+                this.configForm.adAndroidVersion = 'NONE';
+                this.configForm.adSelectAc = ['NONE'];
+                this.configForm.adHideIfExists = '0';
+                this.configForm.adAutoExtendEnabled = '0';
+            }
+        },
         handleCustomPerson(e) {
             const defaultValue = e.target.value;
             if (defaultValue === 'NONE') {
@@ -1273,6 +1331,12 @@ export default {
         handleFloatingInterval(e) {
             this.configForm.adStepBid = Number(Number(e.target.value).toFixed(2));
         },
+        handleAdMinBidBlur(e) {
+            this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
+        },
+        handleAdMaxBidBlur(e) {
+            this.configForm.adMaxBid = Number(Number(e.target.value).toFixed(2));
+        },
         handleDirectionalList() {
             const paramsData = {
                 accountId: this.configForm.accountId
@@ -1305,6 +1369,12 @@ export default {
                 this.configForm.adRetargetingTagsInclude = '';
             }
         },
+        handleClearlist() {
+            this.configForm.updateGetingInclude = [];
+            this.configForm.adRetargetingTagsInclude = '';
+            this.configForm.adRetargetingTagsExclude = '';
+            this.configForm.updateGetingExclude = [];
+        },
         handleDirectEvent(list) {
             this.configForm.updateGetingInclude = list;
             this.configForm.adRetargetingTagsInclude = list && list.join(',');
@@ -1376,6 +1446,7 @@ export default {
         },
         handleAdCpaBidBlur(e) {
             const defaultValue = e.target.value;
+            this.configForm.adCpaBid = Number(Number(defaultValue).toFixed(2));
             if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
                 this.isAdCpaBidBlur = true;
                 this.adCpaBidBlurTxt = '出价不能大于预算';
@@ -1528,7 +1599,12 @@ export default {
             }
         },
         handleAccountMode(e) {
-            this.configForm.accountBudget = 0;
+            if (e.target.value === '1') {
+                this.configForm.accountBudget = 0;
+            }
+            else if (e.target.value === '2') {
+                this.configForm.accountBudget = 1000;
+            }
         },
         handleAdDownLoadType(e) {
             this.optimizationOption = [];
@@ -2037,6 +2113,20 @@ export default {
                 this.$message.error('请选择已有定向包');
                 return;
             }
+            if (paramsFormData.customPerson === 'a') {  
+                if (paramsFormData.adRetargetingTagsType === '1' && !paramsFormData.adRetargetingTagsInclude) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+                else if (paramsFormData.adRetargetingTagsType === '2' && !paramsFormData.adRetargetingTagsExclude) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+                else if (paramsFormData.adRetargetingTagsType === '3' && (!paramsFormData.adRetargetingTagsExclude || !paramsFormData.adRetargetingTagsInclude)) {
+                    this.$message.error('请选择人群');
+                    return;
+                }
+            }
             if (this.configForm.adScheduleType === 'SCHEDULE_START_END' && !this.configForm.launchDateRange.length) {
                 this.$message.error('请选择投放时间');
                 return;

+ 10 - 12
src/views/modules/account-config/components/directional-logic/directional-logic.vue

@@ -304,7 +304,6 @@ export default {
         // },
         defaultlist(newVal) {
             if (newVal) {
-                console.log(newVal, '----newVal--val');
                 this.tableDataAllDirect = newVal;
                 this.updateTableAllDirect = newVal;
                 this.tableDataAllExclude = newVal;
@@ -314,7 +313,6 @@ export default {
             }
         },
         packtype(newVal, oldVal) {
-            console.log(newVal, 'new--new');
             if (newVal === 'directional') {
                 this.tableSelectIds = [];
                 this.selectRightData = [];
@@ -472,16 +470,6 @@ export default {
             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') {
                 let formData = this.selectRightData;
@@ -505,12 +493,22 @@ export default {
             if (type === 'alone') {
                 this.selectRightData = [];
                 this.tableSelectIds = [];
+                this.$emit('clearlist');
             }
             else if (type === 'all') {
                 this.tableSelectDirectIds = [];
                 this.tableSelectDirectData = [];
                 this.tableSelectExcludeIds = [];
                 this.tableSelectExcludeData = [];
+                this.tableDataAllDirect = [];
+                this.tableDataAllExclude = [];
+                this.directInput = '';
+                this.excludeInput = '';
+                this.$nextTick(() => {
+                    this.tableDataAllDirect = this.updateTableAllDirect;
+                    this.tableDataAllExclude = this.updateTableAllExclude;
+                });
+                this.$emit('clearlist');
             }
         }
     }