VoiceMatrixPreview.vue 24 KB

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