import * as React from 'react'; import ReactDOM from 'react-dom'; import { PlaySoundProps } from 'src/types/op-play-sound'; export const typeMap = { success: 'https://aos-wms-test.oss-cn-shanghai.aliyuncs.com/sound/success.wav', error: 'https://aos-wms-test.oss-cn-shanghai.aliyuncs.com/sound/error.wav', warning: 'https://aos-wms-test.oss-cn-shanghai.aliyuncs.com/sound/warning.wav', // 可继续扩展 }; export default function PlaySound(props: PlaySoundProps) { const { visible = true, type = 'success', src, autoPlay = true, loop = false, className, ...audioProps } = props; const audioSrc = src || (type ? typeMap[type] : ''); return visible && audioSrc ? (