Commit 4c48b4a378d902e55856d4d38c4e2b4a0c723ef1

Authored by ww
1 parent 5b271c79

fix: types error

1 import { RadioRecord } from '../../../views/visual/board/detail/config/util'; 1 import { RadioRecord } from '../../../views/visual/board/detail/config/util';
2 import { DeviceTypeEnum } from '../../device/model/deviceModel'; 2 import { DeviceTypeEnum } from '../../device/model/deviceModel';
3 import { DataType } from '../../device/model/modelOfMatterModel'; 3 import { DataType } from '../../device/model/modelOfMatterModel';
  4 +import { DataTypeEnum } from '/@/components/Form/src/externalCompns/components/StructForm/config';
4 5
5 export interface AddDataBoardParams { 6 export interface AddDataBoardParams {
6 name: string; 7 name: string;
@@ -152,7 +153,7 @@ export interface ComponentInfoDetail { @@ -152,7 +153,7 @@ export interface ComponentInfoDetail {
152 153
153 export interface DeviceAttributeParams { 154 export interface DeviceAttributeParams {
154 deviceProfileId: string; 155 deviceProfileId: string;
155 - dataType?: DataType; 156 + dataType?: DataTypeEnum;
156 } 157 }
157 158
158 export interface DeviceAttributeRecord { 159 export interface DeviceAttributeRecord {
@@ -188,11 +188,6 @@ @@ -188,11 +188,6 @@
188 dataSource.value = props.record.record.dataSource.map((item) => { 188 dataSource.value = props.record.record.dataSource.map((item) => {
189 const id = buildUUID(); 189 const id = buildUUID();
190 190
191 - dataSource.value.push({  
192 - id,  
193 - ...item,  
194 - });  
195 -  
196 nextTick(() => { 191 nextTick(() => {
197 (dataSourceEl[id] as FormActionType).setFieldsValue(item); 192 (dataSourceEl[id] as FormActionType).setFieldsValue(item);
198 (dataSourceEl[id] as FormActionType).clearValidate(); 193 (dataSourceEl[id] as FormActionType).clearValidate();
@@ -297,7 +292,7 @@ @@ -297,7 +292,7 @@
297 292
298 <section ref="formListEl"> 293 <section ref="formListEl">
299 <div v-for="item in dataSource" :data-id="item.id" :key="item.id" class="flex bg-light-50"> 294 <div v-for="item in dataSource" :data-id="item.id" :key="item.id" class="flex bg-light-50">
300 - <div class="w-24 text-right flex right justify-end"> 选择设备 </div> 295 + <div class="w-24 text-right flex justify-end"> 选择设备 </div>
301 <div class="pl-2 flex-auto"> 296 <div class="pl-2 flex-auto">
302 <component 297 <component
303 :frontId="$props.frontId" 298 :frontId="$props.frontId"
@@ -8,6 +8,7 @@ import { getDeviceProfile } from '/@/api/alarm/position'; @@ -8,6 +8,7 @@ import { getDeviceProfile } from '/@/api/alarm/position';
8 import { getModelServices } from '/@/api/device/modelOfMatter'; 8 import { getModelServices } from '/@/api/device/modelOfMatter';
9 import { findDictItemByCode } from '/@/api/system/dict'; 9 import { findDictItemByCode } from '/@/api/system/dict';
10 import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; 10 import { DeviceTypeEnum } from '/@/api/device/model/deviceModel';
  11 +import { DataTypeEnum } from '/@/components/Form/src/externalCompns/components/StructForm/config';
11 12
12 export enum BasicConfigField { 13 export enum BasicConfigField {
13 NAME = 'name', 14 NAME = 'name',
@@ -263,7 +264,7 @@ export const dataSourceSchema = (frontId?: FrontComponent): FormSchema[] => { @@ -263,7 +264,7 @@ export const dataSourceSchema = (frontId?: FrontComponent): FormSchema[] => {
263 if (deviceProfileId) { 264 if (deviceProfileId) {
264 return await getDeviceAttribute({ 265 return await getDeviceAttribute({
265 deviceProfileId, 266 deviceProfileId,
266 - dataType: isControlComponent(frontId!) ? 'BOOL' : undefined, 267 + dataType: isControlComponent(frontId!) ? DataTypeEnum.IS_BOOL : undefined,
267 }); 268 });
268 } 269 }
269 } catch (error) {} 270 } catch (error) {}