浏览代码

'改配置页面请求'

魏志佳 4 年之前
父节点
当前提交
ee26aff358

+ 1 - 0
src/views/modules/BatchCreate/linkMultiSelect.vue

@@ -607,6 +607,7 @@
       border: 1px solid #ccc;
       border-radius: 5px;
       overflow-x: auto;
+      overflow-y: hidden;
     }
 
     .rightBox {

+ 32 - 1
src/views/modules/Statistics/components/Treeselect.vue

@@ -188,7 +188,38 @@ export default {
             })
           }
         })
-      } else {
+      } else if(this.reqUrl == '/ctop/projectMember/getProjectAccountByUserId'){
+          getAction(this.reqUrl, {
+            mediaType: this.request,
+          }).then((res) => {
+            if (res.code == 0) {
+              if (res.result.length > 0) {
+                res.result.forEach((element,index) => {
+                  if(element){                  
+                      this.options.push({});                    
+                      this.options[index].label=element.project.projectName +'_('+ element.project.advertiserName +')';
+                      this.options[index].id='project'+element.project.projectId;
+                      this.options[index].key=element.project.projectId;
+                      this.options[index].mediaId=element.project.mediaId;
+                      this.options[index].children=[];
+                                          
+                      if(element.account.length){
+                        element.account.forEach((ele,i)=>{
+                            this.options[index].children.push({});
+                            this.options[index].children[i].label=ele.userName+'_'+ele.authName+'_'+element.project.projectName;
+                            this.options[index].children[i].id=ele.accountId;
+                            this.options[index].children[i].key=ele.accountId;
+                        })
+                          
+                      }                           
+                  }      
+                });
+              } else {
+                this.showLoading = '暂无数据'
+              }
+            }
+          })
+      }else {
         getAction(this.reqUrl, {
           userId: this.userInfo().id,
         }).then((res) => {

+ 0 - 0
src/views/modules/autoLaunch/autoLaunchList.vue


+ 338 - 0
src/views/modules/autoLaunch/components/MultiCheckBox.vue

@@ -0,0 +1,338 @@
+<template>
+  <div class="multiCheckbox">
+    <div class="linkMulti_list" >
+      <div class="title">{{title}}</div>
+      <ul class="linkMulti_list_one">
+        <li class="checkAll" ref="checkAllBox">
+          <a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange" :data-layers="curLayerNum"   >全选</a-checkbox>
+        </li>
+        <li @click.stop="listItemClick($event,item)" v-for="(item,index) in listArr" :key="index"
+          :data-layers="curLayerNum" ref="checkList">
+          <a-checkbox @change="onChange($event,item,index)" :value="item.code" :checked="item.checked"
+            @click.stop="listItemClick($event,item)" :indeterminate="item.indeterminates" >{{item.name}}</a-checkbox>
+          <!-- <span>{{item.name}}</span>                        -->
+          <span class="more" v-show="item.hasChild">
+            <a-icon type="right" />
+          </span>
+        </li>
+      </ul>
+    </div>
+    <!-- <MultiCheckBox class="childClass"  :title='currentItem.name'  :listArr='currentItem.children'  v-if="currentItem" :curLayerNum='currentLayerNum'  />      -->
+  </div>
+</template>
+
+<script>
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
+  export default {
+    name: 'MultiCheckBox',
+    props: {
+      title: {
+        type: String
+      },
+      listArr: {
+        type: Array,
+        default () {
+          return []
+        }
+      },
+      curLayerNum: {
+        type: Number,
+        default () {
+          return 1
+        }
+      },
+      parentChecked: {
+        type: Boolean,
+        default () {
+          return false
+        }
+      },
+      indeterminates:{
+          type:Boolean,
+          default(){
+              return false
+          }
+      }
+    },
+    data() {
+      return {
+        checkedList: [],
+        indeterminate: false,
+        checkAll: false,
+        plainOptions: [],
+        layersNum: 0, //控制层级
+        currentLayerNum: 0, //当前层级是多少层,
+        currentItem: null,
+        labelList:[],//选中的文字的样式
+      }
+    },
+    watch: {
+      checkedList: function (n, o) {
+      // this.labelList=[];
+      //   this.checkedList.forEach((item)=>{
+      //     this.listArr.forEach((ele,index)=>{
+      //       if(ele.code==item){
+      //         this.labelList.push(ele.name)
+      //       }
+      //     })
+      //  }) 
+     },
+      listArr:{
+          handler(n, o) {
+              this.plainOptions=[];
+              this.checkedList=[];
+            //   console.log(n,o,'------')
+              this.listArr.forEach(element => {
+                this.plainOptions.push(element.value)
+                if(element.checked){
+                    let num = this.checkedList.indexOf(element.value)
+                    if (num == -1) {
+                        this.checkedList.push(element.value);
+                        this.labelList.push(element.name);
+                        // console.log(this.checkedList,'--',this.curLayerNum)
+                    }                
+                }else{
+                    let num = this.checkedList.indexOf(element.value)
+                    if (num > -1) {
+                        this.checkedList.splice(num, 1)
+
+                    }
+                    let n=this.labelList.indexOf(element.name)
+                    if (n > -1) {
+                        this.labelList.splice(n, 1)
+                    }
+                }
+            });
+           
+            // console.log(this.checkedList.length,this.plainOptions.length)
+            // console.log(this.checkedList,this.plainOptions.length)
+
+            this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length
+            this.checkAll = this.checkedList.length === this.plainOptions.length && this.plainOptions.length!=0
+
+            this.$emit('getCheckedList',{
+              curLayerNum:this.curLayerNum,
+              checkList:this.checkedList,
+              currentList:this.curLayerNum>1? this.listArr : []
+            })
+          },
+            deep: true
+      },
+
+      parentChecked: {
+        handler(n, o) {
+        //   console.log(n, o, '--parentChecked', this.curLayerNum,this.checkedList,this.plainOptions)
+          if (n) {
+            this.checkAll = true
+            this.checkedList=[];
+            this.listArr.forEach((item, index) => {
+                item.checked = n
+                let num = this.checkedList.indexOf(item.value)
+                if (num == -1) {
+                    this.checkedList.push(item.value);
+                }
+             
+
+            })
+          } else if (n == false) {
+            this.checkAll = false
+            // this.listArr.forEach((item, index) => {
+            //   item.checked = n
+            // })
+            this.checkedList = []
+          }
+        },
+        
+        deep: true,
+        immediate: true
+      }
+    },
+    methods: {
+       onChange(e, item, index) {
+        // console.log(e.target,item)
+
+        if (e.target.checked) {
+          // item.checked=true;
+          this.listArr.forEach((ele, i) => {
+            if (index == i) {
+              this.$set(ele, 'checked', e.target.checked)
+              this.$set(ele, 'indeterminates',false)
+              this.checkedList.push(e.target.value)
+            }
+          })
+        } else {
+          this.listArr.forEach((ele, i) => {
+            if (index == i) {
+              this.$set(ele, 'checked', e.target.checked)
+              
+            }
+          })
+
+          let num = this.checkedList.indexOf(e.target.value)
+          if (num > -1) {
+            this.checkedList.splice(num, 1)
+          }
+        }
+        this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length
+        this.checkAll = this.checkedList.length === this.plainOptions.length
+        // this.listItemClick(e,item);
+      },
+      onCheckAllChange(e) {
+              
+        console.log(event)
+        Object.assign(this, {
+          checkedList: e.target.checked ? this.plainOptions : [],
+          indeterminate: false,
+          checkAll: e.target.checked
+        })
+        console.log(this.checkedList)
+        if (this.checkedList.length) {
+          this.listArr.forEach(item => {
+            this.$set(item, 'checked', true)
+            this.$set(item, 'indeterminates', false)
+          })
+        } else {
+          this.listArr.forEach(item => {
+            this.$set(item, 'checked', false)
+            this.$set(item, 'indeterminate', false)
+          })
+        }
+      
+
+        this.listItemClick(event,{
+            name:'全选',
+            value:'all',
+            checked:e.target.checked,
+            indeterminates:false,
+            parentCode:this.listArr[0].parentCode
+        })
+      },
+      
+      listItemClick(event, item) {
+        // console.log(item)
+        
+        this.$emit('getItemData', {
+          clickObj: event.target,
+          data: item,
+          curLayerNum:this.curLayerNum,
+          checkList:this.checkedList,
+          plainOptions:this.plainOptions,
+          
+        })
+      },
+     
+    },
+    mounted() {
+      this.currentLayerNum = this.curLayerNum
+
+      this.listArr.forEach(element => {
+        this.plainOptions.push(element.value)
+        // console.log(this.plainOptions)
+      })
+ 
+    
+       console.log('zhixingle yici')
+      if (this.$refs.checkList) {
+        let refsCheckListArr = Array.from(this.$refs.checkList)
+        refsCheckListArr.forEach((item, index) => {
+          let nodeArr = Array.from(item.children[0].children)
+          // console.log(nodeArr)
+          nodeArr.forEach((ele, i) => {
+            if (i == 0) {
+              let nodeArr2 = Array.from(ele.children)
+            //   console.log(nodeArr2)
+              nodeArr2.forEach(element => {
+                element.dataset['layers'] = this.curLayerNum
+              })
+            } else {
+              ele.dataset['layers'] = this.curLayerNum
+            }
+          })
+        })
+      }
+
+      if(this.$refs.checkAllBox){
+        //   console.log(this.$refs.checkAllBox)
+          let refsCheckAllArr = Array.from(this.$refs.checkAllBox)
+            refsCheckAllArr.forEach((item, index) => {
+          let nodeArr = Array.from(item.children[0].children)
+          // console.log(nodeArr)
+          nodeArr.forEach((ele, i) => {
+            if (i == 0) {
+              let nodeArr2 = Array.from(ele.children)
+            //   console.log(nodeArr2)
+              nodeArr2.forEach(element => {
+                element.dataset['layers'] = this.curLayerNum
+              })
+            } else {
+              ele.dataset['layers'] = this.curLayerNum
+            }
+          })
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .multiCheckbox {
+    width: 100%;
+    height: 300px;
+
+    ul,
+    li {
+      margin: 0;
+      padding: 0;
+      list-style: none;
+    }
+
+    .linkMulti_list {
+      // padding: 5px 0px;
+      display: inline-block;
+      width: 100%;
+      height: 100%;
+      box-sizing: border-box;
+      overflow: hidden;
+
+      .title {
+        height: 36px;
+        line-height: 36px;
+        font-size: 14px;
+        font-weight: 600;
+        border-radius: 5px 5px 0 0;
+        background-color: rgb(248, 249, 250);
+        padding: 0 15px;
+        border-bottom: 1px solid #ccc;
+        box-sizing: border-box;
+      }
+
+      ul {
+        height: 264px;
+        overflow: auto;
+      }
+
+
+      li {
+        height: 30px;
+        line-height: 30px;
+        cursor: pointer;
+        padding: 0 15px;
+        position: relative;
+
+        .more {
+          position: absolute;
+          top: 2px;
+          right: 10px;
+        }
+      }
+
+      li:hover {
+        background-color: rgb(240, 240, 240);
+      }
+    }
+
+    .ant-checkbox-group {
+      width: 100%;
+    }
+  }
+</style>

+ 687 - 0
src/views/modules/autoLaunch/components/linkMultiSelect.vue

@@ -0,0 +1,687 @@
+<template>
+  <div class="linkMultiSel">
+    <div class="leftBox">
+      <div class="bigBOX" ref="mycheckBox">
+        <div class="big_item">
+          <MultiCheckBox :title="title1" :listArr="listArr1" :curLayerNum="1" :parentChecked="false"
+            @getItemData="getItemData" @getCheckedList='getCheckedList' />
+        </div>
+        <div class="big_item">
+          <MultiCheckBox :title="title2" :listArr="listArr2" :curLayerNum="2"  :parentChecked="parentChecked1"
+            @getItemData="getItemData"  @getCheckedList='getCheckedList' v-if="listArr2.length>0" />
+        </div>
+        <div class="big_item">
+          <MultiCheckBox :title="title3" :listArr="listArr3" :curLayerNum="3"  :parentChecked="parentChecked2"
+            @getItemData="getItemData"  @getCheckedList='getCheckedList' v-if="listArr3.length>0" />
+        </div>
+        <div class="big_item">
+          <MultiCheckBox :title="title4" :listArr="listArr4" :curLayerNum="4"  :parentChecked="parentChecked3"
+            @getItemData="getItemData"  @getCheckedList='getCheckedList' v-if="listArr4.length>0" />
+        </div>
+      </div>
+    </div>
+
+    <div class="rightBox">
+      <div class="title">已选<a-button class="clearAllBtn" type="link" @click="clearAll">清空</a-button></div>
+      <div class="linkMulti_list">
+          <div class="selectBox1">
+            <span class="selectListitem" v-for="(item,index) in checkedShowList" :key='index'>{{item.name}}<a-icon type="close" id="close" @click="deleteItem(item)" /></span>
+          </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import MultiCheckBox from './MultiCheckBox'
+  import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
+  export default {
+    props: ['title', 'listArr','listUrl','maxLayers'],
+    components: {
+      MultiCheckBox
+    },
+    data() {
+      return {
+        listArr1:[],
+        title1:'',
+        title2: '',
+        listArr2: [],
+        title3: '',
+        listArr3: [],
+        title4: '',
+        listArr4: [],
+        clickKey: 0,
+        parentChecked1: false,
+        parentChecked2: false,
+        parentChecked3: false,
+
+       
+
+        currentData: null,
+        layersNum: 0,
+        checkedShowList:[],
+      }
+    },
+    watch: {},
+    methods: {
+      getItemData(val) {
+        this.$nextTick(() => {
+          // this.clickKey = val.clickObj.dataset.layers
+          // let index = parseInt(val.clickObj.dataset.layers) || val.curLayerNum
+          let index = val.curLayerNum
+          this.currentData = val.data
+          
+          let childrensArr = Array.from(this.$refs.mycheckBox.children)
+          setTimeout(() => {
+            // console.log(val, index)
+            // console.log(val.data.checked)
+            if (index == 1 || this.clickKey == 1) {
+                this.$refs.mycheckBox.style.width = '100%'
+                if(val.data.hasChild){
+                    getAction(this.listUrl,{
+                        parentCode:val.data.code,
+                        level:this.maxLayers
+                    }).then((res)=>{
+                        // console.log(res);
+                        if(res.success){
+                            if(res.data.length>0){
+                                res.data.forEach((item,index)=>{
+                                    
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                })
+                                // console.log(this.checkedShowList)
+                                this.checkedShowList.forEach((ele)=>{
+                                  res.data.forEach((item)=>{
+                                      if(ele.code==item.code){
+                                            item.checked=true;
+                                            return
+                                        }
+                                  })        
+                                })
+                                this.listArr3 = []
+                                this.title3 = ''
+                                this.listArr4 = []
+                                this.title4 = ''
+
+                                //处理样式
+                                this.styleHandle(childrensArr, index)
+                                this.parentChecked1 = val.data.checked
+                                this.parentChecked2 = val.data.checked
+                                this.parentChecked3 = val.data.checked
+                                this.listArr2=res.data
+                                this.title2 = val.data.name
+                            }                    
+                        };
+                        
+                    })  
+                }else{
+                    this.listArr3 = []
+                    this.title3 = ''
+                    this.listArr4 = []
+                    this.title4 = ''
+                    this.listArr2 = []
+                    this.title2 = ''
+                    this.resetStyle(childrensArr, index)
+                }  
+                
+                //  this.checkedShowList=val.checkList     
+            } else if (index == 2 || this.clickKey == 2) {
+                if(val.data.hasChild){
+                    getAction(this.listUrl,{
+                        parentCode:val.data.code,
+                        level:this.maxLayers
+                    }).then((res)=>{
+                        // console.log(res);
+                        if(res.success){
+                            if(res.data.length>0){
+                                res.data.forEach((item,index)=>{
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                
+                                })
+                                this.checkedShowList.forEach((ele)=>{
+                                  res.data.forEach((item)=>{
+                                      if(ele.code==item.code){
+                                            item.checked=true;
+                                        }
+                                  })
+                                        
+                                })
+                                this.listArr4 = []
+                                this.title4 = ''
+                                
+                                this.$refs.mycheckBox.style.width = '150%'
+                                this.styleHandle(childrensArr, index)
+                                this.parentChecked2 = val.data.checked
+                                this.parentChecked3 = val.data.checked
+                                this.listArr3=res.data
+                                this.title3 = val.data.name
+                            }                    
+                        };
+                        
+                    })
+                }else{
+                    this.listArr4 = []
+                    this.title4 = ''
+                    this.listArr3 = []
+                    this.title3 = ''
+                    this.$refs.mycheckBox.style.width = '100%'
+                    this.resetStyle(childrensArr, index)
+                }  
+                 
+              
+                let ind=-1
+                this.listArr1.forEach((ele,i)=>{                       
+                    if(ele.code==val.data.parentCode){
+                        ind=i
+                        // console.log(ind)
+                    }                        
+                }) 
+                if(ind>-1){
+                    this.listArr1[ind].indeterminates = !!val.checkList.length && val.checkList.length <val.plainOptions.length
+                    this.listArr1[ind].checked = val.checkList.length === val.plainOptions.length && val.plainOptions.length!=0
+                }
+                
+            } else if (index == 3 || this.clickKey == 3) {
+
+                if(val.data.hasChild){
+                    getAction(this.listUrl,{
+                        parentCode:val.data.code,
+                        level:this.maxLayers
+                    }).then((res)=>{
+                        // console.log(res);
+                        if(res.success){
+                            if(res.data.length>0){
+                                res.data.forEach((item,index)=>{
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                
+                                })
+                                this.checkedShowList.forEach((ele)=>{
+                                  res.data.forEach((item)=>{
+                                      if(ele.code==item.code){
+                                            item.checked=true;
+                                        }
+                                  })
+                                        
+                                })
+                                this.listArr4 = res.data
+                                this.title4 = val.data.name
+                                this.$refs.mycheckBox.style.width = '200%'
+                                this.styleHandle(childrensArr, index)
+                                this.parentChecked3 = val.data.checked
+                                
+                            }                    
+                        };
+                        
+                    })
+                }else{
+                    this.$refs.mycheckBox.style.width = '150%'
+                    this.resetStyle(childrensArr, index)
+                }  
+
+                let ind=-1;
+                if(this.listArr2){
+                    // console.log(this.listArr2)                                      
+                    this.listArr2.forEach((ele,i)=>{                       
+                      if(ele.code==val.data.parentCode){
+                          ind=i
+                          // console.log(ind)
+                      }                                           
+                    })      
+                    if(ind>-1){
+                        this.listArr2[ind].indeterminates = !!val.checkList.length && val.checkList.length <val.plainOptions.length
+                        this.listArr2[ind].checked = val.checkList.length === val.plainOptions.length && val.plainOptions.length!=0
+                    }           
+                }
+                     let z=-1          
+                    this.listArr1.forEach((element,num)=>{                        
+                      if(element.code==this.listArr2[ind].parentCode){
+                          z=num
+                          // console.log(ind)
+                      }
+                        
+                    })      
+                    let checklist=this.listArr2.filter((item,index)=>{
+                        return  item.checked || item.indeterminates
+                    })    
+                    // console.log(checklist)
+                    if(z>-1){
+                            this.listArr1[z].indeterminates = !!checklist.length && checklist.length < this.listArr2.length
+                            this.listArr1[z].checked = checklist.length === this.listArr2.length && this.listArr2.length!=0
+                    }
+            }else if (index == 4 || this.clickKey == 4){
+                if(this.listArr3){
+                    // console.log(this.listArr3)
+                    let ind=-1
+                    this.listArr3.forEach((ele,i)=>{
+                        
+                        if(item.code==val.data.parentCode){
+                            ind=i
+                            // console.log(ind)
+                        }
+                                            
+                    })   
+                    if(ind>-1){
+                        this.listArr3[ind].indeterminates = !!val.checkList.length && val.checkList.length <val.plainOptions.length
+                        this.listArr3[ind].checked = val.checkList.length === val.plainOptions.length && val.plainOptions.length!=0
+                    }              
+                    
+                }
+                if(this.listArr2){
+                    // console.log(this.listArr2)
+                    let ind=-1
+                    this.listArr3.forEach((ele,i)=>{
+                        
+                        if(item.code==val.data.parentCode){
+                            ind=i
+                            // console.log(ind)
+                        }
+                                            
+                    })   
+                    this.listArr2.forEach((element,num)=>{
+                        if(item.code==this.listArr3[ind].parentCode){
+                            ind=num
+                            // console.log(ind)
+                        }                        
+                    })    
+                    if(ind>-1){
+                  
+                        let checklist3=this.listArr3.filter((item,index)=>{
+                            return  item.checked || item.indeterminates
+                        })    
+                        // console.log(checklist)
+                   
+                        this.listArr2[ind].indeterminates = !!checklist3.length && checklist3.length < this.listArr3.length
+                        this.listArr2[ind].checked = checklist3.length === this.listArr3.length && this.listArr3.length!=0
+                        let z=-1;
+                        this.listArr1.forEach((element,num)=>{
+                            
+                            if(item.code==this.listArr2[ind].parentCode){
+                                z=num
+                                // console.log(z)
+                            }
+                            
+                        })      
+                        let checklist2=this.listArr1.filter((item,index)=>{
+                            return  item.checked || item.indeterminates
+                        })  
+                        if(z>-1){
+                            this.listArr1[z].indeterminates = !!checklist2.length && checklist2.length < this.listArr2.length
+                            this.listArr1[z].checked = checklist2.length === this.listArr2.length && this.listArr2.length!=0
+                        }
+                        
+                    }              
+              } 
+             
+            }
+          }, 100)
+          this.$emit('getSelectedArr',val.checkList)
+
+        })
+      },
+      styleHandle(arr, i) {
+        arr.forEach((item, index) => {
+          if (index <= i) {
+            item.style.width = `${100 / (i + 1)}%`
+            item.style.borderRight = '1px solid #ccc'
+          }
+        })
+      },
+      resetStyle(arr, i) {
+        arr.forEach((item, index) => {
+          if (index < i) {
+            item.style.width = `${100 / i}%`
+            item.style.borderRight = '1px solid #ccc'
+          }
+          if (index == i - 1) {
+            item.style.borderRight = 'none'
+          }
+        })
+      },
+      
+      
+      deleteItem(item){
+          // console.log(item);
+          let val='';
+          this.checkedShowList.forEach((ele,index)=>{
+              if(ele.code==item.code){
+                  val=ele.value
+              }
+          })
+          
+          this.checkedShowList=this.checkedShowList.filter((element,index) => {
+              return element.code!=val;
+          });
+          if(item.level==1){
+              this.listArr1.forEach((ele)=>{
+                  if(ele.code==val){
+                     ele.checked=false
+                  }
+              })  
+          }
+          if(item.level==2){
+              // console.log('------------------------------------');
+              let childList=this.checkedShowList.filter((element,index) => {
+                  return element.parentCode==item.parentCode;
+              });
+              let data=[]
+              let checkList=[];
+              let plainOptions=[]
+              this.listArr1.forEach((ele)=>{
+                  if(ele.code==item.parentCode){
+                      data=ele;
+                  }
+                  if(ele.checked){
+                    checkList.push(ele.code)
+                  }
+                  plainOptions.push(ele.code)
+              })
+              if(childList.length==0){
+                  data.indeterminates=false
+              }
+              
+              
+              this.getItemData({
+                clickObj:{},
+                data: data,
+                curLayerNum:1,
+                checkList,
+                plainOptions,
+              })
+              
+
+          }
+          if(item.level==3){
+
+          }
+      },
+
+      clearAll(){
+          this.listArr1.forEach((item)=>{
+              item.checked=false;
+              item.indeterminates=false;
+          })
+          this.listArr2.forEach((item)=>{
+              item.checked=false;
+              item.indeterminates=false;
+          })
+          this.listArr3.forEach((item)=>{
+              item.checked=false
+              item.indeterminates=false
+          })
+          this.listArr4.forEach((item)=>{
+              item.checked=false
+              item.indeterminates=false
+          })
+          this.checkedShowList=[]
+      },
+
+      getCheckedList(val){
+        // console.log(val);
+        if(val.curLayerNum==1){
+          if(val.checkList.length>0){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.level!=1
+            })
+            // console.log(this.checkedShowList)
+            if(val.checkList.length==this.listArr1.length){
+                this.checkedShowList=[];
+                val.checkList.forEach((ele)=>{
+                  var result = this.checkedShowList.some(item => {
+                    if(item.code == ele){
+                        return true 
+                    } 
+                  })
+                  if(!result){
+                    this.listArr1.forEach((item)=>{
+                      if(ele==item.code){
+                          this.checkedShowList.push(item)
+                      }
+                    })
+                  }
+                
+                })
+            }else if(val.checkList.length<this.listArr1.length){
+              val.checkList.forEach((ele)=>{
+                var result = this.checkedShowList.some(item => {
+                    if(item.code == ele){
+                        return true 
+                    } 
+                })
+                if(!result){
+                  this.listArr1.forEach((item)=>{
+                    if(ele==item.code){
+                        this.checkedShowList.push(item)
+                    }
+                  })
+                }
+              
+              })
+            }
+            
+            // console.log(this.checkedShowList)
+          }else{
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.level!=1
+            })
+          }
+          
+        }else if(val.curLayerNum==2){
+          this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.code!=val.currentList[0].parentCode
+          })
+          
+          if(val.checkList.length>0&&val.checkList.length<val.currentList.length){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+            })
+            // console.log(this.checkedShowList)
+            val.checkList.forEach((ele)=>{
+              var result = this.checkedShowList.some(item => {
+                if(item.code == ele){
+                    return true 
+                } 
+              })
+              if(!result){
+                val.currentList.forEach((item)=>{
+                  if(ele==item.code){
+                      this.checkedShowList.push(item)
+                  }
+                })
+              }
+             
+            })
+            // console.log(this.checkedShowList)
+          }else if(val.checkList.length==0){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+
+            })
+          }else if(val.checkList.length==val.currentList.length){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+            })
+            this.listArr1.forEach((item)=>{
+                if(item.code==val.currentList[0].parentCode){
+                    this.checkedShowList.push(item)
+                }
+            })
+          }
+        }else if(val.curLayerNum==3){
+          this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.code!=val.currentList[0].parentCode
+          })
+          
+          if(val.checkList.length>0&&val.checkList.length<val.currentList.length){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+            })
+            // console.log(this.checkedShowList)
+            val.checkList.forEach((ele)=>{
+              var result = this.checkedShowList.some(item => {
+                if(item.code == ele){
+                    return true 
+                } 
+              })
+              if(!result){
+                val.currentList.forEach((item)=>{
+                  if(ele==item.code){
+                      this.checkedShowList.push(item)
+                  }
+                })
+              }
+             
+            })
+            // console.log(this.checkedShowList)
+          }else if(val.checkList.length==0){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+              
+            })
+          }else if(val.checkList.length==val.currentList.length){
+            this.checkedShowList=this.checkedShowList.filter((item)=>{
+              return item.parentCode!=val.currentList[0].parentCode
+            })
+            this.listArr2.forEach((item)=>{
+                if(item.code==val.currentList[0].parentCode){
+                    this.checkedShowList.push(item)
+                }
+            })
+          }
+        }else if(val.curLayerNum==4){
+
+        }
+      },
+
+
+    },
+    mounted() {
+        // this.listArr1=this.listArr;
+        this.title1=this.title;
+        // console.log(this.listUrl)
+        if(this.listUrl){
+            getAction(this.listUrl,{
+                parentCode:0,
+                level:this.maxLayers
+            }).then((res)=>{
+                console.log(res);
+                if(res.success){
+                    res.data.forEach((item,index)=>{
+                        item.value=item.code
+                        item.checked=false;
+                        item.indeterminates=false;
+                        
+                    })
+                };
+                this.listArr1=res.data
+            })
+        }
+
+        
+        
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .linkMultiSel {
+    width: 100%;
+    height: 310px;
+    display: flex;
+
+    ul,
+    li {
+      margin: 0;
+      padding: 0;
+      list-style: none;
+    }
+
+    .leftBox {
+      width: 62%;
+      margin-right: 3%;
+      border: 1px solid #ccc;
+      border-radius: 5px;
+      overflow-x: auto;
+      overflow-y: hidden;
+    }
+
+    .rightBox {
+      width: 35%;
+      border: 1px solid #ccc;
+      border-radius: 5px;
+      .selectBox1{
+            height: 250px;
+            overflow: auto;
+            
+            .selectList{                      
+                display: block;
+                width: 100%;
+                // padding: 0 15px;
+                // padding: 3px 0;
+            }
+            .selectLists{
+                display: block;
+                width: 100%;
+                padding: 0 15px;
+            }
+            .selectLists:hover{
+                background-color: rgba(0,0,0,.1);
+            }
+            .selectListitem{
+                display: block;
+                height: 25px;
+                line-height: 25px;
+                background-color: #eee;
+                border-radius: 5px;
+                padding: 0 10px;
+                margin: 8px 10px;
+                position: relative;
+                #close{
+                    font-size: 12px;
+                    position: absolute;
+                    right: 10px;
+                    top: 5px;
+                    cursor: pointer;
+                }
+            }
+      }
+    }
+
+    .title {
+      height: 36px;
+      line-height: 36px;
+      font-size: 14px;
+      font-weight: 600;
+      border-radius: 5px 5px 0 0;
+      background-color: rgb(248, 249, 250);
+      padding: 0 15px;
+      border-bottom: 1px solid #ccc;
+      position: relative;
+      .clearAllBtn{
+          position: absolute;
+          top: 3px;
+          right: 0;
+      }
+    }
+
+    .big_item {
+      width: 100%;
+      // min-width: 200px;
+      // width: 426px;
+      display: inline-block;
+      // height: calc(100% - 10px);
+    }
+
+    .bigBOX {
+      // width: calc(2 * 100%);
+      height: calc(100% - 10px);
+      box-sizing: border-box;
+      // display: flex;
+    }
+  }
+</style>

