修正非tabs展示模式下出现多余「self」标签问题 (#4579)

* docs: 修复线上bug,内外网都发一版 1.9.1-beta.21

* fix(inputFormula): 修正非tabs展示模式下出现多余「self」标签问题
This commit is contained in:
刘丹 2022-06-10 10:13:54 +08:00 committed by GitHub
parent db77dc3cac
commit 00bcca021b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -239,7 +239,7 @@ export class FormulaEditor extends React.Component<
handleVariableSelect(item: VariableItem) {
const {evalMode, selfVariableName} = this.props;
if (item && item.value && selfVariableName === item.value) {
if (item && item.value && (selfVariableName && selfVariableName === item.value)) {
toast.warning('不能使用当前变量[self],避免循环引用。');
return;
}

View File

@ -46,7 +46,7 @@ function VariableList(props: VariableListProps) {
: (option: Option, states: ItemRenderStates): JSX.Element => {
return (
<span className={cx(`${classPrefix}-item`, itemClassName)}>
{option.label && option.value === selfVariableName && (
{option.label && (selfVariableName && option.value === selfVariableName) && (
<Badge
classnames={cx}
badge={{
@ -58,7 +58,7 @@ function VariableList(props: VariableListProps) {
<label>{option.label}</label>
</Badge>
)}
{option.label && option.value !== selfVariableName && (
{option.label && (!selfVariableName || option.value !== selfVariableName) && (
<label>{option.label}</label>
)}
{option?.tag ? (