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