search项默认显示4条
This commit is contained in:
@@ -231,6 +231,22 @@ const summaryMethod1=({columns,data})=>{
|
||||
})
|
||||
return styleObj
|
||||
}
|
||||
|
||||
// 远程搜索处理函数
|
||||
async function handleRemoteSearch(code,prop,page,dictData) {
|
||||
// 空关键词时可选择加载前10条或清空
|
||||
try {
|
||||
let res = await ReportApi.getTableList(code,{pageSize: 50, pageNo:page})
|
||||
// 更新下拉选项
|
||||
dictData= dictData.concat(res.records.map(item=>({
|
||||
label:item[prop],
|
||||
value:item[prop]
|
||||
})))
|
||||
page++
|
||||
} finally {
|
||||
|
||||
}
|
||||
}
|
||||
function getCurrentDate() {
|
||||
const now = new Date();
|
||||
// 补零函数:小于10则前面加0
|
||||
@@ -383,6 +399,11 @@ const initTable = async () => {
|
||||
pageSize: 1000000,
|
||||
pageNo:1
|
||||
}
|
||||
// config.dicData=[]
|
||||
// config.remote=true
|
||||
// config.popperAppendToBody= true
|
||||
// let pageN=1
|
||||
// config.remoteMethod= handleRemoteSearch(jkTableDicFields[item.fieldName],config.prop,pageN,config.dicData)
|
||||
config.dicFormatter= (res) => { //请求数据格式化
|
||||
const arr=[...new Set(res.records.map(item=>item[config.prop=="zonename"?"salezonename":config.prop]))]
|
||||
return arr.map(item=>({label:item,value:item}))
|
||||
|
||||
@@ -26,7 +26,7 @@ export const setupAvue = async (app: App<Element>) => {
|
||||
searchSpan: 6,
|
||||
searchMenuSpan: 6,
|
||||
searchMenuPosition: 'left',
|
||||
searchIndex: 3,
|
||||
searchIndex: 4,
|
||||
searchIcon: true,
|
||||
searchShowBtn: true,
|
||||
labelSuffix: ' ',
|
||||
|
||||
Reference in New Issue
Block a user