+ 274 - 0
src/views/modules/autoLaunch/components/singleLayerSelecte.vue

@@ -0,0 +1,274 @@
+<template>
+  <div class="singleLayersSelecte">
+    <div class="selectBox">
+      <div class="selectLeft">
+        <div class="title">{{title}}</div>
+        <div class="selectBox1">
+          <span class="selectLists">
+            <a-checkbox
+              :indeterminate="indeterminate"
+              :checked="checkAll"
+              @change="onCheckAllChange"
+            >全选</a-checkbox>
+          </span>
+          <a-checkbox-group
+            v-model="checkedList"
+            :options="plainOptions"
+            @change="checkGroupChange"
+            class="selectList"
+          ></a-checkbox-group>
+        </div>
+      </div>
+      <div class="selectRight">
+        <div class="title">
+          已选
+          <a-button class="clearAllBtn" type="link" @click="clearAll">清空</a-button>
+        </div>
+        <div class="selectBox1">
+          <span class="selectListitem" v-for="(item,index) in checkedShowList" :key="index">
+            {{item}}
+            <a-icon type="close" id="close" @click="deleteItem(item)" />
+          </span>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
+// const plainOptions = ['Apple', 'Pear', 'Orange','44','550','9982','5525'];
+// const defaultCheckedList = ['Apple', 'Orange'];
+export default {
+  data() {
+    return {
+      //选择框
+      checkedList: [],
+      checkedShowList: [],
+      indeterminate: false,
+      checkAll: false,
+      plainOptions: [],
+      valueOptions: [],
+    }
+  },
+  watch: {
+    checkedList: {        
+        handler(n,o){
+            
+                this.$emit('getCheckedList', this.checkedList)
+            
+        },
+        deep: true,
+        immediate: true,
+    },
+    listArr:{
+        handler(n,o){
+            this.plainOptions = this.listArr
+            this.valueOptions=[];
+            this.listArr.forEach((item) => {
+                    this.valueOptions.push(item.value)
+            })
+        },
+        deep: true,
+        immediate: true,
+    },
+    checked: {
+        handler(n, o) {     
+            
+                this.checkedList=[]
+                this.checkedShowList=[];
+                this.plainOptions = this.listArr
+                this.valueOptions=[];
+                this.listArr.forEach((item) => {
+                    this.valueOptions.push(item.value)
+                })
+                 if (this.checked.length) {
+                    this.checkedList = this.checked;
+                    // console.log(this.checkedList,this.plainOptions)
+                    this.checkedList.forEach((ele, i) => {
+                        this.plainOptions.forEach((item, index) => {
+                            if (item.value == ele) {
+                                this.checkedShowList.push(item.label)
+                            }
+                        })
+                    })
+                    this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length
+                    this.checkAll = this.checkedList.length === this.plainOptions.length
+                   
+                }             
+                                     
+        },
+        deep: true,
+        immediate: true,
+    },
+  },
+  props: ['title', 'listArr', 'checked'],
+  methods: {
+    //手机品牌多选的事件
+    checkGroupChange(checkedList) {
+        this.checkedShowList = []
+        // console.log(checkedList)
+        this.indeterminate = !!checkedList.length && checkedList.length < this.plainOptions.length
+        this.checkAll = checkedList.length === this.plainOptions.length
+        checkedList.forEach((ele, i) => {
+            this.plainOptions.forEach((item, index) => {
+            if (item.value == ele) {
+                this.checkedShowList.push(item.label)
+            }
+            })
+        })
+            //  this.$emit('getCheckedList', this.checkedList)
+
+    },
+    onCheckAllChange(e) {
+    // console.log(e.target.checked,this.valueOptions)
+      this.checkedList=[];
+      this.checkedShowList=[];
+      Object.assign(this, {
+        checkedList: e.target.checked ? this.valueOptions : [],
+        indeterminate: false,
+        checkAll: e.target.checked,
+      })
+      this.checkedList.forEach((ele, i) => {
+        this.plainOptions.forEach((item, index) => {
+          if (item.value == ele) {
+            this.checkedShowList.push(item.label)
+          }
+        })
+      })
+      if (!e.target.checked) {
+        this.checkedShowList = []
+      }
+      // console.log(this.checkedList)
+        // this.$emit('getCheckedList', this.checkedList)
+
+    },
+
+    deleteItem(item) {
+      // console.log(item)
+      let val = ''
+      this.plainOptions.forEach((ele, index) => {
+        if (ele.label == item) {
+          val = ele.value
+        }
+      })
+      this.checkedList = this.checkedList.filter((element, index) => {
+        return element != val
+      })
+      this.checkedShowList = this.checkedShowList.filter((element, index) => {
+        return element != item
+      })
+      if (this.checkedList.length == 0) {
+        this.indeterminate = false
+        this.checkAll = false
+      }
+            // this.$emit('getCheckedList', this.checkedList)
+
+    },
+
+    clearAll() {
+      this.checkedList = []
+      this.indeterminate = false
+      this.checkAll = false
+      this.checkedShowList = []
+        // this.$emit('getCheckedList', this.checkedList)
+
+    },
+  },
+  mounted() {
+    this.plainOptions = this.listArr
+    this.valueOptions=[];
+    this.listArr.forEach((item) => {
+      this.valueOptions.push(item.value)
+    })
+    
+    // if (this.checked.length) {
+    //     this.checkedList = this.checked
+    //     this.checkedList.forEach((ele, i) => {
+    //         this.plainOptions.forEach((item, index) => {
+    //         if (item.value == ele) {
+    //             this.checkedShowList.push(item.label)
+    //         }
+    //         })
+    //     })
+    //     this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length
+    //     this.checkAll = this.checkedList.length === this.plainOptions.length
+    // }else{
+    //     this.checkedList = []
+    // }
+    
+    
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.singleLayersSelecte {
+  margin-top: 20px;
+  .selectBox {
+    display: flex;
+    .title {
+      background: #f9f9f9;
+      font-size: 14px;
+      font-weight: 700;
+      padding: 0 15px;
+      border-bottom: 1px solid #ddd;
+      text-align: left;
+      position: relative;
+      border-radius: 5px 5px 0 0;
+      .clearAllBtn{
+        position: absolute;
+        top: 3px;
+        right: 0;
+      }
+    }
+    .selectLeft {
+      width: 40%;
+      margin-right: 2%;
+      border: 1px solid #ddd;
+      border-radius: 5px;
+    }
+    .selectRight {
+      width: 20%;
+      border: 1px solid #ddd;
+      border-radius: 5px;
+    }
+    .selectBox1 {
+      height: 250px;
+      overflow: auto;
+
+      .selectList {
+        display: block;
+        width: 100%;
+        // padding: 0 15px;
+        // padding: 3px 0;
+      }
+      .selectLists {
+        display: block;
+        width: 100%;
+        padding: 0 15px;
+      }
+      .selectLists:hover {
+        background-color: rgba(0, 0, 0, 0.1);
+      }
+      .selectListitem {
+        display: block;
+        height: 25px;
+        line-height: 25px;
+        background-color: #eee;
+        border-radius: 5px;
+        padding: 0 10px;
+        margin: 8px 10px;
+        position: relative;
+        #close {
+          font-size: 12px;
+          position: absolute;
+          right: 10px;
+          top: 5px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+}
+</style>

+ 193 - 367
src/views/modules/autoLaunch/createStrategy.vue

@@ -34,27 +34,8 @@
                 <div class="required-item"></div>
                 </div>
                 <div class="input-item">
-                    <a-tree-select
-                        v-model="accountId"
-                        show-search
-                        style="width: 600px;height:30px"
-                        :dropdownMatchSelectWidth='true'
-                        :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"              
-                        tree-checkable
-                        searchPlaceholder='请输入账户关键字搜索'
-                        :show-checked-strategy="SHOW_PARENT"
-                        placeholder="请选择项目和账户或搜索账户关键字"
-                        treeNodeFilterProp="title"
-                        :allowClear="true"
-                        @change="treeChange"
-                        @search="treeSearch"
-                        @select="treeSelect"                        
-                        :maxTagCount='1'    
-                        :tree-data="treeData"
-                        :filterOption='filterOption'
-                    >
-                
-                    </a-tree-select>
+                    
+                    <Treeselect :appId.sync="accountId" :multiple="false" request="2" reqUrl='/ctop/projectMember/getProjectAccountByUserId'  ref="treeSelect" style="margin-bottom:8px;width:580px " />
                 </div>
             </div>
             </div>
@@ -68,17 +49,17 @@
                 <div class="hint-item">
                 </div>
                 <div class="label-item">
-                <div class="text-item"></div>
+                <div class="text-item">营销目标</div>
                 <div class="required-item"></div>
                 </div>
                 <div class="input-item">
                     <a-form-item >
-                        <a-radio-group   v-decorator="['marketingGoal',{initialValue:'1' }]" @change="marketingGoalChange">
-                            <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-button value="4">收集销售线索</a-radio-button>                                   
-                            <a-radio-button value="5">提高应用活跃</a-radio-button>                                   
+                        <a-radio-group   v-decorator="['marketingGoal',{initialValue:'2' }]" @change="marketingGoalChange">
+                            <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="5">收集销售线索</a-radio-button>                                   
+                            <a-radio-button value="7">提高应用活跃</a-radio-button>                                   
                         </a-radio-group>
                     </a-form-item>
                 </div>
@@ -98,7 +79,7 @@
             </div>
             <div class="input-item">
               <a-form-item>                
-                <a-input v-model="strategyName"  allow-clear />
+                <a-input v-model="strategyName"   allow-clear />
                </a-form-item>
             </div>
           </div>  
@@ -113,30 +94,13 @@
         </div>
       </div>
     </a-form>
-    <div class="infoModal">
-         <a-modal v-model="visible" title="提示"  @ok="handleOk" :keyboard='false' :maskClosable='false'>
-            <ul>
-              <li v-for="(item,index) in errorInfo" :key="index">
-                  <span>账户{{LHKaccountInfo[index].title}}:</span>{{item.message || '投放项目创建成功'}}
-              </li>
-            </ul>
-            <template slot="footer">
-              <a-button key="back" @click="handleCancel">
-                返回本页
-              </a-button>
-              <a-button key="submit" type="primary"  @click="handleOk">
-                下一步
-              </a-button>
-            </template>
-          </a-modal>
-    </div>
   </div>
 </template>
 
 <script>
 import moment from 'moment'
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
-
+import Treeselect from '@/views/modules/Statistics/components/Treeselect.vue'
 import { TreeSelect } from 'ant-design-vue';
 import qs from 'qs'
 const SHOW_PARENT = TreeSelect.SHOW_PARENT;
@@ -148,326 +112,154 @@ for (let i = 0; i < 7*48; i++) {
   
 }
 export default {
-  components: {
-    // selectCheckAll,
-    // newDirectedPackage,
-  },
-  data() {
-    return {
-        LHKaccountInfo:{},
-        treeValue: [],
-        treeData: [],
-        SHOW_PARENT,
-        accountId:[],
-        strategyName: '',
-        form: this.$form.createForm(this),
+    components: {
+        // selectCheckAll,
+        // newDirectedPackage,
+        Treeselect
+    },
+    data() {
+        return {
+            treeData:[],
+            accountId:undefined,
+            strategyName: '',
+            form: this.$form.createForm(this),
 
-        goNextloading:false,
-        goPlanShowloading:false,
-        
-        
-        dateRange: [moment(), moment()],
+            goNextloading:false,
+            goPlanShowloading:false,
+            
+            
+            dateRange: [moment(), moment()],
 
-        visible:false,
-        errorInfo:[],
-       
-        validationRules: {
-            url: [   
-            {          
+            visible:false,
+            errorInfo:[],
+        
+            validationRules: {
+                url: [   
+                {          
+                    required: true,
+                    validator: this.validateURL,
+                },
+                ],
+                strategyName:[{
                 required: true,
-                validator: this.validateURL,
+                validator: this.validateName,
+                }],
+                bid:[{
+                required: true,
+                message:'出价信息必须填写',
+                // validator: this.validateBid,
+                }],
+                roi:[{
+                required: true,
+                message:'ROI系数必须填写',
+                // validator: this.validateBid,
+                }],
             },
-            ],
-            strategyName:[{
-            required: true,
-            validator: this.validateName,
-            }],
-            bid:[{
-            required: true,
-            message:'出价信息必须填写',
-            // validator: this.validateBid,
-            }],
-            roi:[{
-            required: true,
-            message:'ROI系数必须填写',
-            // validator: this.validateBid,
-            }],
-        },
-        
-    }
-  },
-  watch: {
-    
-  },
-  methods: {
-    // //项目改变后的事件
-    treeChange(val) {
-      // console.log(this.treeData)
-      console.log(val)
-      this.accountId = [];
-      //选择一个后禁用其他
-      if(val.length==1){
-          if(val[0]*1){
-            let selectindex=0
-              this.treeData.forEach((ele,index)=>{                   
-                  if(ele.children){
-                     ele.children.map((item,ind)=>{
-                            if(item.value==val[0]){
-                                selectindex=index;
+            
+        }
+    },
+    watch: {
+        accountId(newValue,oldValue){
+            if(newValue){
+                this.treeData.forEach(item=>{
+                    if(item.children){
+                        item.children.forEach(ele=>{
+                            if(ele.value==newValue){
+                                this.$parent.accountInfo=ele
                             }
-                      })
-                  }                   
-              });
-              // console.log(selectindex)
-              if(selectindex ||selectindex==0){
-                this.treeData.forEach((ele,index)=>{
-                    if(index!=selectindex){
-                         ele.disableCheckbox = true;
-                         if(ele.children){
-                              ele.children.map((item,ind)=>{
-                                   item.disableCheckbox = true;
-                              })
-                         }
-                    }
-                })
-              }
-              
-          }else{
-            //  console.log(1)
-              this.treeData.forEach((ele,index)=>{
-                    if(ele.value!=val[0]){
-                         ele.disableCheckbox = true;
-                         
-                         if(ele.children){
-                              ele.children.forEach((item,ind)=>{
-                                   item.disableCheckbox = true;
-                              })
-                         }
-                    }
-                    
-              })
-          }
-          // console.log(this.mediaId)
-          
-      }
-
-        if(val.length==0){
-            this.treeData.forEach((ele,index)=>{              
-                    ele.disableCheckbox = false;
-                    
-                    if(ele.children){
-                        ele.children.forEach((item,ind)=>{
-                            item.disableCheckbox = false;
                         })
                     }
-                
-            });
-            
+                })
+                console.log(this.$parent.accountInfo)
+            }
         }
-      if(val){
-        val.forEach((ele,index)=>{
-          if(ele*1){
-              this.accountId.push(ele)
-          }else{              
-              let projectArr=this.treeData.filter((item)=>{
-                  return item.value==ele
-              });
-              // console.log(projectArr)
-              projectArr[0].children.forEach((element)=>{
-                 this.accountId.push(element.value)
-              })
-          }
-
-
-        })       
-      }
-      
-     console.log(this.accountId);
-      let LHKaccountInfo=[]
-      this.accountId.forEach(item=>{
-          this.treeData.forEach(element=>{
-            element.children.forEach(ele=>{
-              if(item==ele.value){
-                LHKaccountInfo.push(ele)
-              }
-            })
-          })
-      })
-
-      sessionStorage.setItem('LHKaccountInfo',JSON.stringify(LHKaccountInfo))
-    },
-    treeSearch(){
-    },
-    treeSelect(){
     },
+    methods: {
     
-    filterOption(input, option){
-      console.log(input, option)
-      return (
-          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-        );
-    },
- 
 
-    //请求项目和账户内容
-    accountHttp(){
-        this.treeData=[];
-        this.accountId=[];
-        getAction('/ctop/projectMember/getProjectAccountByUserId?mediaType=1', {}).then(res => {
-        if(res.success){
-                // console.log(res);
-                if(res.result){
-                    res.result.forEach((element,index) => {
-                    if(element){                  
-                        this.treeData.push({});                    
-                        this.treeData[index].title=element.project.projectName +'_('+ element.project.advertiserName +')';
-                        this.treeData[index].value='project'+element.project.projectId;
-                        this.treeData[index].key=element.project.projectId;
-                        this.treeData[index].mediaId=element.project.mediaId;
-                        this.treeData[index].children=[];
-                                            
-                        if(element.account.length){
-                        element.account.forEach((ele,i)=>{
-                            this.treeData[index].children.push({});
-                            this.treeData[index].children[i].title=ele.userName+'_'+ele.authName+'_'+element.project.projectName;
-                            this.treeData[index].children[i].value=ele.accountId;
-                            this.treeData[index].children[i].key=ele.accountId;
-                        })
-                            
-                        }                           
-                    }      
-                    });
-                    // console.log(this.treeData)
-                    
-                }
-        }
+        //获取表单的某一个属性值
+        getFormData(className) {
+        return this.form.getFieldValue(className)
+        },
+        dateChange(date, dateString) {
+        // console.log(date,dateString)
+        this.form.getFieldDecorator('startTime')
+        this.form.getFieldDecorator('endTime')
+        this.form.setFieldsValue({
+            startTime: date[0].format('YYYY-MM-DD HH:mm'),
+            endTime:  date[1].format('YYYY-MM-DD HH:mm'),
         })
-    },
-
-    
-    handleOk(e) {
-        this.visible=false;
-        this.$router.replace({path:'/LaunchHousekeeper/setProjectConvert'})
-        
-        
-    },
-    handleCancel(e) {
-        this.visible = false;
-    },
-    
-   
-    //获取表单的某一个属性值
-    getFormData(className) {
-      return this.form.getFieldValue(className)
-    },
-    dateChange(date, dateString) {
-      // console.log(date,dateString)
-      this.form.getFieldDecorator('startTime')
-      this.form.getFieldDecorator('endTime')
-      this.form.setFieldsValue({
-        startTime: date[0].format('YYYY-MM-DD HH:mm'),
-        endTime:  date[1].format('YYYY-MM-DD HH:mm'),
-      })
-    },
+        },
     
-    //推广目的改变
-    marketingGoalChange(e){
-        console.log(e.target)
-        this.marketingGoalHandle(e.target.value)
-    },
+        //推广目的改变
+        marketingGoalChange(e){
+            console.log(e.target)
+            this.marketingGoalHandle(e.target.value)
+        },
     
-    // 验证网址
-    IsURL(res) {
-      //   var strRegex = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|www\.)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/
-      var strRegex = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+(.+[A-Za-z0-9-~\/])+$/
-      var re = new RegExp(strRegex)
-      // console.log(re.test(res))
-      if (re.test(res)) {
-        return true
-      } else {
-        return false
-      }
-    },
-    validateURL(rule, value, callback) {
-      // console.log(rule, value, callback);
-
-      if (this.IsURL(value)) {
-        callback()
-      } else if (value && !this.IsURL(value)) {
-        callback('链接地址无法访问,请正确输入')
-      } else {
-          callback('链接必须填写')
-      }
-    },
-    validateName(rule, value, callback){
-      // console.log(rule, value, callback);
-
-        if (value) {
-          callback()
+        // 验证网址
+        IsURL(res) {
+        //   var strRegex = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|www\.)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/
+        var strRegex = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+(.+[A-Za-z0-9-~\/])+$/
+        var re = new RegExp(strRegex)
+        // console.log(re.test(res))
+        if (re.test(res)) {
+            return true
         } else {
-              callback('应用包名称必须填写')
+            return false
         }
-    },
-    validateBid(rule, value, callback){
-      // console.log(rule, value, callback);
-        if (value) {
-          callback()
+        },
+        validateURL(rule, value, callback) {
+        // console.log(rule, value, callback);
+
+        if (this.IsURL(value)) {
+            callback()
+        } else if (value && !this.IsURL(value)) {
+            callback('链接地址无法访问,请正确输入')
         } else {
-            callback('出价必须填写')
+            callback('链接必须填写')
         }
-    },
+        },
+        validateName(rule, value, callback){
+        // console.log(rule, value, callback);
+
+            if (value) {
+            callback()
+            } else {
+                callback('应用包名称必须填写')
+            }
+        },
+        validateBid(rule, value, callback){
+        // console.log(rule, value, callback);
+            if (value) {
+            callback()
+            } else {
+                callback('出价必须填写')
+            }
+        },
 
    
     
-    goBack() {
-        this.$router.replace('/modules/LaunchHousekeeper/LaunchHousekeeperList')
-        this.$bus.$emit('remove', '/LaunchHousekeeper/newProject')
-    },
+        goBack() {
+            this.$router.replace('/autoLaunch/autoLaunchList')
+            this.$bus.$emit('remove', '/autoLaunch/newStrategy')
+        },
     
-    // 保存并新建创意
-    goNext() {
+        // 保存并新建创意
+        goNext() {
         this.$nextTick(()=>{
             if (this.strategyName) {
-            let LHKaccountInfo=sessionStorage.getItem('LHKaccountInfo');
-                if(LHKaccountInfo){
-                    this.LHKaccountInfo=JSON.parse(LHKaccountInfo)
-                }
                 this.form.validateFields((err, values) => {
                 if (!err) {
 
-                console.log('Received values of form: ', values)
-                // console.log(this.strategyNames)
-                this.goNextloading=true;
-                values.accountId = this.accountId
-                values.strategyName=this.strategyName
-                postAction('/adlab/Project/create', {                
-                    ...values,
-                }).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)
-                                }
-                            })
-
-                            sessionStorage.setItem('projectInfo',JSON.stringify(projectInfo))
-                        }
-                    
-                    } else {
-                    this.goNextloading=false;
-                    this.$message.error('网络开小差了,等会再试试')
-                    }
-                })
+                    console.log('Received values of form: ', values)
+                    // console.log(this.strategyNames)
+                    values.accountId = this.accountId
+                    values.strategyName=this.strategyName
+                    this.$parent.strategyInfo=values;
+                    this.$parent.currentTabComponent='setDirectional'
                 }else{
-                this.$message.error('请正确填写必填项目')
+                    this.$message.error('请正确填写必填项目')
                 }
             })
                 }else{
@@ -476,42 +268,76 @@ export default {
         })
         
         },
-        
+        //请求项目和账户内容
+        accountHttp(){
+            this.treeData=[];
+            this.accountIds=[];
+            getAction('/ctop/projectMember/getProjectAccountByUserId?mediaType=2', {}).then(res => {
+            if(res.success){
+                    // console.log(res);
+                    if(res.result){
+                        res.result.forEach((element,index) => {
+                        if(element){                  
+                            this.treeData.push({});                    
+                            this.treeData[index].title=element.project.projectName +'_('+ element.project.advertiserName +')';
+                            this.treeData[index].value='project'+element.project.projectId;
+                            this.treeData[index].key=element.project.projectId;
+                            this.treeData[index].mediaId=element.project.mediaId;
+                            this.treeData[index].children=[];
+                                                
+                            if(element.account.length){
+                            element.account.forEach((ele,i)=>{
+                                this.treeData[index].children.push({});
+                                this.treeData[index].children[i].title=ele.userName+'_'+ele.authName+'_'+element.project.projectName;
+                                this.treeData[index].children[i].value=ele.accountId;
+                                this.treeData[index].children[i].key=ele.accountId;
+                            })
+                                
+                            }                           
+                        }      
+                        });
+                        // console.log(this.treeData)
+                        
+                    }
+            }
+            })
+        },
 
-        
-    },
-    marketingGoalHandle(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;
-        
-            default:
-                str='转化错误'
-                break;
-        }
-        return str
+
+        marketingGoalHandle(val){
+            let str='';
+            switch (val) {
+                case '2':
+                    str='应用安装'
+                    break;
+                case '3':
+                    str='电商下单'
+                    break;
+                case '4':
+                    str='推广品牌'
+                    break;
+                case '5':
+                    str='营销线上'
+                    break;
+                case '7':
+                    str='应用活跃'
+                    break;
+            
+                default:
+                    str='转化错误'
+                    break;
+            }
+            return str
+        },
     },
+    
   mounted() {
     this.accountHttp()
     // this.$bus.$emit('remove', '/modules/BatchCreate/newGroup')
     let strategyNamepart=this.marketingGoalHandle(this.getFormData('marketingGoal'));
     
     
-    this.strategyName ='[策略]'+ strategyNamepart + moment().format('MM_DD_hh:mm') ;
+    this.strategyName ='[策略]_'+ strategyNamepart+'_' + moment().format('MM_DD_hh:mm') ;
 
     
   },

+ 39 - 0
src/views/modules/autoLaunch/index.vue

@@ -0,0 +1,39 @@
+<template>
+
+        <component v-bind:is="currentTabComponent">
+
+        </component>
+    
+    
+</template>
+
+<script>
+import moment from 'moment';
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
+export default {
+    name:'index',
+    data() {
+        return {
+            currentTabComponent:'createStrategy',
+            isEdit:false,
+            strategyInfo:{},
+            accountInfo:{},
+        }
+    },
+    components:{   
+        createStrategy: () => import('./createStrategy'), 
+        setDirectional: () => import('./setDirectional'), 
+        setCreate: () => import('./setCreate'), 
+        
+    },
+
+    mounted(){
+       this.currentTabComponent='createStrategy' 
+    },
+    beforeDestroy() {
+        this.currentTabComponent='createStrategy' 
+    },
+   
+}
+
+</script>

+ 0 - 0
src/views/modules/autoLaunch/setCreate.vue


文件差异内容过多而无法显示
+ 696 - 498
src/views/modules/autoLaunch/setDirectional.vue


+ 59 - 34
src/views/modules/earlyWarningRules/configRules.vue

@@ -720,27 +720,47 @@ export default {
                     console.log(res);
                     if(res.success){
                         this.spinning=false;
-                        
-                        res.result.ruleList.map((item,index)=>{
-                            item.ruleDetail.forEach((ele,ind)=>{
+                        new Promise((resolve,reject)=>{
+                             getAction(this.url.fieldList,{   
+                                mediaType:res.result.mediaType,
+                                pageNo:1,
+                                pageSize:500,
+                            }).then(result=>{
+                                console.log(result);
+                                if(result.success){ 
+                                    this.rulesFieldList=result.result.map(item=>{
+                                        return {
+                                            name:item.dimensionName,
+                                            code:item.dimension,
+                                            children:item.dimensionList
+                                        }
+                                    }) 
+                                    resolve('success')
+                                }            
+                            })
+                        }).then(data=>{
+                             res.result.ruleList.map((item,index)=>{
+                                item.ruleDetail.forEach((ele,ind)=>{
 
-                                ele.baseIndex=[ele.ruleDimension,ele.indicatorCode];
-                                 getAction(this.url.ruleCondition,{
-                                    dataType:ele.dataType
-                                }).then(result=>{
-                                    console.log(result)
-                                    if(result.success){
-                                        ele.conditionList=result.result
-                                        console.log(this.form);
-                                        this.form={};
-                                        this.form=res.result
-                                    }
+                                    ele.baseIndex=[ele.ruleDimension,ele.indicatorCode];
+                                    getAction(this.url.ruleCondition,{
+                                        dataType:ele.dataType
+                                    }).then(result=>{
+                                        console.log(result)
+                                        if(result.success){
+                                            ele.conditionList=result.result
+                                            console.log(this.form);
+                                            this.form={};
+                                            this.form=res.result
+                                        }
+                                    })
                                 })
                             })
-                        })
 
-                        
-                        this.form=res.result;
+                            
+                            this.form=res.result;
+                        })
+                       
                     }
                 })
             }else{
@@ -817,23 +837,28 @@ export default {
     mounted(){
         // this.spinning=true;
         this.currentRuleId=this.$route.query.id
-        getAction(this.url.fieldList,{   
-            mediaType:this.form.mediaType,
-            pageNo:1,
-            pageSize:500,
-        }).then(res=>{
-            console.log(res);
-            if(res.success){ 
-                this.rulesFieldList=res.result.map(item=>{
-                    return {
-                        name:item.dimensionName,
-                        code:item.dimension,
-                        children:item.dimensionList
-                    }
-                }) 
-                this.getTempletDetail()   
-            }            
-        })
+        if(!this.$route.query.id){
+            getAction(this.url.fieldList,{   
+                mediaType:this.form.mediaType,
+                pageNo:1,
+                pageSize:500,
+            }).then(res=>{
+                console.log(res);
+                if(res.success){ 
+                    this.rulesFieldList=res.result.map(item=>{
+                        return {
+                            name:item.dimensionName,
+                            code:item.dimension,
+                            children:item.dimensionList
+                        }
+                    }) 
+                    this.getTempletDetail()   
+                }            
+            })
+        }else{
+            this.getTempletDetail()   
+        }
+        
         
 
         // console.log(this.$route.query);