魏志佳 5 rokov pred
rodič
commit
af08643ea8

+ 10 - 1
src/utils/request.js

@@ -21,6 +21,9 @@ const service = axios.create({
   timeout: 6000000 // 请求超时时间
 })
 
+
+
+
 const err = (error) => {
   if (error.esponse) {
     let data = error.response.data
@@ -101,7 +104,13 @@ service.interceptors.request.use(config => {
 // response interceptor
 service.interceptors.response.use((response) => {
   return response.data
-}, err)
+}, (error) => {
+    notification.error({
+        message: '系统提示',
+        description: '网络超时'
+      })
+    return 
+  })
 
 const installer = {
   vm: {},

+ 268 - 209
src/views/modules/BatchCreate/MultiCheckBox.vue

@@ -1,30 +1,17 @@
 <template>
   <div class="multiCheckbox">
-    <div class="linkMulti_list" ref="mycheckMul">
+    <div class="linkMulti_list" >
       <div class="title">{{title}}</div>
       <ul class="linkMulti_list_one">
-        <li class="checkAll">
-          <a-checkbox
-            :indeterminate="indeterminate"
-            :checked="checkAll"
-            @change="onCheckAllChange"
-          >全选</a-checkbox>
+        <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.value"
-            :checked="item.checked"
-            @click.stop="listItemClick($event,item)"
-          >{{item.name}}</a-checkbox>
+        <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.children">
+          <span class="more" v-show="item.hasChild">
             <a-icon type="right" />
           </span>
         </li>
@@ -35,218 +22,290 @@
 </template>
 
 <script>
-export default {
-  name: 'MultiCheckBox',
-  props: ['title', 'listArr', 'curLayerNum', 'parentChecked'],
-  data() {
-    return {
-      checkedList: [],
-      indeterminate: false,
-      checkAll: false,
-      plainOptions: [],
-      layersNum: 0, //控制层级
-      currentLayerNum: 0, //当前层级是多少层,
-      currentItem: null
-    }
-  },
-  watch: {
-    checkAll: function(n, o) {
-      if (n != o) {
-        // this.onCheckAllChange()
+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
+          }
       }
     },
-    // listArr(n,o){
-    //     this.listArr.forEach(element => {
-
-    //         this.plainOptions.push(element.value);
-    //         if(element.checked){
-    //             this.checkedList.push(element.value)
-    //         }
-    //     });
-    //     if(this.checkedList.length==this.plainOptions.length){
-    //         this.checkAll=true;
-    //     }
-    // },
-
-    parentChecked: {
-      handler(n, o) {
-        console.log(n, o, '--parentChecked', this.curLayerNum)
-        if (n) {
-          this.checkAll = true
-          this.listArr.forEach((item, index) => {
-            item.checked = n
-            this.checkedList.push(item.value)
-          })
-        } else if (n == false && o == true) {
-          this.checkAll = false
-          this.listArr.forEach((item, index) => {
-            item.checked = n
-          })
-          this.checkedList = []
+    data() {
+      return {
+        checkedList: [],
+        indeterminate: false,
+        checkAll: false,
+        plainOptions: [],
+        layersNum: 0, //控制层级
+        currentLayerNum: 0, //当前层级是多少层,
+        currentItem: null
+      }
+    },
+    watch: {
+      checkAll: function (n, o) {
+        if (n != o) {
+          // this.onCheckAllChange()
         }
       },
-      immediate: true,
-      deep: 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.checkedList.push(e.target.value)
+      listArr:{
+          handler(n, o) {
+              this.plainOptions=[];
+            //   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);
+                        console.log(this.checkedList,'--',this.curLayerNum)
+                    }
+                    
+                }else{
+                    let num = this.checkedList.indexOf(element.value)
+                    if (num > -1) {
+                        this.checkedList.splice(num, 1)
+                    }
+                }
+            });
+           
+            // console.log(this.checkedList.length,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
+          },
+            deep: true
+      },
+
+      parentChecked: {
+        handler(n, o) {
+        //   console.log(n, o, '--parentChecked', this.curLayerNum,this.checkedList,this.plainOptions)
+          if (n) {
+            this.checkAll = true
+            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 = []
           }
-        })
-      } else {
-        this.listArr.forEach((ele, i) => {
-          if (index == i) {
-            this.$set(ele, 'checked', e.target.checked)
+        },
+        
+        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
         })
-
-        let num = this.checkedList.indexOf(e.target.value)
-        if (num > -1) {
-          this.checkedList.splice(num, 1)
+        console.log(this.checkedList)
+        if (this.checkedList.length) {
+          this.listArr.forEach(item => {
+            this.$set(item, 'checked', true)
+          })
+        } else {
+          this.listArr.forEach(item => {
+            this.$set(item, 'checked', false)
+          })
         }
-      }
-      this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length
-      this.checkAll = this.checkedList.length === this.plainOptions.length
-      // this.listItemClick(item);
-    },
-    onCheckAllChange(e) {
-      Object.assign(this, {
-        checkedList: e.target.checked ? this.plainOptions : [],
-        indeterminate: false,
-        checkAll: e.target.checked
-      })
-      if (this.checkedList.length) {
-        this.listArr.forEach(item => {
-          this.$set(item, 'checked', true)
+
+        this.listItemClick(event,{
+            name:'全选',value:'all',checked:e.target.checked,indeterminates:false
         })
-      } else {
-        this.listArr.forEach(item => {
-          this.$set(item, 'checked', false)
+      },
+      
+      listItemClick(event, item) {
+        // console.log(item)
+        
+        this.$emit('getItemData', {
+          clickObj: event.target,
+          data: item,
+          curLayerNum:this.curLayerNum,
+          checkList:this.checkedList,
+          plainOptions:this.plainOptions
         })
-      }
+      },
+     
     },
-    listItemClick(event, item) {
-      console.log(item)
+    mounted() {
+      this.currentLayerNum = this.curLayerNum
 
-      this.$emit('getItemData', {
-        clickObj: event.target,
-        data: item
-      })
-    },
-    // checkItemChange(e){
-    //     console.log(e.target.checked);
-    //     // if(e.target.checked){
-
-    //     // }
-    // },
-    //判断传入的数组的children层数
-    getLayersNum(arr) {
-      arr.map((item, index) => {
-        if (item.children) {
-        }
+      this.listArr.forEach(element => {
+        this.plainOptions.push(element.value)
+        // console.log(this.plainOptions)
       })
-    }
-  },
-  mounted() {
-    this.currentLayerNum = this.curLayerNum
-
-    this.listArr.forEach(element => {
-      this.plainOptions.push(element.value)
-      if (element.checked) {
-        this.checkedList.push(element.value)
+ 
+    
+       
+      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.checkedList.length == this.plainOptions.length) {
-      this.checkAll = true
-    }
-    // console.log(this.checkedList)
-    // console.log(this.curLayerNum)
-
-    // console.log(this.parentChecked)
-
-    console.log(this.$refs.checkList)
-    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;
+  .multiCheckbox {
     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;
-    }
-    .checkAll {
-    }
+    height: 300px;
+
+    ul,
     li {
-      height: 30px;
-      line-height: 30px;
-      cursor: pointer;
-      padding: 0 15px;
-      position: relative;
-      .more {
-        position: absolute;
-        top: 2px;
-        right: 10px;
+      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;
+      }
+
+      .checkAll {}
+
+      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);
       }
     }
-    li:hover {
-      background-color: rgb(240, 240, 240);
+
+    .ant-checkbox-group {
+      width: 100%;
     }
   }
-  .ant-checkbox-group {
-    width: 100%;
-  }
-}
 </style>

+ 368 - 204
src/views/modules/BatchCreate/linkMultiSelect.vue

@@ -3,43 +3,20 @@
     <div class="leftBox">
       <div class="bigBOX" ref="mycheckBox">
         <div class="big_item">
-          <MultiCheckBox
-            :title="title"
-            :listArr="listArr"
-            :curLayerNum="1"
-            :parentChecked="false"
-            @getItemData="getItemData"
-          />
+          <MultiCheckBox :title="title1" :listArr="listArr1" :curLayerNum="1" :parentChecked="false"
+            @getItemData="getItemData" />
         </div>
         <div class="big_item">
-          <MultiCheckBox
-            :title="title2"
-            :listArr="listArr2"
-            :curLayerNum="2"
-            :parentChecked="parentChecked1"
-            @getItemData="getItemData"
-            v-if="listArr2.length>0"
-          />
+          <MultiCheckBox :title="title2" :listArr="listArr2" :curLayerNum="2"  :parentChecked="parentChecked1"
+            @getItemData="getItemData" v-if="listArr2.length>0" />
         </div>
         <div class="big_item">
-          <MultiCheckBox
-            :title="title3"
-            :listArr="listArr3"
-            :curLayerNum="3"
-            :parentChecked="parentChecked2"
-            @getItemData="getItemData"
-            v-if="listArr3.length>0"
-          />
+          <MultiCheckBox :title="title3" :listArr="listArr3" :curLayerNum="3"  :parentChecked="parentChecked2"
+            @getItemData="getItemData" v-if="listArr3.length>0" />
         </div>
         <div class="big_item">
-          <MultiCheckBox
-            :title="title4"
-            :listArr="listArr4"
-            :curLayerNum="4"
-            :parentChecked="parentChecked3"
-            @getItemData="getItemData"
-            v-if="listArr4.length>0"
-          />
+          <MultiCheckBox :title="title4" :listArr="listArr4" :curLayerNum="4"  :parentChecked="parentChecked3"
+            @getItemData="getItemData" v-if="listArr4.length>0" />
         </div>
       </div>
     </div>
@@ -52,189 +29,376 @@
 </template>
 
 <script>
-import MultiCheckBox from './MultiCheckBox'
-export default {
-  props: ['title', 'listArr'],
-  components: {
-    MultiCheckBox
-  },
-  data() {
-    return {
-      title2: '',
-      listArr2: [],
-      title3: '',
-      listArr3: [],
-      title4: '',
-      listArr4: [],
-      clickKey: 0,
-      parentChecked1: false,
-      parentChecked2: false,
-      parentChecked3: false,
-
-      currentData: null,
-      layersNum: 0
-    }
-  },
-  watch: {},
-  methods: {
-    getItemData(val) {
-      this.$nextTick(() => {
-        this.clickKey = val.clickObj.dataset.layers
-        let index = parseInt(val.clickObj.dataset.layers)
-        this.currentData = val.data
-        console.log(val, val.clickObj.dataset.layers)
-        console.log(val.data.checked)
-        let childrensArr = Array.from(this.$refs.mycheckBox.children)
-
-        if (index == 1 || this.clickKey == 1) {
-          this.$refs.mycheckBox.style.width = '100%'
-          if (val.data.children) {
-            this.listArr3 = []
-            this.title3 = ''
-            this.listArr4 = []
-            this.title4 = ''
-
-            //处理样式
-            this.styleHandle(childrensArr, index)
-
-            // if(val.data.checked){
-            //     val.data.children.forEach((item)=>{
-            //         item.checked=true;
-            //     })
-            // }else{
-            //     val.data.children.forEach((item)=>{
-            //         // item.checked=false;
-            //         this.$set(item,'checked',false)
-            //     })
-            // }
-
-            this.parentChecked1 = val.data.checked
-            this.parentChecked2 = val.data.checked
-            this.parentChecked3 = val.data.checked
-            this.listArr2 = val.data.children
-            this.title2 = val.data.name
-            console.log(
-              'parentChecked1',
-              this.parentChecked1,
-              '--',
-              'parentChecked2',
-              this.parentChecked2,
-              '--',
-              'parentChecked3',
-              this.parentChecked3
-            )
-          } else {
-            this.listArr3 = []
-            this.title3 = ''
-            this.listArr4 = []
-            this.title4 = ''
-            this.listArr2 = []
-            this.title2 = ''
-            this.resetStyle(childrensArr, index)
+  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
+      }
+    },
+    watch: {},
+    methods: {
+      getItemData(val) {
+        this.$nextTick(() => {
+          this.clickKey = val.clickObj.dataset.layers
+          let index = parseInt(val.clickObj.dataset.layers) || val.curLayerNum
+          this.currentData = val.data
+          
+          let childrensArr = Array.from(this.$refs.mycheckBox.children)
+          setTimeout(() => {
+            console.log(val, val.clickObj.dataset.layers)
+            // 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.result.records.length>0){
+                                res.result.records.forEach((item,index)=>{
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                
+                                })
+                                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.result.records
+                                this.title2 = val.data.name
+                            }                    
+                        };
+                        
+                    })  
+                }else{
+                    this.listArr3 = []
+                    this.title3 = ''
+                    this.listArr4 = []
+                    this.title4 = ''
+                    this.listArr2 = []
+                    this.title2 = ''
+                    this.resetStyle(childrensArr, index)
+                    }  
+                        
+            } 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.result.records.length>0){
+                                res.result.records.forEach((item,index)=>{
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                
+                                })
+                                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.result.records
+                                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.result.records.length>0){
+                                res.result.records.forEach((item,index)=>{
+                                    item.value=item.code
+                                    item.checked=val.data.checked;
+                                    item.indeterminates=false;
+                                
+                                })
+                                this.listArr4 = res.result.records
+                                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)
+                }  
+
+             
+                if(this.listArr2){
+                    console.log(this.listArr2)
+                    let ind=-1;
+                    
+                    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
+                    }           
+                
+              }
+              
+                  
+                    this.listArr1.forEach((element,num)=>{
+                        
+                        if(element.code==this.listArr2[ind].parentCode){
+                            ind=num
+                            console.log(ind)
+                        }
+                        
+                    })      
+                    let checklist=this.listArr2.filter((item,index)=>{
+                        return  item.checked
+                    })    
+                    // console.log(checklist)
+                    if(ind>-1){
+                            this.listArr1[ind].indeterminates = !!checklist.length && checklist.length < this.listArr2.length
+                            this.listArr1[ind].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
+                        })    
+                        // 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
+                        })  
+                        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)
+
+
+        })
+      },
+      styleHandle(arr, i) {
+        arr.forEach((item, index) => {
+          if (index <= i) {
+            item.style.width = `${100 / (i + 1)}%`
+            item.style.borderRight = '1px solid #ccc'
           }
-        } else if (index == 2 || this.clickKey == 2) {
-          if (val.data.children) {
-            this.listArr4 = []
-            this.title4 = ''
-            this.listArr3 = val.data.children
-            this.title3 = val.data.name
-            this.$refs.mycheckBox.style.width = '150%'
-            this.styleHandle(childrensArr, index)
-            this.parentChecked2 = val.data.checked
-            this.parentChecked3 = val.data.checked
-          } else {
-            this.listArr4 = []
-            this.title4 = ''
-            this.listArr3 = []
-            this.title3 = ''
-            this.$refs.mycheckBox.style.width = '100%'
-            this.resetStyle(childrensArr, index)
+        })
+      },
+      resetStyle(arr, i) {
+        arr.forEach((item, index) => {
+          if (index < i) {
+            item.style.width = `${100 / i}%`
+            item.style.borderRight = '1px solid #ccc'
           }
-        } else if (index == 3 || this.clickKey == 3) {
-          if (val.data.children) {
-            this.listArr4 = val.data.children
-            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)
+          if (index == i - 1) {
+            item.style.borderRight = 'none'
           }
-        }
-      })
-    },
-    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'
+    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.result.records.forEach((item,index)=>{
+                        item.value=item.code
+                        item.checked=false;
+                        item.indeterminates=false;
+                        
+                    })
+                };
+                this.listArr1=res.result.records
+            })
         }
-        if (index == i - 1) {
-          item.style.borderRight = 'none'
-        }
-      })
+
+        
+        
     }
-  },
-  mounted() {}
-}
+  }
 </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;
-  }
-  .rightBox {
-    width: 35%;
-    border: 1px solid #ccc;
-    border-radius: 5px;
-  }
-  .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;
-  }
-
-  .big_item {
+  .linkMultiSel {
     width: 100%;
-    // min-width: 200px;
-    // width: 426px;
-    display: inline-block;
-    // height: calc(100% - 10px);
-  }
+    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;
+    }
+
+    .rightBox {
+      width: 35%;
+      border: 1px solid #ccc;
+      border-radius: 5px;
+    }
+
+    .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;
+    }
+
+    .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;
+    .bigBOX {
+      // width: calc(2 * 100%);
+      height: calc(100% - 10px);
+      box-sizing: border-box;
+      // display: flex;
+    }
   }
-}
 </style>

+ 49 - 66
src/views/modules/BatchCreate/newDirectedPackage.vue

@@ -206,9 +206,6 @@
                         display: block;
                         height: 20px;
                         line-height: 20px;
-                        .Taxonomic_relevant_top_title{
-                           
-                        }
                         .Taxonomic_relevant_top_more{
                             position: absolute;
                             top: 0;
@@ -376,9 +373,6 @@
         .region_input{
             width: 60%;
         }
-        .tabChange{
-
-        }
         .ant-tabs-bar{
             border: 0;
         }
@@ -391,16 +385,16 @@
         </div>
         <div class="optBOX">
             <div class="leftBox">
-                <a-form :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
-                    <a-form-item label="定向包名称">
-                       <a-input placeholder="请输入定向包名称,至多20个字符" style="width:40%" />
+                <a-form :form="form">
+                    <a-form-item label="定向包名称" :label-col="labelCol" :wrapper-col="wrapperCol">
+                       <a-input placeholder="请输入定向包名称,至多20个字符" style="width:40%" v-decorator="['name', { rules: [{ required: true, message: '请输入定向包名称' }] }]" />
                     </a-form-item>
-                    <a-form-item label="媒体:">
-                        <a-radio-group default-value="toutiao" v-model="form.medialType" button-style="solid">
+                    <a-form-item label="媒体:" :label-col="labelCol" :wrapper-col="wrapperCol">
+                        <a-radio-group default-value="toutiao" v-decorator="['medialType', { rules: [{ required: true}] }]"  button-style="solid">
                             <a-radio-button :value="1">头条</a-radio-button>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="地域:" class="optItem" >
+                    <a-form-item label="地域:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="" button-style="solid" v-model="regionValue">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="REGION_LEVEL_PROVINCE">按省市</a-radio-button>
@@ -417,10 +411,10 @@
                                     <div class="tabBox">
                                         <a-tabs v-model="cityTab" @change="cityTabChange">
                                             <a-tab-pane key="geography" tab="地理划分">
-                                                <linkMultiSelect title='省份' :listArr='shengshiArr' @getSelectedArr='getSelectedCityArr'/>
+                                                <linkMultiSelect title='省份' :listArr='shengshiArr' :maxLayers='2' :listUrl='regionListUrl' @getSelectedArr='getSelectedCityArr'/>
                                             </a-tab-pane>
                                             <a-tab-pane key="development" tab="发展划分" >
-                                                <linkMultiSelect title='等级' :listArr='[]' @getSelectedArr='getSelectedCityArr'/>
+                                                <linkMultiSelect title='等级' :listArr='[]' url='' :maxLayers='3' @getSelectedArr='getSelectedCityArr'/>
                                             </a-tab-pane>
                                         </a-tabs>
                                     </div>
@@ -460,17 +454,17 @@
                             </div>
                         </div>                        
                     </a-form-item>
-                    <a-form-item label="性别:" class="optItem">
+                    <a-form-item label="性别:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                          <a-radio-group default-value="" v-model="form.sex" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="men">男</a-radio-button>
                             <a-radio-button value="women">女</a-radio-button>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="年龄:" class="optItem">
+                    <a-form-item label="年龄:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <radioCheck :checkArr='ageArr' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <a-form-item label="精选流量包:" class="optItem">
+                    <a-form-item label="精选流量包:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="men">应用软件精选</a-radio-button>
@@ -478,7 +472,7 @@
                         </a-radio-group>
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />精选流量包仅支持穿山甲、穿山甲-精选游戏广告位</span>
                     </a-form-item>
-                    <a-form-item label="行为兴趣:" class="optItem">
+                    <a-form-item label="行为兴趣:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group v-model="interestActionMode" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="RECOMMEND">
@@ -495,7 +489,7 @@
                         
                     </a-form-item>
                     <div class="interestActionMode" v-show="interestActionMode=='CUSTOM'">
-                            <a-form-item label="行为:" class="optItem">
+                            <a-form-item label="行为:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                                 <div>
                                     <span style="margin-right:5px">在</span> 
                                     <a-select
@@ -644,29 +638,46 @@
 
                             </a-form-item>
                         </div>
-                    <a-form-item label="平台:" class="optItem">
+                    <a-form-item label="平台:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <radioCheck :checkArr='platformArr' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <a-form-item label="过滤已安装:" class="optItem">
+                    <a-form-item label="过滤已安装:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="" button-style="solid">
                             <a-radio-button value="">不过滤</a-radio-button>
                             <a-radio-button value="filter">过滤</a-radio-button>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item label="运营商:" class="optItem">
+                    <a-form-item label="运营商:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <radioCheck :checkArr='carrierArr' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <a-form-item label="网络:" class="optItem">
+                    <a-form-item label="网络:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <radioCheck :checkArr='networkArr' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <!-- <a-form-item label="设备类型:" class="optItem">
-                       <a-radio-group default-value="" button-style="solid">
+                    <a-form-item label="文章类型:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
+                       <a-radio-group default-value="" button-style="solid" v-model="articleType">
                             <a-radio-button value="">不限</a-radio-button>
-                            <a-radio-button value="wifi">智能手机</a-radio-button>
-                            <a-radio-button value="2G">平板</a-radio-button>
+                            <a-radio-button value="articleCategory">文章分类</a-radio-button>                          
                         </a-radio-group>
-                    </a-form-item> -->
-                    <a-form-item label="手机品牌:" class="optItem">
+                        <div v-if="articleType=='articleCategory'" class="deviceBrand">
+                            <div class="selectBox">
+                                <div class="selectLeft">
+                                    <div class="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="clear" type="link" @click="clearAll">清空</a-button></div>
+                                    <div class="selectBox1">
+                                        <span class="selectListitem" v-for="(item,index) in checkedList" :key='index'>{{item}}<a-icon type="close" id="close" @click="deleteItem(item)" /></span>
+                                    </div>
+                                </div>
+                            </div>
+                            
+                        </div>
+                    </a-form-item>
+                    <a-form-item label="手机品牌:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-radio-group default-value="" v-model="deviceBrand" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="byBrand">按品牌</a-radio-button>
@@ -690,7 +701,7 @@
                             
                         </div>
                     </a-form-item>
-                    <a-form-item label="手机价格:"  class="optItem">
+                    <a-form-item label="手机价格:"  class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                        <a-radio-group default-value="" v-model="launchPrice" button-style="solid">
                             <a-radio-button value="">不限</a-radio-button>
                             <a-radio-button value="custom">自定义</a-radio-button>
@@ -700,23 +711,23 @@
                         </span>
                         <span v-else></span>
                     </a-form-item>
-                    <a-form-item label="新用户:" class="optItem">                      
+                    <a-form-item label="新用户:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">                      
                         <radioCheck :checkArr='newUser' @getSonValue='getNewUser' />
                     </a-form-item>
-                    <a-form-item label="智能放量:" class="optItem">
+                    <a-form-item label="智能放量:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="" button-style="solid">
                             <a-radio-button value="">不启用</a-radio-button>
                             <a-radio-button value="open">启用</a-radio-button>
                         </a-radio-group>
                         <span class="tishi"><a-icon type="exclamation-circle" class="tubiao" />智能放量不支持受众预估</span>
                     </a-form-item>
-                    <a-form-item label="保存为模板:" class="optItem">
+                    <a-form-item label="保存为模板:" class="optItem" :label-col="labelCol" :wrapper-col="wrapperCol">
                         <a-radio-group default-value="no" button-style="solid">
                             <a-radio value="yes">是</a-radio>
                             <a-radio value="no">否</a-radio>
                         </a-radio-group>
                     </a-form-item>
-                    <a-form-item :wrapper-col="{ span: 14, offset: 4 }">
+                    <a-form-item :wrapper-col="{ span: 14, offset: 4 }" :label-col="labelCol"> 
                         <a-button type="primary" @click="applicatiSubmit">
                             应用
                         </a-button>
@@ -753,6 +764,7 @@
     </div>
 </template>
 <script>
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
 const plainOptions = ['Apple', 'Pear', 'Orange','44','550','9982','5525'];
 const defaultCheckedList = ['Apple', 'Orange'];
 import radioCheck from './radioCheck';
@@ -894,38 +906,7 @@ let options=[
         },
 ];
 
