From 32eb542f94f460a9f13cfcab3187af6cd936a225 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Mon, 15 Dec 2025 15:55:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5,=E6=8C=89=E9=92=AE=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/formControlPropertiNew.vue | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 8853b90..2c80d32 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2838,8 +2838,7 @@ function getAssociatedFormsCurrentFieldTree1() { // 初始选项数据 const options = ref([]) -// 选中的值 -const selectedValues = ref(["1", "3"]) + // 弹窗显示状态 const dialogVisible = ref(false) @@ -2883,10 +2882,30 @@ const saveChanges = () => { // 清空编辑文本 editText.value = '' - console.log('选项已更新:', { - options: options.value, - selected: selectedValues.value - }) + + controlData.value.options = mergeArrays(controlData.value.options,options.value) + options.value = [] +} + + +function mergeArrays(a, b) { + // 1. 找出a中的最大value(转为数字比较) + let maxValue = 0; + a.forEach(item => { + const numValue = parseInt(item.value, 10); + if (numValue > maxValue) { + maxValue = numValue; + } + }); + + // 2. 创建b的副本并重新赋值value,从maxValue+1开始递增 + const newB = b.map((item, index) => ({ + ...item, + value: String(maxValue + 1 + index) + })); + + // 3. 合并数组,a在前,新的b在后 + return [...a, ...newB]; } //选项批量编辑 liwenxuan 20251212 end @@ -6100,7 +6119,7 @@ const formatTooltip = (val: number) => { -
+
{{ controlData.type === "cascader" ? "编辑" : "新增" }} - - - - 批量编辑 + + 批量导入 +
+ 关联选项设置 +
+
+ 关联选项设置 +
+
+ 关联选项设置 +
+