From 000f5f738b008088e42c68477c2a976a3bf1f41d Mon Sep 17 00:00:00 2001 From: ShineKOT <1917095344@qq.com> Date: Wed, 15 May 2024 18:13:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E4=BF=AE=E5=A4=8D=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=A4=9A=E9=80=89=E6=9C=AA=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=8A=9B=E5=80=BC=E9=97=AE=E9=A2=98=E5=92=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 ++ .../ibiz-picker-select-view.tsx | 23 ++++----- src/panel-component/short-cut/short-cut.scss | 27 ++++++++-- src/panel-component/short-cut/short-cut.tsx | 49 +++++++++++-------- 4 files changed, 70 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f625649..0fbf3a4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,12 @@ 并且此项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/). ## [Unreleased] +### Fixed + +- 修复下拉视图多选未实时抛值问题 +### Changed +- 优化最小化组件 ## [0.7.13] - 2024-05-14 ### Added diff --git a/src/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.tsx b/src/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.tsx index a52e642d0..eeb21b239 100644 --- a/src/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.tsx +++ b/src/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.tsx @@ -330,6 +330,18 @@ export const IBizPickerSelectView = defineComponent({ keySet.value = items.value.map(item => item.srfkey); } } + + // 多选抛值 + if (!singleSelect.value) { + if (c.model.valueType === 'OBJECTS') { + emit('change', multipleObjs.value); + } else { + if (c.valueItem) { + emit('change', multipleTempValue.value, c.valueItem); + } + emit('change', multipleTempText.value); + } + } }; // 打开数据链接视图 @@ -439,17 +451,6 @@ export const IBizPickerSelectView = defineComponent({ // dropdown内容显示隐藏 const onVisibleChange = (e: boolean) => { showView.value = e; - if (!e && !singleSelect.value) { - if (c.model.valueType === 'OBJECTS') { - emit('change', multipleObjs.value); - } else { - if (c.valueItem) { - emit('change', multipleTempValue.value, c.valueItem); - } - emit('change', multipleTempText.value); - } - } - // 下拉隐藏的时候触发编辑器的blur事件 if (e === false) { onBlur({}); diff --git a/src/panel-component/short-cut/short-cut.scss b/src/panel-component/short-cut/short-cut.scss index 845949d6a..9cac047ba 100644 --- a/src/panel-component/short-cut/short-cut.scss +++ b/src/panel-component/short-cut/short-cut.scss @@ -26,7 +26,7 @@ background-color: var(--ibiz-color-primary-light-default); } } - @include m('icon') { + .recover-icon { font-size: 16px; margin-left: 8px; } @@ -48,6 +48,22 @@ } } + @include e('action') { + display: flex; + cursor: pointer; + position: relative; + align-items: center; + flex-flow: row nowrap; + place-content: center flex-start; + width: 225px; + height: 44px; + padding: 9px 20px; + .expand-icon { + font-size: 16px; + margin-right: 8px; + } + } + // 项通用样式 @include e('item') { display: flex; @@ -60,8 +76,7 @@ flex-shrink: 0; font-size: 16px; } - .caption-icon, - .expand-icon { + .caption-icon { margin-right: 8px; } .close-icon, @@ -119,10 +134,16 @@ // popover垂直样式 @include e('popover') { + .is-hidden { + display: none; + } + &.el-popover.el-popper { padding: 10px 0; } .is-vertical { + max-height: 400px; + overflow-y: auto; @include e('item') { width: 225px; height: 44px; diff --git a/src/panel-component/short-cut/short-cut.tsx b/src/panel-component/short-cut/short-cut.tsx index 5a01ebd93..6b7c7d63c 100644 --- a/src/panel-component/short-cut/short-cut.tsx +++ b/src/panel-component/short-cut/short-cut.tsx @@ -42,7 +42,7 @@ export const ShortCut = defineComponent({ /** * 是否显示快捷操作栏 */ - const isShowToolbar = ref(false); + const isShowToolbar = ref(true); /** * 显示更多 @@ -85,6 +85,8 @@ export const ShortCut = defineComponent({ }; onMounted(() => { + const shortCutMode = window.localStorage.getItem('IbizShortCutMode'); + isShowToolbar.value = shortCutMode !== 'vertical'; ibiz.util.shortCut.onChange(onShortCutChange); }); @@ -99,6 +101,9 @@ export const ShortCut = defineComponent({ isShowToolbar.value = !isShowToolbar.value; if (isShowToolbar.value) { isShowMore.value = false; + window.localStorage.setItem('IbizShortCutMode', 'horizontal'); + } else { + window.localStorage.setItem('IbizShortCutMode', 'vertical'); } }; @@ -238,29 +243,33 @@ export const ShortCut = defineComponent({ ); } }, - footer: () => { - if (isVertical && !isShowToolbar.value) { - return ( -
- -
- {ibiz.i18n.t('panelComponent.shortCut.expandToolbar')} -
-
- ); - } - }, }} ); }; + /** + * 绘制底部工具栏 + * + * @return {*} + */ + const renderFoolterToolbar = () => { + return ( +
+ +
+ {ibiz.i18n.t('panelComponent.shortCut.expandToolbar')} +
+
+ ); + }; + /** * 绘制更多工具栏 * @returns @@ -299,7 +308,7 @@ export const ShortCut = defineComponent({ ); }, default: () => { - return renderDraggable(true); + return [renderDraggable(true), renderFoolterToolbar()]; }, }} -- Gitee