From a48f2a5159ab832c1c6fae08e99ada3a590d4e51 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 25 Aug 2021 17:07:23 +0800 Subject: [PATCH] feat: improve code --- .../src/components/admin-layout/More.tsx | 3 + .../admin-layout/Permissions/index.tsx | 11 ++- .../client/src/schemas/action/ActionBar.tsx | 4 + packages/client/src/schemas/add-new/index.tsx | 7 +- .../client/src/schemas/calendar/ActionBar.tsx | 1 + .../src/schemas/calendar/DesignableBar.tsx | 37 ++++++--- .../client/src/schemas/calendar/index.tsx | 2 +- .../client/src/schemas/form/DesignableBar.tsx | 28 ++++--- .../src/schemas/form/Field.DesignableBar.tsx | 4 +- .../client/src/schemas/grid/DesignableBar.tsx | 33 +++++--- packages/client/src/schemas/input/index.tsx | 63 --------------- .../src/schemas/kanban/DesignableBar.tsx | 41 +++++++--- .../src/schemas/kanban/FieldDesignableBar.tsx | 31 ++++--- .../client/src/schemas/markdown/index.tsx | 81 ++++--------------- .../src/schemas/table/SimpleDesignableBar.tsx | 28 ++++--- .../client/src/schemas/table/demos/demo3.tsx | 2 +- packages/client/src/schemas/table/index.tsx | 35 +++++--- packages/client/src/schemas/tabs/index.tsx | 22 ++++- 18 files changed, 207 insertions(+), 226 deletions(-) diff --git a/packages/client/src/components/admin-layout/More.tsx b/packages/client/src/components/admin-layout/More.tsx index 133ad71d5..bdd6b32a4 100644 --- a/packages/client/src/components/admin-layout/More.tsx +++ b/packages/client/src/components/admin-layout/More.tsx @@ -52,6 +52,9 @@ const schema: ISchema = { type: 'void', title: `系统配置`, 'x-component': 'Menu.Action', + "x-component-props": { + icon: 'SettingOutlined', + }, properties: { drawer1: { type: 'void', diff --git a/packages/client/src/components/admin-layout/Permissions/index.tsx b/packages/client/src/components/admin-layout/Permissions/index.tsx index fe9ee3f47..f41192bba 100644 --- a/packages/client/src/components/admin-layout/Permissions/index.tsx +++ b/packages/client/src/components/admin-layout/Permissions/index.tsx @@ -289,12 +289,16 @@ const schema: ISchema = { }, 'x-component': 'Action', 'x-component-props': { + icon: 'DeleteOutlined', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?' + }, useAction: '{{ Table.useTableDestroyAction }}', }, }, [uid()]: { type: 'void', - name: 'action1', title: '创建', 'x-align': 'right', 'x-decorator': 'AddNew.Displayed', @@ -304,6 +308,7 @@ const schema: ISchema = { 'x-component': 'Action', 'x-component-props': { type: 'primary', + icon: 'PlusOutlined', }, properties: { modal: { @@ -460,6 +465,10 @@ const schema: ISchema = { 'x-action-type': 'destroy', 'x-component-props': { type: 'link', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?' + }, useAction: '{{ Table.useTableDestroyAction }}', }, }, diff --git a/packages/client/src/schemas/action/ActionBar.tsx b/packages/client/src/schemas/action/ActionBar.tsx index 8438a74ed..52d6f77ac 100644 --- a/packages/client/src/schemas/action/ActionBar.tsx +++ b/packages/client/src/schemas/action/ActionBar.tsx @@ -158,6 +158,10 @@ function generateActionSchema(type) { 'x-component': 'Action', 'x-designable-bar': 'Action.DesignableBar', 'x-component-props': { + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?' + }, useAction: '{{ Table.useTableDestroyAction }}', }, }, diff --git a/packages/client/src/schemas/add-new/index.tsx b/packages/client/src/schemas/add-new/index.tsx index fe2a0aa5d..e462e2344 100644 --- a/packages/client/src/schemas/add-new/index.tsx +++ b/packages/client/src/schemas/add-new/index.tsx @@ -175,6 +175,7 @@ function generateCardItemSchema(component) { 'x-component': 'Action', 'x-designable-bar': 'Table.Action.DesignableBar', 'x-component-props': { + icon: 'DeleteOutlined', confirm: { title: '删除数据', content: '删除后无法恢复,确定要删除吗?' @@ -193,6 +194,7 @@ function generateCardItemSchema(component) { }, 'x-component': 'Action', 'x-component-props': { + icon: 'PlusOutlined', type: 'primary', }, 'x-designable-bar': 'Table.Action.DesignableBar', @@ -491,7 +493,7 @@ function generateCardItemSchema(component) { }, filter: { type: 'void', - title: '过滤', + title: '筛选', 'x-align': 'right', 'x-designable-bar': 'Calendar.Filter.DesignableBar', 'x-component': 'Calendar.Filter', @@ -502,7 +504,7 @@ function generateCardItemSchema(component) { }, create: { type: 'void', - title: '新增', + title: '创建', 'x-align': 'right', 'x-designable-bar': 'Calendar.ActionDesignableBar', 'x-component': 'Action', @@ -512,6 +514,7 @@ function generateCardItemSchema(component) { }, 'x-component-props': { type: 'primary', + icon: 'PlusOutlined', }, properties: { modal: { diff --git a/packages/client/src/schemas/calendar/ActionBar.tsx b/packages/client/src/schemas/calendar/ActionBar.tsx index e5cd3d1f0..598d18d0d 100644 --- a/packages/client/src/schemas/calendar/ActionBar.tsx +++ b/packages/client/src/schemas/calendar/ActionBar.tsx @@ -174,6 +174,7 @@ function generateActionSchema(type) { }, 'x-component-props': { type: 'primary', + icon: 'PlusOutlined', }, properties: { modal: { diff --git a/packages/client/src/schemas/calendar/DesignableBar.tsx b/packages/client/src/schemas/calendar/DesignableBar.tsx index 11c2e704c..02cfd34e8 100644 --- a/packages/client/src/schemas/calendar/DesignableBar.tsx +++ b/packages/client/src/schemas/calendar/DesignableBar.tsx @@ -20,8 +20,13 @@ import { updateSchema, } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Select, Space } from 'antd'; -import { MenuOutlined, DragOutlined } from '@ant-design/icons'; +import { Modal, Dropdown, Menu, Select, Space } from 'antd'; +import { + MenuOutlined, + DragOutlined, + CalendarOutlined, + FontSizeOutlined, +} from '@ant-design/icons'; import cls from 'classnames'; import { FormDialog, FormLayout } from '@formily/antd'; // import './style.less'; @@ -37,6 +42,7 @@ import { useTable } from '../table'; import { fieldsToFilterColumns } from './'; import { set } from 'lodash'; import { DragHandle } from '../../components/Sortable'; +import { DeleteOutlined, FilterOutlined } from '@ant-design/icons'; export const DesignableBar = observer((props) => { const field = useField(); @@ -70,7 +76,7 @@ export const DesignableBar = observer((props) => { }} overlay={ - + }>
@@ -102,7 +108,7 @@ export const DesignableBar = observer((props) => { />
- + }>
@@ -136,7 +142,7 @@ export const DesignableBar = observer((props) => { />
- + }>
@@ -171,6 +177,7 @@ export const DesignableBar = observer((props) => { } onClick={async () => { const { defaultFilter } = await FormDialog( '设置数据范围', @@ -209,16 +216,22 @@ export const DesignableBar = observer((props) => { } onClick={async () => { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - if (isGridRowOrCol(last)) { - await removeSchema(last); - } + setVisible(false); + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除
} diff --git a/packages/client/src/schemas/calendar/index.tsx b/packages/client/src/schemas/calendar/index.tsx index 88715cf25..34425421c 100644 --- a/packages/client/src/schemas/calendar/index.tsx +++ b/packages/client/src/schemas/calendar/index.tsx @@ -209,7 +209,7 @@ export const Calendar: any = observer((props: any) => { popup selectable events={Array.isArray(field.value.slice()) ? field.value.slice() : []} - views={allViews} + views={['month', 'week', 'day']} step={60} showMultiDayTimes messages={messages} diff --git a/packages/client/src/schemas/form/DesignableBar.tsx b/packages/client/src/schemas/form/DesignableBar.tsx index 6de5691ac..5cd0db597 100644 --- a/packages/client/src/schemas/form/DesignableBar.tsx +++ b/packages/client/src/schemas/form/DesignableBar.tsx @@ -14,7 +14,7 @@ import { } from '@formily/react'; import { useSchemaPath, SchemaField, useDesignable, removeSchema } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Space } from 'antd'; +import { Modal, Dropdown, Menu, Space } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormLayout } from '@formily/antd'; @@ -58,10 +58,10 @@ export const DesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ {/* { { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - if (isGridRowOrCol(last)) { - await removeSchema(last); - } + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/form/Field.DesignableBar.tsx b/packages/client/src/schemas/form/Field.DesignableBar.tsx index be15280d8..933b92917 100644 --- a/packages/client/src/schemas/form/Field.DesignableBar.tsx +++ b/packages/client/src/schemas/form/Field.DesignableBar.tsx @@ -20,7 +20,7 @@ import { updateSchema, } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Space, Switch } from 'antd'; +import { Button, Dropdown, Menu, Modal, Space, Switch } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormDialog, FormLayout } from '@formily/antd'; @@ -186,7 +186,7 @@ export const FieldDesignableBar = observer((props) => { await removeSchema(last); }} > - 移除 + 隐藏 } diff --git a/packages/client/src/schemas/grid/DesignableBar.tsx b/packages/client/src/schemas/grid/DesignableBar.tsx index e762d9b88..d3fd1fed7 100644 --- a/packages/client/src/schemas/grid/DesignableBar.tsx +++ b/packages/client/src/schemas/grid/DesignableBar.tsx @@ -14,7 +14,7 @@ import { } from '@formily/react'; import { useSchemaPath, SchemaField, useDesignable, removeSchema } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Space } from 'antd'; +import { Button, Dropdown, Menu, Modal, Space } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormLayout } from '@formily/antd'; @@ -36,11 +36,14 @@ export const DesignableBar = observer((props) => { const [visible, setVisible] = useState(false); const { dragRef } = useContext(DraggableBlockContext); const { props: tableProps } = useTable(); - const collectionName = field.componentProps?.collectionName || tableProps?.collectionName; + const collectionName = + field.componentProps?.collectionName || tableProps?.collectionName; const { collection } = useCollection({ collectionName }); return (
-
{collection?.title || collection?.name}
+
+ {collection?.title || collection?.name} +
{ e.stopPropagation(); @@ -52,22 +55,28 @@ export const DesignableBar = observer((props) => { {/* */} { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - await removeSchema(last); + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/input/index.tsx b/packages/client/src/schemas/input/index.tsx index 8fd77525c..2f8ee22fc 100644 --- a/packages/client/src/schemas/input/index.tsx +++ b/packages/client/src/schemas/input/index.tsx @@ -44,67 +44,4 @@ export const Input: ComposedInput = connect( Input.TextArea = connect(AntdInput.TextArea, mapReadPretty(Display.TextArea)) Input.URL = connect(AntdInput, mapReadPretty(Display.URL)) -Input.DesignableBar = observer((props) => { - const field = useField(); - const fieldSchema = useFieldSchema(); - const { root, currentSchema, schema, refresh, deepRemove, remove } = useDesignable(); - const [visible, setVisible] = useState(false); - const { dragRef } = useContext(DraggableBlockContext); - return ( -
- { - e.stopPropagation(); - }} - className={cls('designable-bar-actions', { active: visible })} - > - - - - { - setVisible(visible); - }} - overlay={ - - { - const title = uid(); - schema['title'] = title; - field.title = title; - refresh(); - console.log({ root, currentSchema, schema, fieldSchema }, getSchemaPath(fieldSchema)); - }} - > - 修改 Input - - - { - remove(); - // const removed = deepRemove(); - // // console.log({ removed }) - // const last = removed.pop(); - // if (isGridRowOrCol(last)) { - // await removeSchema(last); - // } - }} - > - 移除 - - - } - > - - - - -
- ); -}); - export default Input diff --git a/packages/client/src/schemas/kanban/DesignableBar.tsx b/packages/client/src/schemas/kanban/DesignableBar.tsx index 05a1f3344..0a3ec0ec0 100644 --- a/packages/client/src/schemas/kanban/DesignableBar.tsx +++ b/packages/client/src/schemas/kanban/DesignableBar.tsx @@ -12,9 +12,15 @@ import { useForm, RecursionField, } from '@formily/react'; -import { useSchemaPath, SchemaField, useDesignable, removeSchema, updateSchema } from '../'; +import { + useSchemaPath, + SchemaField, + useDesignable, + removeSchema, + updateSchema, +} from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Space } from 'antd'; +import { Button, Dropdown, Menu, Modal, Space } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormDialog, FormLayout } from '@formily/antd'; @@ -37,11 +43,14 @@ export const DesignableBar = observer((props) => { const [visible, setVisible] = useState(false); const { dragRef } = useContext(DraggableBlockContext); const { props: tableProps } = useTable(); - const collectionName = field.componentProps?.collectionName || tableProps?.collectionName; + const collectionName = + field.componentProps?.collectionName || tableProps?.collectionName; const { collection, fields } = useCollection({ collectionName }); return (
-
{collection?.title || collection?.name}
+
+ {collection?.title || collection?.name} +
{ e.stopPropagation(); @@ -53,10 +62,10 @@ export const DesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ {/* { { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - await removeSchema(last); + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/kanban/FieldDesignableBar.tsx b/packages/client/src/schemas/kanban/FieldDesignableBar.tsx index 695125459..9d3f50b02 100644 --- a/packages/client/src/schemas/kanban/FieldDesignableBar.tsx +++ b/packages/client/src/schemas/kanban/FieldDesignableBar.tsx @@ -20,7 +20,7 @@ import { updateSchema, } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Space, Switch } from 'antd'; +import { Button, Dropdown, Menu, Modal, Space, Switch } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormDialog, FormLayout } from '@formily/antd'; @@ -69,10 +69,10 @@ export const FieldDesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ { { - const removed = deepRemove(); - const fieldName = - schema['x-component-props']?.['fieldName']; - console.log({ schema, removed, fieldName }); - const last = removed.pop(); - displayed.remove(fieldName); - await removeSchema(last); + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + const fieldName = + schema['x-component-props']?.['fieldName']; + const last = removed.pop(); + displayed.remove(fieldName); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/markdown/index.tsx b/packages/client/src/schemas/markdown/index.tsx index bcc9d8ab6..9f0b81053 100644 --- a/packages/client/src/schemas/markdown/index.tsx +++ b/packages/client/src/schemas/markdown/index.tsx @@ -7,7 +7,7 @@ import { useFieldSchema, mapReadPretty, } from '@formily/react'; -import { Button, Dropdown, Input as AntdInput, Menu, Space } from 'antd'; +import { Button, Dropdown, Input as AntdInput, Menu, Modal, Space } from 'antd'; import { InputProps, TextAreaProps } from 'antd/lib/input'; import { Display } from '../display'; import { LoadingOutlined, MenuOutlined, DragOutlined } from '@ant-design/icons'; @@ -125,10 +125,10 @@ Markdown.Void.DesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ { { - const removed = deepRemove(); - const last = removed.pop(); - console.log({ last }) - await removeSchema(last); + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + const last = removed.pop(); + console.log({ last }); + await removeSchema(last); + }, + }); }} > - 移除 - - - } - > - - - - -
- ); -}); - -Markdown.DesignableBar = observer((props) => { - const field = useField(); - const { designable, schema, refresh, deepRemove } = useDesignable(); - const [visible, setVisible] = useState(false); - const { dragRef } = useContext(DraggableBlockContext); - if (!designable) { - return null; - } - return ( -
- { - e.stopPropagation(); - }} - className={cls('designable-bar-actions', { active: visible })} - > - - - - { - setVisible(visible); - }} - overlay={ - - {}}> - 修改标题 - - - { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - if (isGridRowOrCol(last)) { - await removeSchema(last); - } - }} - > - 移除 + 删除 } diff --git a/packages/client/src/schemas/table/SimpleDesignableBar.tsx b/packages/client/src/schemas/table/SimpleDesignableBar.tsx index 963f1af66..760f39fa1 100644 --- a/packages/client/src/schemas/table/SimpleDesignableBar.tsx +++ b/packages/client/src/schemas/table/SimpleDesignableBar.tsx @@ -20,7 +20,7 @@ import { updateSchema, } from '../'; import get from 'lodash/get'; -import { Button, Dropdown, Menu, Select, Space } from 'antd'; +import { Button, Dropdown, Menu, Modal, Select, Space } from 'antd'; import { MenuOutlined, DragOutlined } from '@ant-design/icons'; import cls from 'classnames'; import { FormDialog, FormLayout } from '@formily/antd'; @@ -58,10 +58,10 @@ export const SimpleDesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ { { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - if (isGridRowOrCol(last)) { - await removeSchema(last); - } + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/table/demos/demo3.tsx b/packages/client/src/schemas/table/demos/demo3.tsx index 61dbab57e..045667faf 100644 --- a/packages/client/src/schemas/table/demos/demo3.tsx +++ b/packages/client/src/schemas/table/demos/demo3.tsx @@ -53,7 +53,7 @@ const schema: ISchema = { [uid()]: { type: 'void', name: 'action1', - title: '新增', + title: '创建', 'x-component': 'Action', 'x-designable-bar': 'Table.Action.DesignableBar', properties: { diff --git a/packages/client/src/schemas/table/index.tsx b/packages/client/src/schemas/table/index.tsx index f259418d2..e6690b3ab 100644 --- a/packages/client/src/schemas/table/index.tsx +++ b/packages/client/src/schemas/table/index.tsx @@ -6,7 +6,7 @@ import { useField, useForm, } from '@formily/react'; -import { Pagination, Popover, Table as AntdTable } from 'antd'; +import { Modal, Pagination, Popover, Table as AntdTable } from 'antd'; import { cloneDeep, findIndex, forIn, range, set } from 'lodash'; import React, { Fragment, useEffect, useState } from 'react'; import { useContext } from 'react'; @@ -905,6 +905,7 @@ function generateActionSchema(type) { 'x-component': 'Action', 'x-component-props': { type: 'primary', + icon: 'PlusOutlined', }, 'x-designable-bar': 'Table.Action.DesignableBar', properties: { @@ -944,7 +945,7 @@ function generateActionSchema(type) { 'x-component-props': { confirm: { title: '删除数据', - content: '删除后无法恢复,确定要删除吗?' + content: '删除后无法恢复,确定要删除吗?', }, useAction: '{{ Table.useTableDestroyAction }}', }, @@ -1054,6 +1055,10 @@ function generateMenuActionSchema(type) { 'x-component-props': { useAction: '{{ Table.useTableDestroyAction }}', type: 'link', + confirm: { + title: '删除数据', + content: '删除后无法恢复,确定要删除吗?', + }, }, }, }; @@ -2024,10 +2029,10 @@ Table.DesignableBar = observer((props) => { { - setVisible(visible); - }} + // visible={visible} + // onVisibleChange={(visible) => { + // setVisible(visible); + // }} overlay={ { { - const removed = deepRemove(); - // console.log({ removed }) - const last = removed.pop(); - if (isGridRowOrCol(last)) { - await removeSchema(last); - } + Modal.confirm({ + title: '删除区块', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const removed = deepRemove(); + // console.log({ removed }) + const last = removed.pop(); + await removeSchema(last); + }, + }); }} > - 移除 + 删除 } diff --git a/packages/client/src/schemas/tabs/index.tsx b/packages/client/src/schemas/tabs/index.tsx index d42460f8e..ee1b80db1 100644 --- a/packages/client/src/schemas/tabs/index.tsx +++ b/packages/client/src/schemas/tabs/index.tsx @@ -1,6 +1,14 @@ import { observer, connect, useField, RecursionField } from '@formily/react'; import React from 'react'; -import { Button, Tabs as AntdTabs, Dropdown, Menu, Switch, Space } from 'antd'; +import { + Button, + Tabs as AntdTabs, + Dropdown, + Menu, + Switch, + Space, + Modal, +} from 'antd'; import { findPropertyByPath, getSchemaPath, @@ -327,12 +335,18 @@ Tabs.TabPane.DesignableBar = () => { { - const data = remove(); - await removeSchema(data); setVisible(false); + Modal.confirm({ + title: '删除标签页', + content: '删除后无法恢复,确定要删除吗?', + onOk: async () => { + const data = remove(); + await removeSchema(data); + }, + }); }} > - 移除 + 删除 }