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)
// debugger
// event.emit("record:changeSwicth", {
// loading : true
// })
// setTimeout(() => {
// event.emit("record:changeSwicth", {
// loading : false
// })
// }, 5000)
}, []);
useEffect(() => {
request('/PandaOMS/OMS/DataManger/GetDicConfigs', {
params: {
ParentName: '智能语音',
ChilName: '是否开启',
},
})
.then(res => {
if (res.code != 0) {
return;
} }
// console.log(checked) const { data } = res;
// debugger const config = data.find(item => item.nodeName == '是否开启');
// event.emit("record:changeSwicth", { if (!config) return;
// loading : true const value = config.nodeValue;
// }) if (value != '开') return;
// setTimeout(() => { event.emit('record:changeVisible', {
// event.emit("record:changeSwicth", { visible: true,
// loading : false });
// }) event.on('record:changedStaus', changeSwitch);
// }, 5000) })
}, []) .catch(error => {
useEffect(() => { // console.log(error)
request("/PandaOMS/OMS/DataManger/GetDicConfigs", { });
params: { return () => {
ParentName: "智能语音", event.off('record:changedStaus', changeSwitch);
ChilName: "是否开启" };
} }, [changeSwitch]);
}).then(res => { return null;
if (res.code != 0) { };
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
})
event.on("record:changedStaus", changeSwitch)
}).catch(error => {
// console.log(error)
})
return () => {
event.off("record:changedStaus", changeSwitch)
}
}, [])
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