Skip to content

Commit

Permalink
feat: 新增function time_shift 空支持 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
liangling0628 authored Nov 17, 2022
1 parent 0f6154e commit 2fe4c14
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Menu from 'antd/es/menu';
import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined';
import { LanguageContext } from '../utils/context';
import { getEnByName } from '../utils/utils';
export const EMPTY_VALUE = '-空-';
export interface IFunctionInputProps {
funtion: IFunctionItem;
onDelete: () => void;
Expand Down Expand Up @@ -94,9 +95,9 @@ export default class FunctionInput extends React.PureComponent<IFunctionInputPro
const getParamList = (param: IFunctionParam) => (param?.shortlist?.length ? (
<Menu defaultSelectedKeys={[param.value.toString()]}>
{(param.shortlist as any).map(id => (
<Menu.Item key={id.toString()}>
<Menu.Item key={id === '' ? EMPTY_VALUE : id.toString()}>
<div className="funciton-menu-item" onMouseDown={() => this.handleSelectParam(id, param)}>
{id}
{id === '' ? EMPTY_VALUE : id}
</div>
</Menu.Item>
))}
Expand Down Expand Up @@ -139,15 +140,15 @@ export default class FunctionInput extends React.PureComponent<IFunctionInputPro
key={param.id}
autoFocus
className="param-input"
defaultValue={param.value}
defaultValue={param.value === '' ? '-空-' : param.value}
onBlur={e => this.handleParamBlur(e, param)}
></Input>
</Dropdown>
);
}
return (
<span key={param.id} onClick={e => this.handleParamClick(e, param)} className="funtion-input-param">
{param.value}
{param.value === '' ? EMPTY_VALUE : param.value}
</span>
);
})}
Expand Down

0 comments on commit 2fe4c14

Please sign in to comment.