diff --git a/src/components/ProTable/interface/index.ts b/src/components/ProTable/interface/index.ts index 6a806959..8a9425b4 100644 --- a/src/components/ProTable/interface/index.ts +++ b/src/components/ProTable/interface/index.ts @@ -1,6 +1,6 @@ import { VNode, ComponentPublicInstance, Ref } from "vue"; import { BreakPoint, Responsive } from "@/components/Grid/interface"; -import { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults"; +import type { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults"; import { ProTableProps } from "@/components/ProTable/index.vue"; import ProTable from "@/components/ProTable/index.vue"; @@ -47,6 +47,8 @@ export type SearchProps = { offset?: number; // 搜索字段左侧偏移列数 defaultValue?: string | number | boolean | any[] | Ref; // 搜索项默认值 render?: (scope: SearchRenderScope) => VNode; // 自定义搜索内容渲染(tsx语法) + prependSelect?: boolean; // 搜索项前置选择框,默认为 false + prependSelectOptions?: EnumProps[]; // 搜索项前置选择框数据源,默认为 [] } & Partial>; export type FieldNamesProps = { diff --git a/src/components/SearchForm/components/SearchFormItem.vue b/src/components/SearchForm/components/SearchFormItem.vue index db78afd7..c3674597 100644 --- a/src/components/SearchForm/components/SearchFormItem.vue +++ b/src/components/SearchForm/components/SearchFormItem.vue @@ -2,10 +2,21 @@ + + @@ -23,9 +34,9 @@ diff --git a/src/views/proTable/useProTable/index.vue b/src/views/proTable/useProTable/index.vue index 1f02caeb..b78bacf1 100644 --- a/src/views/proTable/useProTable/index.vue +++ b/src/views/proTable/useProTable/index.vue @@ -163,7 +163,24 @@ const columns = reactive[]>([ } } }, - { prop: "idCard", label: "身份证号", search: { el: "input" } }, + { + prop: "idCard", + label: "综合搜索", + search: { + el: "input", + prependSelect: true, + prependSelectOptions: [ + { + label: "身份证号", + value: "idCard" + }, + { + label: "邮箱", + value: "email" + } + ] + } + }, { prop: "email", label: "邮箱" }, { prop: "address", label: "居住地址" }, {