Explorar o código

fix: 数据源增加拖拽的样式

outaozhen %!s(int64=3) %!d(string=hai) anos
pai
achega
843993986a
Modificáronse 2 ficheiros con 14 adicións e 1 borrados
  1. 12 0
      src/pages/Schema/Option/index.less
  2. 2 1
      src/pages/Schema/Option/index.tsx

+ 12 - 0
src/pages/Schema/Option/index.less

@@ -0,0 +1,12 @@
+.row-dragging {
+  background: #fafafa;
+  border: 1px solid #ccc;
+}
+
+.row-dragging td {
+  padding: 16px;
+}
+
+.row-dragging .drag-visible {
+  visibility: visible;
+}

+ 2 - 1
src/pages/Schema/Option/index.tsx

@@ -10,6 +10,7 @@ import type { ProFormInstance } from '@ant-design/pro-form'
 import { addDataSourceItem, queryDataSource, updateDataSourceItem } from '@/services/api/schema'
 import { MenuOutlined, PlusOutlined } from '@ant-design/icons'
 import classNames from 'classnames'
+import './index.less'
 import { ModalForm, ProFormRadio, ProFormText } from '@ant-design/pro-form'
 import ProTable from '@ant-design/pro-table'
 import { ModalType } from '@/utils/enum'
@@ -180,7 +181,7 @@ const Option = () => {
     }
   }, [state.activeID])
 
-  const DraggableBodyRow = ({ ...restProps }) => {
+  const DraggableBodyRow = ({ className, style, ...restProps }) => {
     if (state.menuDataItems?.length) {
       const index = state.menuDataItems?.findIndex(x => x.index === restProps['data-row-key'])
       return <SortableItem index={index} {...restProps} />