Browse Source

'改规则'

魏志佳 4 years ago
parent
commit
628373d13d

+ 176 - 119
src/views/modules/autoLaunch/setDirectional.vue

@@ -166,7 +166,7 @@
                         </div>
                         <div class="input-item">
                             <a-form-item>
-                                 <a-radio-group   v-decorator="['customCrowd', {initialValue:'0' }]"  >
+                                 <a-radio-group   v-decorator="['customCrowd', {initialValue:'0' }]"  @change="customCrowdChange">
                                     <a-radio-button value="0">不限</a-radio-button>
                                     <a-radio-button value="1">定向</a-radio-button>                           
                                     <a-radio-button value="2">排除</a-radio-button>                           
@@ -174,7 +174,7 @@
                                 </a-radio-group>
                             </a-form-item>
                             <div class="dingxiang_paichu" v-if="getFormData('customCrowd')!='0'" style="width:60%">
-                                    <a-tabs default-active-key="1" @change="retargetTabChange"  >
+                                    <a-tabs v-model="tabKey" @change="retargetTabChange"  >
                                         <a-tab-pane key="1" tab="定向池" v-if="getFormData('customCrowd')!='2'">
                                             <a-table
                                                 :columns="retargetColumns"
@@ -189,6 +189,7 @@
                                                 bordered
                                             >
                                                 <template slot="name" slot-scope="name"> {{ name }} </template>
+                                                <template slot="populationType" slot-scope="populationType"> {{ populationType | customCrowdHandler}} </template>
                                             </a-table>
                                         </a-tab-pane>
                                         <a-tab-pane key="2" tab="排除池" v-if="getFormData('customCrowd')!='1'">
@@ -205,6 +206,7 @@
                                                 bordered
                                             >
                                                 <template slot="name" slot-scope="name"> {{ name }} </template>
+                                                <template slot="populationType" slot-scope="populationType"> {{ populationType |customCrowdHandler}} </template>
                                             </a-table>
                                         </a-tab-pane>
                                        
@@ -282,7 +284,7 @@
                                 <a-radio-button value=''>不限</a-radio-button>
                                 <a-radio-button value="unifiedBudget">统一预算</a-radio-button>
                             </a-radio-group>
-                            <a-input-group compact v-if="getFormData('strategyBudget')=='unifiedBudget'">
+                            <a-input-group compact v-if="getFormData('strategyBudget')=='unifiedBudget'" style="margin-top:20px">
                                 <a-select :disabled="true" v-decorator="['budgetMode', { initialValue:'TOTAL' }]">
                                 <a-select-option value="TOTAL" >总预算</a-select-option>
                                 <!-- <a-select-option
@@ -328,15 +330,44 @@
                         </div>
                         <div class="input-item">
                         <a-form-item>
-                            <a-select size="default" default-value="a1" style="width: 200px" @change="handleChange">
-                                <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
-                                    {{ (i + 9).toString(36) + i }}
-                                </a-select-option>  
+                            <a-select size="default" v-decorator="['ocpxActionType']" style="width: 200px" @change="handleChange">
+                            
+
+                                <a-select-option :value="2">行为数</a-select-option>
+                                <a-select-option :value="180"
+                                v-if="strategyInfo.marketingGoal == '2' && groupTypeData.isActivate == '1'">激活</a-select-option>
+                                <a-select-option :value="53" v-if="
+                                    (strategyInfo.marketingGoal == '4' || strategyInfo.marketingGoal == '5') && groupTypeData.isFormSubmit == '1'
+                                ">表单提交</a-select-option>
+
+                                <a-select-option :value="394" v-if="
+                                    groupTypeData.isOrderSubmit == '1'
+                                ">订单提交</a-select-option>
+                                <a-select-option :value="348" v-if="
+                                    groupTypeData.isValidClue == '1'
+                                ">使用有效线索</a-select-option>
+                                <a-select-option :value="383" v-if="
+                                    groupTypeData.isCreditGrant == '1'
+                                ">授信出价</a-select-option>
+                                <a-select-option :value="384" v-if="
+                                    groupTypeData.isWanJian == '1'
+                                ">完件出价</a-select-option>
+                                <a-select-option :value="190" v-if="
+                                    groupTypeData.isPurchase == '1'
+                                ">付费出价</a-select-option>
+                                <a-select-option :value="191" v-if="
+                                    groupTypeData.isFirstdayRoi == '1'
+                                ">首日ROI</a-select-option>
+                                <a-select-option :value="396" v-if="
+                                    groupTypeData.isRegister == '1'
+                                ">注册优化目标</a-select-option>
                             </a-select>
