Commit e6225729fc0f11047b02e7c6a5fb389dbc8136cf
1 parent
ae44df41
fix: DEFECT-1679 设备分布中,产品也加入支持搜索功能
Showing
1 changed file
with
13 additions
and
6 deletions
| @@ -2,7 +2,8 @@ import type { BasicColumn } from '/@/components/Table'; | @@ -2,7 +2,8 @@ import type { BasicColumn } from '/@/components/Table'; | ||
| 2 | import type { FormSchema } from '/@/components/Table'; | 2 | import type { FormSchema } from '/@/components/Table'; |
| 3 | import { getOrganizationList } from '/@/api/system/system'; | 3 | import { getOrganizationList } from '/@/api/system/system'; |
| 4 | import { copyTransFun } from '/@/utils/fnUtils'; | 4 | import { copyTransFun } from '/@/utils/fnUtils'; |
| 5 | -import { getDeviceDataKeys, getDeviceProfile } from '/@/api/alarm/position'; | 5 | +import { getDeviceDataKeys } from '/@/api/alarm/position'; |
| 6 | +import { deviceProfile } from '/@/api/device/deviceManager'; | ||
| 6 | import { EChartsOption } from 'echarts'; | 7 | import { EChartsOption } from 'echarts'; |
| 7 | 8 | ||
| 8 | export enum AggregateDataEnum { | 9 | export enum AggregateDataEnum { |
| @@ -31,11 +32,17 @@ export const formSchema: FormSchema[] = [ | @@ -31,11 +32,17 @@ export const formSchema: FormSchema[] = [ | ||
| 31 | field: 'deviceProfileId', | 32 | field: 'deviceProfileId', |
| 32 | label: '', | 33 | label: '', |
| 33 | component: 'ApiSelect', | 34 | component: 'ApiSelect', |
| 34 | - componentProps: { | ||
| 35 | - api: getDeviceProfile, | ||
| 36 | - placeholder: '请选择产品', | ||
| 37 | - labelField: 'name', | ||
| 38 | - valueField: 'tbProfileId', | 35 | + componentProps: () => { |
| 36 | + return { | ||
| 37 | + showSearch: true, | ||
| 38 | + labelField: 'name', | ||
| 39 | + valueField: 'tbProfileId', | ||
| 40 | + resultField: 'data', | ||
| 41 | + placeholder: '请选择产品', | ||
| 42 | + api: deviceProfile, | ||
| 43 | + filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => | ||
| 44 | + option.label.includes(inputValue), | ||
| 45 | + }; | ||
| 39 | }, | 46 | }, |
| 40 | }, | 47 | }, |
| 41 | { | 48 | { |