增加中文转拼音

This commit is contained in:
onvia
2023-07-27 14:30:29 +08:00
parent c8132b5bfd
commit dd0373c362
380 changed files with 1156113 additions and 7743 deletions

View File

@@ -3,6 +3,7 @@
<ui-button id="btn-cache" @click="onClickCache()"> 缓存资源 </ui-button>
<ui-checkbox id="is-force-img" style="bottom: 8px;">强制导出图片</ui-checkbox>
<ui-checkbox id="is-img-only" style="bottom: 8px;">只导出图片</ui-checkbox>
<ui-checkbox id="is-pinyin" style="bottom: 8px;" :value="isPinyin" >中文转拼音</ui-checkbox>
<hr />
<div style="display: flex;">

View File

@@ -25,6 +25,7 @@ Editor.Panel.extend({
isImgOnly: false,
isForceImg: false,
isProcessing: false,
isPinyin: true,
},
@@ -45,6 +46,13 @@ Editor.Panel.extend({
this.isImgOnly = !this.isImgOnly;
});
let pinyin = root.getElementById("is-pinyin")
pinyin.addEventListener('change', () => {
this.isPinyin = !this.isPinyin;
});
let str = localStorage.getItem(`${Editor.Project.name}_psd2ui_output`);
if (str) {
let outputInput = root.getElementById("output");
@@ -90,7 +98,7 @@ Editor.Panel.extend({
// Editor.
return;
}
let result = Editor.Dialog.openFile({
'multi': true,
'type': "file",
@@ -113,7 +121,7 @@ Editor.Panel.extend({
let output = outputInput.value;
//
this.isProcessing = true;
Editor.Ipc.sendToMain('ccc-tnt-psd2ui:on-drop-file', { output, files, isForceImg: this.isForceImg, isImgOnly: this.isImgOnly }, (err) => {
Editor.Ipc.sendToMain('ccc-tnt-psd2ui:on-drop-file', { output, files, isForceImg: this.isForceImg, isImgOnly: this.isImgOnly, isPinyin: this.isPinyin }, (err) => {
this.isProcessing = false;
});