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 95 };
96 96 setFormValues(record);
97 97 } else {
  98 + selectWidgetKeys.value = {
  99 + componentKey: TextComponent1Config.key,
  100 + categoryKey: PackagesCategoryEnum.TEXT,
  101 + };
98 102 dataSource.value = [genNewDataSourceItem()];
99 103 }
100 104 }
... ...
... ... @@ -19,6 +19,7 @@
19 19 const currentValue = ref(false);
20 20
21 21 const getDesign = computed(() => {
  22 + // console.log(props.config, 'config');
22 23 const { option } = props.config;
23 24 const {
24 25 attribute,
... ...
... ... @@ -352,18 +352,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
352 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 355 // 选择控制组件4的时候只能选择属性且是(int double类型)
368 356 if (unref(selectWidgetKeys).componentKey == 'LateralNumericalControl') {
369 357 setFieldsValue({
... ...
... ... @@ -102,7 +102,7 @@ class Subscriber {
102 102 return {
103 103 cmdId: subscriptionId,
104 104 entityId: deviceId,
105   - keys: Array.from(attributes.values()).join(','),
  105 + keys: Array.from(attributes.values()).filter(Boolean).join(','),
106 106 entityType: EntityTypeEnum.DEVICE,
107 107 scope: ScopeTypeEnum.LATEST_TELEMERY,
108 108 ...(unsubscribe ? { unsubscribe } : {}),
... ... @@ -354,6 +354,7 @@ export const useDataFetch = (
354 354 props: { config: ComponentPropsConfigType },
355 355 updateFn: DataFetchUpdateFn
356 356 ) => {
  357 + console.log(props, 'props');
357 358 const getBindAttribute = computed(() => {
358 359 const { config } = props;
359 360 const { option } = config as ComponentPropsConfigType<Recordable, DataSource>;
... ...