oak-pay-business/es/components/wpProduct/upsert/web.pc.js

24 lines
1.1 KiB
JavaScript

import React from 'react';
import { Form, Select } from 'antd';
export default function render(props) {
const { wpProduct, applications, oakFullpath, systemId } = props.data;
const { t, update } = props.methods;
if (wpProduct) {
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ minWidth: 460 }}>
<Form.Item label={t('wpProduct:attr.type')}>
<Select value={wpProduct.type} options={['native', 'mp', 'jsapi', 'h5', 'app'].map(ele => ({
label: t(`wpProduct:v.type.${ele}`),
value: ele,
}))} onSelect={(value) => update({ type: value })}/>
</Form.Item>
{wpProduct.type && applications && (<Form.Item label={t('wpProduct:attr.application')}>
<Select value={wpProduct.applicationId} options={applications.map(ele => ({
label: ele.name,
value: ele.id,
}))} onSelect={(value) => update({ applicationId: value })}/>
</Form.Item>)}
</Form>);
}
return null;
}