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 | 9 | import { copyTransFun } from '/@/utils/fnUtils'; |
10 | 10 | import { numberAndNonegativeRule } from '/@/utils/rules'; |
11 | 11 | import { findDictItemByCode } from '/@/api/system/dict'; |
12 | -import { deviceProfile, queryDeviceProfileBy } from '/@/api/device/deviceManager'; | |
12 | +import { queryDeviceProfileBy } from '/@/api/device/deviceManager'; | |
13 | 13 | import { getModelServices } from '/@/api/device/modelOfMatter'; |
14 | 14 | import { ModelOfMatterParams } from '/@/api/device/model/modelOfMatterModel'; |
15 | 15 | import useCommonFun from '../hooks/useCommonFun'; |
... | ... | @@ -418,7 +418,8 @@ export const actionSchema: FormSchema[] = [ |
418 | 418 | component: 'ApiSelect', |
419 | 419 | colProps: { span: 6 }, |
420 | 420 | defaultValue: 'SENSOR', |
421 | - componentProps: () => { | |
421 | + componentProps: ({ formActionType }) => { | |
422 | + const { setFieldsValue } = formActionType; | |
422 | 423 | return { |
423 | 424 | api: findDictItemByCode, |
424 | 425 | params: { |
... | ... | @@ -428,6 +429,11 @@ export const actionSchema: FormSchema[] = [ |
428 | 429 | labelField: 'itemText', |
429 | 430 | valueField: 'itemValue', |
430 | 431 | getPopupContainer: () => document.body, |
432 | + onChange(e) { | |
433 | + if (e) { | |
434 | + setFieldsValue({ deviceProfileId: '' }); | |
435 | + } | |
436 | + }, | |
431 | 437 | }; |
432 | 438 | }, |
433 | 439 | ifShow: ({ values }) => isDeviceOut(values.outTarget), |
... | ... | @@ -440,8 +446,9 @@ export const actionSchema: FormSchema[] = [ |
440 | 446 | componentProps: ({ formActionType, formModel }) => { |
441 | 447 | const { setFieldsValue } = formActionType; |
442 | 448 | const deviceType = formModel['deviceType']; |
449 | + console.log(deviceType); | |
443 | 450 | return { |
444 | - api: deviceProfile, | |
451 | + api: queryDeviceProfileBy, | |
445 | 452 | params: { |
446 | 453 | deviceType, |
447 | 454 | }, | ... | ... |