|
@@ -45,14 +45,31 @@
|
|
|
active-text="显示拼音"
|
|
active-text="显示拼音"
|
|
|
inactive-text="隐藏拼音"
|
|
inactive-text="隐藏拼音"
|
|
|
/>
|
|
/>
|
|
|
- <el-input
|
|
|
|
|
|
|
+ <!-- <el-input
|
|
|
v-show="isEnable(dataContent.showPinyin)"
|
|
v-show="isEnable(dataContent.showPinyin)"
|
|
|
v-model="numberPinyin"
|
|
v-model="numberPinyin"
|
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
|
placeholder="请输入正确的拼音"
|
|
placeholder="请输入正确的拼音"
|
|
|
@blur="convertTonePinyin"
|
|
@blur="convertTonePinyin"
|
|
|
class="pinyin-input"
|
|
class="pinyin-input"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-show="isEnable(dataContent.showPinyin)"
|
|
|
|
|
+ v-model="numberPinyin"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ allow-create
|
|
|
|
|
+ default-first-option
|
|
|
|
|
+ @change="convertTonePinyin"
|
|
|
|
|
+ class="pinyin-input"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option v-for="item in pinyinList" :key="item.pinyin" :value="item.pinyin.replace(/,/g, '')">
|
|
|
|
|
+ <span style="float: left">{{ item.pinyin ? item.pinyin.replace(/,/g, '') : '' }}</span>
|
|
|
|
|
+ <span style="float: right; font-size: 13px; color: #8492a6">{{
|
|
|
|
|
+ item.storage_type === 1 ? '机构库' : item.storage_type === 2 ? '全域库' : '个人库'
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
<span v-show="isEnable(dataContent.showPinyin)" class="tips"
|
|
<span v-show="isEnable(dataContent.showPinyin)" class="tips"
|
|
|
>一到四声分别用数字1-4表示,轻声用0表示,拼音间用空格隔开。</span
|
|
>一到四声分别用数字1-4表示,轻声用0表示,拼音间用空格隔开。</span
|
|
@@ -80,6 +97,7 @@ import RichText from '@/components/RichText.vue';
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
import { fontFamilyList } from '@/views/book/courseware/data/table.js';
|
|
import { fontFamilyList } from '@/views/book/courseware/data/table.js';
|
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
|
|
|
+import { toolGetWordPinyinCorrectionList } from '@/api/pinyinCorrection';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'CorrectPinyin',
|
|
name: 'CorrectPinyin',
|
|
@@ -138,6 +156,7 @@ export default {
|
|
|
left: 0,
|
|
left: 0,
|
|
|
},
|
|
},
|
|
|
dataContent: { activeTextStyle: {}, note: {} },
|
|
dataContent: { activeTextStyle: {}, note: {} },
|
|
|
|
|
+ pinyinList: [], // 拼音校正列表
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -157,6 +176,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.$set(this.dataContent, 'showPinyin', _showPinyin);
|
|
this.$set(this.dataContent, 'showPinyin', _showPinyin);
|
|
|
this.$set(this.dataContent, 'activeTextStyle', style);
|
|
this.$set(this.dataContent, 'activeTextStyle', style);
|
|
|
|
|
+ this.getPinyinList();
|
|
|
},
|
|
},
|
|
|
deep: true,
|
|
deep: true,
|
|
|
},
|
|
},
|
|
@@ -210,6 +230,19 @@ export default {
|
|
|
this.$set(this.dataContent.activeTextStyle, 'textDecoration', style.textDecoration);
|
|
this.$set(this.dataContent.activeTextStyle, 'textDecoration', style.textDecoration);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取拼音校正库列表
|
|
|
|
|
+ getPinyinList() {
|
|
|
|
|
+ this.pinyinList = [];
|
|
|
|
|
+ toolGetWordPinyinCorrectionList({
|
|
|
|
|
+ word: this.dataContent.text,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.pinyinList = res.pinyin_correction_list;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|