VoiceMatrixPreview.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. <!-- eslint-disable vue/no-v-html -->
  2. <template>
  3. <div class="voice-matrix-preview" :style="getAreaStyle()">
  4. <SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
  5. <div class="main">
  6. <div class="voice-matrix-audio">
  7. <div v-show="hasSelectedCell" class="audio-simple">
  8. <img
  9. class="audio-simple-image"
  10. :src="
  11. playing
  12. ? require(`@/assets/voice_matrix/icon-voice-play-blue.png`)
  13. : require(`@/assets/voice_matrix/icon-voice.png`)
  14. "
  15. @click="playAudio"
  16. />
  17. <span
  18. :class="['Repeat-16', 'audio-simple-repeat', isRepeat ? '' : 'disabled']"
  19. @click="isRepeat = !isRepeat"
  20. ></span>
  21. </div>
  22. <AudioLine
  23. v-show="!hasSelectedCell"
  24. ref="audioLine"
  25. audio-id="voiceMatrixAudio"
  26. :mp3="mp3Url"
  27. :get-cur-time="getCurTime"
  28. :stop-audio="stopAudio"
  29. :mp3-source="mp3Source"
  30. :audio-data="data"
  31. @handleChangeStopAudio="handleChangeStopAudio"
  32. @playChange="playChange"
  33. />
  34. </div>
  35. <!-- 语音矩阵 -->
  36. <div class="voice-matrix-container">
  37. <div
  38. v-if="data.option_list.length > 0"
  39. class="matrix"
  40. :style="{
  41. 'grid-template': `36px repeat(${data.option_list.length}, auto) minmax(36px, 1fr) / 36px repeat(${data.option_list[0].length}, auto) minmax(36px, 1fr)`,
  42. }"
  43. @mouseleave="clearSelectCell"
  44. >
  45. <!-- 顶部单元格 -->
  46. <div class="matrix-top" @mouseenter="clearSelectCell"></div>
  47. <template v-for="(row, i) in data.option_list[0]">
  48. <div
  49. :key="`top-${i}`"
  50. :class="[
  51. 'matrix-top',
  52. isEnable(data.property.is_enable_column_play) &&
  53. (selectColumn === i || (selectedLine.type === 'column' && selectedLine.index === i))
  54. ? 'read'
  55. : '',
  56. ]"
  57. @mouseenter="checkboxMouseenter(selectColumn === i, 'column')"
  58. >
  59. <span
  60. v-if="row.type !== 'connection' && isEnable(data.property.is_enable_column_play)"
  61. v-show="selectColumn === i || (selectedLine.type === 'column' && selectedLine.index === i)"
  62. :class="[
  63. `matrix-checkbox-row-${themeColor}`,
  64. selectedLine.type === 'column' && selectedLine.index === i ? 'active' : '',
  65. ]"
  66. @click="selectRowOrColumn(i, 'column')"
  67. ></span>
  68. </div>
  69. </template>
  70. <div class="matrix-top" @mouseenter="clearSelectCell"></div>
  71. <!-- 主矩阵 -->
  72. <template v-for="(row, i) in data.option_list">
  73. <div
  74. :key="`start-${i}`"
  75. :class="[
  76. 'column-wrapper',
  77. isEnable(data.property.is_enable_row_play) &&
  78. (selectRow === i || (selectedLine.type === 'row' && selectedLine.index === i))
  79. ? 'read'
  80. : '',
  81. ]"
  82. @mouseenter="checkboxMouseenter(selectRow === i, 'row')"
  83. >
  84. <span
  85. v-if="isEnable(data.property.is_enable_row_play)"
  86. v-show="selectRow === i || (selectedLine.type === 'row' && selectedLine.index === i)"
  87. :class="[
  88. `matrix-checkbox-column-${themeColor}`,
  89. selectedLine.type === 'row' && selectedLine.index === i ? 'active' : '',
  90. ]"
  91. @click="selectRowOrColumn(i, 'row')"
  92. ></span>
  93. </div>
  94. <!-- 单元格 -->
  95. <template v-for="(column, j) in row">
  96. <div
  97. :key="`wrapper-${i}-${j}`"
  98. :class="[
  99. 'column-wrapper',
  100. (isEnable(data.property.is_enable_row_play) && selectRow === i) ||
  101. (isEnable(data.property.is_enable_column_play) && selectColumn === j) ||
  102. (isEnable(data.property.is_enable_column_play) &&
  103. selectedLine.type === 'column' &&
  104. selectedLine.index === j) ||
  105. (isEnable(data.property.is_enable_row_play) &&
  106. selectedLine.type === 'row' &&
  107. selectedLine.index === i)
  108. ? 'read'
  109. : '',
  110. ]"
  111. @mouseenter="matrixCellMouseenter(i, j, column.type)"
  112. >
  113. <!-- 文本 -->
  114. <div
  115. :key="`column-${i}-${j}`"
  116. :class="[
  117. column.content.length === 0 ? 'space' : `column-${themeColor}`,
  118. (selectCell.row === i && selectCell.column === j) ||
  119. (selectedLine.type === 'column' && selectedLine.index === j) ||
  120. (selectedLine.type === 'row' && selectedLine.index === i)
  121. ? 'selected'
  122. : '',
  123. playing &&
  124. column.lrc_data.begin_time / 1000 <= curTime &&
  125. (curTime < column.lrc_data.end_time / 1000 || column.lrc_data.end_time === -1)
  126. ? 'playing'
  127. : '',
  128. column.isTitle ? 'title' : '',
  129. ]"
  130. @click="matrixCellClick(i, j)"
  131. >
  132. <span class="content rich-text" v-html="sanitizeHTML(column.content)"></span>
  133. </div>
  134. </div>
  135. </template>
  136. <div
  137. :key="`end-${i}`"
  138. :class="[
  139. isEnable(data.property.is_enable_row_play) &&
  140. (selectRow === i || (selectedLine.type === 'row' && selectedLine.index === i))
  141. ? 'read'
  142. : '',
  143. ]"
  144. @mouseenter="clearSelectCell"
  145. ></div>
  146. </template>
  147. <!-- 底部格子 -->
  148. <div class="matrix-bottom" @mouseenter="clearSelectCell"></div>
  149. <template v-for="(row, i) in data.option_list[0]">
  150. <div
  151. :key="`bottom-${i}`"
  152. :class="[
  153. 'matrix-bottom',
  154. isEnable(data.property.is_enable_column_play) &&
  155. (selectColumn === i || (selectedLine.type === 'column' && selectedLine.index === i))
  156. ? 'read'
  157. : '',
  158. ]"
  159. @mouseenter="clearSelectCell"
  160. ></div>
  161. </template>
  162. <div class="matrix-bottom" @mouseenter="clearSelectCell"></div>
  163. </div>
  164. </div>
  165. <!-- 录音 -->
  166. <div class="voice-luyin">
  167. <SoundRecord
  168. ref="luyin"
  169. type="promax"
  170. class="luyin-box"
  171. :answer-record-list="data.record_list"
  172. @getWavblob="getWavblob"
  173. @getSelectData="getSelectData"
  174. @handleParentPlay="pauseOtherAudio"
  175. @sentPause="sentPause"
  176. @handleWav="handleWav"
  177. />
  178. <AudioCompare
  179. :style="{ flex: 1 }"
  180. :theme-color="themeColor"
  181. :wavblob="wavblob"
  182. :url="mp3Url"
  183. :is-record="isRecord"
  184. :sent-pause="sentPause"
  185. :matrix-select-lrc="matrixSelectLrc"
  186. :get-cur-time="getCurTime"
  187. :cur-time="curTime"
  188. :handle-change-stop-audio="handleChangeStopAudio"
  189. @playing="playChange"
  190. />
  191. </div>
  192. </div>
  193. </div>
  194. </template>
  195. <script>
  196. import { getVoiceMatrixData } from '@/views/book/courseware/data/voiceMatrix';
  197. import { getRandomNumber } from '@/utils/index.js';
  198. import PreviewMixin from '../common/PreviewMixin';
  199. import Bus from './components/Bus.js';
  200. import SoundRecord from '../../common/SoundRecord.vue';
  201. import AudioCompare from './components/AudioCompareMatrix.vue';
  202. import AudioLine from './components/AudioLine.vue';
  203. export default {
  204. name: 'VoiceMatrixPreview',
  205. components: {
  206. SoundRecord,
  207. AudioCompare,
  208. AudioLine,
  209. },
  210. mixins: [PreviewMixin],
  211. data() {
  212. return {
  213. data: getVoiceMatrixData(),
  214. cid: getRandomNumber(),
  215. themeColor: 'red',
  216. curTime: 0,
  217. playing: false,
  218. stopAudio: true,
  219. unWatch: null,
  220. lrcArray: [],
  221. fileName: '',
  222. // 底色行、列
  223. selectRow: -1,
  224. selectColumn: -1,
  225. // 行、列选中
  226. selectedLine: {
  227. type: '',
  228. index: 0,
  229. },
  230. // 点击选中
  231. selectCell: {
  232. row: -1,
  233. column: -1,
  234. },
  235. isRepeat: false,
  236. // 跟读所需属性
  237. wavblob: null,
  238. isRecord: false,
  239. matrixSelectLrc: null,
  240. };
  241. },
  242. computed: {
  243. hasSelectedCell() {
  244. const { type, index } = this.selectedLine;
  245. const { row, column } = this.selectCell;
  246. return (type.length > 0 && index >= 0) || (row >= 0 && column >= 0);
  247. },
  248. mp3Url() {
  249. const audioData = this.data.audio_data;
  250. return audioData.url.match(/^\[FID##/) ? audioData.temporary_url : audioData.url;
  251. },
  252. mp3Source() {
  253. const audioData = this.data.audio_data;
  254. return 'source' in audioData ? audioData.source : '';
  255. },
  256. mp3Duration() {
  257. return this.data.audio_data.media_duration * 1000;
  258. },
  259. selectData() {
  260. const { type, index } = this.selectedLine;
  261. const { row, column } = this.selectCell;
  262. return {
  263. type: type.length > 0 && index >= 0 ? type : 'cell',
  264. index,
  265. row,
  266. column,
  267. };
  268. },
  269. },
  270. watch: {
  271. hasSelectedCell() {
  272. this.handleParentPlay();
  273. },
  274. isShowRightAnswer(val) {
  275. if (!val) return;
  276. this.handleWav(this.answer.record_list);
  277. if (this.answer.record_list.length > 0) {
  278. this.getWavblob(this.answer.record_list[0].wavData);
  279. }
  280. },
  281. 'data.record_list'(val) {
  282. this.answer.record_list = val;
  283. },
  284. },
  285. created() {
  286. Bus.$on('audioPause', (id) => {
  287. if (this.cid === id) return;
  288. if (this.$refs.luyin?.microphoneStatus) this.$refs.luyin.microphone();
  289. this.handleParentPlay();
  290. });
  291. if (!('record_list' in this.answer)) {
  292. this.$set(this.answer, 'record_list', []);
  293. }
  294. },
  295. mounted() {
  296. document.querySelector('body').addEventListener('click', this.restoreAudioStatus);
  297. },
  298. beforeDestroy() {
  299. document.querySelector('body').removeEventListener('click', this.restoreAudioStatus);
  300. },
  301. methods: {
  302. handleWav(data) {
  303. this.data.record_list = data;
  304. },
  305. // 鼠标移入移出
  306. matrixCellMouseenter(i, j, type) {
  307. if (type === 'connection') {
  308. this.selectRow = -1;
  309. this.selectColumn = -1;
  310. } else {
  311. this.selectRow = i;
  312. this.selectColumn = j;
  313. }
  314. },
  315. clearSelectCell() {
  316. this.selectRow = -1;
  317. this.selectColumn = -1;
  318. },
  319. // 单击单元格
  320. matrixCellClick(row, column) {
  321. if (this.playing) this.handleParentPlay();
  322. if (this.unWatch) this.unWatch();
  323. this.lrcArray = [];
  324. if (row === this.selectCell.row && column === this.selectCell.column) {
  325. this.selectCell = { row: -1, column: -1 };
  326. return;
  327. }
  328. this.selectedLine = { type: '', index: -1 };
  329. this.selectCell = { row, column };
  330. this.handleChangeTime(this.data.option_list[row][column].lrc_data);
  331. // 设置录音文件名
  332. this.setRecordingFileName(row, column);
  333. },
  334. setRecordingFileName(row, column) {
  335. return `录音第${column}列第${row}行`;
  336. },
  337. /**
  338. * 判断 click 点击是否语音矩阵可操作区域
  339. * @param {PointerEvent} event
  340. */
  341. restoreAudioStatus(event) {
  342. const whitePath = [
  343. 'column-green',
  344. 'column-red',
  345. 'column-brown',
  346. 'matrix-checkbox-column-',
  347. 'matrix-checkbox-row-',
  348. 'audio-simple-image',
  349. 'audio-simple-repeat',
  350. 'luyin-box',
  351. ];
  352. const operable = event.composedPath().some((item) => {
  353. const className = item.className;
  354. if (!className) return false;
  355. return whitePath.some((path) => className.includes(path));
  356. });
  357. if (!operable) {
  358. this.selectedLine = { type: '', index: -1 };
  359. this.selectCell = { row: -1, column: -1 };
  360. if (this.playing) this.handleParentPlay();
  361. if (this.unWatch) this.unWatch();
  362. }
  363. },
  364. checkboxMouseenter(isSelected, type) {
  365. if (!isSelected) return this.clearSelectCell();
  366. if (type === 'row') this.selectColumn = -1;
  367. if (type === 'column') this.selectRow = -1;
  368. },
  369. // 选中行、列
  370. selectRowOrColumn(index, type) {
  371. this.handleParentPlay();
  372. this.lrcArray = [];
  373. this.selectCell = { row: -1, column: -1 };
  374. if (this.unWatch) this.unWatch();
  375. if (this.selectedLine.type === type && this.selectedLine.index === index) {
  376. this.selectedLine = { type: '', index: -1 };
  377. return;
  378. }
  379. this.selectedLine = { type, index };
  380. let number = index;
  381. if (type === 'column') {
  382. this.data.option_list[index].forEach((item, i) => {
  383. if (i >= index) return;
  384. });
  385. }
  386. this.fileName = `第 ${number + 1} ${type === 'row' ? '行' : '列'}`;
  387. },
  388. playAudio() {
  389. if (!this.hasSelectedCell) return;
  390. if (this.playing) return this.handleParentPlay();
  391. if (this.lrcArray.length > 0) return this.$refs.audioLine.PlayAudio();
  392. if (this.unWatch) this.unWatch();
  393. this.lrcArray = [];
  394. const { type, index } = this.selectedLine;
  395. if (type.length > 0 && index >= 0 && type === 'row') {
  396. this.data.option_list[index].forEach((item) => {
  397. const data = this.getLrcData(item);
  398. if (data) this.lrcArray.push(data);
  399. });
  400. if (this.lrcArray.length > 0) this.lrcPlay(this.lrcArray[0], 0);
  401. return;
  402. }
  403. if (type.length > 0 && index >= 0 && type === 'column') {
  404. this.data.option_list.forEach((item) => {
  405. const data = this.getLrcData(item[index]);
  406. if (data) this.lrcArray.push(data);
  407. });
  408. if (this.lrcArray.length > 0) this.lrcPlay(this.lrcArray[0], 0);
  409. return;
  410. }
  411. const { row, column } = this.selectCell;
  412. if (row >= 0 && column >= 0) {
  413. this.handleChangeTime(this.data.option_list[row][column].lrc_data);
  414. }
  415. },
  416. lrcPlay({ begin_time, end_time }, index) {
  417. this.handleParentPlay();
  418. this.$nextTick(() => {
  419. this.$refs.audioLine.onTimeupdateTime(begin_time / 1000);
  420. this.$refs.audioLine.PlayAudio();
  421. if (end_time === -1) return;
  422. const end = end_time / 1000 - 0.01;
  423. this.unWatch = this.$watch('curTime', (val) => {
  424. if (val >= end) {
  425. if (!this.hasSelectedCell) return this.unWatch();
  426. this.handleParentPlay();
  427. this.$refs.audioLine.onTimeupdateTime(end);
  428. this.unWatch();
  429. const i = index + 1;
  430. if (i < this.lrcArray.length) {
  431. return this.lrcPlay(this.lrcArray[i], i);
  432. }
  433. if (this.isRepeat) {
  434. return this.lrcPlay(this.lrcArray[0], 0);
  435. }
  436. this.lrcArray = [];
  437. }
  438. });
  439. });
  440. },
  441. playChange(playing) {
  442. this.playing = playing;
  443. // 子组件通信,同时只能播放一个音频
  444. if (playing) Bus.$emit('audioPause', this.cid);
  445. },
  446. pauseOtherAudio() {
  447. Bus.$emit('audioPause', this.cid);
  448. this.stopAudio = true;
  449. },
  450. // 暂停音频播放
  451. handleParentPlay() {
  452. this.stopAudio = true;
  453. },
  454. // 音频播放时改变布尔值
  455. handleChangeStopAudio() {
  456. this.stopAudio = false;
  457. },
  458. getCurTime(curTime) {
  459. this.curTime = curTime;
  460. },
  461. getWavblob(wavblob) {
  462. this.wavblob = wavblob;
  463. },
  464. getSelectData({ type, index, row, column }) {
  465. if (type === '') return;
  466. const arr = [];
  467. if (type.length > 0 && index >= 0 && type === 'row') {
  468. this.data.option_list[index].forEach((item) => {
  469. const data = this.getLrcData(item);
  470. if (data) arr.push(data);
  471. });
  472. this.matrixSelectLrc = arr;
  473. return;
  474. }
  475. if (type.length > 0 && index >= 0 && type === 'column') {
  476. this.data.option_list.forEach((item) => {
  477. const data = this.getLrcData(item[index]);
  478. if (data) arr.push(data);
  479. });
  480. this.matrixSelectLrc = arr;
  481. return;
  482. }
  483. if (type === 'cell' && row >= 0 && column >= 0) {
  484. const lrcData = this.data.option_list[row][column].lrc_data;
  485. if (lrcData.end_time === -1) lrcData.end_time = this.mp3Duration;
  486. this.matrixSelectLrc = [lrcData];
  487. }
  488. },
  489. getLrcData({ content, lrc_data }) {
  490. if (content.length > 0) {
  491. if (lrc_data.end_time === -1) {
  492. return {
  493. begin_time: lrc_data.begin_time,
  494. end_time: this.mp3Duration,
  495. text: lrc_data.text,
  496. };
  497. }
  498. return lrc_data;
  499. }
  500. return false;
  501. },
  502. sentPause(isRecord) {
  503. this.isRecord = isRecord;
  504. },
  505. handleChangeTime({ begin_time, end_time }) {
  506. if (this.unWatch) this.unWatch();
  507. this.handleParentPlay();
  508. this.$nextTick(() => {
  509. this.$refs.audioLine.onTimeupdateTime(begin_time / 1000);
  510. this.$refs.audioLine.PlayAudio();
  511. // 监听是否已到结束时间,为了选中效果 - 0.01
  512. if (end_time === -1) return;
  513. const end = end_time / 1000 - 0.01;
  514. this.unWatch = this.$watch('curTime', (val) => {
  515. if (val >= end) {
  516. this.handleParentPlay();
  517. this.$refs.audioLine.onTimeupdateTime(end);
  518. this.unWatch();
  519. this.unWatch = null;
  520. if (this.isRepeat) {
  521. this.handleChangeTime({ begin_time, end_time });
  522. }
  523. }
  524. });
  525. });
  526. },
  527. },
  528. };
  529. </script>
  530. <style lang="scss" scoped>
  531. @use '@/styles/mixin.scss' as *;
  532. $select-color: #1890ff;
  533. $border-color: #e6e6e6;
  534. .voice-matrix-preview {
  535. @include preview-base;
  536. .main {
  537. color: #262626;
  538. .voice-matrix-audio {
  539. display: flex;
  540. height: 42px;
  541. border: 1px solid $border-color;
  542. border-radius: 8px 8px 0 0;
  543. .audio-number {
  544. padding: 12px 0 0 12px;
  545. %serial-number,
  546. .serial-number {
  547. display: inline-block;
  548. width: 16px;
  549. height: 16px;
  550. font-family: 'robot';
  551. font-size: 16px;
  552. line-height: 16px;
  553. color: #000;
  554. text-align: center;
  555. border-radius: 50%;
  556. }
  557. }
  558. .audio-simple {
  559. display: flex;
  560. flex-grow: 1;
  561. align-items: center;
  562. justify-content: space-between;
  563. height: 100%;
  564. line-height: 46px;
  565. img {
  566. width: 16px;
  567. height: 16px;
  568. margin-left: 12px;
  569. cursor: pointer;
  570. }
  571. .Repeat-16 {
  572. display: inline-block;
  573. width: 16px;
  574. height: 16px;
  575. margin-right: 12px;
  576. cursor: pointer;
  577. }
  578. }
  579. }
  580. // 语音矩阵
  581. .voice-matrix-container {
  582. height: calc(100% - 80px);
  583. font-size: 16px;
  584. word-break: break-word;
  585. background-color: #f5f5f5;
  586. border-right: 1px solid $border-color;
  587. border-left: 1px solid $border-color;
  588. .matrix {
  589. display: inline-grid;
  590. width: 100%;
  591. height: 100%;
  592. %matrix-checkbox {
  593. position: relative;
  594. top: calc(50% - 5px);
  595. display: block;
  596. width: 14px;
  597. height: 14px;
  598. margin: 0 auto;
  599. cursor: pointer;
  600. border: 1.5px solid #b0b0b0;
  601. border-radius: 4px;
  602. &.active {
  603. border-color: $select-color;
  604. &::after {
  605. position: absolute;
  606. left: 4px;
  607. box-sizing: content-box;
  608. width: 3px;
  609. height: 7px;
  610. content: '';
  611. border: 1px solid $select-color;
  612. border-top: 0;
  613. border-left: 0;
  614. transition: transform 0.15s ease-in 0.05s;
  615. transform: rotate(45deg) scaleY(1);
  616. transform-origin: center;
  617. }
  618. }
  619. }
  620. .matrix-checkbox-row-,
  621. .matrix-checkbox-row-red {
  622. @extend %matrix-checkbox;
  623. }
  624. %matrix-checkbox-column,
  625. .matrix-checkbox-column-,
  626. .matrix-checkbox-column-red {
  627. @extend %matrix-checkbox;
  628. top: calc(50% - 7px);
  629. right: -2px;
  630. }
  631. .read {
  632. background-color: #eaeaea;
  633. }
  634. .highlight-,
  635. .highlight-red {
  636. color: $select-color;
  637. }
  638. .column-wrapper {
  639. padding: 4px;
  640. %column {
  641. width: 100%;
  642. height: 100%;
  643. min-height: 32px;
  644. cursor: pointer;
  645. user-select: none;
  646. background-color: #fff;
  647. border: 1px solid $border-color;
  648. border-radius: 8px;
  649. transition: 0.2s;
  650. &:hover {
  651. border-color: #8c8c8c;
  652. }
  653. &.selected {
  654. color: $select-color;
  655. border-color: $select-color;
  656. }
  657. &.playing {
  658. background-color: rgba(24, 144, 255, 10%);
  659. }
  660. &.title {
  661. background-color: transparent;
  662. border-color: transparent;
  663. }
  664. > span {
  665. display: inline-block;
  666. padding: 4px 12px;
  667. line-height: 24px;
  668. }
  669. }
  670. %column-red,
  671. .column-,
  672. .column-red {
  673. @extend %column;
  674. position: relative;
  675. &::before {
  676. display: inline-block;
  677. vertical-align: middle;
  678. content: '';
  679. }
  680. }
  681. %sentence,
  682. .sentence-,
  683. .sentence-red {
  684. @extend %column;
  685. display: inline-grid;
  686. column-gap: 8px;
  687. justify-content: start;
  688. justify-items: center;
  689. padding: 4px 12px;
  690. line-height: 24px;
  691. > span {
  692. padding: 0;
  693. }
  694. .pinyin {
  695. font-family: 'GB-PINYINOK-B';
  696. font-size: 12px;
  697. line-height: 20px;
  698. opacity: 0.45;
  699. }
  700. .chs {
  701. font-size: 16px;
  702. line-height: 24px;
  703. }
  704. }
  705. .connection {
  706. position: relative;
  707. top: calc(50% - 1px);
  708. width: 16px;
  709. height: 2px;
  710. margin: 0 -4px;
  711. background-color: #252525;
  712. border-radius: 4px;
  713. &.highlight-bc-,
  714. &.highlight-bc-red {
  715. background-color: $select-color;
  716. }
  717. }
  718. // 拼音 + 文字
  719. %pinyin-english,
  720. .pinyinEnglish-,
  721. .pinyinEnglish-red {
  722. @extend %column;
  723. .inside-wrapper {
  724. padding: 4px 12px;
  725. .pinyin {
  726. font-family: 'GB-PINYINOK-B';
  727. font-size: 16px;
  728. line-height: 24px;
  729. }
  730. .english {
  731. font-family: 'robot';
  732. font-size: 12px;
  733. line-height: 20px;
  734. opacity: 0.45;
  735. }
  736. }
  737. }
  738. %text-brackets,
  739. .textBrackets-,
  740. .textBrackets-red {
  741. @extend %column;
  742. .brackets-text {
  743. font-family: 'GB-PINYINOK-B';
  744. }
  745. .brackets {
  746. font-size: 16px;
  747. }
  748. }
  749. }
  750. }
  751. .matrix-audio {
  752. width: 228px;
  753. height: 40px;
  754. padding: 4px 4px 4px 16px;
  755. margin: 24px 24px 0 0;
  756. background-color: #fff;
  757. border: 1px solid $border-color;
  758. border-radius: 8px;
  759. }
  760. }
  761. .voice-luyin {
  762. display: flex;
  763. align-items: center;
  764. height: 40px;
  765. padding: 3px 16px;
  766. border: 1px solid $border-color;
  767. border-radius: 0 0 8px 8px;
  768. :deep .record {
  769. max-width: 280px;
  770. }
  771. }
  772. }
  773. }
  774. .NNPE-tableList-tr-last {
  775. .voice-matrix {
  776. padding-bottom: 0;
  777. }
  778. }
  779. </style>
  780. <style lang="scss">
  781. .voice-matrix {
  782. &-audio {
  783. .audioLine {
  784. border-radius: 8px 8px 0 0 !important;
  785. }
  786. .el-slider {
  787. width: 100% !important;
  788. }
  789. }
  790. .luyin-box {
  791. .el-select .el-input {
  792. width: 136px;
  793. }
  794. }
  795. }
  796. </style>