diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 7a8cc8f..2b81063 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2829,6 +2829,67 @@ function getAssociatedFormsCurrentFieldTree1() { }); } + +//选项批量编辑 liwenxuan 20251212 start + +// 初始选项数据 +const options = ref([]) + +// 选中的值 +const selectedValues = ref(["1", "3"]) + +// 弹窗显示状态 +const dialogVisible = ref(false) + +// 编辑时的文本内容(每行一个选项) +const editText = ref('') + +// 打开弹窗 +const openDialog = () => { + // 将选项数组转换为文本,每行一个 + editText.value = options.value.map(option => option.label).join('\n') + dialogVisible.value = true +} + +// 取消编辑 +const cancelEditing = () => { + dialogVisible.value = false + editText.value = '' +} + +// 保存更改 +const saveChanges = () => { + // 按行分割文本,过滤空行和空白字符 + const lines = editText.value + .split('\n') + .map(line => line.trim()) + .filter(line => line !== '') + + // 生成新的选项数组 + const newOptions = lines.map((label, index) => ({ + label, + value: (index + 1).toString() // 从1开始的正整数 + })) + + // 更新选项列表 + options.value = newOptions + + // 关闭弹窗 + dialogVisible.value = false + + // 清空编辑文本 + editText.value = '' + + console.log('选项已更新:', { + options: options.value, + selected: selectedValues.value + }) +} + +//选项批量编辑 liwenxuan 20251212 end + + + //关联选项设置优化为树 liwenxuan 20251209 start let datapropsformList = JSON.parse(JSON.stringify(props.formList)) const glxxszTree = computed(()=>{ @@ -6151,6 +6212,12 @@ const formatTooltip = (val: number) => { controlData.type === "cascader" ? "编辑" : "新增" }} + + + 批量编辑 + + +