Commit 4f1a7479 authored by xuchaozou's avatar xuchaozou

Revert "feat: 初步增加录音模块哦"

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