diff --git a/common/request.js b/common/request.js
index b56a794..62b81ef 100644
--- a/common/request.js
+++ b/common/request.js
@@ -3,7 +3,7 @@ import store from "@/store"
export function host(host='default',suffix='/plant_manage'){
return(
process.env.NODE_ENV === 'development'?{
- default:`http://qv6mj8.natappfree.cc${suffix}`
+ default:`http://m3df6f.natappfree.cc${suffix}`
}:{
default:`http://qv6mj8.natappfree.cc${suffix}`
}
@@ -29,10 +29,11 @@ const request=async function(url,param={}){
"X-Access-Token":store.getters.token,
}
- if(param.file){
+ if(param.file||param.filePath){
var res=await uni.uploadFile({
url:`${param.host||host()}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`,
- file:param.file,
+ file:param.file||{},
+ filePath:param.filePath||"",
name:"file",
formData:param.body||{},
timeout:param.timeout||60*1000,
diff --git a/components/form.vue b/components/form.vue
index 250deb0..b297672 100644
--- a/components/form.vue
+++ b/components/form.vue
@@ -141,25 +141,25 @@
-
+
{{suffix}}
- {{/^\d+$/.test(value)&&columns[0][value][keyName]||placeholder||`请选择${label}`}}
+ {{/^\d+$/.test(value)&&columns[0][value].label||placeholder||`请选择${label}`}}
添加照片
-
+
{{value[0]||startPlaceholder||'开始时间'}}
-
{{value[1]||endPlaceholder||'结束时间'}}
-
+
@@ -171,7 +171,7 @@
v-if="type=='select'"
:columns="columns"
:show="show"
- :keyName="keyName"
+ keyName="label"
:defaultIndex="[value||0]"
closeOnClickOverlay
@close="show=false"
@@ -225,10 +225,6 @@ import request,{host} from '@/common/request'
type:String,
default:"",
},
- keyName:{
- type:String,
- default:"label",
- },
type:{
type:String,
default:"text"
@@ -288,14 +284,14 @@ import request,{host} from '@/common/request'
})))
for(var i=0; i{
if(v==e.file[i]){
v.status='success'
v.message=''
- v.tempUrl=res.data.data
+ v.tempUrl=res.data
this.$set(this.imgList,k,this.imgList[k])
return true
}
diff --git a/pages/massif/info.vue b/pages/massif/info.vue
index e100832..3c79673 100644
--- a/pages/massif/info.vue
+++ b/pages/massif/info.vue
@@ -14,27 +14,29 @@
v-bind="v"
:required="!!rules[k]"
:field="k"
- :value="({dateRange:fields.date.value})[v.type||'text']||formData[k]"
+ :value="(/^dateRange$|^select$/.test(v.type)?fields[k].value:formData[k])"
@input="formData[k]=$event"
@selectRDate="selectDate"
+ @select="fields[k].value=$event;formData[k]=fields[k].columns[0][$event].value"
@imgs="fields[k].value=$event"/>