Browse Source

修改名称

master
邓宏 2 years ago
parent
commit
43b4724bfc
  1. 42
      uni_modules/d-form/components/d-form/d-form.vue

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

@ -356,7 +356,7 @@
lunar lunar
@confirm="$emit('input',$event.fulldate)"/> @confirm="$emit('input',$event.fulldate)"/>
<u-overlay v-if="type=='select-tab'" :show="show" @click="show=false"> <u-overlay v-if="type=='select-tab'" :show="show" @click="show=false">
<input class="select-tab-input" placeholder="请输入" @click.stop="" :focus="show" @blur="show=false" @confirm="addTab($event.detail.value)"/> <input class="select-tab-input" placeholder="请输入" @click.stop="" :focus="show" @blur="show=false" @confirm="addCode($event.detail.value)"/>
</u-overlay> </u-overlay>
<view v-if="type=='map'" class="amap" :class="{show:showMap}"> <view v-if="type=='map'" class="amap" :class="{show:showMap}">
<map id="amap"/> <map id="amap"/>
@ -563,6 +563,26 @@ import {computeArea} from '@/common/utils'
}) })
} }
}, },
async addCode(e){
if(e){
var res=await request("/common/api/dict/addDictItem",{
params:{
text:e,
dictCode:this.dictCode
}
})
if(res.statu){
uni.showToast({title:"添加成功!",icon:"none"})
this.dictCodeList.push({label: res.data.itemText,value: res.data.itemValue})
}else{
uni.showModal({
title:"提示",
content:res.msg||`添加${this.label}失败!`,
showCancel:false,
})
}
}
},
async afterRead(e){ async afterRead(e){
this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{ this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{
status: 'uploading', status: 'uploading',
@ -602,26 +622,6 @@ import {computeArea} from '@/common/utils'
this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children) this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children)
} }
}, },
async addTab(e){
if(e){
var res=await request("/common/api/dict/addDictItem",{
params:{
text:e,
dictCode:this.dictCode
}
})
if(res.statu){
uni.showToast({title:"添加成功!",icon:"none"})
this.dictCodeList.push({label: res.data.itemText,value: res.data.itemValue})
}else{
uni.showModal({
title:"提示",
content:res.msg||`添加${this.label}失败!`,
showCancel:false,
})
}
}
},
openMap(){ openMap(){
// uni.navigateTo({url:"/pages/massif/mapEditor"}) // uni.navigateTo({url:"/pages/massif/mapEditor"})

Loading…
Cancel
Save