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