Commit e30d1276 by fukai

完善对setValues、setCodeValues的支持

parent 6bdbee1a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:clearable="clearable" :clearable="clearable"
@click.native="handleClick" @click.native="handleClick"
> >
<template v-if="dbCodeList.length > 0"> <template v-if="dbCodeList && dbCodeList.length > 0">
<el-option <el-option
v-for="item in dbCodeList" v-for="item in dbCodeList"
:key="item.value" :key="item.value"
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
> >
</el-option> </el-option>
</template> </template>
<template v-else-if="code.length > 0"> <template v-else-if="code && code.length > 0">
<el-option <el-option
v-for="item in code" v-for="item in code"
:key="item.value" :key="item.value"
......
...@@ -20,6 +20,19 @@ export default { ...@@ -20,6 +20,19 @@ export default {
Vue.set(this.codeSet,key,values[key]) Vue.set(this.codeSet,key,values[key])
} }
}, },
//获取后台setValues、setCodeValues传来的动态码
getBackendCode(key){
let arr = codeSet[key]
if(!arr)
return undefined
return arr.map(item=>{
let itemArr = item.split("\t")
if(itemArr.length > 1)
return {label:itemArr[0]+"\t"+itemArr[1],value:itemArr[0]}
else
return {label:itemArr[0],value:itemArr[1]}
})
},
async init(params) { async init(params) {
let rtnmsg = await Api.post(this.declareParams.trnName + "/init", { params }) let rtnmsg = await Api.post(this.declareParams.trnName + "/init", { params })
if(rtnmsg.respCode == SUCCESS){ if(rtnmsg.respCode == SUCCESS){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment