fastadmin custom table search function

In the search function of fastadmin, all fields can be searched by default, and it is hidden and displayed, but we generally need to display it for customers to see at a glance, and some fields are not available for searching. Here is an article to record the solution.
1. First, find the generated js file, find the table in the initialization file section, we need to disable the default search, open common form Search
plus initialization code inside the table the following code

//禁用默认搜索
search: false,
//启用普通表单搜索
commonSearch: true,
//可以控制是否默认显示搜索单表,false则隐藏,默认为false
searchFormVisible: true,

The third field in the code is used to control whether the search column should be displayed on the page. It is not displayed by default. I changed it to display
1) Field fuzzy search, and change the corresponding value of opera to uppercase LIKE.

{
    
    field: 'name', title: '藏品名称',operate:'LIKE'},

2) Full name search

{
    
    field: 'tel', title: __('Tel')},

3) If you want some fields not to be displayed in the search function bar, change the corresponding value of operate to false.

{
    
    field: 'view', title: __('View'),operate:false},

Guess you like

Origin blog.csdn.net/qq_36129701/article/details/81324966