| | |
| | | if (index >= 0) items?.splice(index, 1); |
| | | } |
| | | |
| | | function deptSearch({ exposed }: { exposed: any }) { |
| | | const items = exposed.config?.items as { prop?: string; component?: any }[] | undefined; |
| | | if (!items) return; |
| | | for (let i = items.length - 1; i >= 0; i--) { |
| | | if (items[i].prop === "departmentId") items.splice(i, 1); |
| | | } |
| | | items.unshift({ |
| | | label: t("按单位筛选"), |
| | | prop: "departmentId", |
| | | component: { |
| | | name: "cl-dept-select", |
| | | props: { |
| | | placeholder: t("请选择单位"), |
| | | checkStrictly: true, |
| | | immediate: true, |
| | | clearable: true, |
| | | }, |
| | | style: { width: "180px" }, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const Search = useSearch({ |
| | | plugins: [hideDateSearch] |
| | | plugins: [hideDateSearch, deptSearch] |
| | | }); |
| | | |
| | | // cl-crud |