前端hook项目重构笔记2-重构之裁剪上传功能

删除多余的代码和注释

从987行精简到380行

修改配置文件名 TailoringSchemeAdd 裁剪方案新增

 ant design自定义穿梭框代码

  const renderItem = (item: RecordType) => {
    const customLabel = (
      <Row>
        <div style={{ lineHeight: "54px" }}>{item.title}</div>
        {item.chosen && (
          <div className={styles["antForm"]}>
            <Form
              form={formDataList}
              initialValues={menu || {}}
              layout="inline"
            >
              <Form.Item
                label="唛架比"
                name={`ratio-${item.key}`}
                rules={[{ required: true, message: "请输入唛架比" }]}
              >
                <Input style={{ width: "100px", marginTop: "10px" }} />
              </Form.Item>
            </Form>
          </div>
        )}
      </Row>
    );
    return {
      label: customLabel,
      value: item.title,
    };
  };

posted @ 2023-02-18 14:12  前端导师歌谣  阅读(23)  评论(0)    收藏  举报  来源