Commit 2d3bdcab authored by 皮倩雯's avatar 皮倩雯

fix: '产品配置'

parent c432831d
Pipeline #45154 passed with stages
in 7 minutes 13 seconds
...@@ -28,12 +28,17 @@ const EditForm = props => { ...@@ -28,12 +28,17 @@ const EditForm = props => {
}, },
]; ];
useEffect(() => { useEffect(() => {
console.log(productObj.ProductName);
console.log(productObj.IsUsed, 'productObj.IsUsed'); console.log(productObj.IsUsed, 'productObj.IsUsed');
form.setFieldsValue({ ...productObj }); let aa = userProductsList.find(i => i.ProductName == productObj.ProductName);
console.log(aa);
if (!productObj.IsUsed) { if (!productObj.IsUsed) {
setBut(true); setBut(true);
form.setFieldsValue({ ...productObj });
} else { } else {
setBut(false); setBut(false);
form.setFieldsValue({ ...aa });
} }
}, [productObj]); }, [productObj]);
// 提交选择 // 提交选择
...@@ -109,35 +114,42 @@ const EditForm = props => { ...@@ -109,35 +114,42 @@ const EditForm = props => {
))} ))}
</Select> </Select>
</Item> </Item>
<Item {but ? (
label="访问路由" <></>
name="RouteUrl" ) : (
rules={[ <>
{ <Item
required: true, label="访问路由"
message: '请输入访问路由,ip加端口号,示例//localhost:3001', name="RouteUrl"
}, rules={[
]} {
> required: true,
{/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */} message: '请输入访问路由,ip加端口号,示例//localhost:3001',
<Input placeholder="请输入访问路由,ip加端口号,示例//localhost:3001" allowClear /> },
</Item> ]}
>
{/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */}
<Input placeholder="请输入访问路由,ip加端口号,示例//localhost:3001" allowClear />
</Item>
<Item
label="默认配置"
name="DefaultSetting"
rules={[
{
required: false,
message: '请输入默认配置',
},
]}
>
<TextArea
placeholder='请输入json对象,示例{"name":"张三","age":"18"}'
autoSize={{ minRows: 3, maxRows: 5 }}
/>
</Item>
</>
)}
<Item
label="默认配置"
name="DefaultSetting"
rules={[
{
required: false,
message: '请输入默认配置',
},
]}
>
<TextArea
placeholder='请输入json对象,示例{"name":"张三","age":"18"}'
autoSize={{ minRows: 3, maxRows: 5 }}
/>
</Item>
<div style={{ display: 'flex', marginLeft: '35%' }}> <div style={{ display: 'flex', marginLeft: '35%' }}>
<Item wrapperCol={{ span: 8, offset: 8 }} style={{ marginRight: '30px' }}> <Item wrapperCol={{ span: 8, offset: 8 }} style={{ marginRight: '30px' }}>
<Button type="primary" htmlType="submit" disabled={but}> <Button type="primary" htmlType="submit" disabled={but}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment