Commit 6ca3829487e7de2281d7c854e5d13a4d6e3ffe42
1 parent
9c6698b8
fix:DEFECT-1003 场景联动执行动作,选择类型后,产品显示为全部
Showing
1 changed file
with
10 additions
and
3 deletions
@@ -9,7 +9,7 @@ import { scheduleOptions } from './formatData'; | @@ -9,7 +9,7 @@ import { scheduleOptions } from './formatData'; | ||
9 | import { copyTransFun } from '/@/utils/fnUtils'; | 9 | import { copyTransFun } from '/@/utils/fnUtils'; |
10 | import { numberAndNonegativeRule } from '/@/utils/rules'; | 10 | import { numberAndNonegativeRule } from '/@/utils/rules'; |
11 | import { findDictItemByCode } from '/@/api/system/dict'; | 11 | import { findDictItemByCode } from '/@/api/system/dict'; |
12 | -import { deviceProfile, queryDeviceProfileBy } from '/@/api/device/deviceManager'; | 12 | +import { queryDeviceProfileBy } from '/@/api/device/deviceManager'; |
13 | import { getModelServices } from '/@/api/device/modelOfMatter'; | 13 | import { getModelServices } from '/@/api/device/modelOfMatter'; |
14 | import { ModelOfMatterParams } from '/@/api/device/model/modelOfMatterModel'; | 14 | import { ModelOfMatterParams } from '/@/api/device/model/modelOfMatterModel'; |
15 | import useCommonFun from '../hooks/useCommonFun'; | 15 | import useCommonFun from '../hooks/useCommonFun'; |
@@ -418,7 +418,8 @@ export const actionSchema: FormSchema[] = [ | @@ -418,7 +418,8 @@ export const actionSchema: FormSchema[] = [ | ||
418 | component: 'ApiSelect', | 418 | component: 'ApiSelect', |
419 | colProps: { span: 6 }, | 419 | colProps: { span: 6 }, |
420 | defaultValue: 'SENSOR', | 420 | defaultValue: 'SENSOR', |
421 | - componentProps: () => { | 421 | + componentProps: ({ formActionType }) => { |
422 | + const { setFieldsValue } = formActionType; | ||
422 | return { | 423 | return { |
423 | api: findDictItemByCode, | 424 | api: findDictItemByCode, |
424 | params: { | 425 | params: { |
@@ -428,6 +429,11 @@ export const actionSchema: FormSchema[] = [ | @@ -428,6 +429,11 @@ export const actionSchema: FormSchema[] = [ | ||
428 | labelField: 'itemText', | 429 | labelField: 'itemText', |
429 | valueField: 'itemValue', | 430 | valueField: 'itemValue', |
430 | getPopupContainer: () => document.body, | 431 | getPopupContainer: () => document.body, |
432 | + onChange(e) { | ||
433 | + if (e) { | ||
434 | + setFieldsValue({ deviceProfileId: '' }); | ||
435 | + } | ||
436 | + }, | ||
431 | }; | 437 | }; |
432 | }, | 438 | }, |
433 | ifShow: ({ values }) => isDeviceOut(values.outTarget), | 439 | ifShow: ({ values }) => isDeviceOut(values.outTarget), |
@@ -440,8 +446,9 @@ export const actionSchema: FormSchema[] = [ | @@ -440,8 +446,9 @@ export const actionSchema: FormSchema[] = [ | ||
440 | componentProps: ({ formActionType, formModel }) => { | 446 | componentProps: ({ formActionType, formModel }) => { |
441 | const { setFieldsValue } = formActionType; | 447 | const { setFieldsValue } = formActionType; |
442 | const deviceType = formModel['deviceType']; | 448 | const deviceType = formModel['deviceType']; |
449 | + console.log(deviceType); | ||
443 | return { | 450 | return { |
444 | - api: deviceProfile, | 451 | + api: queryDeviceProfileBy, |
445 | params: { | 452 | params: { |
446 | deviceType, | 453 | deviceType, |
447 | }, | 454 | }, |