|
|
@@ -3,10 +3,6 @@
|
|
|
<template #content>
|
|
|
<div class="container">
|
|
|
<div class="batch-set">
|
|
|
- <SvgIcon icon-class="font-bold" size="16" @click="BatchSetFormat('bold')" />
|
|
|
- <SvgIcon icon-class="font-italic" size="16" @click="BatchSetFormat('italic')" />
|
|
|
- <SvgIcon icon-class="font-underline" size="16" @click="BatchSetFormat('strikethrough')" />
|
|
|
- <SvgIcon icon-class="font-strikethrough" size="16" @click="BatchSetFormat('underline')" />
|
|
|
<el-select
|
|
|
v-model="font"
|
|
|
style="width: 120px"
|
|
|
@@ -24,6 +20,13 @@
|
|
|
<el-option v-for="size in fontSizeList" :key="size" :label="size" :value="size" />
|
|
|
</el-select>
|
|
|
<el-color-picker v-model="color" @change="BatchSetFormat('color', color)" />
|
|
|
+ <SvgIcon icon-class="font-bold" size="20" @click="BatchSetFormat('bold')" />
|
|
|
+ <SvgIcon icon-class="font-italic" size="20" @click="BatchSetFormat('italic')" />
|
|
|
+ <SvgIcon icon-class="font-underline" size="24" @click="BatchSetFormat('strikethrough')" />
|
|
|
+ <SvgIcon icon-class="font-strikethrough" size="24" @click="BatchSetFormat('underline')" />
|
|
|
+ <SvgIcon icon-class="align-left" size="20" @click="BatchSetFormat('align', 'LEFT')" />
|
|
|
+ <SvgIcon icon-class="align-center" size="20" @click="BatchSetFormat('align', 'MIDDLE')" />
|
|
|
+ <SvgIcon icon-class="align-right" size="20" @click="BatchSetFormat('align', 'RIGHT')" />
|
|
|
</div>
|
|
|
|
|
|
<div class="option-list">
|
|
|
@@ -43,6 +46,13 @@
|
|
|
<span class="multilingual" @click="openMultilingual(i, j)">
|
|
|
<SvgIcon icon-class="multilingual" class-name="multilingual" width="12" height="12" />
|
|
|
</span>
|
|
|
+ <span
|
|
|
+ class="toggle-pill"
|
|
|
+ :class="{ 'is-active': li.is_only_text }"
|
|
|
+ @click="toggleOnlyText(li, !li.is_only_text)"
|
|
|
+ >
|
|
|
+ <span class="toggle-dot"></span>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -222,6 +232,16 @@ export default {
|
|
|
let curIndex = 0;
|
|
|
this.data.option_list.forEach((row) => {
|
|
|
row.forEach((item, i) => {
|
|
|
+ // 跳过没有内容和 is_only_text 为 true 的单元格
|
|
|
+ const plainText = item.content.replace(/<[^>]+>/g, '').trim();
|
|
|
+ if (plainText.length === 0 || item.is_only_text) {
|
|
|
+ row[i].lrc_data = {
|
|
|
+ begin_time: 0,
|
|
|
+ end_time: 0,
|
|
|
+ text: '',
|
|
|
+ };
|
|
|
+ return;
|
|
|
+ }
|
|
|
const lrcData = lrcArr[curIndex];
|
|
|
if (lrcData) {
|
|
|
row[i].lrc_data = lrcData;
|
|
|
@@ -310,6 +330,9 @@ export default {
|
|
|
saveSubtitles(dataList) {
|
|
|
this.data.option_list = dataList;
|
|
|
},
|
|
|
+ toggleOnlyText(item, val) {
|
|
|
+ this.$set(item, 'is_only_text', val);
|
|
|
+ },
|
|
|
openMultilingual(i, j) {
|
|
|
this.curSelectRow = i;
|
|
|
this.curSelectColumn = j;
|
|
|
@@ -336,7 +359,10 @@ export default {
|
|
|
}
|
|
|
const text = this.data.option_list
|
|
|
.map((item) =>
|
|
|
- item.map(({ content = '' }) => {
|
|
|
+ item.map(({ content = '', is_only_text }) => {
|
|
|
+ console.log(is_only_text);
|
|
|
+
|
|
|
+ if (is_only_text) return '';
|
|
|
const plainText = content.replace(/<[^>]+>/g, '').trim();
|
|
|
return plainText;
|
|
|
}),
|
|
|
@@ -418,6 +444,37 @@ export default {
|
|
|
right: 3px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
+ .toggle-pill {
|
|
|
+ position: absolute;
|
|
|
+ top: 6px;
|
|
|
+ right: 22px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: 22px;
|
|
|
+ height: 12px;
|
|
|
+ padding: 0 2px;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #c0c4cc;
|
|
|
+ border-radius: 6px;
|
|
|
+ transition: background 0.2s;
|
|
|
+
|
|
|
+ &.is-active {
|
|
|
+ background: #a0cfff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .toggle-dot {
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 50%;
|
|
|
+ transition: transform 0.2s;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.is-active .toggle-dot {
|
|
|
+ transform: translateX(10px);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|