Просмотр исходного кода

fix: 物模型editTable弹框X

wzyyy 3 лет назад
Родитель
Сommit
8f675e027e
1 измененных файлов с 15 добавлено и 1 удалено
  1. 15 1
      src/components/Metadata/EditTable/index.tsx

+ 15 - 1
src/components/Metadata/EditTable/index.tsx

@@ -156,10 +156,24 @@ Editable.Popover = observer((props) => {
     const value = get(field.form.values, path)?.name;
     title = value || '配置参数';
   }
+
+  const headTitle = () => {
+    return (
+      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
+        <div>{props.title || field.title}</div>
+        <CloseOutlined
+          onClick={() => {
+            setVisible(false);
+          }}
+        />
+      </div>
+    );
+  };
+
   return (
     <Popover
       {...props}
-      title={props.title || field.title}
+      title={headTitle()}
       visible={visible}
       className={cls(prefixCls, props.className)}
       content={props.children}