1.JDate年份显示正常(模态框需完善)

2.a-tree-select搜索接口联调(value值重复需完善)
This commit is contained in:
yaoyanan
2021-03-18 17:40:45 +08:00
parent 8c489cac12
commit 3e3a523644
2 changed files with 42 additions and 17 deletions
+29 -3
View File
@@ -12,6 +12,7 @@
:value="treeValue"
:treeData="treeData"
:multiple="multiple"
:show-search="!multiple"
@change="onChange"
@search="onSearch">
</a-tree-select>
@@ -128,7 +129,7 @@
this.$emit('change', this.value,text)
}
},
initDictInfo(){
initDictInfo(){ //取出父组件传过来的codetexttableName
let arr = this.dict.split(",")
this.tableName = arr[0]
this.text = arr[1]
@@ -150,6 +151,7 @@
hasChildField:this.hasChildField,
condition:this.condition
}
console.log(param)
getAction(this.url,param).then(res=>{
if(res.success){
console.log(res)
@@ -184,7 +186,7 @@
}
}
},
loadRoot(){
loadRoot(){ // 初始化树
let param = {
pid:this.pidValue,
tableName:this.tableName,
@@ -224,7 +226,31 @@
},
onSearch(value){
console.log(value)
let param = {
code:this.code,
keyword:value,
pidField:this.pidField,
tableName:this.tableName,
text:this.text
}
getAction('/sys/dict/queryTreeDataByKeyword',param).then((res)=>{
if (res.success){
//设置是否是叶子节点(是否能展开)
for(let i of res.result){
i.value = i.key
if(i.leaf==false){
i.isLeaf=false
}else if(i.leaf==true){
i.isLeaf=true
}
}
//赋值树的数据
this.treeData = []
this.treeData = [...res.result]
// this.treeData = fn(res.result)
// fn(res.result)
}
})
},
getCurrTreeData(){
return this.treeData