Explorar o código

'改媒介报表'

魏志佳 %!s(int64=5) %!d(string=hai) anos
pai
achega
a564bd42df

+ 53 - 74
src/views/modules/BatchCreate/MultiCheckBox.vue

@@ -4,8 +4,9 @@
             <div class="title">{{title}}</div>
             <ul class="linkMulti_list_one">
                 <li class="checkAll"><a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange"> 全选</a-checkbox> </li>
-                <li @click="listItemClick(item)" v-for="(item,index) in listArr" :key='index' :data-layers='curLayerNum'>
-                    <a-checkbox   @change='checkItemChange' >{{item.name}}</a-checkbox>                       
+                <li @click="listItemClick(item)" v-for="(item,index) in listArr" :key='index' :data-layers='curLayerNum' ref="checkList">
+                    <a-checkbox   @change="onChange($event,item)" :value='item.value' :checked='item.checked'>{{item.name}}</a-checkbox>
+                    <!-- <span>{{item.name}}</span>                        -->
                     <span class="more" v-show="item.children"><a-icon type="right" /></span>
                 </li>                    
             </ul>                               
@@ -15,46 +16,70 @@
 </template>
 
 <script>
-const plainOptions = ['Apple', 'Pear', 'Orange'];
+
     export default {
         name:'MultiCheckBox',
         props:['title','listArr','curLayerNum'],
         data() {
             return {
-               checkedList: [],
+                checkedList: [],
                 indeterminate: false,
                 checkAll: false,
-                plainOptions,
+                plainOptions:[],
                 layersNum:0,//控制层级
                 currentLayerNum:0,//当前层级是多少层,
                 currentItem:null,
             }
         },
         methods: {
-            onChange(checkedList) {
-                this.indeterminate = !!checkedList.length && checkedList.length < plainOptions.length;
-                this.checkAll = checkedList.length === plainOptions.length;
+            onChange(e,item) {
+                console.log(e.target,item)
+                if(e.target.checked){
+                    this.$set(item,'checked',true)
+                    this.checkedList.push(e.target.value)
+                    console.log(this.listArr)
+                }else{
+                    this.$set(item,'checked',e.target.checked)
+                    console.log(this.listArr)
+                    let index=this.checkedList.indexOf(e.target.value);
+                    if(index > -1){
+                        this.checkedList.splice(index,1)
+                    }
+                }
+                this.indeterminate = !!this.checkedList.length && this.checkedList.length < this.plainOptions.length;
+                this.checkAll = this.checkedList.length === this.plainOptions.length;
             },
             onCheckAllChange(e) {
                 Object.assign(this, {
-                    checkedList: e.target.checked ? plainOptions : [],
+                    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)
+                    })
+                }else{
+                    this.listArr.forEach((item)=>{
+                       this.$set(item,'checked',false)
+                   })
+                }
             },
             listItemClick(item){
+               
+                    this.$emit('getItemData',{
+                        'clickObj':event.target,
+                        'data':item
+                    })
+                
                 
-                this.$emit('getItemData',{
-                    'clickObj':event.target,
-                    'data':item
-                })
             },
-            checkItemChange(e){
-                console.log(e.target.checked);
-                // if(e.target.checked){
+            // checkItemChange(e){
+            //     console.log(e.target.checked);
+            //     // if(e.target.checked){
 
-                // }   
-            },
+            //     // }   
+            // },
             //判断传入的数组的children层数
             getLayersNum(arr){
                 arr.map((item,index)=>{
@@ -66,6 +91,12 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
         },
         mounted() {
             this.currentLayerNum=this.curLayerNum;
+            // this.plainOptions=this.listArr
+            this.listArr.forEach(element => {
+                // console.log(element);
+                this.plainOptions.push(element.value);
+                element.checked=false
+            });
             console.log(this.curLayerNum)
         },
     }
@@ -73,11 +104,8 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
 
 <style lang="scss" scoped>
 .multiCheckbox{   
-    // width:100%;
-    // overflow: auto;   
-    height: 100%;
-    display: flex;
-    overflow: scorll;
+    width:100%;   
+    height: 300px;
     ul,li{
         margin: 0;
         padding: 0;
@@ -87,7 +115,7 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
         // padding: 5px 0px;
         display: inline-block;
         width: 100%;
-        height: 300px;
+        height: 100%;
         box-sizing: border-box;       
         overflow: hidden;   
         .title{
@@ -99,6 +127,7 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
             background-color: rgb(248,249,250);
             padding: 0 15px;
             border-bottom: 1px solid #ccc;
+            box-sizing: border-box;    
         }
         ul{
             height: 264px;
@@ -128,56 +157,6 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
         width: 100%;
     }
 }
-ul,li{
-    margin: 0;
-    padding: 0;
-    list-style: none;
-}
-.linkMulti_list{
-    // padding: 5px 0px;
-    display: inline-block;
-    width: 100%;
-    min-width: 200px;
-    height: 300px;
-    box-sizing: border-box;       
-    overflow: auto;
-    .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;
-    }
-    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);
-    }
-
-}
 
