Commit 34e5b4efbf88b091f117153850cf3e73888f99bb
Merge branch 'ft' into 'main_dev'
ix: DEFECT-1682 设备导入时,网关子设备选择支持查询功能 See merge request yunteng/thingskit-front!949
Showing
5 changed files
with
24 additions
and
8 deletions
... | ... | @@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
67 | 67 | |
68 | 68 | if (items.length) { |
69 | 69 | const first = items.at(0)!; |
70 | - const { deviceName, id, severity, type } = first; | |
70 | + const { deviceAlias, deviceName, id, severity, type } = first; | |
71 | 71 | |
72 | 72 | let key: Nullable<string> = `open-notify-${id}`; |
73 | 73 | |
... | ... | @@ -80,7 +80,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
80 | 80 | description: h('div', {}, [ |
81 | 81 | h('div', { style: { marginRight: '5px' } }, [ |
82 | 82 | h('span', { style: { marginRight: '5px' } }, '设备:'), |
83 | - h('span', {}, `[${deviceName}]`), | |
83 | + h('span', {}, `[${deviceAlias ?? deviceName}]`), | |
84 | 84 | ]), |
85 | 85 | h('div', { style: { marginRight: '5px' } }, [ |
86 | 86 | h('span', { style: { marginRight: '5px' } }, '告警场景:'), | ... | ... |
... | ... | @@ -41,6 +41,7 @@ |
41 | 41 | " |
42 | 42 | v-else-if="item.key === TableDefaultTypeEnum.ENTITYID" |
43 | 43 | v-model:value="item.value" |
44 | + v-bind="createPickerSearch()" | |
44 | 45 | placeholder="请选择" |
45 | 46 | :options="entityOptions" |
46 | 47 | allowClear |
... | ... | @@ -53,6 +54,7 @@ |
53 | 54 | " |
54 | 55 | v-else-if="item.key === TableDefaultTypeEnum.KEYS" |
55 | 56 | v-model:value="item.value" |
57 | + v-bind="createPickerSearch()" | |
56 | 58 | placeholder="请选择" |
57 | 59 | :options="attributeOptions" |
58 | 60 | mode="multiple" |
... | ... | @@ -102,6 +104,7 @@ |
102 | 104 | " |
103 | 105 | v-else |
104 | 106 | v-model:value="item.value" |
107 | + v-bind="createPickerSearch()" | |
105 | 108 | placeholder="请选择" |
106 | 109 | :options="valueOptions" |
107 | 110 | allowClear |
... | ... | @@ -157,6 +160,7 @@ |
157 | 160 | import { getPacketIntervalByRange } from '/@/views/device/localtion/cpns/TimePeriodForm/helper'; |
158 | 161 | import { uniqBy } from 'lodash'; |
159 | 162 | import { TableDefaultTypeEnum } from '../../../config/enum'; |
163 | + import { createPickerSearch } from '/@/utils/pickerSearch'; | |
160 | 164 | |
161 | 165 | const props = defineProps({ |
162 | 166 | method: { | ... | ... |
... | ... | @@ -212,6 +212,10 @@ export const basicInfoForm: FormSchema[] = [ |
212 | 212 | labelField: 'name', |
213 | 213 | valueField: 'tbDeviceId', |
214 | 214 | getPopupContainer: () => document.body, |
215 | + showSearch: true, | |
216 | + filterOption: (inputValue: string, options: Record<'label', string>) => { | |
217 | + return options.label.includes(inputValue); | |
218 | + }, | |
215 | 219 | }; |
216 | 220 | }, |
217 | 221 | }, | ... | ... |
... | ... | @@ -2,7 +2,8 @@ import type { BasicColumn } from '/@/components/Table'; |
2 | 2 | import type { FormSchema } from '/@/components/Table'; |
3 | 3 | import { getOrganizationList } from '/@/api/system/system'; |
4 | 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 | 7 | import { EChartsOption } from 'echarts'; |
7 | 8 | |
8 | 9 | export enum AggregateDataEnum { |
... | ... | @@ -31,11 +32,17 @@ export const formSchema: FormSchema[] = [ |
31 | 32 | field: 'deviceProfileId', |
32 | 33 | label: '', |
33 | 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 | { | ... | ... |