From d2f22ccdc74c1ee8434e878ed13ed06f49f18eec Mon Sep 17 00:00:00 2001 From: zhf <1204297681@qq.com> Date: Tue, 15 Jul 2025 22:06:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E5=8F=82=E6=95=B0=E6=8F=8F=E8=BF=B0=E3=80=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E5=8F=82=E6=95=B0=E9=80=82=E9=85=8D=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ibiz-transfer-picker.tsx | 5 ++-- .../date-range-select.tsx | 10 +++---- .../date-range-select.controller.ts | 9 ++++++ .../ibiz-emoji-picker/ibiz-emoji-picker.tsx | 1 + .../ibiz-tree-picker/ibiz-tree-picker.tsx | 5 ++-- .../ibiz-virtualized-list.tsx | 30 ++++++++++++------- 6 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.tsx b/src/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.tsx index 0df78bbb..d7ad32fd 100644 --- a/src/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.tsx +++ b/src/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.tsx @@ -22,15 +22,16 @@ import './ibiz-transfer-picker.scss'; /** * 穿梭框选择(扩展) * - * @description 用于通过穿梭框样式区分未选数据和已选数据。基于`数据选择`编辑器进行扩展,编辑器样式代码名称为:TRANSFER_PICKER + * @description 通过穿梭框区分未选数据和已选数据。基于`数据选择`编辑器进行扩展,编辑器样式代码名称为:TRANSFER_PICKER * @primary * @editorparams {"name":"titles","parameterType":"string[]","defaultvalue":"[\"可选列表\",\"已选列表\"]","description":"用于自定义列表标题,该值为字符串数组。其中下标为 0 的字符串对应穿梭框左侧列表的标题,下标为 1 的字符串对应穿梭框右侧列表的标题"} * @editorparams {"name":"buttontexts","parameterType":"string[]","defaultvalue":"[\"删除\",\"添加\"]","description":"用于自定义按钮显示文字,该值为字符串数组。其中下标为 0 的字符串对应左侧按钮文字,下标为 1 的字符串对应右侧按钮文字"} * @editorparams {"name":"remotesearch","parameterType":"boolean","defaultvalue":"false","description":"是否启用远程过滤搜索功能。左侧列表默认采用本地过滤搜索,若此值为 true,则会开启远程过滤搜索"} * @editorparams {"name":"valuetype","parameterType":"string","description":"编辑器的值类型"} - * @editorparams {"name":"objectidfield","parameterType":"string","description":"值类型为OBJECTS时的对象标识属性"} + * @editorparams {"name":"objectidfield","parameterType":"string","description":"值类型为OBJECTS时的对象标识属性。当值类型非 OBJECTS 且配置了此参数时,抛出的值为选中数据以值分隔符拼接而成的字符串"} * @editorparams {"name":"objectnamefield","parameterType":"string","description":"值类型为OBJECTS时的对象名称属性。也用于控制是否触发左侧列表数据的默认加载,配置时会触发默认加载,不配置时不会触发默认加载"} * @editorparams {"name":"objectvaluefield","parameterType":"string","description":"值类型为OBJECTS时的对象值属性"} + * @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"} * @ignoreprops autoFocus | overflowMode * @ignoreemits blur | focus | enter */ diff --git a/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx b/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx index ec0a1862..11ad9666 100644 --- a/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx +++ b/src/editor/date-range-select/date-range-select-picker/date-range-select.tsx @@ -21,12 +21,12 @@ import './date-range-select.scss'; /** * 时间范围选择(扩展) * - * @description 使用el-date-picker组件封装,用于实现天、周、月、季度、年等不同时间单位的时间范围选择功能。支持编辑器样式为`时间范围(可选单位)`,基于`时间范围选择器`编辑器进行扩展 + * @description 使用el-date-picker组件封装,用于实现天、周、月、季度、年等不同时间单位的时间范围选择功能。基于`时间范围选择器`编辑器进行扩展,编辑器样式代码名称为:SWITCHUNIT * @primary - * @editorparams {"name":"switchUnit","parameterType":"boolean","defaultvalue":true,"description":"是否显示时间单位选择功能组件,该组件主要用于切换时间单位,根据不同的时间单位抛出不同的开始与结束时间值"} - * @editorparams {"name":"defaultUnit","parameterType":"'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR'","defaultvalue":"'DAY'","description":"默认时间单位,配置不同时间单位将展示对应的时间选择组件"} - * @editorparams {"name":"emitMode","parameterType":"'DEFAULT' | 'TIME'","defaultvalue":"'DEFAULT'","description":"数据抛出模式。当参数值为 'DEFAULT' 且时间单位为 'DAY' 时,若当前时间为 '2025/04/23',开始时间为 '2025/04/22'、结束时间为 '2025/04/24',此时若时间类型为固定时间,将开始与结束时间的时间戳除以 1000 后按 `{start:1745251200,end:1745510399,unit:'DAY',type:'STATIC'}` 格式抛值,若为动态时间则按 `{start:-1,end:1,unit:'DAY',type:'DYNAMIC'}` 格式抛值,以当前时间与开始、结束时间的时间间隔体现;而当参数值为 'TIME' 时,将开始与结束时间按本地时间格式转换为字符串,按 `{start:'2025/4/22 00:00:00',end:'2025/4/24 23:59:59',unit:'DAY',type:'STATIC'}` 格式抛值"} - * @ignoreprops autoFocus | overflowMode | controlParams + * @editorparams {"name":"switchunit","parameterType":"boolean","defaultvalue":true,"description":"是否显示时间单位选择功能组件,该组件主要用于切换时间单位,根据不同的时间单位抛出不同的开始与结束时间值"} + * @editorparams {"name":"defaultunit","parameterType":"'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR'","defaultvalue":"'DAY'","description":"默认时间单位,配置不同时间单位将展示对应的时间选择组件"} + * @editorparams {"name":"emitmode","parameterType":"'DEFAULT' | 'TIME'","defaultvalue":"'DEFAULT'","description":"抛值模式。当参数值为 'DEFAULT' 且时间单位为 'DAY' 时,若当前时间为 '2025/04/23',开始时间为 '2025/04/22'、结束时间为 '2025/04/24',此时若时间类型为固定时间,将开始与结束时间的时间戳除以 1000 后按 `{start:1745251200,end:1745510399,unit:'DAY',type:'STATIC'}` 格式抛值,若为动态时间则按 `{start:-1,end:1,unit:'DAY',type:'DYNAMIC'}` 格式抛值,以当前时间与开始、结束时间的时间间隔体现;而当参数值为 'TIME' 时,将开始与结束时间按本地时间格式转换为字符串,按 `{start:'2025/4/22 00:00:00',end:'2025/4/24 23:59:59',unit:'DAY',type:'STATIC'}` 格式抛值"} + * @ignoreprops autoFocus | overflowMode * @ignoreemits blur | focus | enter | infoTextChange */ export const IBizDateRangeSelect = defineComponent({ diff --git a/src/editor/date-range-select/date-range-select.controller.ts b/src/editor/date-range-select/date-range-select.controller.ts index db8bde70..76c71c2f 100644 --- a/src/editor/date-range-select/date-range-select.controller.ts +++ b/src/editor/date-range-select/date-range-select.controller.ts @@ -39,12 +39,21 @@ export class DateRangeSelectEditorController extends EditorController { if (this.editorParams.switchUnit) { this.switchUnit = this.editorParams.switchUnit === 'true'; } + if (this.editorParams.switchunit) { + this.switchUnit = this.editorParams.switchunit === 'true'; + } if (this.editorParams.defaultUnit) { this.defaultUnit = this.editorParams.defaultUnit; } + if (this.editorParams.defaultunit) { + this.defaultUnit = this.editorParams.defaultunit; + } if (this.editorParams.emitMode) { this.emitMode = this.editorParams.emitMode; } + if (this.editorParams.emitmode) { + this.emitMode = this.editorParams.emitmode; + } } } diff --git a/src/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.tsx b/src/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.tsx index 33ad690f..2f29e89c 100644 --- a/src/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.tsx +++ b/src/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.tsx @@ -13,6 +13,7 @@ import './ibiz-emoji-picker.scss'; * * @description 用于选择utf8表情,抛值时会将utf8表情转为UTF-8字符串,再抛出。基于`下拉列表框`编辑器进行扩展,编辑器样式代码名称为:EMOJI_PICKER * @primary + * @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"} * @ignoreprops autoFocus | overflowMode * @ignoreemits blur | focus | enter | infoTextChange */ diff --git a/src/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.tsx b/src/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.tsx index e0f0fd66..49ba5691 100644 --- a/src/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.tsx +++ b/src/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.tsx @@ -15,8 +15,9 @@ import './ibiz-tree-picker.scss'; * * @description 用于以树形样式呈现选择项,支持搜索过滤、全选、取消全选、全展开及全收起功能,常用于绘制树形结构的代码表数据。基于`下拉列表框(多选)`编辑器进行扩展,编辑器样式代码名称为:TREE_PICKER * @primary - * @editorparams {"name":"showtoolbar","parameterType":"boolean","defaultvalue":"false","description":"是否显示头部工具栏。默认不显示,若此值为 true,则会在头部呈现快捷工具栏,该工具栏可用于执行全选、取消全选、全展开以及全收起操作"} - * @ignoreprops autoFocus | overflowMode | controlParams + * @editorparams {"name":"showtoolbar","parameterType":"boolean","defaultvalue":"false","description":"是否显示顶部工具栏。默认不显示,若此值为 true,则会在顶部呈现快捷工具栏,该工具栏可用于执行全选、取消全选、全展开以及全收起操作"} + * @editorparams {"name":"valuetype","parameterType":"string","description":"编辑器的值类型"} + * @ignoreprops autoFocus | overflowMode * @ignoreemits blur | focus | enter | infoTextChange */ export const IBizTreePicker = defineComponent({ diff --git a/src/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.tsx b/src/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.tsx index 2ad47d96..96c376a9 100644 --- a/src/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.tsx +++ b/src/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.tsx @@ -23,15 +23,18 @@ import './ibiz-virtualized-list.scss'; /** * 虚拟化选择器(扩展) * - * @description 使用el-select-v2组件,在下拉数据较多的情况下,避免渲染至 DOM 中时造成性能问题。基于`下拉列表框`、`下拉列表框(多选)`编辑器进行扩展,编辑器样式代码名称为:VIRTUALIZED_LIST + * @description 使用el-select-v2组件,在下拉数据较多的情况下,避免渲染至 DOM 中时造成性能问题。基于`下拉列表框`、`下拉列表框(多选)`编辑器进行扩展,编辑器样式代码名称为:VIRTUALIZED_LIST * @primary - * @editorparams {name:forceSelection,parameterType:boolean,defaultvalue:true,description:是否允许用户创建选择项。当参数为false时,可在输入框输入内容,使其显示在下拉选项中呈现,并且可选择} - * @editorparams {name:defaultFirstOption,parameterType:boolean,defaultvalue:false,description:默认选中第一个,在该属性为 true 的情况下,按下回车就可以选中当前选项列表中的第一个选项,无需使用鼠标或键盘方向键进行定位} - * @editorparams {name:blankItemName,parameterType:string,description:在单选模式下,用于在下拉展示数据首项添加一条空白项数据,其文本内容为配置的该参数值} - * @editorparams {name:alwaysLoad,parameterType:boolean,defaultvalue:false,description:当前值改变、下拉框出现时,是否重新加载代码表数据。设置为 true 时每次相关事件触发都会重新加载数据} + * @editorparams {name:forceselection,parameterType:boolean,defaultvalue:true,description:是否禁止用户创建选择项。当参数为false时,可在输入框输入内容,使其显示在下拉选项中呈现,并且可选择} + * @editorparams {name:blankitemname,parameterType:string,description:在单选模式下,用于在下拉展示数据顶部添加一条空白项数据,其文本内容为配置的该参数值} + * @editorparams {name:alwaysload,parameterType:boolean,defaultvalue:false,description:当值改变、下拉框出现时,是否重新加载代码表数据。设置为 true 时每次相关事件触发都会重新加载数据} * @editorparams {name:type,parameterType:'round' | 'other',defaultvalue:'other',description:下拉框的样式类型,可取值为 'round'(圆角类型)或 'other'(其他类型)} - * @editorparams {name:overflowMode,parameterType:'auto' | 'ellipsis',defaultvalue:'auto',description:用于控制该编辑器下拉区域的宽度显示方式。当参数值为 'ellipsis' 时,下拉区域宽度将与输入框保持一致,若内容超出宽度则会显示省略号,鼠标悬浮在内容上时会出现提示信息} - * @ignoreprops overflowMode | controlParams + * @editorparams {name:overflowmode,parameterType:'auto' | 'ellipsis',defaultvalue:'auto',description:用于控制该编辑器下拉区域的宽度显示方式。当参数值为 'auto' 时,下拉区域宽度会根据内容自动展开;当参数值为 'ellipsis' 时,下拉区域宽度将与输入框保持一致,若内容超出宽度则会显示省略号,鼠标悬浮在内容上时会出现提示信息} + * @editorparams {name:allitems,parameterType:boolean,defaultvalue:false,description:下拉列表框是否启用全部项} + * @editorparams {name:itemstext,parameterType:string,defaultvalue:'全部',description:下拉列表框全部项文本} + * @editorparams {"name":"valuetype","parameterType":"string","description":"编辑器的值类型"} + * @editorparams {"name":"readonly","parameterType":"boolean","defaultvalue":false,"description":"设置编辑器是否为只读态"} + * @ignoreprops overflowMode */ export const IBizVirtualizedList = defineComponent({ name: 'IBizVirtualizedList', @@ -292,7 +295,10 @@ export const IBizVirtualizedList = defineComponent({ emitVal = Number(select); emit('change', emitVal); } - if (c.editorParams.alwaysLoad === 'true') { + if ( + c.editorParams.alwaysLoad === 'true' || + c.editorParams.alwaysload === 'true' + ) { loadCodeList(); } if (props.autoFocus) { @@ -377,7 +383,9 @@ export const IBizVirtualizedList = defineComponent({ const onVisibleChange = async (visible: boolean) => { if ( visible && - (!isLoadedCodeList.value || c.editorParams.alwaysLoad === 'true') + (!isLoadedCodeList.value || + c.editorParams.alwaysLoad === 'true' || + c.editorParams.alwaysload === 'true') ) { // 下拉框出现时如果没有加载过代码表去加载 await loadCodeList(); @@ -495,7 +503,9 @@ export const IBizVirtualizedList = defineComponent({ render() { const overflowMode = - this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode; + this.c.editorParams.overflowMode || + this.c.editorParams.overflowmode || + ibiz.config.pickerEditor.overflowMode; const isEllipsis = overflowMode === 'ellipsis'; const editContent = ( -- Gitee