Explorar o código

把term form 里面的内容单独提取成一个组件

visuddhinanda %!s(int64=3) %!d(string=hai) anos
pai
achega
9a3c5c98f7
Modificáronse 1 ficheiros con 92 adicións e 0 borrados
  1. 92 0
      dashboard/src/components/studio/term/TermEditInner.tsx

+ 92 - 0
dashboard/src/components/studio/term/TermEditInner.tsx

@@ -0,0 +1,92 @@
+import { useIntl } from "react-intl";
+
+import {
+  ProForm,
+  ProFormText,
+  ProFormTextArea,
+} from "@ant-design/pro-components";
+
+import LangSelect from "../LangSelect";
+
+const Widget = () => {
+  const intl = useIntl();
+  return (
+    <>
+      <ProForm.Group>
+        <ProFormText
+          width="md"
+          name="word"
+          required
+          label={intl.formatMessage({
+            id: "dict.fields.word.label",
+          })}
+          rules={[
+            {
+              required: true,
+              message: intl.formatMessage({
+                id: "channel.create.message.noname",
+              }),
+            },
+          ]}
+        />
+        <ProFormText
+          width="md"
+          name="tag"
+          tooltip={intl.formatMessage({
+            id: "term.fields.description.tooltip",
+          })}
+          label={intl.formatMessage({
+            id: "term.fields.description.label",
+          })}
+        />
+      </ProForm.Group>
+      <ProForm.Group>
+        <ProFormText
+          width="md"
+          name="meaning"
+          tooltip={intl.formatMessage({
+            id: "term.fields.meaning.tooltip",
+          })}
+          label={intl.formatMessage({
+            id: "term.fields.meaning.label",
+          })}
+        />
+        <ProFormText
+          width="md"
+          name="meaning2"
+          tooltip={intl.formatMessage({
+            id: "term.fields.meaning2.tooltip",
+          })}
+          label={intl.formatMessage({
+            id: "term.fields.meaning2.label",
+          })}
+        />
+      </ProForm.Group>
+      <ProForm.Group>
+        <ProFormText
+          width="md"
+          name="channel"
+          tooltip={intl.formatMessage({
+            id: "term.fields.channel.tooltip",
+          })}
+          label={intl.formatMessage({
+            id: "term.fields.channel.label",
+          })}
+        />
+
+        <LangSelect />
+      </ProForm.Group>
+      <ProForm.Group>
+        <ProFormTextArea
+          name="note"
+          width="xl"
+          label={intl.formatMessage({
+            id: "forms.fields.note.label",
+          })}
+        />
+      </ProForm.Group>
+    </>
+  );
+};
+
+export default Widget;