75 lines
1.7 KiB
TypeScript
75 lines
1.7 KiB
TypeScript
import DeptAPI from "@/api/dept";
|
|
import type { ISearchConfig } from "@/components/PageSearch/index.vue";
|
|
|
|
const searchConfig: ISearchConfig = {
|
|
pageName: "sys:user",
|
|
formItems: [
|
|
{
|
|
type: "input",
|
|
label: "关键字",
|
|
prop: "keywords",
|
|
attrs: {
|
|
placeholder: "用户名/昵称/手机号",
|
|
clearable: true,
|
|
style: {
|
|
width: "200px",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: "tree-select",
|
|
label: "部门",
|
|
prop: "deptId",
|
|
attrs: {
|
|
placeholder: "请选择",
|
|
data: [],
|
|
filterable: true,
|
|
"check-strictly": true,
|
|
"render-after-expand": false,
|
|
clearable: true,
|
|
style: {
|
|
width: "150px",
|
|
},
|
|
},
|
|
async initFn(formItem) {
|
|
formItem.attrs.data = await DeptAPI.getOptions();
|
|
// 注意:如果initFn函数不是箭头函数,this会指向此配置项对象,那么也就可以用this来替代形参formItem
|
|
// this.attrs!.data = await DeptAPI.getOptions();
|
|
},
|
|
},
|
|
{
|
|
type: "select",
|
|
label: "状态",
|
|
prop: "status",
|
|
attrs: {
|
|
placeholder: "全部",
|
|
clearable: true,
|
|
style: {
|
|
width: "100px",
|
|
},
|
|
},
|
|
options: [
|
|
{ label: "启用", value: 1 },
|
|
{ label: "禁用", value: 0 },
|
|
],
|
|
},
|
|
{
|
|
type: "date-picker",
|
|
label: "创建时间",
|
|
prop: "createAt",
|
|
attrs: {
|
|
type: "daterange",
|
|
"range-separator": "~",
|
|
"start-placeholder": "开始时间",
|
|
"end-placeholder": "截止时间",
|
|
"value-format": "YYYY-MM-DD",
|
|
style: {
|
|
width: "240px",
|
|
},
|
|
},
|
|
},
|
|
],
|
|
};
|
|
|
|
export default searchConfig;
|