diff --git a/config/config.ts b/config/config.ts index 9dbc3ccd..36546891 100644 --- a/config/config.ts +++ b/config/config.ts @@ -14,7 +14,7 @@ const isProduction = env === 'production'; const t = Date.now(); export default defineConfig({ proxy: { - ...proxy('http://192.168.50.166:8080') + ...proxy() }, history: { type: 'hash' diff --git a/src/components/seal-table/components/seal-column.tsx b/src/components/seal-table/components/seal-column.tsx index 6eec250e..3fd7ba30 100644 --- a/src/components/seal-table/components/seal-column.tsx +++ b/src/components/seal-table/components/seal-column.tsx @@ -2,7 +2,7 @@ import { CheckOutlined, FormOutlined, UndoOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Button, Input, InputNumber, Tooltip } from 'antd'; import classNames from 'classnames'; -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import RowContext from '../row-context'; import '../styles/cell.less'; import { SealColumnProps } from '../types'; @@ -35,6 +35,12 @@ const SealColumn: React.FC = (props) => { setCurrent(cachedValue.current); setIsEditing(false); }; + useEffect(() => { + if (editable) { + cachedValue.current = row[dataIndex]; + setCurrent(row[dataIndex]); + } + }, [row[dataIndex], editable]); const renderContent = () => { if (isEditing && editable) {