+
+                           
                         </a-form-item>
                         </div>
                     </div>
-                    <div class="row-item" v-if="getFormData('bidType')==10">
+                    <div class="row-item" v-if="(getFormData('ocpxActionType') == 180 || getFormData('ocpxActionType') == 53) &&groupTypeData.deepConversionTypes.length > 0 ">
                         <div class="hint-item"></div>
                         <div class="label-item">
                         <div class="text-item">深度转化目标</div>
@@ -344,10 +375,9 @@
                         </div>
                         <div class="input-item">
                         <a-form-item>
-                            <a-select size="default" default-value="a1" style="width: 200px" @change="handleChange">
-                                <a-select-option v-for="i in 25" :key="(i + 9).toString(36) + i">
-                                    {{ (i + 9).toString(36) + i }}
-                                </a-select-option>  
+                            <a-select v-decorator="['deepConversionType']" allowClear>
+                                <a-select-option v-for="(items, index) of groupTypeData.deepConversionTypes" :key="index">
+                                {{ items.desc }}</a-select-option>
                             </a-select>
                         </a-form-item>
                         </div>
@@ -419,7 +449,7 @@
                                 >请输入点击出价,不少于0.1元,不超过10000元</span>
                         </div>    
                     </div>
-                    <div class="row-item" v-if="getFormData('bidType')==10">
+                    <div class="row-item" v-if="(getFormData('ocpxActionType') == 180 || getFormData('ocpxActionType') == 53) &&groupTypeData.deepConversionTypes.length > 0 ">
                         <div class="hint-item">
                         </div>
                         <div class="label-item">
@@ -460,7 +490,7 @@
                         <div class="input-item">
                         <a-form-item>
                             <a-radio-group v-model="adposition" @change="adpositionChange">
-                                <a-radio-button value="smartInventorys">优选广告位</a-radio-button>
+                                <a-radio-button :value='1'>优选广告位</a-radio-button>
                                 <a-radio-button value="inventoryTypes">按媒体指定位置</a-radio-button>                            
                             </a-radio-group>
                         </a-form-item>
@@ -578,7 +608,7 @@ import singleLayersSelecte from './components/singleLayerSelecte'
 import scheduleTime from '@/components/formComponents/toutiaoTime'
 import qs from 'qs'
 var str = ""
