Browse Source

修改自动投放

朱鑫波 4 năm trước cách đây
mục cha
commit
e1adaa4a91

+ 303 - 7
src/views/modules/autoLaunch/configLaunchInfo.vue

@@ -273,6 +273,23 @@
                         
                         </div>
                     </div>
+                    <div class="row-item">
+                    <div class="hint-item"></div>
+                    <div class="label-item">
+                        <div class="text-item">调起链接</div>
+                        </div>
+                        <div class="input-item">
+                            <a-form-item>
+                                <a-switch default-checked v-model="uriCheck"/>
+                                <span style="color:red"> 需加白使用</span>
+                                <div v-if="uriCheck">
+                                    <a-input placeholder="请填写链接" v-decorator="['schemaUri', { rules: [{ message:'链接不能为空'}] }]" />
+                                   
+                                </div>
+                                
+                            </a-form-item>
+                        </div>
+                    </div>
                     <div class="row-item" v-if="getFormData('campaignType') == 3">
                         <div class="hint-item"></div>
                         <div class="label-item">
@@ -633,6 +650,87 @@
                     </div>
 
 
+
+
+                    <div class="row-item" v-if="getFormData('platformOs')==1">
+                        <div class="hint-item"></div>
+                        <div class="label-item">
+                        <div class="text-item">APP行为</div>
+                        <div class="required-item"></div>
+                        </div>
+                        <div class="input-item">
+                            <a-form-item>
+                                <a-radio-group v-model="appType" @change="getAppType">
+                                    <a-radio-button value="0">不限</a-radio-button>
+                                    <a-radio-button value="1">按分类</a-radio-button>
+                                    <a-radio-button value="2">按APP名称</a-radio-button>    
+                                </a-radio-group>
+                            </a-form-item>
+                            <a-form-item v-if="appType==='1'">
+                                <a-select
+                                    mode="multiple"
+                                    style="width: 100%"
+                                    optionFilterProp="children"
+                                    showSearch
+                                    :filterOption="filterOption"
+                                    v-decorator="['appInterest', { rules: [{ required: true, message: '请选择APP行为' }] }]"
+                                >
+                                    <a-select-option v-for="item in optionsAppActive" :key="item.tagId" :value="item.tagId">{{
+                                    item.tagName
+                                    }}</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                            <a-form-item v-if="appType==='2'">
+                                <div style="position: relative" v-clickoutside="handleClose">
+                                    <a-input
+                                    placeholder="请输入搜索内容"
+                                    @change="getAppAll"
+                                    @focus="getAppAllElse"
+                                    style="width: 100%; position: relative"
+                                    v-model="appListValue"
+                                    />
+                                    <div
+                                    style="
+                                        width: 100%;
+                                        position: absolute;
+                                        z-index: 10;
+                                        height: 200px;
+                                        background: white;
+                                        overflow: auto;
+                                        box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
+                                    "
+                                    v-if="closeDialog"
+                                    >
+                                    <ul>
+                                        <li style="padding: 0 10px">
+                                        <a-checkbox
+                                            style="float: left; margin: 0 5px"
+                                            @change="onCheckAllChangeApp"
+                                            :indeterminate="indeterminateApp"
+                                            :checked="checkAllApp"
+                                        ></a-checkbox
+                                        >全选
+                                        </li>
+                                        <a-checkbox-group @change="onChangeApp" v-model="checkArr" class="home-card" style="width: 100%">
+                                        <li style="padding: 0 10px; width: 100%" v-for="item of optionsApp" :key="item.appId">
+                                            <a-checkbox :value="item.appId" style="float: left; margin: 0 5px"></a-checkbox>{{ item.appName }}
+                                        </li>
+                                        </a-checkbox-group>
+                                    </ul>
+                                    </div>
+                                    <div style="width: 100%" v-if="optionsAll.length > 0">
+                                        <a-tag v-for="item of optionsAll" :key="item" closable :afterClose="() => log(item)">
+                                            {{ showAppName(item) ? showAppName(item) : item }}
+                                        </a-tag>
+                                    </div>
+                                </div>
+                            </a-form-item>
+               
+                        
+                        </div>
+                    </div>
+
+
                     <div class="row-item">
                         <div class="hint-item"></div>
                             <div class="label-item">
