fix: 修复表格搜索不能用,表单删除样式显示 (#1256)

Co-authored-by: sealday <zhanglin@daoyoucloud.com>
Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1256
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-07-02 21:00:08 +08:00 committed by sealday
parent 6c9f9cd8a8
commit 2db816a872
4 changed files with 14 additions and 12 deletions

View File

@ -332,6 +332,7 @@ export class BuiltInPlugin extends Plugin {
name: 'pinned-list', name: 'pinned-list',
config: { config: {
items: { items: {
ui: { order: 50, component: 'DesignableSwitch', pin: true, snippet: 'ui.*' },
wf: { order: 100, component: 'WorkflowLink', pin: true, snippet: 'pm.*' }, wf: { order: 100, component: 'WorkflowLink', pin: true, snippet: 'pm.*' },
ds: { order: 200, component: 'DatasourceLink', pin: true, snippet: 'pm.*' }, ds: { order: 200, component: 'DatasourceLink', pin: true, snippet: 'pm.*' },
pm: { order: 300, component: 'PluginManagerLink', pin: true, snippet: 'pm' }, pm: { order: 300, component: 'PluginManagerLink', pin: true, snippet: 'pm' },

View File

@ -184,10 +184,9 @@ const Copy = forwardRef<HTMLButtonElement, CommonProps>((props, ref) => {
if (array.field?.pattern !== 'editable') return null; if (array.field?.pattern !== 'editable') return null;
return wrapSSR( return wrapSSR(
<Button <Button
ghost
{...props} {...props}
type="text"
style={{ style={{
padding: '0 0 0 6px',
width: 'auto', width: 'auto',
height: 'auto', height: 'auto',
...props.style, ...props.style,
@ -226,10 +225,9 @@ const Remove = forwardRef<HTMLSpanElement, CommonProps>((props, ref) => {
if (array.field?.pattern !== 'editable') return null; if (array.field?.pattern !== 'editable') return null;
return wrapSSR( return wrapSSR(
<Button <Button
ghost type="text"
{...props} {...props}
style={{ style={{
padding: '0 0 0 6px',
width: 'auto', width: 'auto',
height: 'auto', height: 'auto',
...props.style, ...props.style,
@ -268,10 +266,9 @@ const MoveDown = forwardRef<HTMLSpanElement, CommonProps>((props, ref) => {
if (array.field?.pattern !== 'editable') return null; if (array.field?.pattern !== 'editable') return null;
return ( return (
<Button <Button
ghost
{...props} {...props}
type="text"
style={{ style={{
padding: '0 0 0 6px',
width: 'auto', width: 'auto',
height: 'auto', height: 'auto',
...props.style, ...props.style,
@ -309,10 +306,9 @@ const MoveUp = forwardRef<HTMLSpanElement, CommonProps>((props, ref) => {
if (array.field?.pattern !== 'editable') return null; if (array.field?.pattern !== 'editable') return null;
return ( return (
<Button <Button
ghost type="text"
{...props} {...props}
style={{ style={{
padding: '0 0 0 6px',
width: 'auto', width: 'auto',
height: 'auto', height: 'auto',
...props.style, ...props.style,

View File

@ -93,7 +93,7 @@ export const useTabSearchCollapsibleInputItemAction = (props) => {
const onInputChange = (v) => { const onInputChange = (v) => {
const timeout = { current: null }; const timeout = { current: null };
clearTimeout(timeout.current); clearTimeout(timeout.current);
const inputValue = v.target?.value || v; const inputValue = v.target?.value ?? v;
setValue(inputValue); setValue(inputValue);
if (inputValue === '') { if (inputValue === '') {
timeout.current = setTimeout(() => { timeout.current = setTimeout(() => {
@ -101,6 +101,7 @@ export const useTabSearchCollapsibleInputItemAction = (props) => {
}, 2000); }, 2000);
} }
}; };
const onButtonClick = () => { const onButtonClick = () => {
onSelect(value); onSelect(value);
}; };

View File

@ -23,9 +23,13 @@ export const useTabSearchCollapsibleInputItem = () => {
// 保留原有的 filter // 保留原有的 filter
let storedFilter = block.service.params?.[1]?.filters || {}; let storedFilter = block.service.params?.[1]?.filters || {};
if (value.length) { if (value.length) {
if (value[0]) {
storedFilter[key] = { storedFilter[key] = {
[filterKey]: value, [filterKey]: value,
}; };
} else {
delete storedFilter[key]?.[filterKey];
}
if (canBeCalculatedField) { if (canBeCalculatedField) {
storedFilter[key] = { storedFilter[key] = {