|
|
@@ -22,13 +22,14 @@
|
|
|
:title="isPreview ? '' : '点击校对'"
|
|
|
:style="{
|
|
|
cursor: isPreview ? '' : 'pointer',
|
|
|
- 'align-items': wIndex == 0 ? 'flex-start' : 'center',
|
|
|
+ 'align-items': 'flex-start',
|
|
|
}"
|
|
|
@click="correctPinyin(word, block.paragraphIndex, block.oldIndex, wIndex)"
|
|
|
>
|
|
|
<span
|
|
|
v-if="pinyinPosition === 'top' && hasPinyinInParagraphNeVersion(block.paragraphIndex)"
|
|
|
class="pinyin"
|
|
|
+ :style="getPinyinStyle(word)"
|
|
|
>
|
|
|
{{ getPinyinText(word) }}</span
|
|
|
>
|
|
|
@@ -36,6 +37,7 @@
|
|
|
<span
|
|
|
v-if="pinyinPosition !== 'top' && hasPinyinInParagraphNeVersion(block.paragraphIndex)"
|
|
|
class="pinyin"
|
|
|
+ :style="getPinyinStyle(word)"
|
|
|
>
|
|
|
{{ getPinyinText(word) }}</span
|
|
|
>
|
|
|
@@ -385,6 +387,39 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ getPinyinText(item) {
|
|
|
+ return this.checkShowPinyin(item.showPinyin) ? item.pinyin.replace(/\s+/g, '') : '\u200B';
|
|
|
+ },
|
|
|
+ // 拼音固定为拼音字体,跟随汉字的字号、颜色、粗细的样式
|
|
|
+ getPinyinStyle(item) {
|
|
|
+ const styles = {};
|
|
|
+
|
|
|
+ // 固定使用 League 字体
|
|
|
+ styles['font-family'] = 'League';
|
|
|
+
|
|
|
+ // 只继承字号和颜色
|
|
|
+ if (item.activeTextStyle) {
|
|
|
+ if (item.activeTextStyle.fontSize) {
|
|
|
+ styles['font-size'] = item.activeTextStyle.fontSize;
|
|
|
+ }
|
|
|
+ if (item.activeTextStyle.color) {
|
|
|
+ styles['color'] = item.activeTextStyle.color;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果设置了全局字号,优先使用全局字号
|
|
|
+ if (this.isAllSetting && this.fontSize) {
|
|
|
+ styles['font-size'] = this.fontSize;
|
|
|
+ this.isAllSetting = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 明确重置不应该继承的样式
|
|
|
+ styles['text-decoration'] = 'none';
|
|
|
+ styles['font-style'] = 'normal';
|
|
|
+ styles['letter-spacing'] = '0';
|
|
|
+
|
|
|
+ return styles;
|
|
|
+ },
|
|
|
removeTagFromStack(tagStack, tagName) {
|
|
|
for (let i = tagStack.length - 1; i >= 0; i--) {
|
|
|
if (tagStack[i].tag === tagName) {
|
|
|
@@ -496,9 +531,6 @@ export default {
|
|
|
}
|
|
|
return this.isEnable(showPinyin);
|
|
|
},
|
|
|
- getPinyinText(item) {
|
|
|
- return this.checkShowPinyin(item.showPinyin) ? item.pinyin.replace(/\s+/g, '') : '\u200B';
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -550,7 +582,6 @@ export default {
|
|
|
> span {
|
|
|
display: inline-flex;
|
|
|
flex-direction: column;
|
|
|
- align-items: center;
|
|
|
}
|
|
|
|
|
|
.py-char {
|
|
|
@@ -561,6 +592,7 @@ export default {
|
|
|
.pinyin {
|
|
|
display: inline-block;
|
|
|
min-height: 12px;
|
|
|
+ font-family: 'League';
|
|
|
|
|
|
// font-family: 'PINYIN-B';
|
|
|
// font-size: 12px;
|
|
|
@@ -568,6 +600,10 @@ export default {
|
|
|
// line-height: 12px;
|
|
|
// color: $font-color;
|
|
|
line-height: 1em;
|
|
|
+ text-decoration: none !important;
|
|
|
+
|
|
|
+ // 防止继承父元素的删除线
|
|
|
+ text-decoration-skip-ink: none;
|
|
|
}
|
|
|
}
|
|
|
|