@@ -1416,6 +1514,20 @@
                         </a-form-item>
                         </div>
                     </div>  
+                    <div class="row-item">
+                        <div class="hint-item"> </div>
+                        <div class="label-item">
+                        <div class="text-item">是否高质量素材复建</div>
+                        </div>
+                        <div class="input-item">
+                        <a-form-item>  
+                            <a-radio-group v-decorator="['historyTop', { initialValue: 0 }]">
+                                <a-radio-button :value="0">是</a-radio-button>
+                                <a-radio-button :value="1">否</a-radio-button>                            
+                            </a-radio-group>
+                        </a-form-item>
+                        </div>
+                    </div> 
                 </div>
              
         </div>
@@ -1640,6 +1752,8 @@ export default {
     },
     data() {
         return {
+            appType: '0',
+            uriCheck: false,
             programUnitCnt:60,
             customUnitCnt:400,
             customUnitCntMax:400,
@@ -1781,13 +1895,36 @@ export default {
                 // validator: this.validateBid,
                 }],
             },
-
+            optionsApp: [],
+            optionsAppActive: [],
+            checkArr: [],
+            closeDialog: false,
+            indeterminateApp: false,
             useDirectionalVisible:false,
+            appListValue: '',
+            checkOptions: [],
+            checkAllApp: false,
+            optionsAll: []
            
             
         }
     },
     watch: {
+        checkArr(n, o) {
+            this.optionsAll.push(...n)
+            this.optionsAll = [...new Set(this.optionsAll)]
+            if (n.length != o.length) {
+                if (n.length < o.length) {
+                var a = new Set(n)
+                var b = new Set(o)
+                var c = new Set([...b].filter((item) => !a.has(item))) // {1}
+                var d = this.optionsAll.indexOf(...c)
+                if (d > 0) {
+                    this.optionsAll.splice(d, 1)
+                }
+                }
+            }
+        },
         accountId(newValue,oldValue){
             setTimeout(()=>{
                  this.form.setFieldsValue({
@@ -1874,6 +2011,135 @@ export default {
             },
     },
     methods: {
+        getDataType(type, dataList) {
+            getAction('/kuaishou/batch/getTargetList', { tagType: type }).then((res) => {
+                if (res.success) {
+                    this[dataList] = res.result
+                }
+            })
+        },
+        clearAll() {
+            this.$nextTick(()=>{
+                this.checkArr = []
+                this.optionsAll = []
+                this.indeterminateApp = false
+                this.checkAllApp = false
+            })
+            
+        },
+        log(appId) {
+            var index = this.optionsAll.findIndex((item) => item === appId)
+            this.optionsAll.splice(index, 1)
+            if (this.optionsAll.length == 0) {
+                this.indeterminateApp = false
+                this.checkAllApp = false
+            }
+        },
+        getAppType(e) {
+            this.optionsApp = []
+            this.form.setFieldsValue({ appInterest: [] })
+            this.checkArr = []
+            if (e.target.value == '1') {
+                getAction('/kuaishou/batch/getTargetList', { tagType: 'APP_INTEREST' }).then((res) => {
+                    if (res.success) {
+                        this.optionsApp = res.result
+                    }
+                })
+            }
+        },
+        handleClose(e) {
+            this.closeDialog = false
+        },
+        showAppName(appId) {
+            if (this.checkOptions.length > 0) {
+                var data = this.checkOptions.filter((item) => {
+                    return item.appId == appId
+                })
+                if (data[0]) {
+                    return data[0].appName
+                } else {
+                    return null
+                }
+            } else {
+                return null
+            }
+        },
+        getAppAllElse(e) {
+            this.checkArr = this.optionsAll
+
+            if (this.appListValue != '') {
+                getAction('/kuaishou/batch/getAppSearch', {
+                accountId: this.accountId,
+                appName: e.target.value,
+                }).then((res) => {
+                if (res.result) {
+                    this.optionsApp = res.result
+                    this.checkOptions.push(...res.result)
+                    this.closeDialog = true
+                } else {
+                    this.optionsApp = []
+                    this.closeDialog = false
+                }
+                })
+            } else {
+                this.optionsApp = []
+                this.closeDialog = false
+            }
+        },
+        getAppAll(e) {
+            if (e.target.value !== '') {
+                getAction('/kuaishou/batch/getAppSearch', {
+                    accountId:this.accountId,
+                    appName: e.target.value,
+                }).then((res) => {
+                if (res.result) {
+                    this.optionsApp = res.result
+                    this.checkOptions.push(...res.result)
+                    this.closeDialog = true
+                } else {
+                    this.optionsApp = []
+                    this.closeDialog = false
+                }
+                })
+            } else {
+                this.optionsApp = []
+                this.closeDialog = false
+            }
+        },
+        onCheckAllChangeApp(e) {
+            Object.assign(this, {
+                checkArr: e.target.checked
+                ? this.optionsApp.map((item) => {
+                    return item.appId
+                    })
+                : [],
+                indeterminateApp: false,
+                checkAllApp: e.target.checked,
+            })
+            this.$nextTick(()=>{
+                if (this.optionsAll.length > 20) {
+                    this.$message.error('最多选择20个APP行为')
+                    this.checkArr = []
+                    this.optionsAll = []
+                    this.indeterminateApp = false
+                    this.checkAllApp = false
+                }
+            })
+           
+        },
+        onChangeApp(checkedList) {
+            this.indeterminateApp =
+                !!checkedList.length &&
+                checkedList.length <
+                this.optionsApp.map((item) => {
+                    return item.appId
+                }).length
+            this.checkAllApp =
+                checkedList.length ===
+                this.optionsApp.map((item) => {
+                    return item.appId
+                }).length
+        },
         setImageCnt(e){
             this.customUnitCntMax = e?Math.floor(2000/e):2000
         },
@@ -2382,7 +2648,7 @@ export default {
             this.form.validateFields((err, values) => {
                 //console.log(values) 
                 if (!err) {     
-                    console.log(values)              
+                    // console.log(values)              
                     this.goNextloading=true;
                     if(this.district!='NONE'){
                         values.district=this.district
@@ -2428,7 +2694,17 @@ export default {
                     values.region=JSON.stringify(this.region);
                     
                     values.convertId=this.convertId==''?undefined:this.convertId;
-
+                    values.appInterest = JSON.stringify(values.appInterest)
+                    
+                    if (this.appType == '2') {
+                        values.appIds = JSON.stringify(this.optionsAll)
+                        values.appInterest = JSON.stringify([])
+                    }else if(this.appType == '0'){
+                        values.appIds = JSON.stringify([])
+                        values.appInterest = JSON.stringify([])
+                    }else {
+                        values.appIds = JSON.stringify([])
+                    }
                     // let excludePopulation=this.excludeSelectedKeys.map(item=>{
                     //     return item.id
                     // })
@@ -2690,6 +2966,7 @@ export default {
 
         editEchoPage(){
             this.spinning=true;
+            
             if(this.editRecordId){
                 getAction('/ctop/aiKuaishouAdvertiserStrategy/queryById',{
                     id:this.editRecordId
@@ -2698,6 +2975,19 @@ export default {
                     
                     this.accountId=res.result.accountId;
                     this.description=res.result.description
+                    this.appType = res.result.appInterest ? '1' : res.result.appIds ? '2' : '0'
+                    // if(this.appType === '2') {
+                    //     postAction('/kuaishou/batch/getAppNames',{accountId:this.accountId,appIds:res.result.appIds}).then((result) => {
+                    //         if (result.success) {
+                    //             this.checkOptions = result.result.map(i=>{
+                    //                 return {
+                    //                     appId: i.id,
+                    //                     appName: i.name
+                    //                 }
+                    //             })
+                    //         }
+                    //     })
+                    // }
                     
                     //  res.result.creativeTag=res.result.creativeTag?res.result.creativeTag:[]
                     this.sysType=res.result.platformOs
@@ -2759,18 +3049,23 @@ export default {
                     this.customUnitCnt = res.result.customUnitCnt
                     this.programUnitCnt = res.result.programUnitCnt
                     this.customUnitCntMax = Math.floor(2000/res.result.imageCnt)
+                    this.uriCheck = res.result.schemaUri ? true : false
+                    this.appType = res.result.appInterest&&JSON.parse(res.result.appInterest).length>0 ? '1' : res.result.appIds&&JSON.parse(res.result.appIds).length>0 ? '2' : '0'
+                    this.checkArr = this.appType === '2' ? JSON.parse(res.result.appIds) : []
+                    this.optionsAll =  res.result.appIds ? (typeof  res.result.appIds == 'string' ? JSON.parse(res.result.appIds) : res.result.appIds) : []
+                    this.checkAllApp = false
+                    res.result.appInterest = res.result.appInterest?JSON.parse(res.result.appInterest):[]
 
                     setTimeout(()=>{                       
                         this.form.setFieldsValue({
                              ...res.result,
                             creativeTag:res.result.creativeTag?JSON.parse(res.result.creativeTag):[],
-                            
                             isOpen:res.result.isOpen?res.result.isOpen:0,
                             cpaBid:res.result.cpaBid/1000,
                             
                             deviceBrand:res.result.deviceBrand?JSON.parse(res.result.deviceBrand):[],
                             devicePrice:res.result.devicePrice?JSON.parse(res.result.devicePrice):[],
-                           
+                            useAppMarket:res.result.useAppMarket==1?true:false,
                             campaignDayBudget:res.result.campaignDayBudget?res.result.campaignDayBudget/1000:null,
                             unitDayBudget:res.result.unitDayBudget?res.result.unitDayBudget/1000:null
                            
@@ -2783,7 +3078,8 @@ export default {
                             url:res.result.url,
                             schemaUri:res.result.schemaUri,
                             appId:res.result.singleAppid?JSON.parse(res.result.appIdArray)[0]:JSON.parse(res.result.appIdArray),
-                            useAppMarket:res.result.useAppMarket==1?true:false,
+                            
+                            appInterest:res.result.appInterest
                         })
                         
                     },100)
@@ -2972,7 +3268,7 @@ export default {
     },
     mounted() {
         this.accountHttp()
-        
+        this.getDataType('APP_INTEREST', 'optionsAppActive')
         // this.$bus.$emit('remove', '/modules/BatchCreate/newGroup')
         let strategyNamepart=this.campaignTypeHandle(this.getFormData('campaignType'));
         

+ 19 - 11
src/views/modules/autoLaunch/configLaunchList.vue

@@ -403,18 +403,26 @@ export default {
             this.$router.push(`/autoLaunch/configLaunchInfo?id=${record.id}`)
         },
         deleteRecord(record){
-            this.loading=true
-            deleteAction(this.url.delete,{
-                id:record.id
-            }).then(res=>{
-                this.loading=false
-                if(res.success){
-                    this.$message.success(res.message);
-                    this.getStrategyList()
-                }else{
-                    this.$message.success(res.message);
+            let that = this
+            this.$confirm({
+                title: '删除提示',
+                content: '是否删除该账户配置信息?',
+                onOk() {
+                    that.loading=true
+                    deleteAction(that.url.delete,{
+                        id:record.id
+                    }).then(res=>{
+                        that.loading=false
+                        if(res.success){
+                            that.$message.success(res.message);
+                            that.getStrategyList()
+                        }else{
+                            that.$message.success(res.message);
+                        }
+                    })
                 }
-            })
+            });
+           
         },
         filterOption(input, option) {
             return (

+ 0 - 1
src/views/modules/kuaishouapp/account/stepForm/stepModule/targetedPopulation.vue

@@ -1223,7 +1223,6 @@ export default {
     },
     getAppAllElse(e) {
       this.checkArr = this.optionsAll
-      // this.getAppAll()
       var data = ''
       if (this.$route.path == '/creat/creatUnit') {
         data = localStorage.getItem('campaignAccountId')

+ 2 - 2
vue.config.js

@@ -69,7 +69,7 @@ module.exports = {
     proxy: {
       '/jeecg-boot': {
           // target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
-          // target: 'http://192.168.1.3:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+          target: 'http://192.168.1.3:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.188:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
@@ -86,7 +86,7 @@ module.exports = {
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目 
         // target:'http://118.24.244.213:8804',
-       target:'http://139.186.165.84:8806', //测试
+      //  target:'http://139.186.165.84:8806', //测试
 
         ws: false,