Commit 0fb75a0dbcf82552ece1db784903b4d88150648b

Authored by 赵凤
1 parent 3d023a40

删除多余代码

src/pages/approval/PreSetting/components/CreateItem.tsx
... ... @@ -14,8 +14,6 @@ const layout = {
14 14 wrapperCol: { span: 20 },
15 15 };
16 16 interface Props {
17   - // visible: boolean;
18   - // setVisible?: any;
19 17 item: PreSetting.Item;
20 18 setItem: any;
21 19 approvalConfigId: number;
... ... @@ -54,9 +52,7 @@ export default function CreateItem({
54 52 .then((res) => {
55 53 message.success("保存成功");
56 54 setItem({visible: false});
57   - // setVisible(false);
58 55 setListLoading(true);
59   - // setParams({ current: 1 }, true);
60 56 })
61 57 .catch((err) => message.error(err.message))
62 58 .finally(() => {
... ... @@ -69,7 +65,6 @@ export default function CreateItem({
69 65 <Modal
70 66 title={`${id?'编辑':'新增'}预设条件`}
71 67 visible={visible}
72   - // onCancel={() => setVisible(false)}
73 68 onCancel={() => setItem({ visible: false })}
74 69 onOk={() => form.submit()}
75 70 confirmLoading={loading}
... ... @@ -115,17 +110,13 @@ export default function CreateItem({
115 110  
116 111 <Form.Item
117 112 noStyle
118   - shouldUpdate={(prevValues, currentValues) =>
119   - prevValues.type !== currentValues.type
120   - }
  113 + shouldUpdate={(prevValues, currentValues) => prevValues.type !== currentValues.type}
121 114 >
122   - {({ getFieldValue }) =>
123   - [1, 2].includes(getFieldValue("type")) ? (
124   - <Form.Item name="unit" label="单位" rules={[{ required: true }]}>
125   - <Input placeholder="请输入单位" maxLength={4} />
126   - </Form.Item>
127   - ) : null
128   - }
  115 + {({ getFieldValue }) => ([1, 2].includes(getFieldValue("type")) ? (
  116 + <Form.Item name="unit" label="单位" rules={[{ required: true }]}>
  117 + <Input placeholder="请输入单位" maxLength={4} />
  118 + </Form.Item>
  119 + ) : null)}
129 120 </Form.Item>
130 121 {conditionType && (
131 122 <Form.Item
... ... @@ -136,14 +127,14 @@ export default function CreateItem({
136 127 <Select placeholder="请选择">
137 128 {[1, 2].includes(conditionType)
138 129 ? Judge_Rule1.map((item) => (
139   - <Option value={item.value} key={item.value}>
140   - {item.label}
141   - </Option>
  130 + <Option value={item.value} key={item.value}>
  131 + {item.label}
  132 + </Option>
142 133 ))
143 134 : Judge_Rule2.map((item) => (
144   - <Option value={item.value} key={item.value}>
145   - {item.label}
146   - </Option>
  135 + <Option value={item.value} key={item.value}>
  136 + {item.label}
  137 + </Option>
147 138 ))}
148 139 </Select>
149 140 </Form.Item>
... ...
src/pages/approval/PreSetting/entity.ts
... ... @@ -12,6 +12,7 @@ export const Condition_Type = [
12 12 { label: "车辆区域库", value: 8 },
13 13 { label: "资金账户", value: 9 },
14 14 { label: "能力提升业务类型", value: 10 },
  15 + { label: "款项", value: 11 },
15 16 ];
16 17 export enum Condition_Type_Enum{
17 18 "数量"=1,
... ...
src/pages/approval/PreSetting/index.tsx
... ... @@ -63,10 +63,7 @@ export default function PreSetting({ match }: Props) {
63 63 <Description term="审批编号">{approvalNo || ""}</Description>
64 64 </DescriptionList>
65 65 <div style={{ height: 15 }} />
66   - <DescriptionList size="large" title="" col={1}>
67   - {/* <Description term="审批名称">{approvalName || ""}</Description> */}
68   - {/* <Description term="审批名称">{approvalName || ""}</Description> */}
69   - </DescriptionList>
  66 +
70 67 <div
71 68 style={{
72 69 marginBottom: 20,
... ... @@ -82,7 +79,6 @@ export default function PreSetting({ match }: Props) {
82 79 <Table
83 80 dataSource={data}
84 81 rowKey={(record) => `id_${record.id}`}
85   - // pagination={false}
86 82 loading={loading}
87 83 scroll={{ x: 500, y: 350 }}
88 84 >
... ...