From 55e23ac305e430319cd9e3689dc38876bdce8fe8 Mon Sep 17 00:00:00 2001 From: Vion Date: Thu, 20 Jan 2022 23:53:53 +0800 Subject: [PATCH] Accepting incoming values : fixed --- rc-busness/components/addressInput.vue | 61 +++++++++++++++++--------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/rc-busness/components/addressInput.vue b/rc-busness/components/addressInput.vue index a7671802..a60768aa 100644 --- a/rc-busness/components/addressInput.vue +++ b/rc-busness/components/addressInput.vue @@ -56,27 +56,14 @@ export default { }, methods:{ initAddress(){ - this.show=true; //Initilizing - - //mobile - let self=this; // defaultValues : array[{id:"_ID_IN_columns_of_province",name:"_NAME_IN_columns"},{id:"_ID_IN_columns_of_city",name:"_NAME_IN_columns"},{id:"_ID_IN_columns_of_area",name:"_NAME_IN_columns"}] let defaultValues = [{id:this.columns[0].values[0].id, name:this.columns[0].values[0].name},{id:this.columns[1].values[0].id, name:this.columns[1].values[0].name},{id:this.columns[2].values[0].id, name:this.columns[2].values[0].name}]; - if(this.defaultValues) - defaultValues=this.defaultValues; - this.$children.forEach(function(vueComponent){ - if(vueComponent._name=="") - { - self.onChange(vueComponent,defaultValues); //Important - } - }); - //mobile end - - //PC - this.curDisplayingColIndex=0; - this.switchTab(this.curDisplayingColIndex); - //PC end + if(this.defaultValues && this.defaultValues.length>0) + { + defaultValues = this.defaultValues; + this.onConfirm(defaultValues); + } //Initilizing end }, pickValue(pickId,pickName){ @@ -160,7 +147,7 @@ export default { return false; for(var i in haystack){ if(haystack[i].id==needle.id){ - return true; + return i; } } return false; @@ -245,6 +232,33 @@ export default { }, popAddress() { this.show=true; + let _self=this; + + //mobile + //const picker = this.selectComponent('.ts-area-picker-mobile-component'); + this.defaultValues.forEach(function(ele,index){ + let tmpPointer=parseInt(_self.inArray(ele,_self.columns[index].values)); + if(tmpPointer) + { + _self.columns[index].defaultIndex = tmpPointer; + } + }); + + // setTimeout(function(){ + // //debugger; + // _self.$children.forEach(function(vueComponent){ + // if(vueComponent._name=="") + // { + // _self.onChange(vueComponent,_self.returnValueArr); //Important + // } + // }); + // },500); + //mobile end + + //PC + this.curDisplayingColIndex=0; + this.switchTab(this.curDisplayingColIndex); + //PC end }, pcHideAddress() { this.onConfirm(this.returnValueArr); @@ -312,13 +326,13 @@ export default {