From b41586828ebf2663719b2856c5d115ca930982dd Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Fri, 31 Oct 2025 10:17:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=BF=9D=E5=AD=98=E6=9D=A1=E4=BB=B6UI?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/control/form/search-form/search-form.scss | 37 +---- src/control/form/search-form/search-form.tsx | 138 +----------------- src/locale/en/index.ts | 6 - src/locale/zh-CN/index.ts | 5 - 5 files changed, 4 insertions(+), 183 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ac91640..8bbe9446d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ ### Change +- 移除搜索表单保存条件UI相关代码 - 更新多数据视图同时存在搜索表单和搜索栏时才会绘制搜索表单弹出按钮 - 更新直接内容轮播图和视频样式,更新树导航栏样式 - 更新面板组件样式变量抽取,组件内部不直接使用基础变量 diff --git a/src/control/form/search-form/search-form.scss b/src/control/form/search-form/search-form.scss index 5206e3faa..68bf93fd2 100644 --- a/src/control/form/search-form/search-form.scss +++ b/src/control/form/search-form/search-form.scss @@ -5,11 +5,6 @@ $control-search-form: ( 'btn-margin': 0 0 0 getCssVar(spacing, tight), 'form-page-item-padding-top': calc(getCssVar('padding') / 2), 'form-item-container-padding-bottom': calc(getCssVar('padding', 'right') / 2), - 'popover-padding': getCssVar(spacing, tight) 0, - 'popover-item-padding': getCssVar(spacing, tight) getCssVar(spacing, base), - 'popover-item-margin': getCssVar(spacing, base) 0 0 0, - 'save-name-padding': getCssVar(spacing, base), - 'filter-item-gap': getCssVar(spacing, base), ); @include b(control-searchform) { @@ -42,22 +37,6 @@ $control-search-form: ( margin: getCssVar('control-search-form', 'btn-margin'); } - @include e('popover-more') { - margin: getCssVar('control-search-form', 'btn-margin'); - } - - @include e('popover-content') { - @include set-component-css-var('control-search-form', $control-search-form); - - padding: getCssVar('control-search-form', 'popover-padding'); - @include m('item') { - padding: getCssVar('control-search-form', 'popover-item-padding'); - &:first-child { - margin-top: 0; - } - } - } - @include e('right') { @include flex(row, flex-start, center); @@ -68,18 +47,4 @@ $control-search-form: ( padding: 0; } } - - @include e('save-name') { - &.van-cell { - padding: getCssVar('control-search-form', 'save-name-padding'); - } - } - - @include e('filter-item'){ - padding: getCssVar('control-search-form', 'popover-item-padding'); - display: flex; - gap: getCssVar('control-search-form', 'filter-item-gap'); - align-items: center; - justify-content: space-between; - } -} \ No newline at end of file +} diff --git a/src/control/form/search-form/search-form.tsx b/src/control/form/search-form/search-form.tsx index 4b548c708..73e6eb066 100644 --- a/src/control/form/search-form/search-form.tsx +++ b/src/control/form/search-form/search-form.tsx @@ -1,7 +1,7 @@ import { IControlProvider, SearchFormController } from '@ibiz-template/runtime'; import { useControlController, useNamespace } from '@ibiz-template/vue3-util'; import { IDESearchForm } from '@ibiz/model-core'; -import { defineComponent, PropType, reactive, ref } from 'vue'; +import { defineComponent, PropType, reactive } from 'vue'; import './search-form.scss'; export const SearchFormControl = defineComponent({ @@ -34,15 +34,6 @@ export const SearchFormControl = defineComponent({ ); const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`); - // 显示下拉气泡 - const showPopover = ref(false); - - // 显示保存弹窗 - const showSaveDialog = ref(false); - - // 保存方案名称 - const saveName = ref(''); - c.evt.on('onCreated', () => { const keys = Object.keys(c.details); keys.forEach(key => { @@ -51,44 +42,6 @@ export const SearchFormControl = defineComponent({ }); }); - // 重置 - const onReset = () => { - showPopover.value = false; - c.reset(); - }; - - // 保存过滤条件 - const onSaveFilter = () => { - showSaveDialog.value = true; - }; - - // 点击历史保存项 - const onHistoryClick = (index: number) => { - showPopover.value = false; - c.applyStoredFilter(index); - }; - - // 移除历史保存项 - const onHistoryRemove = (index: number, event: PointerEvent) => { - event.stopPropagation(); - c.removeStoredFilter(index); - }; - - // 保存弹窗取消 - const onDialogCancel = () => { - saveName.value = ''; - showSaveDialog.value = false; - showPopover.value = false; - }; - - // 保存弹窗确定 - const onDialogConfirm = async () => { - await c.storeFilter(saveName.value); - saveName.value = ''; - showSaveDialog.value = false; - showPopover.value = false; - }; - // 搜索按钮 const renderSearch = () => { return ( @@ -111,96 +64,9 @@ export const SearchFormControl = defineComponent({ ); }; - // 绘制历史保存列表 - const renderHistorySaveList = () => { - if (c.state.storedFilters?.length > 0) { - return c.state.storedFilters.map((item: IData, index: number) => { - return ( -
onHistoryClick(index)} - > - {item.name} - onHistoryRemove(index, event)} - name='close-outline' - > -
- ); - }); - } - return null; - }; - - // 绘制有保存时的下拉状态按钮 - const renderDropdown = () => { - return ( - - {{ - reference: () => { - return ( - - {ibiz.i18n.t('control.form.searchForm.more')} - - ); - }, - default: () => { - return ( -
-
- {ibiz.i18n.t('control.form.searchForm.reset')} -
-
- {ibiz.i18n.t('control.form.searchForm.saveFilter')} -
- {renderHistorySaveList()} - - - -
- ); - }, - }} -
- ); - }; - // 更多按钮 const renderAllBtns = () => { - let moreBtns = null; - if (c.state.enableStoredFilters) { - moreBtns = renderDropdown(); - } else { - moreBtns = renderReset(); - } - return [renderSearch(), moreBtns]; + return [renderSearch(), renderReset()]; }; return { c, ns, renderSearch, renderAllBtns }; diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts index f1155eaf4..e2d9b6f09 100644 --- a/src/locale/en/index.ts +++ b/src/locale/en/index.ts @@ -119,12 +119,6 @@ export default { searchForm: { search: 'Search', reset: 'Reset', - saveFilter: 'Save Filter', - more: 'More', - saveTitle: 'Store custom queries', - saveName: 'Save name', - savePlaceholder: - 'Please enter the name of the custom query to be stored', }, }, list: { diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts index c3f0a3cc2..5fd7f2234 100644 --- a/src/locale/zh-CN/index.ts +++ b/src/locale/zh-CN/index.ts @@ -101,11 +101,6 @@ export default { searchForm: { search: '查询', reset: '重置', - saveFilter: '保存条件', - more: '更多', - saveTitle: '存储自定义查询', - saveName: '保存名称', - savePlaceholder: '请输入要存储的自定义查询名称', }, }, list: { -- Gitee