关于Pro的一些使用(1)

1)

<ProFormDependency name={['buyCount']}>               {({ buyCount }, { setFieldsValue }) => {                 isNaN(buyCount)                   ? setFieldsValue({                       amountMoney: '¥0',                       amount: 0,                     })                   : setFieldsValue({                       amountMoney: `¥${buyCount * item?.priceUnit}`,                       amount:buyCount*item?.priceUnit                     });                 return [                   <ProFormField name="amount" width="sm" readonly hidden />,                   <ProFormField                     label="合计应付"                     name="amountMoney"                     width="sm"                     readonly                     hidden={type === 3}                   />,                 ];               }}             </ProFormDependency> 2) <Alert               message={<span dangerouslySetInnerHTML={{ __html: item?.description }}></span>}               type="info"               style={{ marginBottom: 24 }}             /> 3)  <ProFormField     readonly     label="合计应付"     fieldProps={{ value: `¥${amount}` }}    labelCol={{ span: 8 }}    wrapperCol={{ span: 16 }}   /> 4)  <DrawerForm       // drawerFormConfig 布局       {...drawerFormConfig}       title={(() => drawerTitle())()}       visible={visible}       form={formRef}       onVisibleChange={onVisibleChange}       onFinish={onFinish}     >       {type === 3 ? (         <Alert message="应用续费仅支持低版本向高版本续费,续费后不支持退换" type="warning" />       ) : null}       <Tabs defaultActiveKey={activeKey} onChange={onTabChange}>         {initialValues.map((item) => (           <Tabs.TabPane             key={item?.id}             tab={item?.name}     //在什么情况下隐藏 不显示             disabled={type === 3 && item?.serialNumber <= appSerialNumber}             forceRender           >             <Upgrade               toBasic={item}               type={type}               deductionFees={deductionFees}               renewDate={renewDate}             ></Upgrade>                            <Card title="历史订单" size="small" style={{ backgroundColor: 'rgba(0, 0, 0, .02)' }}>                 <ProFormField label="订单编号" name="orderNo" readonly />                 <Row>                   <Col span={12}>                     <ProFormField                       label="产品名称"                       name="productName"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                   <Col span={12}>                     <ProFormField                       label="套餐名称"                       name="packageName"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                 </Row>                 <Row>                   <Col span={12}>                     <ProFormField                       label="资源使用"                       name="usedResources"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                   <Col span={12}>                     <ProFormField                       label="账户使用"                       name="usedUsers"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                 </Row>                 <Row>                   <Col span={12}>                     <ProFormField                       label="购买周期"                       name="purchasedPeriod"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                   <Col span={12}>                     <ProFormField                       label="有效期至"                       name="expire"                       labelCol={{ span: 8 }}                       wrapperCol={{ span: 16 }}                       readonly                     />                   </Col>                 </Row>                 <ProFormField label="剩余费用" name="leftAmount" readonly />                 <ProFormField name="packageOrderId" hidden readonly />                 <ProFormField name="deductionFee" hidden readonly />               </Card>             {/* )} */}             {type === 3               ? [                   <p style={{ margin: '24px 0', color: '#ccc' }}>                     升级抵扣规则:在订单有效期内进行升级,将抵扣原套餐已使用时间金额                   </p>,                 ]               : null}           </Tabs.TabPane>         ))}       </Tabs>     </DrawerForm>
上一篇:Python 中有 3 个不可思议的返回功能


下一篇:2021-7-27 汇编语言 程序:驱动万物的伟力