Showing
1 changed file
with
14 additions
and
1 deletions
| @@ -256,7 +256,7 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -256,7 +256,7 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 256 | api: async () => { | 256 | api: async () => { |
| 257 | try { | 257 | try { |
| 258 | if (deviceProfileId) { | 258 | if (deviceProfileId) { |
| 259 | - return await getDeviceAttribute({ | 259 | + const option = await getDeviceAttribute({ |
| 260 | deviceProfileId, | 260 | deviceProfileId, |
| 261 | dataType: | 261 | dataType: |
| 262 | (isControlComponent(category!) && | 262 | (isControlComponent(category!) && |
| @@ -265,6 +265,19 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -265,6 +265,19 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 265 | ? DataTypeEnum.IS_BOOL | 265 | ? DataTypeEnum.IS_BOOL |
| 266 | : undefined, | 266 | : undefined, |
| 267 | }); | 267 | }); |
| 268 | + | ||
| 269 | + // 当我们通过复制组件在进行编辑的时候选择控制组件会使不是bool属性的值进行赋值 | ||
| 270 | + if ( | ||
| 271 | + (!option?.length && | ||
| 272 | + isControlComponent(category!) && | ||
| 273 | + unref(selectWidgetKeys).componentKey !== 'LateralNumericalControl') || | ||
| 274 | + isBooleanComponent(unref(selectWidgetKeys)) | ||
| 275 | + ) { | ||
| 276 | + setFieldsValue({ | ||
| 277 | + [DataSourceField.ATTRIBUTE]: null, | ||
| 278 | + }); | ||
| 279 | + } | ||
| 280 | + return option; | ||
| 268 | } | 281 | } |
| 269 | } catch (error) {} | 282 | } catch (error) {} |
| 270 | return []; | 283 | return []; |