Browse Source

添加字段category

visuddhinanda 2 years ago
parent
commit
0439aa81ca

+ 6 - 0
dashboard/src/components/admin/relation/RelationEdit.tsx

@@ -142,6 +142,7 @@ const RelationEditWidget = ({
                   fromCase: res.data.from?.case,
                   fromSpell: res.data.from?.spell,
                   to: res.data.to,
+                  category: res.data.category,
                 };
               } else {
                 return {
@@ -215,6 +216,11 @@ const RelationEditWidget = ({
           allowClear={false}
           label={intl.formatMessage({ id: "forms.fields.to.label" })}
         />
+        <ProFormText
+          width="md"
+          name="category"
+          label={intl.formatMessage({ id: "forms.fields.category.label" })}
+        />
       </ProForm.Group>
     </ModalForm>
   );

+ 1 - 0
dashboard/src/locales/zh-Hans/forms.ts

@@ -68,6 +68,7 @@ const items = {
   "forms.fields.username.label": "用户名(登录名)",
   "forms.fields.nickname.label": "昵称",
   "forms.fields.editor.label": "编辑者",
+  "forms.fields.category.label": "分类",
 };
 
 export default items;

+ 10 - 0
dashboard/src/pages/admin/relation/list.tsx

@@ -88,6 +88,7 @@ export interface IRelationRequest {
   case?: string | null;
   from?: IFrom | null;
   to?: string[];
+  category?: string;
   editor?: IUser;
   updated_at?: string;
   created_at?: string;
@@ -118,6 +119,7 @@ export interface IRelation {
   fromCase?: string[];
   fromSpell?: string;
   to?: string[];
+  category?: string;
   editor?: IUser;
   updated_at?: string;
   created_at?: string;
@@ -251,6 +253,13 @@ const Widget = () => {
               ));
             },
           },
+          {
+            title: intl.formatMessage({
+              id: "forms.fields.category.label",
+            }),
+            dataIndex: "category",
+            key: "category",
+          },
           {
             title: intl.formatMessage({
               id: "forms.fields.editor.label",
@@ -343,6 +352,7 @@ const Widget = () => {
               case: item.case,
               from: item.from,
               to: item.to,
+              category: item.category,
               editor: item.editor,
               created_at: item.created_at,
               updated_at: item.updated_at,