浏览代码

新建定向包问题

liuxiaona 1 年之前
父节点
当前提交
a2c59f0d6c

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

@@ -57,12 +57,14 @@ const props = withDefaults(defineProps<{
57 57
   title?: string,
58 58
   list?:any,
59 59
   subId?:string|number,
60
-  echochooseNum?:number
60
+  echochooseNum?:number,
61
+  key?:number
61 62
 }>(), {
62 63
   title: '',
63 64
   list:[],
64 65
   subId:'',
65
-  echochooseNum:0
66
+  echochooseNum:0,
67
+  key:1
66 68
 })
67 69
 const chooseObj = reactive<reactiveTableAndAny>({
68 70
   items:[]
@@ -80,50 +82,9 @@ const {
80 82
 }  = cascaderTs(props)
81 83
 
82 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 85
 const chooseNum = ref<number>(props.echochooseNum)
124 86
 
125 87
 const updateChooseNum = () => {
126
-  console.log('updateChooseNum');
127 88
   let num:number = 0
128 89
   chooseObj.items = []
129 90
   opionsList.value.forEach(item=>{
@@ -165,6 +126,9 @@ const updateChooseNum = () => {
165 126
 watch(()=>pageInfo.key,()=>{
166 127
   updateChooseNum()
167 128
 })
129
+watch(()=>props.key,()=>{
130
+  pageInfo.subOpions = []
131
+})
168 132
 onMounted(()=>{
169 133
   updateChooseNum()
170 134
 })

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

@@ -34,7 +34,9 @@
34 34
                       @returnEvent="val=>reEventRadio(val,item)">
35 35
             <template v-if="item.EgName=='geo_location'" v-slot:appoint>
36 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 40
                 <el-checkbox-group v-model="item.value.location_types" @change="getEstimation">
39 41
                   <el-checkbox v-for="i in pageInfo.locationList" :label="i.label" >{{i.value}}</el-checkbox>
40 42
                 </el-checkbox-group>
@@ -139,6 +141,7 @@ const pageInfo = reactive<reactiveTableAndAny>({
139 141
   ],
140 142
   estimationObj:{},
141 143
   directPacketParams:{},//确认和获取信息后台需要的参数
144
+  showKey:1
142 145
 })
143 146
 const fullLoading = ref<boolean>(false)
144 147
 
@@ -301,6 +304,7 @@ const switchShow = (val:boolean)=>{
301 304
   dialogShow.value = val
302 305
   if(val){
303 306
     loading.value = true
307
+    pageInfo.showKey++
304 308
     nextTick(async ()=>{
305 309
       //自定义转化行为
306 310
       await get_behavior_list()