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(); if(this.type=='dateRange' && this.dateType=='end' && this.value[0])return new Date(this.value[0]).getTime();
}, },
imgs(){ 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 [] return []
}, },
pickerContent(){// pickerContent(){//
@ -381,9 +381,9 @@ import {dataType} from 'black-knight/lib/config/tools'
setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1) setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1)
}) })
} }
}, if(this.type=='upImg'){
activated(){ window.the=this
console.log("-------activated---------------") }
}, },
methods:{ methods:{
async afterRead(e){ 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.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}){ delImg({file}){
if(file.type=='unsaved'){ if(file.type=='unsaved'){
this.imgList.splice(file.index,1) this.imgList.splice(file.index,1)
}else{ }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){ pickerChange(e){
if(dataType(e.value[e.columnIndex].children, 'array')){ 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.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
this.maps.onclick=(e)=>{ this.maps.onclick=(e)=>{
if(this.value.length<0){ if(this.value.length<0){
} }
console.log(e,'-------maps--click---------') console.log(e,'-------maps--click---------')
} }

Loading…
Cancel
Save