Browse Source

修改 表单图片

master
邓宏 2 years ago
parent
commit
04778febce
  1. 16
      uni_modules/d-form/components/d-form/d-form.vue

16
uni_modules/d-form/components/d-form/d-form.vue

@ -359,7 +359,7 @@ import {dataType} from 'black-knight/lib/config/tools'
if(this.type=='dateRange' && this.dateType=='end' && this.value[0])return new Date(this.value[0]).getTime();
},
imgs(){
if(this.type=='upImg')return this.value.map((v,index)=>({url:`${host('imgUrl')}/${v}`,status:"success",index,type:'saved'})).concat(this.imgList.map((v,index)=>Object.assign(v,{index,type:'unsaved'})))
if(this.type=='upImg')return this.value.map((v,index)=>({url:`${host('imgUrl')}/${v}`,tempUrl:v,status:"success",index,type:'saved'})).concat(this.imgList.map((v,index)=>Object.assign(v,{index,type:'unsaved'})))
return []
},
pickerContent(){//
@ -381,9 +381,9 @@ import {dataType} from 'black-knight/lib/config/tools'
setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1)
})
}
},
activated(){
console.log("-------activated---------------")
if(this.type=='upImg'){
window.the=this
}
},
methods:{
async afterRead(e){
@ -410,15 +410,15 @@ import {dataType} from 'black-knight/lib/config/tools'
this.imgList=this.imgList.filter(v=>!v==e.file[i])
}
}
this.$emit('imgs',this.imgs.map(v=>({saved:v.url,unsaved:v.tempUrl})[v.type]).join(','))
this.$emit('imgs',this.imgs.map(v=>v.tempUrl).join(','))
},
delImg({file}){
if(file.type=='unsaved'){
this.imgList.splice(file.index,1)
}else{
this.$emit("input",this.value.filter(v=>v.index!=file.index).map(v=>v.url))
this.$emit("input",this.value.filter((v,k)=>k!=file.index))
}
this.$emit('imgs',this.imgs.map(v=>({saved:v.url,unsaved:v.tempUrl})[v.type]).join(','))
this.$emit('imgs',this.imgs.map(v=>v.tempUrl).join(','))
},
pickerChange(e){
if(dataType(e.value[e.columnIndex].children, 'array')){
@ -435,7 +435,7 @@ import {dataType} from 'black-knight/lib/config/tools'
this.maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
this.maps.onclick=(e)=>{
if(this.value.length<0){
}
console.log(e,'-------maps--click---------')
}

Loading…
Cancel
Save