-.addborder{
-    border-right: 1px solid #ccc;
-}
 
 </style>

+ 100 - 26
src/views/modules/BatchCreate/linkMultiSelect.vue

@@ -1,11 +1,21 @@
 <template>
     <div class="linkMultiSel">
         <div class="leftBox">
-            
-                <MultiCheckBox  :title="title" :listArr='listArr' :curLayerNum='1' @getItemData='getItemData' />
-                <MultiCheckBox  :title="title" :listArr='listArr' :curLayerNum='2' v-if="listArr2.length>0" />
-                <MultiCheckBox  :title="title" :listArr='listArr' :curLayerNum='3' v-if="listArr3.length>0"/>
-                <MultiCheckBox  :title="title" :listArr='listArr' :curLayerNum='4' v-if="listArr4.length>0"/>
+            <div class="bigBOX" ref="mycheckBox">
+                <div class="big_item" >
+                    <MultiCheckBox  :title="title" :listArr='listArr' :curLayerNum='1' @getItemData='getItemData' />
+                </div>
+                <div class="big_item">
+                    <MultiCheckBox  :title="title2" :listArr='listArr2' :curLayerNum='2'  @getItemData='getItemData' v-if="listArr2.length>0" />
+                </div>
+                <div class="big_item">
+                    <MultiCheckBox  :title="title3" :listArr='listArr3' :curLayerNum='3'  @getItemData='getItemData' v-if="listArr3.length>0"/>
+                </div>
+                <div class="big_item">
+                    <MultiCheckBox  :title="title4" :listArr='listArr4' :curLayerNum='4'  @getItemData='getItemData' v-if="listArr4.length>0"/>
+                </div>
+            </div>
+               
 
         </div>
         
@@ -37,34 +47,87 @@ import MultiCheckBox from './MultiCheckBox'
                 clickKey:0,
             }
         },
+       
         methods: {
             getItemData(val){
                 this.clickKey=val.clickObj.dataset.layers;
-                let index=val.clickObj.dataset.layers;
-                console.log(val,val.clickObj.dataset.layers);
+                let index=parseInt(val.clickObj.dataset.layers);
+                // console.log(val,val.clickObj.dataset.layers);
                 this.clickKey=val.clickObj.dataset.layers;
+                let childrensArr= Array.from(this.$refs.mycheckBox.children);
                 if(index==1){
-                  
-                    this.listArr3=[];
-                    this.title3='';
-                    this.listArr4=[];
-                    this.title4='';
-                    this.listArr2=val.data.children;
-                    this.title2=val.data.name;
+                    this.$refs.mycheckBox.style.width='100%';
+                    if(val.data.children){
+                        this.listArr3=[];
+                        this.title3='';
+                        this.listArr4=[];
+                        this.title4='';
+                        this.listArr2=val.data.children;
+                        this.title2=val.data.name;
+                        //处理样式                        
+                        this.styleHandle(childrensArr,index)
+                    }else{
+                        this.listArr3=[];
+                        this.title3='';
+                        this.listArr4=[];
+                        this.title4='';
+                        this.listArr2=[];
+                        this.title2='';
+                        this.resetStyle(childrensArr,index)
+
+                    }
+                    
                 }else if(index==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)
+                    }else{
+                        this.listArr4=[];
+                        this.title4='';
+                        this.listArr3=[];
+                        this.title3='';
+                         this.$refs.mycheckBox.style.width='100%'
+                        this.resetStyle(childrensArr,index)
+                    }
                     
-                    this.listArr4=[];
-                    this.title4='';
-
-                    this.listArr3=val.data.children;
-                    this.title3=val.data.name;
                 }else if(index==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)
