parent
6980ce819e
commit
cf96e155b6
@ -1,69 +1,42 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Speech Synthesis Example</title>
|
<meta charset="UTF-8">
|
||||||
</head>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<body>
|
<title>unicode-bidi 示例</title>
|
||||||
<h1>Speech Synthesis Example</h1>
|
<style>
|
||||||
<input type="text" id="text" value="请0的家属到手术室门口接病人" />
|
.normal {
|
||||||
<br />
|
unicode-bidi: normal;
|
||||||
<label for="rate">Rate:</label>
|
direction: ltr;
|
||||||
<input type="number" id="rate" value="1" step="0.1" min="0.1" max="10" />
|
|
||||||
<br />
|
|
||||||
<label for="voice">Voice:</label>
|
|
||||||
<select id="voiceSelect"></select>
|
|
||||||
<br />
|
|
||||||
<button onclick="speakText()">Speak</button>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const synth = window.speechSynthesis;
|
|
||||||
const voiceSelect = document.getElementById('voiceSelect');
|
|
||||||
|
|
||||||
function populateVoiceList() {
|
|
||||||
const voices = synth.getVoices();
|
|
||||||
console.log(voices);
|
|
||||||
if (voices.length === 0) {
|
|
||||||
synth.onvoiceschanged = populateVoiceList;
|
|
||||||
} else {
|
|
||||||
voiceSelect.innerHTML = ''; // 清空之前的选项
|
|
||||||
voices.forEach((voice, index) => {
|
|
||||||
const option = document.createElement('option');
|
|
||||||
option.textContent = `${voice.name} (${voice.lang})`;
|
|
||||||
console.log(`${voice.name} (${voice.lang})`);
|
|
||||||
option.value = index;
|
|
||||||
voiceSelect.appendChild(option);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
.embed {
|
||||||
|
unicode-bidi: embed;
|
||||||
populateVoiceList();
|
direction: rtl;
|
||||||
if (typeof synth.onvoiceschanged !== 'undefined') {
|
}
|
||||||
synth.onvoiceschanged = populateVoiceList;
|
.isolate {
|
||||||
}
|
unicode-bidi: isolate;
|
||||||
|
direction: rtl;
|
||||||
function speakText() {
|
}
|
||||||
window.speechSynthesis.cancel(); // 清除之前的语音合成
|
.bidi-override {
|
||||||
|
unicode-bidi: bidi-override;
|
||||||
setTimeout(() => {
|
direction: rtl;
|
||||||
const textInput = document.getElementById('text').value;
|
}
|
||||||
const rate = parseFloat(document.getElementById('rate').value);
|
.isolate-override {
|
||||||
|
unicode-bidi: isolate-override;
|
||||||
|
direction: rtl;
|
||||||
const utterance = new SpeechSynthesisUtterance([textInput, textInput, textInput].join(''));
|
}
|
||||||
|
.plaintext {
|
||||||
const selectedVoiceIndex = voiceSelect.selectedOptions[0].value;
|
unicode-bidi: plaintext;
|
||||||
const voices = synth.getVoices();
|
direction: rtl;
|
||||||
utterance.voice = voices[selectedVoiceIndex];
|
}
|
||||||
utterance.rate = rate;
|
</style>
|
||||||
|
</head>
|
||||||
utterance.onend = function (event) {
|
<body>
|
||||||
console.log('Speech has finished.');
|
<p class="normal">normal: This is an English text with عربى text embedded.</p>
|
||||||
alert('Speech has finished.');
|
<p class="embed">embed: This is an English text with عربى text embedded.</p>
|
||||||
};
|
<p class="isolate">isolate: This is an English text with عربى text embedded.</p>
|
||||||
|
<p class="bidi-override">bidi-override: This is an English text with عربى text embedded.</p>
|
||||||
window.speechSynthesis.speak(utterance);
|
<p class="isolate-override">isolate-override: This is an English text with عربى text embedded.</p>
|
||||||
}, 100); // 延迟 100 毫秒
|
<p class="plaintext">plaintext: This is an English text with عربى text embedded.</p>
|
||||||
}
|
</body>
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
import _axios from '@/utils/_axios';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取首台准点率列表(右边)
|
||||||
|
*/
|
||||||
|
export const GetMonitorOperationCount = date => {
|
||||||
|
return _axios({
|
||||||
|
url: '/api/QualityMicroservice/Monitor/GetMonitorFirstOperation',
|
||||||
|
params: {
|
||||||
|
date,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半年内首台准点率(左下角)
|
||||||
|
*/
|
||||||
|
export const GetMonitorFirstOperationMonth = () => {
|
||||||
|
return _axios({
|
||||||
|
url: '/api/QualityMicroservice/Monitor/GetMonitorFirstOperationMonth',
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in new issue