parent
6980ce819e
commit
cf96e155b6
@ -1,69 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Speech Synthesis Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Speech Synthesis Example</h1>
|
||||
<input type="text" id="text" value="请0的家属到手术室门口接病人" />
|
||||
<br />
|
||||
<label for="rate">Rate:</label>
|
||||
<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);
|
||||
});
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>unicode-bidi 示例</title>
|
||||
<style>
|
||||
.normal {
|
||||
unicode-bidi: normal;
|
||||
direction: ltr;
|
||||
}
|
||||
.embed {
|
||||
unicode-bidi: embed;
|
||||
direction: rtl;
|
||||
}
|
||||
.isolate {
|
||||
unicode-bidi: isolate;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
populateVoiceList();
|
||||
if (typeof synth.onvoiceschanged !== 'undefined') {
|
||||
synth.onvoiceschanged = populateVoiceList;
|
||||
.bidi-override {
|
||||
unicode-bidi: bidi-override;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
function speakText() {
|
||||
window.speechSynthesis.cancel(); // 清除之前的语音合成
|
||||
|
||||
setTimeout(() => {
|
||||
const textInput = document.getElementById('text').value;
|
||||
const rate = parseFloat(document.getElementById('rate').value);
|
||||
|
||||
|
||||
const utterance = new SpeechSynthesisUtterance([textInput, textInput, textInput].join(''));
|
||||
|
||||
const selectedVoiceIndex = voiceSelect.selectedOptions[0].value;
|
||||
const voices = synth.getVoices();
|
||||
utterance.voice = voices[selectedVoiceIndex];
|
||||
utterance.rate = rate;
|
||||
|
||||
utterance.onend = function (event) {
|
||||
console.log('Speech has finished.');
|
||||
alert('Speech has finished.');
|
||||
};
|
||||
|
||||
window.speechSynthesis.speak(utterance);
|
||||
}, 100); // 延迟 100 毫秒
|
||||
.isolate-override {
|
||||
unicode-bidi: isolate-override;
|
||||
direction: rtl;
|
||||
}
|
||||
</script>
|
||||
.plaintext {
|
||||
unicode-bidi: plaintext;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p class="normal">normal: This is an English text with عربى text embedded.</p>
|
||||
<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>
|
||||
<p class="isolate-override">isolate-override: This is an English text with عربى text embedded.</p>
|
||||
<p class="plaintext">plaintext: This is an English text with عربى text embedded.</p>
|
||||
</body>
|
||||
</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