mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-06 17:18:36 +08:00
基础自带的所有组件面板实现了国际化配置
This commit is contained in:
parent
f39144a955
commit
b3258dc166
@ -9,7 +9,7 @@
|
|||||||
v-for="control in group.controls">
|
v-for="control in group.controls">
|
||||||
<img class="icon" v-if="!control.icon" :src="editor?.icons[control.id]" />
|
<img class="icon" v-if="!control.icon" :src="editor?.icons[control.id]" />
|
||||||
<div class="icon-html" v-if="control.icon" v-html="control.icon"></div>
|
<div class="icon-html" v-if="control.icon" v-html="control.icon"></div>
|
||||||
<div class="text">{{ control.name }}</div>
|
<div class="text">{{ editor.i18n(control.name) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<svg class="icon warn" aria-hidden="true">
|
<svg class="icon warn" aria-hidden="true">
|
||||||
<use xlink:href="#icon-warn"></use>
|
<use xlink:href="#icon-warn"></use>
|
||||||
</svg>
|
</svg>
|
||||||
<span>是否保存文件?</span>
|
<span>{{ editor.i18n('ddei.confirm-save-file') }}</span>
|
||||||
<div style="flex:1"></div>
|
<div style="flex:1"></div>
|
||||||
<svg class="icon close" aria-hidden="true" @click="cancel">
|
<svg class="icon close" aria-hidden="true" @click="cancel">
|
||||||
<use xlink:href="#icon-close"></use>
|
<use xlink:href="#icon-close"></use>
|
||||||
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tail">
|
<div class="tail">
|
||||||
<div class="button button-main" @click="ok">保存</div>
|
<div class="button button-main" @click="ok">{{ editor.i18n('ddei.save') }}</div>
|
||||||
<div class="button" @click="abort">不保存</div>
|
<div class="button" @click="abort">{{ editor.i18n('ddei.abort') }}</div>
|
||||||
<div class="button" @click="cancel">取消</div>
|
<div class="button" @click="cancel">{{ editor.i18n('ddei.cancel') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<svg class="icon warn" aria-hidden="true">
|
<svg class="icon warn" aria-hidden="true">
|
||||||
<use xlink:href="#icon-publish"></use>
|
<use xlink:href="#icon-publish"></use>
|
||||||
</svg>
|
</svg>
|
||||||
<span>发布文件</span>
|
<span>{{ editor.i18n('ddei.publish') }}{{ editor.i18n('ddei.file') }}</span>
|
||||||
<div style="flex:1"></div>
|
<div style="flex:1"></div>
|
||||||
<svg class="icon close" aria-hidden="true" @click="cancel">
|
<svg class="icon close" aria-hidden="true" @click="cancel">
|
||||||
<use xlink:href="#icon-close"></use>
|
<use xlink:href="#icon-close"></use>
|
||||||
@ -14,8 +14,8 @@
|
|||||||
<div class="msg">
|
<div class="msg">
|
||||||
</div>
|
</div>
|
||||||
<div class="tail">
|
<div class="tail">
|
||||||
<div class="button button-main" @click="ok">发布</div>
|
<div class="button button-main" @click="ok">{{ editor.i18n('ddei.publish') }}</div>
|
||||||
<div class="button" @click="cancel">取消</div>
|
<div class="button" @click="cancel">{{ editor.i18n('ddei.cancel') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4,6 +4,8 @@ export default {
|
|||||||
new: 'New',
|
new: 'New',
|
||||||
open: 'Open',
|
open: 'Open',
|
||||||
save: 'Save',
|
save: 'Save',
|
||||||
|
abort: 'Abort',
|
||||||
|
publish: 'Publish',
|
||||||
download: 'Download',
|
download: 'Download',
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
@ -32,6 +34,7 @@ export default {
|
|||||||
setting: 'Setting',
|
setting: 'Setting',
|
||||||
cut: 'Cut',
|
cut: 'Cut',
|
||||||
copy: 'Copy',
|
copy: 'Copy',
|
||||||
|
delete: 'Delete',
|
||||||
paste: 'Paste',
|
paste: 'Paste',
|
||||||
more: 'More',
|
more: 'More',
|
||||||
page: 'Page',
|
page: 'Page',
|
||||||
@ -53,6 +56,7 @@ export default {
|
|||||||
moveStage: "Move",
|
moveStage: "Move",
|
||||||
linkLine: "Line",
|
linkLine: "Line",
|
||||||
search: "Search",
|
search: "Search",
|
||||||
|
replace: "Replace",
|
||||||
fileDescription: "DDei Design File",
|
fileDescription: "DDei Design File",
|
||||||
wholePage: "Whole Page",
|
wholePage: "Whole Page",
|
||||||
precent: "Pre",
|
precent: "Pre",
|
||||||
|
|||||||
@ -4,6 +4,8 @@ export default {
|
|||||||
new: '新建',
|
new: '新建',
|
||||||
open: '打开',
|
open: '打开',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
|
abort:'放弃',
|
||||||
|
publish: '发布',
|
||||||
download: '下载',
|
download: '下载',
|
||||||
export: '导出',
|
export: '导出',
|
||||||
import: '导入',
|
import: '导入',
|
||||||
@ -34,6 +36,7 @@ export default {
|
|||||||
setting: '设置',
|
setting: '设置',
|
||||||
cut:'剪切',
|
cut:'剪切',
|
||||||
copy:'复制',
|
copy:'复制',
|
||||||
|
delete:'删除',
|
||||||
paste:'粘贴',
|
paste:'粘贴',
|
||||||
more: '更多',
|
more: '更多',
|
||||||
page: '页面',
|
page: '页面',
|
||||||
@ -53,7 +56,8 @@ export default {
|
|||||||
choose: "选择",
|
choose: "选择",
|
||||||
moveStage: "移动画布",
|
moveStage: "移动画布",
|
||||||
linkLine: "连接线",
|
linkLine: "连接线",
|
||||||
search:"搜索",
|
search: "搜索",
|
||||||
|
replace: "替换",
|
||||||
fileDescription: "DDei设计文件",
|
fileDescription: "DDei设计文件",
|
||||||
wholePage: "整页",
|
wholePage: "整页",
|
||||||
precent: "百分比",
|
precent: "百分比",
|
||||||
@ -286,6 +290,8 @@ export default {
|
|||||||
"standard": "标准颜色",
|
"standard": "标准颜色",
|
||||||
"recently": "最近使用",
|
"recently": "最近使用",
|
||||||
"choosed": "已选颜色",
|
"choosed": "已选颜色",
|
||||||
}
|
},
|
||||||
|
|
||||||
|
"confirm-save-file":"是否保存文件?",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -20,7 +20,7 @@ class MenuCopySheet extends DDeiMenuBase {
|
|||||||
static defaultIns: MenuCopySheet = new MenuCopySheet();
|
static defaultIns: MenuCopySheet = new MenuCopySheet();
|
||||||
|
|
||||||
defaultOptions: object = {
|
defaultOptions: object = {
|
||||||
'label': '复制',
|
'label': 'ddei.copy',
|
||||||
'icon': '#icon-paste',
|
'icon': '#icon-paste',
|
||||||
'models': ["DDeiSheet"],
|
'models': ["DDeiSheet"],
|
||||||
'disabled': false
|
'disabled': false
|
||||||
@ -78,9 +78,9 @@ class MenuCopySheet extends DDeiMenuBase {
|
|||||||
|
|
||||||
let newSheet = DDeiSheet.loadFromJSON(sheetJson, { currentDdInstance: ddInstance });
|
let newSheet = DDeiSheet.loadFromJSON(sheetJson, { currentDdInstance: ddInstance });
|
||||||
|
|
||||||
|
let pageText = editor.i18n('ddei.page');
|
||||||
file.sheets.splice(file?.currentSheetIndex + 1, 0, newSheet);
|
file.sheets.splice(file?.currentSheetIndex + 1, 0, newSheet);
|
||||||
newSheet.name = "页面-" + file.sheets.length
|
newSheet.name = pageText+"-" + file.sheets.length
|
||||||
file.changeSheet(file.currentSheetIndex + 1);
|
file.changeSheet(file.currentSheetIndex + 1);
|
||||||
let stage = newSheet.stage;
|
let stage = newSheet.stage;
|
||||||
stage.ddInstance = ddInstance;
|
stage.ddInstance = ddInstance;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class MenuRemoveSheet extends DDeiMenuBase {
|
|||||||
static defaultIns: MenuRemoveSheet = new MenuRemoveSheet();
|
static defaultIns: MenuRemoveSheet = new MenuRemoveSheet();
|
||||||
|
|
||||||
defaultOptions: object = {
|
defaultOptions: object = {
|
||||||
'label': '删除',
|
'label': 'ddei.delete',
|
||||||
'icon': '#icon-remove',
|
'icon': '#icon-remove',
|
||||||
'models':["DDeiSheet"],
|
'models':["DDeiSheet"],
|
||||||
'disabled': false
|
'disabled': false
|
||||||
|
|||||||
@ -3,24 +3,24 @@
|
|||||||
<div class="ddei-core-panel-fileoperate-item" style="grid-row:1/3">
|
<div class="ddei-core-panel-fileoperate-item" style="grid-row:1/3">
|
||||||
<div class="ddei-core-panel-fileoperate-item-box" @click="newFile">
|
<div class="ddei-core-panel-fileoperate-item-box" @click="newFile">
|
||||||
<img width="16px" height="16px" :src="icons['icon-file']" />
|
<img width="16px" height="16px" :src="icons['icon-file']" />
|
||||||
<div>新建</div>
|
<div>{{ editor.i18n('ddei.new') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ddei-core-panel-fileoperate-item-box" @click="save">
|
<div class="ddei-core-panel-fileoperate-item-box" @click="save">
|
||||||
<img width="16px" height="16px" :src="icons['icon-save']" />
|
<img width="16px" height="16px" :src="icons['icon-save']" />
|
||||||
<div>保存</div>
|
<div>{{ editor.i18n('ddei.save') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ddei-core-panel-fileoperate-item-box" @click="openFile">
|
<div class="ddei-core-panel-fileoperate-item-box" @click="openFile">
|
||||||
<img width="16px" height="16px" :src="icons['icon-open']" />
|
<img width="16px" height="16px" :src="icons['icon-open']" />
|
||||||
<div>打开</div>
|
<div>{{ editor.i18n('ddei.open') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ddei-core-panel-fileoperate-item-box" @click="download">
|
<div class="ddei-core-panel-fileoperate-item-box" @click="download">
|
||||||
<img width="16px" height="16px" :src="icons['icon-download']" />
|
<img width="16px" height="16px" :src="icons['icon-download']" />
|
||||||
<div>下载</div>
|
<div>{{ editor.i18n('ddei.download') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ddei-core-panel-fileoperate-item">
|
<div class="ddei-core-panel-fileoperate-item">
|
||||||
<div class="ddei-core-panel-fileoperate-item-text">
|
<div class="ddei-core-panel-fileoperate-item-text">
|
||||||
保存
|
{{ editor.i18n('ddei.save') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -521,8 +521,8 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
>img {
|
>img {
|
||||||
margin-top: -1px;
|
margin-top: 2px;
|
||||||
margin-left: -1px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@ -523,8 +523,8 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 60px;
|
min-width: 60px;
|
||||||
|
padding:0 10px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
v-for="control in group.controls" @click="quickCreateControl(control.id)">
|
v-for="control in group.controls" @click="quickCreateControl(control.id)">
|
||||||
<img class="icon" v-if="!control.icon" :src="editor?.icons[control.id]" />
|
<img class="icon" v-if="!control.icon" :src="editor?.icons[control.id]" />
|
||||||
<div class="icon-html" v-if="control.icon" v-html="control.icon"></div>
|
<div class="icon-html" v-if="control.icon" v-html="control.icon"></div>
|
||||||
<div class="text">{{ control.name }}</div>
|
<div class="text">{{ editor.i18n(control.name)}}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -9,8 +9,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ddei-ext-panel-search-box">
|
<div class="ddei-ext-panel-search-box">
|
||||||
<input class="ddei-ext-panel-search-box-input" v-model="editor.search.keywords" :id="searchInputId"
|
<input class="ddei-ext-panel-search-box-input" v-model="editor.search.keywords" :id="searchInputId"
|
||||||
ref="searchBoxInput" @keydown="executeQuery($event)" @focus="changeEditorState" placeholder="搜索"
|
ref="searchBoxInput" @keydown="executeQuery($event)" @focus="changeEditorState"
|
||||||
autocomplete="off" />
|
:placeholder="editor.i18n('ddei.search')" autocomplete="off" />
|
||||||
<div @click="changeMatchCase()"
|
<div @click="changeMatchCase()"
|
||||||
:class="{ 'ddei-ext-panel-search-box-btn': true, 'ddei-ext-panel-search-box-btn__selected': editor.search?.matchCase == 1 }">
|
:class="{ 'ddei-ext-panel-search-box-btn': true, 'ddei-ext-panel-search-box-btn__selected': editor.search?.matchCase == 1 }">
|
||||||
<svg class="icon" style="width:16px;height:16px;" aria-hidden="true">
|
<svg class="icon" style="width:16px;height:16px;" aria-hidden="true">
|
||||||
@ -24,8 +24,11 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ddei-ext-panel-search-result">
|
<div class="ddei-ext-panel-search-result" v-if="editor.lang == 'zh_CN'">
|
||||||
第{{ editor.search?.resultIndex+1 }}项,共{{ editor.search?.result?.length }}项
|
第{{ editor.search?.resultIndex + 1 }}项,共{{ editor.search?.result?.length }}项
|
||||||
|
</div>
|
||||||
|
<div class="ddei-ext-panel-search-result" v-if="editor.lang != 'zh_CN'">
|
||||||
|
{{editor.search?.resultIndex + 1}}/{{editor.search?.result?.length }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ddei-ext-panel-search-buttons">
|
<div class="ddei-ext-panel-search-buttons">
|
||||||
@ -52,7 +55,8 @@
|
|||||||
|
|
||||||
<div v-if="editor.search?.mode==2" class="ddei-ext-panel-search-box">
|
<div v-if="editor.search?.mode==2" class="ddei-ext-panel-search-box">
|
||||||
<input :id="replaceInputId" ref="searchReplaceBoxInput" class="ddei-ext-panel-search-box-input"
|
<input :id="replaceInputId" ref="searchReplaceBoxInput" class="ddei-ext-panel-search-box-input"
|
||||||
v-model="replaceText" @focus="changeEditorState" placeholder="替换" autocomplete="off" />
|
v-model="replaceText" @focus="changeEditorState" :placeholder="editor.i18n('ddei.replace')"
|
||||||
|
autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="editor.search?.mode == 2" class="ddei-ext-panel-search-replace-buttons">
|
<div v-if="editor.search?.mode == 2" class="ddei-ext-panel-search-replace-buttons">
|
||||||
<div class="ddei-ext-panel-search-replace-buttons-btn" @click="executeReplace(editor)">
|
<div class="ddei-ext-panel-search-replace-buttons-btn" @click="executeReplace(editor)">
|
||||||
|
|||||||
@ -34,11 +34,11 @@ class DDeiExtTooltipLifeCycle extends DDeiLifeCycle {
|
|||||||
return DDeiExtTooltipLifeCycle;
|
return DDeiExtTooltipLifeCycle;
|
||||||
}
|
}
|
||||||
|
|
||||||
EVENT_MOUSE_IN_AREA: DDeiFuncData | null = new DDeiFuncData("tooltip-show", 1, (operateType, data, ddInstance, evt)=>{
|
EVENT_MOUSE_MOVE_IN_CONTROL: DDeiFuncData | null = new DDeiFuncData("tooltip-show", 1, (operateType, data, ddInstance, evt)=>{
|
||||||
this.showTooltip(operateType, data, ddInstance, evt)
|
this.showTooltip(operateType, data, ddInstance, evt)
|
||||||
});
|
});
|
||||||
|
|
||||||
EVENT_MOUSE_OPERATING: DDeiFuncData | null = new DDeiFuncData("tooltip-hidden", 1, this.mouseOperating);
|
EVENT_MOUSE_MOVE_IN_LAYER: DDeiFuncData | null = new DDeiFuncData("tooltip-hidden", 1, this.mouseOperating);
|
||||||
|
|
||||||
EVENT_CLOSE_FILE_AFTER: DDeiFuncData | null = new DDeiFuncData("tooltip-close", 1, this.mouseOperating);
|
EVENT_CLOSE_FILE_AFTER: DDeiFuncData | null = new DDeiFuncData("tooltip-close", 1, this.mouseOperating);
|
||||||
|
|
||||||
|
|||||||
@ -9,10 +9,10 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="menu.code != 'split'" class="ddei-editor-menu-dialog-item-content">
|
<div v-if="menu.code != 'split'" class="ddei-editor-menu-dialog-item-content">
|
||||||
{{ menu.label }}
|
{{ editor.i18n(menu.label) }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="menu.code != 'split'" class="ddei-editor-menu-dialog-item-desc">
|
<div v-if="menu.code != 'split'" class="ddei-editor-menu-dialog-item-desc">
|
||||||
{{ menu.desc }}
|
{{ editor.i18n(menu.desc) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -98,6 +98,7 @@ const loadControlByFrom = function (controlOriginDefinies: Map<string, object>,
|
|||||||
loadControlOthers(controlOriginDefinies, control)
|
loadControlOthers(controlOriginDefinies, control)
|
||||||
|
|
||||||
if (fromMenus) {
|
if (fromMenus) {
|
||||||
|
|
||||||
if (!control.menus) {
|
if (!control.menus) {
|
||||||
control.menus = {};
|
control.menus = {};
|
||||||
}
|
}
|
||||||
@ -109,6 +110,7 @@ const loadControlByFrom = function (controlOriginDefinies: Map<string, object>,
|
|||||||
}
|
}
|
||||||
|
|
||||||
control.menus = fromMenus
|
control.menus = fromMenus
|
||||||
|
|
||||||
control.attrDefineMap = new Map()
|
control.attrDefineMap = new Map()
|
||||||
if (!control.type && control.type != fromControl.type) {
|
if (!control.type && control.type != fromControl.type) {
|
||||||
control.type = fromControl.type
|
control.type = fromControl.type
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user