diff --git a/src/components/common/carousel-indicator/index.vue b/src/components/common/carousel-indicator/index.vue index 023fe003..7db034e3 100644 --- a/src/components/common/carousel-indicator/index.vue +++ b/src/components/common/carousel-indicator/index.vue @@ -3,7 +3,7 @@
- +
diff --git a/src/components/common/custom-module/data-rendering/index.vue b/src/components/common/custom-module/data-rendering/index.vue index 46b5c0d7..46f69c0e 100644 --- a/src/components/common/custom-module/data-rendering/index.vue +++ b/src/components/common/custom-module/data-rendering/index.vue @@ -2,7 +2,7 @@
@@ -66,6 +66,12 @@ const props = defineProps({ type: Boolean, default: false }, + groupSourceList: { + type: Array, + default: () => { + return []; + } + }, customGroupFieldId: { type: String, default: '' diff --git a/src/components/common/custom-module/model-custom-group/index.vue b/src/components/common/custom-module/model-custom-group/index.vue index 6fd64d0b..c1ec2921 100644 --- a/src/components/common/custom-module/model-custom-group/index.vue +++ b/src/components/common/custom-module/model-custom-group/index.vue @@ -8,7 +8,7 @@
- +
@@ -19,7 +19,7 @@
- +
@@ -38,7 +38,7 @@ @@ -87,6 +87,23 @@ const props = defineProps({ isCustom: { type: Boolean, default: false + }, + groupSourceList: { + type: Array, + default: () => { + return []; + } + }, + showData: { + type: Object as PropType<{ + data_key: string; + data_name: string; + data_logo?: string; + }>, + default: () => ({ + data_key: 'id', + data_name: 'name', + }) } }); // 用于页面判断显示 @@ -102,19 +119,24 @@ const is_show = computed(() => { //#region 自定义组真实数据 const data_source_content_list = computed(() => { - if (!isEmpty(props.sourceList)) { - const data_source_id = form.value.data_source_field.id; - let list = get_nested_property(props.sourceList, data_source_id); - // 如果是自定义标题,进一步处理嵌套对象中的数据 - if (props.sourceList.data) { - list = get_nested_property(props.sourceList.data, data_source_id); + const data_source_id = form.value?.data_source_field?.id || ''; + // 自定义组的数据源内容切换 + const is_data_source_id = field_list.value.filter((item: any) => item.field == data_source_id); + if (is_data_source_id.length > 0) { + if (!isEmpty(props.sourceList)) { + let list = get_nested_property(props.sourceList, data_source_id); + // 如果是自定义标题,进一步处理嵌套对象中的数据 + if (props.sourceList.data) { + list = get_nested_property(props.sourceList.data, data_source_id); + } + return list == '' ? [] : list; + } else { + return []; } - return list == '' ? [] : list; } else { - return []; + return props.groupSourceList; } }); - const get_nested_property = (obj: any, path: string) => { // 检查路径参数是否为字符串且非空,若不满足条件则返回空字符串 if (typeof path !== 'string' || !path) return []; diff --git a/src/components/common/custom-module/model-icon/index.vue b/src/components/common/custom-module/model-icon/index.vue index 87785781..1a9b9ffd 100644 --- a/src/components/common/custom-module/model-icon/index.vue +++ b/src/components/common/custom-module/model-icon/index.vue @@ -37,6 +37,10 @@ const props = defineProps({ type: Boolean, default: false }, + isCustomGroup: { + type: Boolean, + default: false + }, customGroupFieldId: { type: String, default: '' diff --git a/src/components/common/custom-module/model-image/index.vue b/src/components/common/custom-module/model-image/index.vue index 62a35308..1e8bb07c 100644 --- a/src/components/common/custom-module/model-image/index.vue +++ b/src/components/common/custom-module/model-image/index.vue @@ -32,6 +32,10 @@ const props = defineProps({ type: Boolean, default: false }, + isCustomGroup: { + type: Boolean, + default: false + }, customGroupFieldId: { type: String, default: '' diff --git a/src/components/common/custom-module/model-lines/index.vue b/src/components/common/custom-module/model-lines/index.vue index ba33120b..20b01dfd 100644 --- a/src/components/common/custom-module/model-lines/index.vue +++ b/src/components/common/custom-module/model-lines/index.vue @@ -26,6 +26,10 @@ const props = defineProps({ type: Boolean, default: false }, + isCustomGroup: { + type: Boolean, + default: false + }, customGroupFieldId: { type: String, default: '' diff --git a/src/components/common/custom-module/model-panel/index.vue b/src/components/common/custom-module/model-panel/index.vue index 35b89ffe..cd1fb763 100644 --- a/src/components/common/custom-module/model-panel/index.vue +++ b/src/components/common/custom-module/model-panel/index.vue @@ -28,6 +28,10 @@ const props = defineProps({ type: Boolean, default: false }, + isCustomGroup: { + type: Boolean, + default: false + }, customGroupFieldId: { type: String, default: '' diff --git a/src/components/common/custom-module/model-text/index.vue b/src/components/common/custom-module/model-text/index.vue index 3ec3ef79..fc5daf1b 100644 --- a/src/components/common/custom-module/model-text/index.vue +++ b/src/components/common/custom-module/model-text/index.vue @@ -39,6 +39,10 @@ const props = defineProps({ type: Boolean, default: false }, + isCustomGroup: { + type: Boolean, + default: false + }, customGroupFieldId: { type: String, default: '' @@ -87,7 +91,7 @@ const text_title = computed(() => { let new_title = cloneDeep(formValue.text_title); let new_field_list = field_list.value; // 判断是否是自定义组 - if (!props.isCustom && !isEmpty(props.customGroupFieldId)) { + if (props.isCustomGroup && !isEmpty(props.customGroupFieldId)) { // 取出对应自定义组的内容 const group_option_list = new_field_list.find((item: any) => item.field === props.customGroupFieldId); // 取出自定义组内部数据源参数的详细数据 diff --git a/src/components/model-carousel/model-carousel-content.vue b/src/components/model-carousel/model-carousel-content.vue index 97dd1948..8d5ce844 100644 --- a/src/components/model-carousel/model-carousel-content.vue +++ b/src/components/model-carousel/model-carousel-content.vue @@ -1,8 +1,10 @@