-let shengshiArr=[
-    {name:'北京',value:'beijing'},
-    {name:'天津',value:'tianjin'},
-    {name:'上海',value:'shanghai'},
-    {name:'重庆',value:'chongqing'},
-    {
-        name:'山西',
-        value:'shanxi',
-        children:[
-            {
-                name:'太原',
-                value:'taiyuan',
-            },
-            {
-                name:'阳泉',
-                value:'yangquan',
-                children:[
-                    {
-                        name:'盂县',
-                        value:'yuxian',
-                        children:[
-                            {
-                                name:'上社镇',
-                                value:'shangshezhen'
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-]
+
 export default {
     components:{
         radioCheck,
@@ -996,6 +977,8 @@ export default {
             AIselect:true,//行为下的自动选词是否可用
 
             shengshiArr,
+            regionListUrl:'ctop/bytedanceAreaInfo/list',
+            acticleType:'',//文章分类
         }
     },
     methods: {

+ 1 - 1
src/views/modules/Statistics/accountReport.vue

@@ -533,7 +533,7 @@ export default {
     //项目改变后的事件
     treeChange(val) {
       // console.log(this.treeData)
-      // console.log(val)
+      console.log(val)
       this.accountId = [];
       //选择一个后禁用其他
       if(val.length==1){

+ 2 - 0
src/views/modules/Statistics/mediaReport.vue

@@ -100,6 +100,8 @@
                         <a-select-option value="">全部</a-select-option>
                         <a-select-option :value='1'>头条</a-select-option>                       
                         <a-select-option :value='2'>快手</a-select-option>                       
+                        <a-select-option :value='3'>头条内广</a-select-option>                       
+                        <a-select-option :value='4'>快手内广</a-select-option>                       
                     </a-select>                   
                 </span>
 

+ 1 - 1
src/views/modules/onlineTraining/onlineTrainingList.vue

@@ -20,7 +20,7 @@
         <a slot="extra" @click="addList">
           新增培训视频
         </a>
-        <a-directory-tree defaultExpandAll @select="onSelect" @expand="onExpand" :loadData="onLoadData"
+        <a-directory-tree  @select="onSelect" @expand="onExpand" :loadData="onLoadData"
           :treeData="treeData">
         </a-directory-tree>
       </a-card>

+ 3 - 3
vue.config.js

@@ -67,14 +67,14 @@ module.exports = {
        
         // target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
        
-        // target: 'http://192.168.0.111:8088', //请求本地 需要jeecg-boot后台项目  英豪
+        target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
        
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
-        // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
+        // target: 'http://192.168.1.94:8804', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.1.51:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://api.tjyourong.com.cn/jeecg-boot', //请求本地 需要jeecg-boot后台项目 
-        target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
         // target: 'http://192.168.1.251:8088', //请求本地 需要jeecg-boot后台项目 
         // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目