Commit 418d85d7 authored by xuchaozou's avatar xuchaozou

feat: 初步增加录音模块哦

parent a5e02234
Pipeline #85588 waiting for manual action with stages
import { request, event } from '@wisdom-utils/utils' import { request, event } from '@wisdom-utils/utils';
import { useCallback, useEffect } from 'react' import { useCallback, useEffect } from 'react';
const SoundAi = props => { const SoundAi = props => {
const changeSwitch = useCallback(({recordData , e : checked}) => { const changeSwitch = useCallback(({ recordData, e: checked }) => {
if(checked) { if (checked) {
} }
// console.log(checked) // console.log(checked)
// debugger // debugger
...@@ -16,34 +15,36 @@ const SoundAi = props => { ...@@ -16,34 +15,36 @@ const SoundAi = props => {
// loading : false // loading : false
// }) // })
// }, 5000) // }, 5000)
}, []) }, []);
useEffect(() => { useEffect(() => {
request("/PandaOMS/OMS/DataManger/GetDicConfigs", { request('/PandaOMS/OMS/DataManger/GetDicConfigs', {
params: { params: {
ParentName: "智能语音", ParentName: '智能语音',
ChilName: "是否开启" ChilName: '是否开启',
} },
}).then(res => { })
.then(res => {
if (res.code != 0) { if (res.code != 0) {
return return;
} }
const data = res.data const { data } = res;
const config = data.find(item => item.nodeName == "是否开启") const config = data.find(item => item.nodeName == '是否开启');
if(!config) return if (!config) return;
const value = config.nodeValue const value = config.nodeValue;
if(value != "开") return if (value != '开') return;
event.emit("record:changeVisible", { event.emit('record:changeVisible', {
visible : true visible: true,
});
event.on('record:changedStaus', changeSwitch);
}) })
event.on("record:changedStaus", changeSwitch) .catch(error => {
}).catch(error => {
// console.log(error) // console.log(error)
}) });
return () => { return () => {
event.off("record:changedStaus", changeSwitch) event.off('record:changedStaus', changeSwitch);
} };
}, []) }, [changeSwitch]);
return null return null;
} };
export default SoundAi export default SoundAi;
\ No newline at end of file
...@@ -414,7 +414,7 @@ const Layout = props => { ...@@ -414,7 +414,7 @@ const Layout = props => {
window.share.event.removeAllListeners('updateSite'); window.share.event.removeAllListeners('updateSite');
loginAction.events.removeListener('toggleIndustry', handleToggleIndustry); loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
}; };
}, [loginAction.events, props]); }, [GetIntegrationConfig, loginAction.events, props]);
useEffect(() => { useEffect(() => {
const needMark = () => const needMark = () =>
......
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