+                    }else{
+                        this.$refs.mycheckBox.style.width='150%'
+                        this.resetStyle(childrensArr,index)
+                    }
                     
-                    this.listArr4=val.data.children;
-                    this.title4=val.data.name;
                 }
             },
-
+            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';
+                    }
+                });
+            }   
         },
         mounted() {
             
@@ -75,7 +138,7 @@ import MultiCheckBox from './MultiCheckBox'
 <style lang="scss" scoped>
 .linkMultiSel{
     width: 100%;
-    height: 300px;
+    height: 310px;
     display: flex;
     ul,li{
         margin: 0;
@@ -87,7 +150,7 @@ import MultiCheckBox from './MultiCheckBox'
         margin-right: 3%;
         border: 1px solid #ccc;
         border-radius: 5px;
-
+        overflow-x: auto;
     }
     .rightBox{
         width: 35%;
@@ -105,9 +168,20 @@ import MultiCheckBox from './MultiCheckBox'
         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;
+    }
 
 
 

+ 10 - 3
src/views/modules/BatchCreate/newDirectedPackage.vue

@@ -510,22 +510,29 @@ let options=[
 ];
 
 let shengshiArr=[
-    {name:'北京'},
-    {name:'天津'},
+    {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:'上社镇'
+                                name:'上社镇',
+                                value:'shangshezhen'
                             }
                         ]
                     }

+ 3 - 3
src/views/modules/Statistics/mediaReport.vue

@@ -438,7 +438,7 @@ export default {
                 projectId:project,
                 mediaType,
                 todayDate:this.dateValue.format('YYYY-MM-DD'),
-                yesterdayDate:this.dateValue.subtract(1,"days").format('YYYY-MM-DD'),               
+                yesterdayDate:moment(this.dateValue).subtract(1,"days").format('YYYY-MM-DD'),               
             }).then(res => {
                 let blob = new Blob([res], {
                 type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
@@ -467,7 +467,7 @@ export default {
         },
         disabledDate(current) {
             // console.log(current)
-            // return  current &&current > moment()
+            return  current &&current > moment()
         },
 
     },
@@ -485,7 +485,7 @@ export default {
             projectId:'',
             mediaType:'',
             todayDate:this.dateValue.format('YYYY-MM-DD'),
-            yesterdayDate:this.dateValue.subtract(1,'days').format('YYYY-MM-DD'),
+            yesterdayDate:moment(this.dateValue).subtract(1,'days').format('YYYY-MM-DD'),
         })
        
        

+ 5 - 5
vue.config.js

@@ -71,9 +71,9 @@ module.exports = {
        
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
-        target: 'http://192.168.1.51:8088', //请求本地 需要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: 'http://api.tjyourong.com.cn/jeecg-boot', //请求本地 需要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后台项目 
@@ -82,9 +82,9 @@ module.exports = {
 
         ws: false,
         changeOrigin: true,
-        // pathRewrite: {
-        //     '/jeecg-boot': ''  //默认所有请求都加了jeecg-boot前缀,需要去掉
-        // }
+        pathRewrite: {
+            '/jeecg-boot': ''  //默认所有请求都加了jeecg-boot前缀,需要去掉
+        }
       },
     },
     // before(app) {