Browse Source

新建定向包问题

liuxiaona 1 year ago
parent
commit
a2c59f0d6c

+ 7 - 43
src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index.vue

57
   title?: string,
57
   title?: string,
58
   list?:any,
58
   list?:any,
59
   subId?:string|number,
59
   subId?:string|number,
60
-  echochooseNum?:number
60
+  echochooseNum?:number,
61
+  key?:number
61
 }>(), {
62
 }>(), {
62
   title: '',
63
   title: '',
63
   list:[],
64
   list:[],
64
   subId:'',
65
   subId:'',
65
-  echochooseNum:0
66
+  echochooseNum:0,
67
+  key:1
66
 })
68
 })
67
 const chooseObj = reactive<reactiveTableAndAny>({
69
 const chooseObj = reactive<reactiveTableAndAny>({
68
   items:[]
70
   items:[]
80
 }  = cascaderTs(props)
82
 }  = cascaderTs(props)
81
 
83
 
82
 const {deleEvent} = subChooseTs()
84
 const {deleEvent} = subChooseTs()
83
-
84
-// const chooseNum = computed(()=>{
85
-//   let num:number = 0
86
-//   chooseObj.items = []
87
-//   opionsList.value.forEach(item=>{
88
-//     if(item.isCheck){
89
-//       num+=1
90
-//       chooseObj.items.push(item)
91
-//     }else{
92
-//       if(item.child&&item.child.length>0){
93
-//         item.child.forEach(sub=>{
94
-//           if(sub.isCheck){
95
-//             num+=1
96
-//             chooseObj.items.push(sub)
97
-//           }else{
98
-//             if(sub.child&&sub.child.length>0){
99
-//               sub.child.forEach(sun=>{
100
-//                 if(sun.isCheck){
101
-//                   num+=1
102
-//                   chooseObj.items.push(sun)
103
-//                 }else{
104
-//                   if(sun.child&&sun.child.length>0){
105
-//                     sun.child.forEach(cSun=>{
106
-//                       if(cSun.isCheck){
107
-//                         num+=1
108
-//                         chooseObj.items.push(cSun)
109
-//                       }
110
-//                     })
111
-//                   }
112
-//                 }
113
-//               })
114
-//             }
115
-//           }
116
-//         })
117
-//       }
118
-//     }
119
-//   })
120
-//   return num
121
-// })
122
-
123
 const chooseNum = ref<number>(props.echochooseNum)
85
 const chooseNum = ref<number>(props.echochooseNum)
124
 
86
 
125
 const updateChooseNum = () => {
87
 const updateChooseNum = () => {
126
-  console.log('updateChooseNum');
127
   let num:number = 0
88
   let num:number = 0
128
   chooseObj.items = []
89
   chooseObj.items = []
129
   opionsList.value.forEach(item=>{
90
   opionsList.value.forEach(item=>{
165
 watch(()=>pageInfo.key,()=>{
126
 watch(()=>pageInfo.key,()=>{
166
   updateChooseNum()
127
   updateChooseNum()
167
 })
128
 })
129
+watch(()=>props.key,()=>{
130
+  pageInfo.subOpions = []
131
+})
168
 onMounted(()=>{
132
 onMounted(()=>{
169
   updateChooseNum()
133
   updateChooseNum()
170
 })
134
 })

+ 5 - 1
src/components/businessMoudle/batchGdt/configArea/directPacket/newDirecPacket.vue

34
                       @returnEvent="val=>reEventRadio(val,item)">
34
                       @returnEvent="val=>reEventRadio(val,item)">
35
             <template v-if="item.EgName=='geo_location'" v-slot:appoint>
35
             <template v-if="item.EgName=='geo_location'" v-slot:appoint>
36
               <div class="tMar20">
36
               <div class="tMar20">
37
-                <Cascade title="国家" :list="pageInfoTs.location_ca_list" :echochooseNum="item.value.regions&&item.value.regions.length" key="geo_location" @getIds="val=>handleCasItem(val,'geo_location',item)"></Cascade>
37
+                <Cascade :key="pageInfo.showKey" title="国家" :list="pageInfoTs.location_ca_list"
38
+                         :echochooseNum="item.value.regions&&item.value.regions.length" key="geo_location"
39
+                         @getIds="val=>handleCasItem(val,'geo_location',item)"></Cascade>
38
                 <el-checkbox-group v-model="item.value.location_types" @change="getEstimation">
40
                 <el-checkbox-group v-model="item.value.location_types" @change="getEstimation">
39
                   <el-checkbox v-for="i in pageInfo.locationList" :label="i.label" >{{i.value}}</el-checkbox>
41
                   <el-checkbox v-for="i in pageInfo.locationList" :label="i.label" >{{i.value}}</el-checkbox>
40
                 </el-checkbox-group>
42
                 </el-checkbox-group>
139
   ],
141
   ],
140
   estimationObj:{},
142
   estimationObj:{},
141
   directPacketParams:{},//确认和获取信息后台需要的参数
143
   directPacketParams:{},//确认和获取信息后台需要的参数
144
+  showKey:1
142
 })
145
 })
143
 const fullLoading = ref<boolean>(false)
146
 const fullLoading = ref<boolean>(false)
144
 
147
 
301
   dialogShow.value = val
304
   dialogShow.value = val
302
   if(val){
305
   if(val){
303
     loading.value = true
306
     loading.value = true
307
+    pageInfo.showKey++
304
     nextTick(async ()=>{
308
     nextTick(async ()=>{
305
       //自定义转化行为
309
       //自定义转化行为
306
       await get_behavior_list()
310
       await get_behavior_list()