fix: 代码优化
This commit is contained in:
parent
9a37c1cd99
commit
7ad93af5d4
|
|
@ -136,31 +136,6 @@
|
||||||
|
|
||||||
// 如果没有找到 finish_reason 为 "stop" 的事件,则返回 null 或其他默认值
|
// 如果没有找到 finish_reason 为 "stop" 的事件,则返回 null 或其他默认值
|
||||||
return stopEvent;
|
return stopEvent;
|
||||||
}
|
|
||||||
|
|
||||||
// 筛选关键词
|
|
||||||
function containsKeywordRegex(text) {
|
|
||||||
var index = Items.findIndex(item => text.includes(item));
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
return index
|
|
||||||
} else {
|
|
||||||
return 99999
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 语音所需时间
|
|
||||||
function calculateSpeakingTime(text) {
|
|
||||||
// 假设平均每分钟说230个单词
|
|
||||||
const wordsPerMinute = 230;
|
|
||||||
// 计算文字的长度
|
|
||||||
const wordCount = text.trim().length;
|
|
||||||
// 计算所需时间(以分钟为单位)
|
|
||||||
const speakingTime = wordCount / wordsPerMinute;
|
|
||||||
// 转换为秒数
|
|
||||||
const speakingTimeInSeconds = speakingTime * 60;
|
|
||||||
console.log(speakingTimeInSeconds, '说完需要多少秒')
|
|
||||||
return speakingTimeInSeconds;
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -300,7 +275,6 @@
|
||||||
if (result) {
|
if (result) {
|
||||||
DetailDay(result.dataKey, result.date).then(res => {
|
DetailDay(result.dataKey, result.date).then(res => {
|
||||||
let TargetData = res.data.data;
|
let TargetData = res.data.data;
|
||||||
var QSindex = containsKeywordRegex(params.msg);
|
|
||||||
|
|
||||||
if (result.dataKey == 'ECGData') {
|
if (result.dataKey == 'ECGData') {
|
||||||
TargetData.map(item => {
|
TargetData.map(item => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue