diff --git a/CHANGELOG.md b/CHANGELOG.md index fa70eb51d19c67efeb0ce079cb2b6bc6dcdbe80e..e74550e9e2d307ba614517560a98f4ae2210d47a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,13 @@ - 补充带主表单的视图,表单加载回来后在视图state里添加srfactiveviewdata - 编辑视图支持上一个,下一个,第一个,最后一个的界面行为 +- 工具栏项支持按钮样式 +- 工具栏下拉菜单支持loading ### Changed - 数值框输入焦点默认靠左 +- 输入框值变更模式调整 ### Fixed diff --git a/src/control/toolbar/toolbar.scss b/src/control/toolbar/toolbar.scss index 04e492964aad49eab2627802db8909c0388f26ac..6575e7bab7948fcb8d15c794aac2385c6e21e117 100644 --- a/src/control/toolbar/toolbar.scss +++ b/src/control/toolbar/toolbar.scss @@ -172,6 +172,17 @@ $control-toolbar: ( color: getCssVar(color, primary, hover, text); background-color: getCssVar(color, primary, hover); } + + .el-button { + justify-content: flex-start; + width: 100%; + padding: 0; + + --el-button-active-bg-color: transparent; + --el-button-hover-bg-color: transparent; + --el-button-bg-color: transparent; + --el-mask-color-extra-light: transparent; + } } } diff --git a/src/control/toolbar/toolbar.tsx b/src/control/toolbar/toolbar.tsx index f900fd7a28eed6c4120c2200a333f697789ce859..3b46765c5faf3a95208687218963ddd27f7550bd 100644 --- a/src/control/toolbar/toolbar.tsx +++ b/src/control/toolbar/toolbar.tsx @@ -9,6 +9,7 @@ import { import { IControlProvider, IExtraButton, + IToolbarController, ToolbarController, } from '@ibiz-template/runtime'; import { IBizExportExcel } from './export-excel/export-excel'; @@ -124,6 +125,12 @@ export const ToolbarControl = defineComponent({ } return ( - {btnContent(item2)} + + {btnContent(item2)} + ); } @@ -185,18 +196,24 @@ export const ToolbarControl = defineComponent({ > ); } + const buttonType = ( + item as IDETBUIActionItem + ).buttonStyle?.toLowerCase(); return (
=> handleClick(item, e)} @@ -231,8 +248,8 @@ export const ToolbarControl = defineComponent({ }; }, render() { - const { state } = this.c; - + const { state, model } = this.c as IToolbarController; + const toolbarStyle = model.toolbarStyle?.toLowerCase(); let content = null; if (state.isCreated) { content = [ @@ -259,7 +276,10 @@ export const ToolbarControl = defineComponent({ return ( {content} diff --git a/src/editor/text-box/input/input.tsx b/src/editor/text-box/input/input.tsx index 18773594166e085e543db981abebd063cfd5ebc5..e0b9e6d30b7ff8172e350bab8bcceb8e6bf3638d 100644 --- a/src/editor/text-box/input/input.tsx +++ b/src/editor/text-box/input/input.tsx @@ -1,6 +1,5 @@ /* eslint-disable no-nested-ternary */ import { computed, defineComponent, onUnmounted, ref, watch } from 'vue'; -import { debounce } from 'lodash-es'; import { getEditorEmits, getInputProps, @@ -100,39 +99,20 @@ export const IBizInput = defineComponent({ } }; - let isDebounce = false; - let awaitSearch: () => void; let blurCacheValue: string | undefined; - // 防抖值变更回调 - const debounceChange = debounce( - (val: string | number) => { - // 拦截掉blur触发后change - if (blurCacheValue !== val) { - emit('change', val); - } - blurCacheValue = undefined; - isDebounce = false; - if (awaitSearch) { - awaitSearch(); - } - }, - 300, - { leading: true }, - ); // 值变更 const handleChange = (val: string | number) => { - isDebounce = true; - debounceChange(val); + // 拦截掉blur触发后change + if (blurCacheValue !== val) { + emit('change', val); + } + blurCacheValue = undefined; }; const handleKeyUp = (e: KeyboardEvent) => { if (e && e.code === 'Enter') { emit('enter', e); - if (isDebounce) { - awaitSearch = () => { - editorRef.value.$el.dispatchEvent(e); - }; - } + editorRef.value.$el.dispatchEvent(e); } }; @@ -337,7 +317,7 @@ export const IBizInput = defineComponent({ maxlength={this.c.model.maxLength} minlength={this.c.model.minLength} show-word-limit={this.showLimit && this.c.model.showMaxLength} - onInput={this.handleChange} + onChange={this.handleChange} onKeyup={this.handleKeyUp} onBlur={this.onBlur} onFocus={this.onFocus}