Commit 34e5b4efbf88b091f117153850cf3e73888f99bb

Authored by xp.Huang
2 parents 76f07c64 8adb6e9b

Merge branch 'ft' into 'main_dev'

ix: DEFECT-1682 设备导入时,网关子设备选择支持查询功能

See merge request yunteng/thingskit-front!949
@@ -187,6 +187,7 @@ export interface AlarmLogItem { @@ -187,6 +187,7 @@ export interface AlarmLogItem {
187 originatorType: number; 187 originatorType: number;
188 deviceId: string; 188 deviceId: string;
189 deviceName: string; 189 deviceName: string;
  190 + deviceAlias: string;
190 type: string; 191 type: string;
191 severity: string; 192 severity: string;
192 status: string; 193 status: string;
@@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
67 67
68 if (items.length) { 68 if (items.length) {
69 const first = items.at(0)!; 69 const first = items.at(0)!;
70 - const { deviceName, id, severity, type } = first; 70 + const { deviceAlias, deviceName, id, severity, type } = first;
71 71
72 let key: Nullable<string> = `open-notify-${id}`; 72 let key: Nullable<string> = `open-notify-${id}`;
73 73
@@ -80,7 +80,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -80,7 +80,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
80 description: h('div', {}, [ 80 description: h('div', {}, [
81 h('div', { style: { marginRight: '5px' } }, [ 81 h('div', { style: { marginRight: '5px' } }, [
82 h('span', { style: { marginRight: '5px' } }, '设备:'), 82 h('span', { style: { marginRight: '5px' } }, '设备:'),
83 - h('span', {}, `[${deviceName}]`), 83 + h('span', {}, `[${deviceAlias ?? deviceName}]`),
84 ]), 84 ]),
85 h('div', { style: { marginRight: '5px' } }, [ 85 h('div', { style: { marginRight: '5px' } }, [
86 h('span', { style: { marginRight: '5px' } }, '告警场景:'), 86 h('span', { style: { marginRight: '5px' } }, '告警场景:'),
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 " 41 "
42 v-else-if="item.key === TableDefaultTypeEnum.ENTITYID" 42 v-else-if="item.key === TableDefaultTypeEnum.ENTITYID"
43 v-model:value="item.value" 43 v-model:value="item.value"
  44 + v-bind="createPickerSearch()"
44 placeholder="请选择" 45 placeholder="请选择"
45 :options="entityOptions" 46 :options="entityOptions"
46 allowClear 47 allowClear
@@ -53,6 +54,7 @@ @@ -53,6 +54,7 @@
53 " 54 "
54 v-else-if="item.key === TableDefaultTypeEnum.KEYS" 55 v-else-if="item.key === TableDefaultTypeEnum.KEYS"
55 v-model:value="item.value" 56 v-model:value="item.value"
  57 + v-bind="createPickerSearch()"
56 placeholder="请选择" 58 placeholder="请选择"
57 :options="attributeOptions" 59 :options="attributeOptions"
58 mode="multiple" 60 mode="multiple"
@@ -102,6 +104,7 @@ @@ -102,6 +104,7 @@
102 " 104 "
103 v-else 105 v-else
104 v-model:value="item.value" 106 v-model:value="item.value"
  107 + v-bind="createPickerSearch()"
105 placeholder="请选择" 108 placeholder="请选择"
106 :options="valueOptions" 109 :options="valueOptions"
107 allowClear 110 allowClear
@@ -157,6 +160,7 @@ @@ -157,6 +160,7 @@
157 import { getPacketIntervalByRange } from '/@/views/device/localtion/cpns/TimePeriodForm/helper'; 160 import { getPacketIntervalByRange } from '/@/views/device/localtion/cpns/TimePeriodForm/helper';
158 import { uniqBy } from 'lodash'; 161 import { uniqBy } from 'lodash';
159 import { TableDefaultTypeEnum } from '../../../config/enum'; 162 import { TableDefaultTypeEnum } from '../../../config/enum';
  163 + import { createPickerSearch } from '/@/utils/pickerSearch';
160 164
161 const props = defineProps({ 165 const props = defineProps({
162 method: { 166 method: {
@@ -212,6 +212,10 @@ export const basicInfoForm: FormSchema[] = [ @@ -212,6 +212,10 @@ export const basicInfoForm: FormSchema[] = [
212 labelField: 'name', 212 labelField: 'name',
213 valueField: 'tbDeviceId', 213 valueField: 'tbDeviceId',
214 getPopupContainer: () => document.body, 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,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 {