<el-select
v-model="getListParams.usedStatus"
placeholder="请选择状态"
filterable
:filter-method="filterList"
clearable
@clear="clearList"
>
<el-option
v-for="item in allListTop15"
:key="item.baselineId"
:label="item.baselineName"
:value="item.baselineId"
>
</el-option>
</el-select>
getAllList() {
getBaselineList({ page: 1, rows: 1000 }, (data) => {
const { code, message } = data
if (code !== '200') {
this.$message.error(message)
return
}
this.allList = data.data.list || []
let currenItem = this.allList.filter((item) => item.baselineId === 'AQJX0033231')
this.allListTop15 = this.allList.slice(0, 15)
this.allListTop15 = [...new Set([...currenItem, ...this.allListTop15])]
})
},
filterList(query) {
if (query) {
let result= this.allList.filter((item) => item.baselineName.includes(query))
this.allListTop15 = result.length > 15 ? result.slice(0, 15) : result
}
},
clearList() {
this.allListTop15 = this.allList.slice(0, 15)
}
|