From 1ca9cd8256f676ca10dff6601e79818d9a43a2c8 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 23 Apr 2024 11:10:12 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=A1=A8=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 515cad92c..4b8b07820 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -1859,7 +1859,8 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { //let rootid_ = data.value.label associatedFormsCurrentFormFieldTree.value = [{ id: 'rootid_'+data.label, - label: '当前表单', + //label: '当前表单', + label: '当前表单-'+data.treeAttrs.show, children: [...resData.value], treeAttrs: data.treeAttrs, }] @@ -3459,6 +3460,7 @@ const loadNextPage = () => { { {
From c37de4e81ddb790933400bcf5b8622e6c3914b46 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 23 Apr 2024 13:22:23 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 2 +- src/types/components.d.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 4b8b07820..ff9c43e81 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -3366,7 +3366,7 @@ const loadNextPage = () => { Date: Tue, 7 May 2024 14:45:36 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=85=8D=E7=BD=AE-=E5=8D=95=E9=80=89?= =?UTF-8?q?=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/assembly/index.ts | 9 +- src/components/DesignForm/formControlAttr.vue | 181 +++++++++++++++++- 2 files changed, 186 insertions(+), 4 deletions(-) diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index 76d13c258..dd32b14a2 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -80,7 +80,8 @@ const selectOption: any = [ icon: 'radio', iconFont: 'fa-dot-circle-o', control: { - modelValue: '' + modelValue: '', + glxxsz:[], }, options: selectOption, // 下拉选项数据集合 config: config, @@ -96,7 +97,8 @@ const selectOption: any = [ icon: 'checkbox', iconFont: 'fa-check-square-o', control: { - modelValue: [] + modelValue: [], + glxxsz:[], }, options: selectOption, config: config, @@ -113,7 +115,8 @@ const selectOption: any = [ iconFont: 'fa-toggle-down', control: { modelValue: '', - appendToBody: true + appendToBody: true, + glxxsz:[], }, options: selectOption, config: config, diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index ff9c43e81..7376339b6 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -1850,6 +1850,7 @@ function formidChanged(){ } const associatedFormsCurrentFormFieldTree = ref() +const associatedFormsCurrentFormFieldTreeForGlxxsz = ref() getAssociatedFormsCurrentFieldTree().then(({ data }) => { if(data.id==="cfid为空"){ @@ -1864,6 +1865,17 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { children: [...resData.value], treeAttrs: data.treeAttrs, }] + + let resDataForGlxxsz = ref(data.children.slice(8)) + + + associatedFormsCurrentFormFieldTreeForGlxxsz.value = [{ + id: 'rootid_'+data.label, + //label: '当前表单', + label: '当前表单-'+data.treeAttrs.show, + children: [...resDataForGlxxsz.value], + treeAttrs: data.treeAttrs, + }] } }); @@ -2153,6 +2165,69 @@ function delRole(id:String){ //liwenxuan20240403 associatedForms end +//liwenxuan20240426 单选多选下拉 关联选项设置 start + +const glxxszDialogFlag = ref(false) +const glxxszDialogFlagCheckBox = ref(false) +function handelGlxxszDialog(){ + if(controlData.value.options.length===0){ + alert("无可配置选项,请先添加。") + }else{ + glxxszDialogFlag.value = true + } +} + +function handelGlxxszDialogCheckbox(){ + glxxszDialogFlagCheckBox.value = true +} + +function handleDetermineGlxxszDialog(){ + glxxszDialogFlag.value = false +} +function handleDetermineGlxxszDialogCheckBox(){ + glxxszDialogFlagCheckBox.value = false +} +/* function addShowField(val:string){ + alert('addShowField:'+val) +} */ + + + +//radio,select添加选项时同步配置选项 +watch(()=>controlData.value.options, (changedOptions:any) => { + if(controlData.value.type === "radio" || controlData.value.type === "select"){ + if(changedOptions.length===0){ + //删没了option + controlData.value.control.glxxsz = [] + }else{ + if(changedOptions.length < controlData.value.control.glxxsz.length){ + //删除了某个option + controlData.value.control.glxxsz = controlData.value.control.glxxsz.filter((item: { optionValue: any }) => changedOptions.find((bItem: { value: any }) => item.optionValue == bItem.value)) + }else{ + for(var i = 0; i < changedOptions.length; i++){ + if(controlData.value.control.glxxsz[i]===undefined){ + //新增了某个option + controlData.value.control.glxxsz.push( + { + optionLabel: changedOptions[i].label, + optionValue: changedOptions[i].value, + tableIndex: i, + id: uuidv4().replaceAll('-','').toString(), + } + ) + }else{ + //修改了某个option + controlData.value.control.glxxsz[i].optionLabel = changedOptions[i].label + controlData.value.control.glxxsz[i].optionValue = changedOptions[i].value + } + } + } + } + } +},{ deep: true }) + + +//liwenxuan20240426 单选多选下拉 关联选项设置 end @@ -2774,6 +2849,12 @@ const loadNextPage = () => {
+
+ 关联选项设置 +
+
+ 关联选项设置 +
+ + + + + + + + + + + + + + + + + From 7f6bd37fc8c692a0a60cd1481ea71045850dade2 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Wed, 8 May 2024 16:31:02 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=85=8D=E7=BD=AE-=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/assembly/index.ts | 3 +- src/components/DesignForm/formControlAttr.vue | 98 ++++++++++++++++--- .../DesignForm/public/form/form.vue | 2 +- 3 files changed, 86 insertions(+), 17 deletions(-) diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index dd32b14a2..7d739262f 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -1,3 +1,4 @@ +import { v4 as uuidv4 } from "uuid"; const selectOption: any = [ /*{ label: '标签1', @@ -98,7 +99,7 @@ const selectOption: any = [ iconFont: 'fa-check-square-o', control: { modelValue: [], - glxxsz:[], + glxxszForCheckBox:[], }, options: selectOption, config: config, diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 7376339b6..5b5634bda 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -1134,11 +1134,52 @@ // 属性设置相关结束 // 多选固定选项删除 const delSelectOption = (index: number, type?: string) => { - if (type === 'tabs') { - controlData.value.columns.splice(index, 1) - } else { - controlData.value.options.splice(index, 1) + //liwenxuan 20240508 checkbox 删除选项时提醒 start + let delflag = true + let breakFlag = 0 + if(controlData.value.type === 'checkbox'){ + for(var i = 0;i < controlData.value.control.glxxszForCheckBox.length;i ++){ + if(breakFlag>0){ + break + } + for(var j = 0; j < controlData.value.control.glxxszForCheckBox[i].selectedOptions.length; j++){ + if(controlData.value.control.glxxszForCheckBox[i].selectedOptions[j] === controlData.value.options[index].value){ + let del =confirm("您本次删除的选项已在关联选项设置中有所配置,相关关联选项设置将被删除,是否确定删除?"); + if (del==true){ + breakFlag++ + break + }else{ + delflag = false + breakFlag++ + break + } + } + } + + + } + } + if(delflag === true){ + //删除相关关联选项设置 + const todelArr:any = [] + for(var i = 0;i < controlData.value.control.glxxszForCheckBox.length;i ++){ + for(var j = 0; j < controlData.value.control.glxxszForCheckBox[i].selectedOptions.length; j++){ + if(controlData.value.control.glxxszForCheckBox[i].selectedOptions[j] === controlData.value.options[index].value){ + todelArr.push(controlData.value.control.glxxszForCheckBox[i].id) + } + } + } + for(var i = 0;i < todelArr.length;i++){ + controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id != todelArr[i]) + } + //liwenxuan 20240508 checkbox 删除选项时提醒 end + if (type === 'tabs' ) { + controlData.value.columns.splice(index, 1) + } else { + controlData.value.options.splice(index, 1) + } } + } // 多选固定选项增加 const addSelectOption = (type: any) => { @@ -2223,10 +2264,26 @@ watch(()=>controlData.value.options, (changedOptions:any) => { } } } + }else if(controlData.value.type === "checkbox"){ + } },{ deep: true }) +function createRowForGlxxsz(){ + controlData.value.control.glxxszForCheckBox.push( + { + selectedOptions:[], + showFields:[], + id: uuidv4().replaceAll('-','').toString(), + } + ) +} + +function deleteRowForGlxxsz(row: { id: any }){ + controlData.value.control.glxxszForCheckBox = controlData.value.control.glxxszForCheckBox.filter((item: { id: any }) => item.id!=row.id) +} + //liwenxuan20240426 单选多选下拉 关联选项设置 end @@ -3744,23 +3801,34 @@ const loadNextPage = () => { - - - - @@ -3819,11 +3808,11 @@ const loadNextPage = () => { - + + @@ -3834,7 +3823,7 @@ const loadNextPage = () => {