筛选控件全面 支持AutoComplete

This commit is contained in:
杰 朱
2021-10-22 15:59:29 +08:00
parent 0d15cd1150
commit 753f7a3258
3 changed files with 38 additions and 12 deletions

View File

@@ -23,17 +23,42 @@ export default {
data: Array //表格数据
},
computed: {
/*
custnanme() {
this.data3=[];
this.data3 = [];
this.data.forEach(item => {
//console.log(1)
this.data3.push(item.cCusAbbName);
});
this.data3 = this.noRepeat(this.data3);
this.data3 = this.data3.slice(0, 10);
//console.log(this.data);
//console.log(this.columns);
//console.log(this.arraydata);
return this.data3;
},
*/
getarraydata:function(){
this.arraydata=[]
this.columns.forEach(element => {
this.arraydata[element.key] = [];
});
for (var item = 0; item < this.data.length; item++) {
//遍历对象数组,item表示某个具体的对象
for (var i in this.data[item]) {
if (this.arraydata.hasOwnProperty(i)) {
this.arraydata[i].push(this.data[item][i]);
}
//console.log(this.objectList[item][i]); //objectList[item][i]表示某个对象的某个具体属性值,i表示属性名,可以打印出来看一下;
}
}
return function(key){
this.arraydata[key] = this.noRepeat(this.arraydata[key]);
return this.arraydata[key];
}
}
},
data() {
return {
@@ -43,6 +68,7 @@ export default {
}
],
data3: [],
arraydata: new Array(),
tableColumnsFilters: [],
search: {} //过滤条件保存的对象,就是保存Input框和Select中值
};
@@ -92,7 +118,7 @@ export default {
props: {
value: "", //Select选项列表一般 0 为全部
transfer: true,
data: this.custnanme,
data: this.getarraydata(this.columns[index].key),
filterMethod: this.filterMethod
},
on: {
@@ -230,7 +256,7 @@ export default {
}, 0);
sums[key] = {
key,
value: v
value: v
};
} else {
sums[key] = {
@@ -239,7 +265,6 @@ export default {
};
}
});
return sums;
}

View File

@@ -169,7 +169,7 @@ export default {
key: "cSOCode",
width: "160",
filter: {
type: "Input"
type: "AutoComplete"
}
},
@@ -189,7 +189,7 @@ export default {
width: "150",
key: "cInvName",
filter: {
type: "Input"
type: "AutoComplete"
}
},
{
@@ -198,7 +198,7 @@ export default {
key: "cInvStd",
width: "220",
filter: {
type: "Input"
type: "AutoComplete"
}
},
{
@@ -526,6 +526,7 @@ body {
}
.ivu-select-dropdown-transfer {
width: 150px;
width: 165px;
height: 350px;
}
</style>