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

♻️ refactor(contract): 优化合同续期相关代码结构

- 前端: 从App中直接获取modal实例替代单独引入Modal组件
- 后端: 移除hetong-renew.entity中冗余的client关联字段,优化数据模型设计
yourname 8 месяцев назад
Родитель
Сommit
fcd392e4e7

+ 2 - 2
src/client/admin/pages/ContractRenews.tsx

@@ -30,11 +30,11 @@ const RenewStatusEnum = {
 
 const { Title } = Typography;
 const { Option } = Select;
-const { confirm } = Modal;
 const { RangePicker } = DatePicker;
 
 const ContractRenews: React.FC = () => {
-  const { message } = App.useApp();
+  const { message, modal } = App.useApp();
+  const { confirm } = modal;
   const queryClient = useQueryClient();
   const [form] = Form.useForm();
   const [searchForm] = Form.useForm();

+ 0 - 7
src/server/modules/contracts/hetong-renew.entity.ts

@@ -14,13 +14,6 @@ export class HetongRenew {
   contractId!: number;
   @ManyToOne(() => Hetong, hetong => hetong.renews)
   contract!: Hetong;
-  
-  @Column({ name: 'client_id', type: 'int', unsigned: true })
-  @ForeignKey(() => Client)
-  clientId!: number;
-  
-  @ManyToOne(() => Client, client => client.contractRenews)
-  client!: Client;
 
   @Column({ name: 'amount', type: 'varchar', length: 50, nullable: true })
   amount?: string;