2
0
Quellcode durchsuchen

♻️ refactor(classroom): remove submitUser field from classroom data

- 删除教室数据实体中的submitUser字段
- 移除创建和更新表单中的提交用户输入项
- 删除相关的数据验证规则
- 清理表单初始化和编辑时的submitUser属性
yourname vor 6 Monaten
Ursprung
Commit
9c4adfb8d9

+ 3 - 42
src/client/admin/pages/ClassroomDataPage.tsx

@@ -56,8 +56,7 @@ export const ClassroomDataPage: React.FC = () => {
       price: null,
       price: null,
       code: null,
       code: null,
       status: null,
       status: null,
-      spare: null,
-      submitUser: null
+      spare: null
     }
     }
   });
   });
 
 
@@ -72,8 +71,7 @@ export const ClassroomDataPage: React.FC = () => {
       price: null,
       price: null,
       code: null,
       code: null,
       status: null,
       status: null,
-      spare: null,
-      submitUser: null
+      spare: null
     }
     }
   });
   });
 
 
@@ -124,8 +122,7 @@ export const ClassroomDataPage: React.FC = () => {
       price: item.price || null,
       price: item.price || null,
       code: item.code || null,
       code: item.code || null,
       status: item.status,
       status: item.status,
-      spare: item.spare || null,
-      submitUser: item.submitUser || null
+      spare: item.spare || null
     });
     });
     setIsModalOpen(true);
     setIsModalOpen(true);
   };
   };
@@ -559,24 +556,6 @@ export const ClassroomDataPage: React.FC = () => {
                   )}
                   )}
                 />
                 />
 
 
-                <FormField
-                  control={createForm.control}
-                  name="submitUser"
-                  render={({ field }) => (
-                    <FormItem>
-                      <FormLabel>提交用户</FormLabel>
-                      <FormControl>
-                        <Input
-                          placeholder="请输入提交用户"
-                          value={field.value || ''}
-                          onChange={(e) => field.onChange(e.target.value || null)}
-                        />
-                      </FormControl>
-                      <FormMessage />
-                    </FormItem>
-                  )}
-                />
-
                 <DialogFooter>
                 <DialogFooter>
                   <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
                   <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
                     取消
                     取消
@@ -739,24 +718,6 @@ export const ClassroomDataPage: React.FC = () => {
                   )}
                   )}
                 />
                 />
 
 
-                <FormField
-                  control={updateForm.control}
-                  name="submitUser"
-                  render={({ field }) => (
-                    <FormItem>
-                      <FormLabel>提交用户</FormLabel>
-                      <FormControl>
-                        <Input
-                          placeholder="请输入提交用户"
-                          value={field.value || ''}
-                          onChange={(e) => field.onChange(e.target.value || null)}
-                        />
-                      </FormControl>
-                      <FormMessage />
-                    </FormItem>
-                  )}
-                />
-
                 <DialogFooter>
                 <DialogFooter>
                   <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
                   <Button type="button" variant="outline" onClick={() => setIsModalOpen(false)}>
                     取消
                     取消

+ 0 - 3
src/server/modules/classroom/classroom-data.entity.ts

@@ -30,9 +30,6 @@ export class ClassroomData {
   @Column({ name: 'spare', type: 'varchar', length: 255, nullable: true, comment: '备用' })
   @Column({ name: 'spare', type: 'varchar', length: 255, nullable: true, comment: '备用' })
   spare!: string | null;
   spare!: string | null;
 
 
-  @Column({ name: 'submit_user', type: 'varchar', length: 255, nullable: true, comment: '提交用户' })
-  submitUser!: string | null;
-
   @Column({ name: 'created_by', type: 'int', nullable: true, comment: '创建用户ID' })
   @Column({ name: 'created_by', type: 'int', nullable: true, comment: '创建用户ID' })
   createdBy!: number | null;
   createdBy!: number | null;
 
 

+ 0 - 12
src/server/modules/classroom/classroom-data.schema.ts

@@ -50,10 +50,6 @@ export const ClassroomDataSchema = z.object({
     description: '备用',
     description: '备用',
     example: '备用信息'
     example: '备用信息'
   }),
   }),
-  submitUser: z.string().max(255, '提交用户最多255个字符').nullable().openapi({
-    description: '提交用户',
-    example: 'user123'
-  }),
   createdBy: z.coerce.number<number>().int('创建用户ID必须是整数').positive('创建用户ID必须是正整数').nullable().openapi({
   createdBy: z.coerce.number<number>().int('创建用户ID必须是整数').positive('创建用户ID必须是正整数').nullable().openapi({
     description: '创建用户ID',
     description: '创建用户ID',
     example: 1
     example: 1
@@ -105,10 +101,6 @@ export const CreateClassroomDataDto = z.object({
   spare: z.string().max(255, '备用信息最多255个字符').nullable().optional().openapi({
   spare: z.string().max(255, '备用信息最多255个字符').nullable().optional().openapi({
     description: '备用',
     description: '备用',
     example: '备用信息'
     example: '备用信息'
-  }),
-  submitUser: z.string().max(255, '提交用户最多255个字符').nullable().optional().openapi({
-    description: '提交用户',
-    example: 'user123'
   })
   })
 });
 });
 
 
@@ -145,9 +137,5 @@ export const UpdateClassroomDataDto = z.object({
   spare: z.string().max(255, '备用信息最多255个字符').nullable().optional().openapi({
   spare: z.string().max(255, '备用信息最多255个字符').nullable().optional().openapi({
     description: '备用',
     description: '备用',
     example: '备用信息'
     example: '备用信息'
-  }),
-  submitUser: z.string().max(255, '提交用户最多255个字符').nullable().optional().openapi({
-    description: '提交用户',
-    example: 'user123'
   })
   })
 });
 });