-for (let i = 0; i < 7*48; i++) {
+for (let i = 0; i < 7*24; i++) {
  str+='0'
   
 }
@@ -654,14 +684,12 @@ let retargetColumns=[
         scopedSlots: { customRender: 'name' },
     },
     {
-        title: '属性',
-        dataIndex: 'tag',
-        // filters: [
-        //     { text: '自定义', value: 'male' },
-        //     { text: '系统推荐', value: 'female' },
-        //     { text: '第三方', value: 'femal' },
-        // ],
-        width: '20%',
+    title: '属性',
+      dataIndex: 'populationType',
+      scopedSlots: {
+        customRender: 'populationType'
+      },
+      width: 200
     },
     {
         title: '所属账号',
@@ -675,15 +703,15 @@ let retargetColumns=[
 
 const plainOptions = [
     {
-      value: 'INVENTORY_VIDEO_FEED',
+      value: 6,
       label: '上下滑大屏广告'
     },
     {
-      value: 'INVENTORY_VIDEO_FEED1',
+      value: 7,
       label: '信息流广告'
     },
     {
-      value: 'INVENTORY_VIDEO_FEED2',
+      value: 3,
       label: '视频播放页广告'
     },
 ];
@@ -697,6 +725,9 @@ export default {
     },
     data() {
         return {
+            tabKey:'1',
+            adposition:1,
+            groupTypeData:null,
             convert: false,
             convertId: "",
             convertList: [],
@@ -713,7 +744,7 @@ export default {
             chargeMethods:'CPC',
             
             form: this.$form.createForm(this),
-            adposition:'smartInventorys',
+            
             unionVideoType:'REWARDED_VIDEO',
             district:'NONE',
             sceneInventory:'',
@@ -833,6 +864,10 @@ export default {
             },
         },
     methods: {
+        disabledDate(current) {
+           
+            return current && current < moment().subtract(1, 'day')
+        },
         bidTypeChange(e){
             console.log(e);
             this.chargeMethods=e.target.value==10?"OCPM":'CPC'
@@ -882,26 +917,38 @@ export default {
                 checkAll: e.target.checked,
                 });
             },
+            customCrowdChange(e){
+                console.log(e);
+                if(e.target.value=='1' || e.target.value=='2'){
+                    this.retargetTabChange();
+                    this.tabKey=e.target.value
+                }else if(e.target.vaule=='3'){
+                    this.retargetTabChange();
+                    this.tabKey='1'
+                }
+            },
+
             // 自定义人群的--同时定向排除tab切换事件
-            retargetTabChange(tabkey){
-                console.log(tabkey)
+            retargetTabChange(){
+                console.log()
                 this.retargetDataAll=[];
                 this.loading=true;
                 
-                    getAction('/ctop/audience/list',{
+                    getAction('/kuaishou/batch/getPopulationList',{
                         accountId:this.accountInfo.value
                     }).then((res)=>{
                         // console.log(res)
                         this.loading=false;
                         if(res.success){
-                            res.data.forEach((ele)=>{
-                                ele.key=item.value+'_'+ele.custom_audience_id      
-                                ele.id= ele.custom_audience_id  
-                                ele.accountName=item.title
-                                ele.accountId=item.value                   
+                            res.result.forEach((ele)=>{
+                                ele.key=this.accountInfo.value+'_'+ele.orientationId   
+                                ele.id= ele.orientationId 
+                                ele.name=ele.orientationName+"("+ele.orientationId+")"
+                                ele.accountName=this.accountInfo.title
+                                ele.accountId=this.accountInfo.value               
                             })
                             // this.retargetData=res.data;
-                            this.retargetDataAll=[...this.retargetDataAll,...res.data];
+                            this.retargetDataAll=[...this.retargetDataAll,...res.result];
                             
                         }
                     })
@@ -1037,103 +1084,47 @@ export default {
             this.form.validateFields((err, values) => {
                 if (!err) {
 
-                    console.log('Received values of form: ', values)
+                    
                     if(this.district!='NONE'){
-                    values.district=this.district
+                        values.district=this.district
                     }
                     
                     console.log(this.excludeSelectedKeys,this.incluedSelectedKeys)
                     this.goNextloading=true;
-
+                    // 设置广告位值
                     if(this.adposition!='inventoryTypes'){
                         this.checkedList=[];
+                        values.sceneId=[this.adposition]
+                    }else{
+                        values.sceneId=this.checkedList
                     }
-
-                    if(this.projectInfo.length>0&&this.projectInfo[0].deliveryRange=='UNION'){
-                    this.checkedList=[];
-                    this.checkedList.push(900000000)
-                    }
-
+                    // 时间段值
                     if(this.getFormData('scheduleTime')!=''){
-                        values.weekTime=this.scheduleTimeData
+                        values.scheduleTime=this.scheduleTimeData
                     }else{
-                        values.weekTime=''
+                        values.scheduleTime=''
                     }
+                    // 投放时间的值
                     if(this.getFormData('scheduleType')=='SCHEDULE_FROM_NOW'){
-                    values.startTime=this.dateRange[0].format('YYYY-MM-DD');
-                    values.endTime= this.dateRange[1].add(10,"years").format('YYYY-MM-DD');
+                        values.beginTime=this.dateRange[0].format('YYYY-MM-DD');
+                        values.endTime= this.dateRange[1].add(10,"years").format('YYYY-MM-DD');
                     
                     }else{
-                        values.startTime=this.dateRange[0].format('YYYY-MM-DD');
+                        values.beginTime=this.dateRange[0].format('YYYY-MM-DD');
                         values.endTime= this.dateRange[1].format('YYYY-MM-DD');
                     }
-                    
 
-                    let params=[];
-                
+                    values.agesRange=this.agesRange
+                    values.region=this.region
 
-                params=this.projectInfo.map((item,index)=>{
-                    item.retargetingTagsExclude=[];
-                    item.retargetingTagsInclude=[];
-                    this.excludeSelectedKeys.forEach(ele=>{
-                        if(ele.accountId==item.accountId){
-                            item.retargetingTagsExclude.push(ele.id)
-                        }
-                    })
-                    this.incluedSelectedKeys.forEach(ele=>{
-                        if(ele.accountId==item.accountId){
-                            item.retargetingTagsInclude.push(ele.id)
-                        }
-                    })
-                    let city=this.city.map(item=>{
-                        return item*1
-                    })
-                    return {
-                        ...item,
-                        unionVideoType:this.unionVideoType,
-                        inventoryType:this.checkedList,
-                        audience:{
-                            agesRange:this.agesRange,
-                            city,
-                            ...values,
-                            retargetingTagsExclude:item.retargetingTagsExclude,
-                            retargetingTagsInclude:item.retargetingTagsInclude,
-                            autoExtendEnabled:this.autoExtendEnabled,
-                            autoExtendTargets:this.autoExtendTargets,
-                            inventoryType:this.checkedList,
-                            district:this.district=='NONE'?'':this.district,
-                            
-                        }
-
-                    }
-                })
-                console.log(params)
-                postAction('/adlab/Project/setAudience', params).then((res) => {
-                    console.log(res)
-                    if (res.success) {
-                    this.goNextloading=false;
                     
-                        if(res.result){
-                            this.errorInfo=res.result;
-                            this.visible=true;
-
-                            let projectInfo=[]
-                            res.result.forEach(item=>{
-                                if(item.code==0){
-                                projectInfo.push(item)
-                                }
-                            })
+                    console.log('Received values of form: ', values)
+                    let params=[];
+                
 
-                            sessionStorage.setItem('projectInfo',JSON.stringify(projectInfo))
-                        }
-                    
-                    } else {
-                    this.goNextloading=false;
-                    this.$message.error('网络开小差了,等会再试试')
-                    }
-                })
+                
                 }else{
-                this.$message.error('请正确填写必填项目')
+                    this.$message.error('请正确填写必填项目')
                 }
             })
             
@@ -1158,12 +1149,12 @@ export default {
         },
 
         getPlatForm(appId) {
-            if (appId) {
-                var data = this.appList.filter(item => {
-                    return item.appId == appId
-                })
-                return data[0].platform
-            }
+            // if (appId) {
+            //     var data = this.appList.filter(item => {
+            //         return item.appId == appId
+            //     })
+            //     return data[0].platform
+            // }
         },
 
         convertChange() {
@@ -1213,7 +1204,13 @@ export default {
             this.strategyInfo=this.$parent.strategyInfo
             console.log(this.$parent.strategyInfo)
             this.getAppList()
-            
+            getAction('/kuaishou/batch/getIsActivate', {
+                accountId: this.accountInfo.value
+            }).then(res => {
+                if (res.success) {
+                this.groupTypeData = res.result
+                }
+            })
     },
     filters: {
       getDate(value) {
@@ -1233,6 +1230,66 @@ export default {
           4: 'iOS网页游戏'
         }
         return data[str]
+      },
+        customCrowdHandler(val){
+            let str=''
+            switch (val) {
+                case '1':
+                    str='上传人群'
+                    break;
+                case '2':
+                    str='广告人群'
+                    break;
+                case '3':
+                    str='主题专区'
+                    break;
+                case '4':
+                    str='逻辑规则'
+                    break;
+                case '5':
+                    str='人群扩展'
+                    break;
+                case '6':
+                    str='平台定制'
+                    break;
+                case '7':
+                    str='定制付费'
+                    break;
+                case '8':
+                    str='网红粉丝类别'
+                    break;
+                case '9':
+                    str='内容付费行为'
+                    break;
+                case '10':
+                    str='移动应用安装'
+                    break;
+                case '11':
+                    str='快手使用活跃度'
+                    break;
+                case '12':
+                    str='行业分类'
+                    break;
+                case '13':
+                    str='商业兴趣'
+                    break;
+                case '14':
+                    str='固化标签'
+                    break;
+                case '15':
+                    str='行业偏好'
+                    break;
+                case '16':
+                    str='第三方标签'
+                    break;
+                case '17':
+                    str='产品关键词'
+                    break;
+            
+                default:
+                    break;
+            }
+            return str
       }
     },
 }

+ 3 - 3
src/views/modules/earlyWarningRules/configRules.vue

@@ -22,10 +22,10 @@
                         <div class="input-item"> 
                              <a-form-model-item ref="eventRuleLevel"  prop="eventRuleLevel">
                                 <a-radio-group v-model="form.mediaType" :disabled="form.templateId!=null" @change="mediaTypeChange">
-                                    <a-radio-button :value="1" >头条</a-radio-button>
+                                    <a-radio-button :value="3" >头条</a-radio-button>
                                     <a-radio-button :value="2">快手</a-radio-button>
-                                    <a-radio-button :value="3">头条内广</a-radio-button>
-                                    <a-radio-button :value="4">快手内广</a-radio-button>
+                                    <!-- <a-radio-button :value="3">头条内广</a-radio-button>
+                                    <a-radio-button :value="4">快手内广</a-radio-button> -->
                                    
                                 </a-radio-group>
                             </a-form-model-item>

+ 76 - 28
src/views/modules/earlyWarningRules/useRuleList.vue

@@ -48,6 +48,11 @@
           <span slot="mediaType" slot-scope="text">
             {{ text | handleMediaType }}
           </span>
+          <span slot="accountStatus" slot-scope="text">
+              <span class="bohui" v-if="text==1"></span>
+              <span class="shenhe" v-if="text==0"></span>
+              {{text?'暂停':'投放中'}}
+          </span>
           <span slot="processMethod" slot-scope="text">
             {{ text == 'SEND' ? '仅发送通知' : '发送并关停组' }}
           </span>
@@ -84,7 +89,7 @@
 <script>
 import moment from 'moment'
 import Treeselect from './pushTreeSelect.vue'
-import { getAction, postAction, downFile, downFilePost, deleteAction } from '@/api/manage'
+import { getAction, postAction, downFile, downFilePost, deleteAction , putAction } from '@/api/manage'
 let existColumns = [
   // {
   //     title: '运行/暂停',
@@ -129,6 +134,15 @@ let existColumns = [
 ]
 
 let recordsColumns = [
+
+    {
+      title: '运行/暂停',
+      dataIndex: 'status',
+      align: 'center',
+      width:100,
+      key: 'status',
+      scopedSlots: { customRender: 'status' }
+  },
   {
     title: '模板名称',
     dataIndex: 'templateName',
@@ -160,6 +174,13 @@ let recordsColumns = [
     scopedSlots: { customRender: 'accountId' },
   },
   {
+    title: '账户状态',
+    dataIndex: 'accountStatus',
+    align: 'center',
+    key: 'accountStatus',
+    scopedSlots: { customRender: 'accountStatus' },
+  },
+  {
     title: '运营',
     dataIndex: 'userName',
     align: 'center',
@@ -350,34 +371,41 @@ export default {
     },
     switchChange(text, record) {
       console.log(text, record)
-      record.spin = true
-      let eventRuleStatus = '1'
-      if (text) {
-        eventRuleStatus = '0'
-      } else {
-        eventRuleStatus = '1'
-      }
+      if(record.accountStatus==0 || record.accountStatus==1&&text){
+        record.spin = true
+        let templateStatus = 0
+        if (text) {
+          templateStatus = 1
+        } else {
+          templateStatus = 0
+        }
 
-      postAction('/alarm/alarmEventRule/edit', {
-        eventRuleId: record.eventRuleId,
-        eventRuleStatus,
-      }).then((res) => {
-        console.log(res)
-        record.spin = false
-        if (res.success) {
-          // this.getTableListHttp()
-          if (text) {
-            record.status = false
-            eventRuleStatus = '0'
+        putAction('/ruleAccountTemplate/edit', {
+          id: record.id,
+          templateStatus,
+        }).then((res) => {
+          console.log(res)
+          record.spin = false
+          if (res.success) {
+            // this.getTableListHttp()
+            if (text) {
+              record.status = false
+              templateStatus = 1
+              this.$message.success('修改成功')
+            } else {
+              record.status = true
+              templateStatus = 0
+              this.$message.success('修改成功')
+            }
           } else {
-            record.status = true
-            eventRuleStatus = '1'
+            this.$message.error('修改失败')
+            // this.getTableListHttp()
           }
-        } else {
-          this.$message.error('修改失败')
-          // this.getTableListHttp()
-        }
-      })
+        })
+      }else{        
+          this.$message.error('当前账户已关停,预警规则不支持开启!')
+      }
+      
     },
 
     getTableListHttp(url) {
@@ -395,7 +423,7 @@ export default {
             this.data = res.result.records.map((item) => {
               return {
                 ...item,
-                status: item.eventRuleStatus == '1' ? true : false,
+                status: item.templateStatus == 0 ? true : false,
                 spin: false,
               }
             })
@@ -403,7 +431,7 @@ export default {
             this.data = res.result.list.map((item) => {
               return {
                 ...item,
-                status: item.eventRuleStatus == '1' ? true : false,
+                status: item.templateStatus == 0 ? true : false,
                 spin: false,
               }
             })
@@ -473,6 +501,26 @@ export default {
     .opts {
       margin-bottom: 15px;
     }
+
+    .shenhe{
+      width: 6px;
+      height: 6px;
+      display: inline-block;
+      background: #52C41A;
+      border-radius: 50%;
+      position: relative;
+      top: -2px;
+    }
+    .bohui{
+      width: 6px;
+      height: 6px;
+      display: inline-block;
+      background: #F5222D;
+      border-radius: 50%;
+      position: relative;
+      top: -2px;
+    }
   }
+
 }
 </style>

+ 2 - 2
vue.config.js

@@ -68,7 +68,7 @@ module.exports = {
     open : true,
     proxy: {
       '/jeecg-boot': {
-        //  target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+         target: 'http://192.168.1.8: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后台项目  祚云
@@ -77,7 +77,7 @@ module.exports = {
         // target: 'http://192.168.1.43:8888', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目