Merge branch 'sit-Carl' of gitee.com:carl_Ming_1/smart-admin into sit-jiamin-v2

This commit is contained in:
Admin
2022-01-21 02:49:44 +00:00
committed by Gitee
29 changed files with 2628 additions and 2040 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="ts-area-picker-container">
<input class="ts-area-picker-value-displayer" @focus="initAddress" v-model="displayValue" placeholder="请选择所在地区"></input>
<input class="ts-area-picker-value-displayer" placeholder="请选择收货地址" @focus="popAddress" v-model="displayValue"></input>
<input type="hidden" :value="returnValue">
<div class="ts-area-picker-desktop" v-if="show">
@@ -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=="<VanPicker>")
{
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=="<VanPicker>")
// {
// _self.onChange(vueComponent,_self.returnValueArr); //Important
// }
// });
// },500);
//mobile end
//PC
this.curDisplayingColIndex=0;
this.switchTab(this.curDisplayingColIndex);
//PC end
},
pcHideAddress() {
this.onConfirm(this.returnValueArr);
@@ -303,7 +317,7 @@ export default {
}
},
mounted(){
console.log(this.defaultValues);
this.initAddress();
},
components:{
@@ -312,13 +326,13 @@ export default {
</script>
<style lang="less" scoped>
.ts-area-picker-container{display:inline-block;}
.ts-area-picker-container{display:inline-block;position:relative;}
.ts-area-picker-value-displayer{
}
.ts-area-picker-tmp-value{
border-bottom:1px solid #D7D7D7;
padding:0 2.5rem;
padding:0;
box-sizing: border-box;
position:relative;
ul{
@@ -332,6 +346,7 @@ export default {
padding: 1.25rem 0;
margin-right:.75rem;
cursor: pointer;
text-align: center;
&.active{
color:#E2001A;
border-bottom:4px solid #E2001A;
@@ -467,11 +482,15 @@ export default {
width:40rem;
}
.ts-area-picker-desktop{
position:absolute;
top:0;
left:0;
display:block;
width:100%;
height:19.25rem;
border:1px solid #808285;
overflow:hidden;
background:#fff;
}
}
@keyframes flash-error