UNPKG

@tntd/reference

Version:

<!-- * @Author: 周泽飞 zefei.zhou@tongdun.net * @Date: 2024-12-03 10:07:54 * @LastEditors: 郑泳健 * @LastEditTime: 2026-01-20 15:55:03 * @FilePath: /tntd3/packages/reference/README.md * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: http

100 lines (96 loc) 3.15 kB
import { WrapLocaleReceiver } from '../I18N'; import React, { useState } from 'react'; import { Drawer, Button, Alert } from 'tntd'; import ReferenceInfo from '../ReferenceInfo'; export default WrapLocaleReceiver((props) => { const { resolve, type, canNextOpera, modalWrap, referenceData, removeModal, title, orgMap = {}, appList = [], cancelText, okText, emptyType, showPagination, destroyOnClose = true, jumpFun, iframeJump, weakMsg, strongMsg, I18N } = props || {}; const [visible, setVisible] = useState(true); return ( <Drawer title={title || I18N.referencecheck.index.yinYongGuanXiCha} visible={visible} width={1000} destroyOnClose={destroyOnClose} getContainer={modalWrap} onCancel={()=>setVisible(false)} afterVisibleChange={(vi)=>{ if(!vi){ removeModal() } }} showFooter={!!canNextOpera} footer={canNextOpera?[ <Button key="back" onClick={()=>setVisible(false)}> {cancelText || I18N.referencecheck.index.quXiao} </Button>, canNextOpera && ( <Button key="submit" type="primary" onClick={() => { setVisible(false); resolve(type); }} > {okText || I18N.referencecheck.index.xiaYiBu} </Button> ), ]:null} > <div className="reference-check-drawer"> {canNextOpera && ( <div className="mb16"> <Alert type="warning" message={ weakMsg || referenceData?.message || I18N.referencecheck.index.cunZaiRuoYinYong } /> </div> )} {!canNextOpera && ( <div className="mb16"> <Alert type="error" message={ strongMsg || referenceData?.message || I18N.referencecheck.index.cunZaiQiangYinYong } /> </div> )} <div className="relation-reference-detail"> <ReferenceInfo jumpFun={jumpFun} iframeJump={iframeJump} showPagination={showPagination} emptyType={emptyType} referenceData={referenceData} orgMap={orgMap} appList={appList} unmountHandle={removeModal} /> </div> </div> </Drawer> ) });