|
|
@@ -23,6 +23,13 @@
|
|
|
<span
|
|
|
class="words"
|
|
|
:class="[/^[0-9]*$/.test(items.text)] ? (/^[\u4e00-\u9fa5]/.test(items.text) ? 'hanzi' : 'en') : ''"
|
|
|
+ :style="{
|
|
|
+ fontFamily: items.fontFamily,
|
|
|
+ color: items.color,
|
|
|
+ textDecoration: items.textDecoration,
|
|
|
+ borderBottom: items.border === 'dotted' ? '1px dotted' : '',
|
|
|
+ fontWeight: items.fontWeight,
|
|
|
+ }"
|
|
|
>
|
|
|
{{ items.text }}
|
|
|
</span>
|
|
|
@@ -38,26 +45,51 @@
|
|
|
:close-on-click-modal="false"
|
|
|
:modal-append-to-body="false"
|
|
|
:modal="false"
|
|
|
- width="250px"
|
|
|
+ width="400px"
|
|
|
class="login-dialog"
|
|
|
>
|
|
|
<div class="check-box">
|
|
|
<div class="content">
|
|
|
<div class="words-box">
|
|
|
- <span class="words">
|
|
|
+ <span
|
|
|
+ class="words"
|
|
|
+ :style="{
|
|
|
+ fontFamily: itemActive.fontFamily,
|
|
|
+ color: itemActive.color,
|
|
|
+ textDecoration: itemActive.textDecoration,
|
|
|
+ borderBottom: itemActive.border === 'dotted' ? '1px dotted' : '',
|
|
|
+ fontWeight: itemActive.fontWeight,
|
|
|
+ }"
|
|
|
+ >
|
|
|
{{ itemActive.text }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-form>
|
|
|
- <el-form-item label="字体">
|
|
|
- <el-radio-group v-model="itemActive.fontFamily">
|
|
|
- <el-radio v-for="(item, index) in fontFamilyList" :key="'fontFamilyList' + index" :label="item.value">
|
|
|
- <span>{{ item.name }}</span>
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <div ref="toolbarMenu" class="toolbar">
|
|
|
+ <el-select v-model="itemActive.fontFamily" placeholder="请选择">
|
|
|
+ <el-option v-for="item in fontFamilyList" :key="item.value" :label="item.name" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ <span class="picker-area" :class="['tool-item', itemActive.color ? 'active' : '']">
|
|
|
+ <el-color-picker
|
|
|
+ ref="colorPicker"
|
|
|
+ v-model="itemActive.color"
|
|
|
+ @click="itemActive.color = itemActive.color"
|
|
|
+ />
|
|
|
+ <SvgIcon icon-class="fontcolor" title="字体颜色" size="18" />
|
|
|
+ </span>
|
|
|
+ <span :class="['tool-item', itemActive.textDecoration === 'underline' ? 'active' : '']">
|
|
|
+ <SvgIcon icon-class="underline" title="下划线" size="18" @click="setActiveTextStyle('underline')" />
|
|
|
+ </span>
|
|
|
+ <span :class="['tool-item', itemActive.fontWeight === 'bold' ? 'active' : '']">
|
|
|
+ <SvgIcon icon-class="bold" title="加粗" size="20" @click="setActiveTextStyle('bold')" />
|
|
|
+ </span>
|
|
|
+ <span :class="['tool-item', itemActive.textDecoration === 'line-through' ? 'active' : '']">
|
|
|
+ <SvgIcon icon-class="strikethrough" title="删除线" size="20" @click="setActiveTextStyle('line-through')" />
|
|
|
+ </span>
|
|
|
+ <span :class="['tool-item', itemActive.border === 'dotted' ? 'active' : '']">
|
|
|
+ <SvgIcon icon-class="borderDotted" title="下划虚线" size="16" @click="setActiveTextStyle('border')" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
<div class="btn-box">
|
|
|
<el-button type="info" size="small" @click="cancleDialog">取消</el-button>
|
|
|
<el-button type="primary" size="small" @click="surePinyin">保存</el-button>
|
|
|
@@ -85,21 +117,6 @@ export default {
|
|
|
dialogFlag: false,
|
|
|
checkPinyinInput: '',
|
|
|
oldInput: '',
|
|
|
- tableData: [
|
|
|
- ['ā', 'á', 'ǎ', 'à', 'a'],
|
|
|
- ['ō', 'ó', 'ǒ', 'ò', 'o'],
|
|
|
- ['ē', 'é', 'ě', 'è', 'e'],
|
|
|
- ['ī', 'í', 'ǐ', 'ì', 'i'],
|
|
|
- ['ū', 'ú', 'ǔ', 'ù', 'u'],
|
|
|
- ['ǖ', 'ǘ', 'ǚ', 'ǜ', 'ü'],
|
|
|
- ['Ā', 'Á', 'Â', 'À', 'A'],
|
|
|
- ['Ō', 'Ó', 'Ô', 'Ò', 'O'],
|
|
|
- ['Ē', 'É', 'Ê', 'È', 'E'],
|
|
|
- ['Ī', 'Í', 'Î', 'Ì', 'I'],
|
|
|
- ['Ū', 'Ú', 'Û', 'Ù', 'U'],
|
|
|
- ['n', 'ń', 'ň', 'ǹ', 'n'],
|
|
|
- ['m̄', 'ḿ', 'm', 'm̀', 'm'],
|
|
|
- ],
|
|
|
toneList: [' ', 'ˉ', 'ˊ', 'ˇ', 'ˋ'],
|
|
|
fontFamilyList: [
|
|
|
{
|
|
|
@@ -152,6 +169,9 @@ export default {
|
|
|
marginRight: true,
|
|
|
saveIndex,
|
|
|
fontFamily: itemss.fontFamily,
|
|
|
+ textDecoration: itemss.textDecoration,
|
|
|
+ fontWeight: itemss.fontWeight,
|
|
|
+ border: itemss.border,
|
|
|
};
|
|
|
arr[index].push(obj);
|
|
|
let saveObj = {
|
|
|
@@ -191,12 +211,32 @@ export default {
|
|
|
this.itemActive.sentenceIndex,
|
|
|
this.itemActive.wordIndex,
|
|
|
this.itemActive.fontFamily,
|
|
|
+ this.itemActive.textDecoration,
|
|
|
+ this.itemActive.fontWeight,
|
|
|
+ this.itemActive.border,
|
|
|
);
|
|
|
this.$message.success('保存成功');
|
|
|
this.activeIndex = null;
|
|
|
// this.itemActive = null;
|
|
|
this.dialogFlag = false;
|
|
|
},
|
|
|
+ // 设置样式
|
|
|
+ setActiveTextStyle(type) {
|
|
|
+ let style = this.itemActive;
|
|
|
+ if (type === 'line-through') {
|
|
|
+ style.textDecoration = style.textDecoration === 'line-through' ? '' : 'line-through';
|
|
|
+ this.$set(this.itemActive, 'textDecoration', style.textDecoration);
|
|
|
+ } else if (type === 'bold') {
|
|
|
+ style.fontWeight = style.fontWeight === 'bold' ? '' : 'bold';
|
|
|
+ this.$set(this.itemActive, 'fontWeight', style.fontWeight);
|
|
|
+ } else if (type === 'underline') {
|
|
|
+ style.textDecoration = style.textDecoration === 'underline' ? '' : 'underline';
|
|
|
+ this.$set(this.itemActive, 'textDecoration', style.textDecoration);
|
|
|
+ } else if (type === 'border') {
|
|
|
+ style.border = style.border === 'dotted' ? '' : 'dotted';
|
|
|
+ this.$set(this.itemActive, 'border', style.border);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -368,6 +408,47 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.toolbar {
|
|
|
+ display: flex;
|
|
|
+ column-gap: 10px;
|
|
|
+ align-items: center;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ .picker-area {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ :deep .el-color-picker {
|
|
|
+ position: absolute;
|
|
|
+
|
|
|
+ &__trigger {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__color {
|
|
|
+ border: none !important;
|
|
|
+
|
|
|
+ &-inner {
|
|
|
+ background-color: rgba(0, 0, 0, 0%) !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &__icon {
|
|
|
+ display: none !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .tool-item {
|
|
|
+ padding: 4px 6px;
|
|
|
+ border-radius: 8px;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background: #a6ccf7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.check-article {
|
|
|
@@ -385,5 +466,9 @@ export default {
|
|
|
background: #f3f3f3;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .el-color-picker__empty {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|