From 18832377995c25cc1f1299002de2482e29a347fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Wed, 25 Dec 2024 16:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-module/data-rendering/index.vue | 5 +- .../custom-tabs-content.vue | 60 ++++ .../model-custom-group/index.vue | 306 +++++++++++------- .../model-custom-group-style.vue | 34 +- .../model-custom/components/index-default.ts | 12 +- .../model-custom/components/index.vue | 14 +- .../model-custom/model-custom-styles.vue | 8 +- 7 files changed, 304 insertions(+), 135 deletions(-) create mode 100644 src/components/common/custom-module/model-custom-group/custom-tabs-config/custom-tabs-content.vue diff --git a/src/components/common/custom-module/data-rendering/index.vue b/src/components/common/custom-module/data-rendering/index.vue index e747184f..ad04b1aa 100644 --- a/src/components/common/custom-module/data-rendering/index.vue +++ b/src/components/common/custom-module/data-rendering/index.vue @@ -14,7 +14,10 @@ + diff --git a/src/components/common/custom-module/model-custom-group/custom-tabs-config/custom-tabs-content.vue b/src/components/common/custom-module/model-custom-group/custom-tabs-config/custom-tabs-content.vue new file mode 100644 index 00000000..8a37abaa --- /dev/null +++ b/src/components/common/custom-module/model-custom-group/custom-tabs-config/custom-tabs-content.vue @@ -0,0 +1,60 @@ + + + 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 2e7f8b5d..1e40c59e 100644 --- a/src/components/common/custom-module/model-custom-group/index.vue +++ b/src/components/common/custom-module/model-custom-group/index.vue @@ -1,18 +1,59 @@ diff --git a/src/components/model-custom/components/index-default.ts b/src/components/model-custom/components/index-default.ts index 160afca1..441c3b9f 100644 --- a/src/components/model-custom/components/index-default.ts +++ b/src/components/model-custom/components/index-default.ts @@ -175,18 +175,16 @@ const panel_com_data = { } const custom_group_com_data = { + // 容器高度 com_width: 100, com_height: 100, staging_height: 100, - color_list: [{ color: 'rgb(244, 252, 255)', color_percentage: undefined }], - direction: '90deg', - custom_list: [], + custom_list: [], // 自定义内容处理 custom_height: 100, // 自定义高度 - data_content: { - - }, + data_source_direction: 'vertical', // 铺满方式 + data_source_carousel_col: 1, // 铺满数量 data_style: { - ...defaultCustom + ...defaultCustom.style } } // 判断两个矩形是否有交集或者被包裹 diff --git a/src/components/model-custom/components/index.vue b/src/components/model-custom/components/index.vue index caf314de..6c5e347b 100644 --- a/src/components/model-custom/components/index.vue +++ b/src/components/model-custom/components/index.vue @@ -84,6 +84,9 @@ + @@ -202,10 +205,7 @@ const on_sort = (item: SortableEvent) => { }; //#endregion //#region 中间区域的处理逻辑 -const diy_data = ref([]); -watch(props.list, (newVal) => { - diy_data.value = newVal; -}, {immediate: true, deep: true}); +const diy_data = toRef(props.list); // 因为容器变更的话,需要重新计算高度,所以不能默认选中第一个 // onMounted(() => { // // 如果默认不等于空的话,则默认选中第一个 @@ -260,9 +260,13 @@ const edit_close_processing = (index: number) => { // 复制 const copy = (index: null | number) => { if (typeof index === 'number' && !isNaN(index)) { + const data = cloneDeep(get_diy_index_data(index)); + // 计算存在多少个相同的key + const list = diy_data.value.filter(item => item.key == data.key); // 获取当前数据, 复制的时候id更换一下 const new_data = { - ...cloneDeep(get_diy_index_data(index)), + ...data, + new_name: data.name + list.length, // 添加别名, 复制是在原有的基础上复制,所以必须要不需要判断是否存在历史的 id: get_math(), }; // 在当前位置下插入数据 diff --git a/src/components/model-custom/model-custom-styles.vue b/src/components/model-custom/model-custom-styles.vue index 1679d1ba..959aef75 100644 --- a/src/components/model-custom/model-custom-styles.vue +++ b/src/components/model-custom/model-custom-styles.vue @@ -68,7 +68,7 @@
- +