Commit 8eb7140680c0cc26976eef2398d0cd4061580842

Authored by xp.Huang
2 parents 9617ea8e 6191613e

Merge branch 'fix/DEFECT-1494' into 'main_dev'

fix: 修改控制组问题和看板编辑创建没有恢复默认

See merge request yunteng/thingskit-front!809
@@ -95,6 +95,10 @@ @@ -95,6 +95,10 @@
95 }; 95 };
96 setFormValues(record); 96 setFormValues(record);
97 } else { 97 } else {
  98 + selectWidgetKeys.value = {
  99 + componentKey: TextComponent1Config.key,
  100 + categoryKey: PackagesCategoryEnum.TEXT,
  101 + };
98 dataSource.value = [genNewDataSourceItem()]; 102 dataSource.value = [genNewDataSourceItem()];
99 } 103 }
100 } 104 }
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 const currentValue = ref(false); 19 const currentValue = ref(false);
20 20
21 const getDesign = computed(() => { 21 const getDesign = computed(() => {
  22 + // console.log(props.config, 'config');
22 const { option } = props.config; 23 const { option } = props.config;
23 const { 24 const {
24 attribute, 25 attribute,
@@ -352,18 +352,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => { @@ -352,18 +352,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
352 : undefined, 352 : undefined,
353 }); 353 });
354 354
355 - // 当我们通过复制组件在进行编辑的时候选择控制组件会使不是bool属性的值进行赋值  
356 - if (  
357 - (!option?.length &&  
358 - isControlComponent(category!) &&  
359 - unref(selectWidgetKeys).componentKey !== 'LateralNumericalControl') ||  
360 - isBooleanComponent(unref(selectWidgetKeys))  
361 - ) {  
362 - setFieldsValue({  
363 - [DataSourceField.ATTRIBUTE]: null,  
364 - });  
365 - }  
366 -  
367 // 选择控制组件4的时候只能选择属性且是(int double类型) 355 // 选择控制组件4的时候只能选择属性且是(int double类型)
368 if (unref(selectWidgetKeys).componentKey == 'LateralNumericalControl') { 356 if (unref(selectWidgetKeys).componentKey == 'LateralNumericalControl') {
369 setFieldsValue({ 357 setFieldsValue({
@@ -102,7 +102,7 @@ class Subscriber { @@ -102,7 +102,7 @@ class Subscriber {
102 return { 102 return {
103 cmdId: subscriptionId, 103 cmdId: subscriptionId,
104 entityId: deviceId, 104 entityId: deviceId,
105 - keys: Array.from(attributes.values()).join(','), 105 + keys: Array.from(attributes.values()).filter(Boolean).join(','),
106 entityType: EntityTypeEnum.DEVICE, 106 entityType: EntityTypeEnum.DEVICE,
107 scope: ScopeTypeEnum.LATEST_TELEMERY, 107 scope: ScopeTypeEnum.LATEST_TELEMERY,
108 ...(unsubscribe ? { unsubscribe } : {}), 108 ...(unsubscribe ? { unsubscribe } : {}),
@@ -354,6 +354,7 @@ export const useDataFetch = ( @@ -354,6 +354,7 @@ export const useDataFetch = (
354 props: { config: ComponentPropsConfigType }, 354 props: { config: ComponentPropsConfigType },
355 updateFn: DataFetchUpdateFn 355 updateFn: DataFetchUpdateFn
356 ) => { 356 ) => {
  357 + console.log(props, 'props');
357 const getBindAttribute = computed(() => { 358 const getBindAttribute = computed(() => {
358 const { config } = props; 359 const { config } = props;
359 const { option } = config as ComponentPropsConfigType<Recordable, DataSource>; 360 const { option } = config as ComponentPropsConfigType<Recordable, DataSource>;