c.loadMore()}
>
{model.groupMode !== 'NONE' ? renderGroup() : renderDefault()}
diff --git a/src/control/form/form-detail/form-group-panel/form-group-panel.tsx b/src/control/form/form-detail/form-group-panel/form-group-panel.tsx
index e9c73dd2be9..85ffff350c2 100644
--- a/src/control/form/form-detail/form-group-panel/form-group-panel.tsx
+++ b/src/control/form/form-detail/form-group-panel/form-group-panel.tsx
@@ -123,7 +123,9 @@ export const FormGroupPanel = defineComponent({
state.isShowMore = !state.isShowMore;
}}
>
- {!state.isShowMore ? '显示更多' : '收起'}
+ {!state.isShowMore
+ ? ibiz.i18n.t('control.form.formGroupPanel.showMore')
+ : ibiz.i18n.t('app.retract')}
);
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.tsx
index 56935ec42ca..1b9b858ce06 100644
--- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.tsx
+++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.tsx
@@ -32,7 +32,7 @@ export const FormMDCtrlForm = defineComponent({
]}
onClick={(): void => props.controller.create()}
>
- 添加
+ {ibiz.i18n.t('app.add')}
);
};
@@ -59,7 +59,11 @@ export const FormMDCtrlForm = defineComponent({
{{
item: ({ data }: { data: IData }) => {
if (!formProvider) {
- return 未找到表单的适配器
;
+ return (
+
+ {ibiz.i18n.t('control.form.formMDctrlForm.noFindProvider')}
+
+ );
}
const formComponent = h(resolveComponent(formProvider.component), {
class: this.ns.be('item', 'form'),
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.tsx
index 9075281505c..74388778204 100644
--- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.tsx
+++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.tsx
@@ -85,7 +85,7 @@ export const FormMDCtrlMD = defineComponent({
type='primary'
onClick={(): void => this.controller.create()}
>
- 添加
+ {ibiz.i18n.t('app.add')}
)}
{this.controller.enableDelete && (
@@ -99,7 +99,7 @@ export const FormMDCtrlMD = defineComponent({
]}
onClick={(): void => this.controller.remove()}
>
- 删除
+ {ibiz.i18n.t('app.delete')}
)}
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx
index af5cf6d8577..59b936b9e05 100644
--- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx
+++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx
@@ -42,7 +42,9 @@ export const FormMDCtrlRepeater = defineComponent({
default:
return (
- 暂未支持重复器样式{this.controller.repeaterStyle}
+ {ibiz.i18n.t('control.form.formMDctrlRepeater.noSupportStyle', {
+ repeaterStyle: this.controller.repeaterStyle,
+ })}
);
}
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.tsx
index 6ac30d93246..26d53ce8f73 100644
--- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.tsx
+++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.tsx
@@ -25,8 +25,8 @@ export const RepeaterMultiForm = defineComponent({
const removeClick = async (index: number) => {
const confirm = await ibiz.modal.confirm({
- title: '删除提醒',
- desc: '是否删除选中项?',
+ title: ibiz.i18n.t('control.form.repeaterMultiForm.confirmTitle'),
+ desc: ibiz.i18n.t('control.form.repeaterMultiForm.confirmDesc'),
});
if (confirm) {
props.controller.remove(index);
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx
index 6cb4e026ea6..e0ab4e68b34 100644
--- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx
+++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx
@@ -48,7 +48,9 @@ export const RepeaterSingleForm = defineComponent({
},
render() {
if (!this.controller.repeatedForm) {
- throw new RuntimeError('没有repeatedForm');
+ throw new RuntimeError(
+ ibiz.i18n.t('control.form.repeaterSingleForm.errorMessage'),
+ );
}
return (
;
break;
default:
- {model.contentType}暂未支持
;
+
+ {model.contentType}
+ {ibiz.i18n.t('app.noSupport')}
+
;
break;
}
diff --git a/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx b/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx
index d481f5b1a44..af0caf8fd1b 100644
--- a/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx
+++ b/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx
@@ -47,7 +47,7 @@ export const MDCtrlContainer = defineComponent({
}
>
{showButton && }
- 添加
+ {ibiz.i18n.t('app.add')}
);
};
@@ -65,7 +65,7 @@ export const MDCtrlContainer = defineComponent({
emit('removeClick', item, index);
}}
>
- 删除
+ {ibiz.i18n.t('app.delete')}
);
}
@@ -78,7 +78,7 @@ export const MDCtrlContainer = defineComponent({
emit('removeClick', item, index);
}}
>
- 删除
+ {ibiz.i18n.t('app.delete')}
);
};
@@ -96,7 +96,7 @@ export const MDCtrlContainer = defineComponent({
const formComponent = this.$slots.item ? (
this.$slots.item({ data: item, index })
) : (
- 未提供item插槽
+ {ibiz.i18n.t('control.form.mdCtrlContainer.noSlot')}
);
return (
diff --git a/src/control/form/form/form.tsx b/src/control/form/form/form.tsx
index 970727429fe..39f0cfeb86f 100644
--- a/src/control/form/form/form.tsx
+++ b/src/control/form/form/form.tsx
@@ -78,7 +78,11 @@ export const FormControl = defineComponent({
const provider = c.providers[detailId];
if (!provider) {
return (
-
暂未支持的表单项类型: {detail.detailType}或找不到对应适配器
+
+ {ibiz.i18n.t('control.form.noSupportDetailType', {
+ detailType: detail.detailType,
+ })}
+
);
}
const component = resolveComponent(provider.component) as string;
diff --git a/src/control/form/search-form/search-form.tsx b/src/control/form/search-form/search-form.tsx
index 5b17c3d94c2..ae99beaa5c5 100644
--- a/src/control/form/search-form/search-form.tsx
+++ b/src/control/form/search-form/search-form.tsx
@@ -51,13 +51,13 @@ export const SearchFormControl = defineComponent({
class={this.ns.be('buttons', 'search')}
onClick={() => this.c.onSearchButtonClick()}
>
- 查询
+ {ibiz.i18n.t('control.form.searchForm.search')}
this.c.reset()}
>
- 重置
+ {ibiz.i18n.t('control.form.searchForm.reset')}
);
diff --git a/src/control/list/list-render-util.tsx b/src/control/list/list-render-util.tsx
index 42c9935b3ce..d89304751c5 100644
--- a/src/control/list/list-render-util.tsx
+++ b/src/control/list/list-render-util.tsx
@@ -113,7 +113,7 @@ export function useListRender(
}
return (
c.loadMore()}>
- 加载更多
+ {ibiz.i18n.t('control.common.loadMore')}
);
};
diff --git a/src/control/list/list/list.tsx b/src/control/list/list/list.tsx
index 8231def2b9e..2ba0d4edd45 100644
--- a/src/control/list/list/list.tsx
+++ b/src/control/list/list/list.tsx
@@ -110,7 +110,7 @@ export const ListControl = defineComponent({
const itemClass = [ns.b('item'), ns.b('item-expand')];
return (
- 展开
+ {ibiz.i18n.t('control.list.expand')}
);
};
@@ -147,7 +147,7 @@ export const ListControl = defineComponent({
>
diff --git a/src/control/list/md-ctrl/md-ctrl.tsx b/src/control/list/md-ctrl/md-ctrl.tsx
index f623245c475..bd8db913d27 100644
--- a/src/control/list/md-ctrl/md-ctrl.tsx
+++ b/src/control/list/md-ctrl/md-ctrl.tsx
@@ -125,7 +125,9 @@ export const MDCtrlControl = defineComponent({
1 && '我已经到底啦~'
+ props.loadMode === 'auto' &&
+ c.state.curPage > 1 &&
+ ibiz.i18n.t('control.list.end')
}
onLoad={props.loadMode === 'auto' ? () => c.loadMore() : undefined}
>
diff --git a/src/control/toolbar/toolbar.tsx b/src/control/toolbar/toolbar.tsx
index 8530aa88aac..e214c7faa16 100644
--- a/src/control/toolbar/toolbar.tsx
+++ b/src/control/toolbar/toolbar.tsx
@@ -97,7 +97,11 @@ export const ToolbarControl = defineComponent({
const renderToolbarItem = (item: IDEToolbarItem) => {
const itemId = item.id!;
if (['SEPERATOR', 'RAWITEM'].includes(item.itemType!)) {
- ibiz.log.error(`工具栏项类型:${item.itemType}暂不支持`);
+ ibiz.log.error(
+ ibiz.i18n.t('control.toolbar.noSupportType', {
+ itemType: item.itemType,
+ }),
+ );
return null;
}
if (item.itemType === 'ITEMS') {
diff --git a/src/control/tree/tree.tsx b/src/control/tree/tree.tsx
index a4c8a77fd8a..23a8107be45 100644
--- a/src/control/tree/tree.tsx
+++ b/src/control/tree/tree.tsx
@@ -128,7 +128,7 @@ export const TreeControl = defineComponent({
const { originData } = opts;
if (!originData._leaf) {
return h('div', {
- text: '下级',
+ text: ibiz.i18n.t('control.tree.subordinate'),
className: 'tree-button',
click: (e: Event, _opts: IData) => {
_opts.store.breadcrumb.list.push(_opts);
diff --git a/src/control/wizard-panel/wizard-panel.tsx b/src/control/wizard-panel/wizard-panel.tsx
index 48be7e92400..be7c0bbc831 100644
--- a/src/control/wizard-panel/wizard-panel.tsx
+++ b/src/control/wizard-panel/wizard-panel.tsx
@@ -71,7 +71,9 @@ export const WizardPanelControl = defineComponent({
this.c.onPrevClick();
}}
>
- {dewizard.prevCaption ? dewizard.prevCaption : '上一步'}
+ {dewizard.prevCaption
+ ? dewizard.prevCaption
+ : ibiz.i18n.t('control.wizardPanel.prev')}
)}
{supportActions.includes('NEXT') && (
@@ -82,7 +84,9 @@ export const WizardPanelControl = defineComponent({
this.c.onNextClick();
}}
>
- {dewizard.nextCaption ? dewizard.nextCaption : '下一步'}
+ {dewizard.nextCaption
+ ? dewizard.nextCaption
+ : ibiz.i18n.t('control.wizardPanel.next')}
)}
{supportActions.includes('FINISH') && (
@@ -93,7 +97,9 @@ export const WizardPanelControl = defineComponent({
this.c.onFinishClick();
}}
>
- {dewizard.finishCaption ? dewizard.finishCaption : '完成'}
+ {dewizard.finishCaption
+ ? dewizard.finishCaption
+ : ibiz.i18n.t('control.wizardPanel.finish')}
)}
diff --git a/src/editor/cascader/ibiz-cascader/ibiz-cascader.tsx b/src/editor/cascader/ibiz-cascader/ibiz-cascader.tsx
index f90e6cca166..b941107b5a3 100644
--- a/src/editor/cascader/ibiz-cascader/ibiz-cascader.tsx
+++ b/src/editor/cascader/ibiz-cascader/ibiz-cascader.tsx
@@ -179,7 +179,11 @@ export const IBizCascader = defineComponent({
(item: IData, index: number) => ({
...item,
value: item.srfkey,
- text: item.srfmajortext ? item.srfmajortext : `标题${index}`,
+ text: item.srfmajortext
+ ? item.srfmajortext
+ : ibiz.i18n.t('editor.cascader.ibizCascader.title', {
+ index,
+ }),
nodekey: `${value ? `${value}_${item.srfkey}` : item.srfkey}`,
children:
tabIndex === valueItems.value.length - 1 ? undefined : [],
diff --git a/src/editor/common/data-mpicker/ibiz-data-mpicker.tsx b/src/editor/common/data-mpicker/ibiz-data-mpicker.tsx
index 1890818337e..3632d188f33 100644
--- a/src/editor/common/data-mpicker/ibiz-data-mpicker.tsx
+++ b/src/editor/common/data-mpicker/ibiz-data-mpicker.tsx
@@ -96,7 +96,7 @@ export const IBizDataMPicker = defineComponent({
this.onCancel(e);
}}
>
- 取消
+ {ibiz.i18n.t('editor.common.cancel')}
);
diff --git a/src/editor/data-picker/picker-editor.controller.ts b/src/editor/data-picker/picker-editor.controller.ts
index 2a4f7ab0c15..d30728e3573 100644
--- a/src/editor/data-picker/picker-editor.controller.ts
+++ b/src/editor/data-picker/picker-editor.controller.ts
@@ -217,7 +217,10 @@ export class PickerEditorController extends EditorController {
);
return res as IHttpResponse;
}
- throw new RuntimeModelError(this.model, '请配置实体和实体数据集');
+ throw new RuntimeModelError(
+ this.model,
+ ibiz.i18n.t('editor.common.entityConfigErr'),
+ );
}
/**
@@ -242,7 +245,10 @@ export class PickerEditorController extends EditorController {
params.selectedData = selectedData;
}
if (!this.pickupView) {
- throw new RuntimeModelError(this.model, '请配置数据选择视图');
+ throw new RuntimeModelError(
+ this.model,
+ ibiz.i18n.t('editor.common.selectViewConfigErr'),
+ );
}
// 模态打开视图
const res = await ibiz.commands.execute(
@@ -274,7 +280,10 @@ export class PickerEditorController extends EditorController {
const { linkAppViewId } = this.model;
if (!linkAppViewId) {
- throw new RuntimeModelError(this.model, '请配置数据链接视图');
+ throw new RuntimeModelError(
+ this.model,
+ ibiz.i18n.t('editor.common.linkViewConfigErr'),
+ );
}
return ibiz.commands.execute(
OpenAppViewCommand.TAG,
diff --git a/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.tsx b/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.tsx
index a860f055432..2c91ffa05a3 100644
--- a/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.tsx
+++ b/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.tsx
@@ -38,15 +38,15 @@ export const IBizDatePicker = defineComponent({
// 时间选择器文本
const lang = {
- title: '选择日期',
- cancel: '取消',
- confirm: '确认',
- year: '年',
- month: '月',
- day: '日',
- hour: '时',
- min: '分',
- sec: '秒',
+ title: ibiz.i18n.t('editor.datePicker.title'),
+ cancel: ibiz.i18n.t('editor.datePicker.cancel'),
+ confirm: ibiz.i18n.t('editor.datePicker.confirm'),
+ year: ibiz.i18n.t('editor.datePicker.year'),
+ month: ibiz.i18n.t('editor.datePicker.month'),
+ day: ibiz.i18n.t('editor.datePicker.day'),
+ hour: ibiz.i18n.t('editor.datePicker.hour'),
+ min: ibiz.i18n.t('editor.datePicker.min'),
+ sec: ibiz.i18n.t('editor.datePicker.sec'),
};
// 编辑器dom
diff --git a/src/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.tsx b/src/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.tsx
index 1a024021278..dda1132120b 100644
--- a/src/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.tsx
+++ b/src/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.tsx
@@ -35,15 +35,15 @@ export const IBizDateRangePicker = defineComponent({
const items: string[] = [];
// 时间选择器文本
const lang = {
- title: '选择日期',
- cancel: '取消',
- confirm: '确认',
- year: '年',
- month: '月',
- day: '日',
- hour: '时',
- min: '分',
- sec: '秒',
+ title: ibiz.i18n.t('editor.datePicker.title'),
+ cancel: ibiz.i18n.t('editor.datePicker.cancel'),
+ confirm: ibiz.i18n.t('editor.datePicker.confirm'),
+ year: ibiz.i18n.t('editor.datePicker.year'),
+ month: ibiz.i18n.t('editor.datePicker.month'),
+ day: ibiz.i18n.t('editor.datePicker.day'),
+ hour: ibiz.i18n.t('editor.datePicker.hour'),
+ min: ibiz.i18n.t('editor.datePicker.min'),
+ sec: ibiz.i18n.t('editor.datePicker.sec'),
};
// 值分割符
let valueSeparator = ';';
diff --git a/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx b/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx
index 5a8300facc7..86d9de836ab 100644
--- a/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx
+++ b/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx
@@ -137,7 +137,7 @@ export const IBizDropdown = defineComponent({
render() {
// 编辑态内容
const editContent = this.hasChildren
- ? '暂未支持树形下拉选择'
+ ? ibiz.i18n.t('editor.dropdownList.noSupportTreePicker')
: [
{
this.showPicker = false;
}}
diff --git a/src/editor/markdown/markdown-editor.controller.ts b/src/editor/markdown/markdown-editor.controller.ts
index d6e61896010..9e8c361067f 100644
--- a/src/editor/markdown/markdown-editor.controller.ts
+++ b/src/editor/markdown/markdown-editor.controller.ts
@@ -37,7 +37,7 @@ export class MarkDownEditorController extends EditorController {
} catch (error) {
throw new RuntimeModelError(
uploadparams,
- `配置uploadparams没有按标准JSON格式`,
+ ibiz.i18n.t('editor.markdown.uploadJsonFormatErr'),
);
}
}
@@ -47,7 +47,7 @@ export class MarkDownEditorController extends EditorController {
} catch (error) {
throw new RuntimeModelError(
exportparams,
- `配置exportparams没有按标准JSON格式`,
+ ibiz.i18n.t('editor.markdown.exportJsonFormatErr'),
);
}
}
@@ -109,11 +109,13 @@ export class MarkDownEditorController extends EditorController {
})
.then((response: IData) => {
if (response.status !== 200) {
- throw new RuntimeError('下载文件失败');
+ throw new RuntimeError(
+ ibiz.i18n.t('editor.markdown.downloadFailedErr'),
+ );
}
// 请求成功,后台返回的是一个文件流
if (!response.data) {
- throw new RuntimeError('文件流数据不存在');
+ throw new RuntimeError(ibiz.i18n.t('editor.markdown.noExistentErr'));
} else {
// 获取文件名
const fileName = file.name;
diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts
index 8ceaf166c6f..49cd643b199 100644
--- a/src/locale/en/index.ts
+++ b/src/locale/en/index.ts
@@ -4,6 +4,13 @@ import { en as modelHelperEn } from '@ibiz-template/model-helper';
import { en as coreEn } from '@ibiz-template/core';
export default {
+ // 应用级
+ app: {
+ noSupport: 'Not supported currently',
+ add: 'Add',
+ delete: 'Delete',
+ retract: 'Retract',
+ },
// 组件
component: {
actionToolbar: {
@@ -15,11 +22,99 @@ export default {
},
},
// 部件
- control: {},
+ control: {
+ common: {
+ loadMore: 'Load more',
+ },
+ dataView: { end: 'The end~' },
+ form: {
+ noSupportDetailType:
+ 'Form detail type not supported: {detailType} or corresponding provider cannot be found',
+ formGroupPanel: {
+ showMore: 'Show More',
+ },
+ formMDctrlForm: {
+ noFindProvider: 'Provider not found for form',
+ },
+ repeaterMultiForm: {
+ confirmTitle: 'Tips for deletion',
+ confirmDesc: 'Do you want to delete the selection?',
+ },
+ repeaterSingleForm: {
+ errorMessage: 'No repeatedForm',
+ },
+ formMDctrlRepeater: {
+ noSupportStyle:
+ 'Repeater style {repeaterStyle} is currently not supported',
+ },
+ mdCtrlContainer: {
+ noSlot: 'Item slot not provided',
+ },
+ formMDctrl: {
+ errorMessage:
+ 'The content type is currently not supported as {contentType}',
+ },
+ searchForm: {
+ search: 'Search',
+ reset: 'Reset',
+ },
+ },
+ list: {
+ expand: 'Expand',
+ selectedData: 'Selected data',
+ end: 'The end~',
+ },
+ toolbar: {
+ noSupportType: 'Toolbar item type: {itemType} is not supported',
+ },
+ tree: {
+ subordinate: 'Subordinate',
+ },
+ wizardPanel: {
+ prev: 'Previous',
+ next: 'Next',
+ finish: 'Finish',
+ },
+ },
// 编辑器
editor: {
common: {
+ entityConfigErr: 'Please configure entities and entity datasets',
+ selectViewConfigErr: 'Please configure the data selection view',
linkViewConfigErr: 'Please configure the data link view',
+ cancel: 'Cancel',
+ confirm: 'Confirm',
+ },
+ cascader: {
+ ibizCascader: {
+ title: 'Title {index}',
+ },
+ },
+ datePicker: {
+ title: 'Select a date',
+ cancel: 'Cancel',
+ confirm: 'Confirm',
+ year: 'Year',
+ month: 'Month',
+ day: 'Day',
+ hour: 'Hour',
+ min: 'Minute',
+ sec: 'Second',
+ },
+ dropdownList: {
+ noSupportTreePicker: 'Drop-down tree selection is not supported',
+ confirm: 'confirm',
+ },
+ markdown: {
+ uploadJsonFormatErr:
+ 'The configuration of uploadparams did not follow the standard JSON format',
+ exportJsonFormatErr:
+ 'The configuration of exportparams did not follow the standard JSON format',
+ downloadFailedErr: 'Download file failed',
+ noExistentErr: 'The file stream data does not exist',
+ },
+ notSupportedEditor: {
+ unsupportedType: 'Unsupported editor types - {editorType}',
},
stepper: {
pleaseEnter: 'Please enter',
diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts
index 3114b04f171..580beb3bc67 100644
--- a/src/locale/zh-CN/index.ts
+++ b/src/locale/zh-CN/index.ts
@@ -4,6 +4,13 @@ import { zhCn as modelHelperZhCN } from '@ibiz-template/model-helper';
import { zhCn as coreZhCN } from '@ibiz-template/core';
export default {
+ // 应用级
+ app: {
+ noSupport: '暂未支持',
+ add: '添加',
+ delete: '删除',
+ retract: '收起',
+ },
// 组件
component: {
actionToolbar: {
@@ -15,11 +22,95 @@ export default {
},
},
// 部件
- control: {},
+ control: {
+ common: {
+ loadMore: '加载更多',
+ },
+ dataView: { end: '我已经到底啦~' },
+ form: {
+ noSupportDetailType:
+ '暂未支持的表单项类型: {detailType} 或找不到对应适配器',
+ formGroupPanel: {
+ showMore: '显示更多',
+ },
+ formMDctrlForm: {
+ noFindProvider: '未找到表单的适配器',
+ },
+ repeaterMultiForm: {
+ confirmTitle: '删除提醒',
+ confirmDesc: '是否删除选中项?',
+ },
+ repeaterSingleForm: {
+ errorMessage: '没有repeatedForm',
+ },
+ formMDctrlRepeater: {
+ noSupportStyle: '暂未支持重复器样式{repeaterStyle}',
+ },
+ mdCtrlContainer: {
+ noSlot: '未提供item插槽',
+ },
+ formMDctrl: {
+ errorMessage: '暂未支持内容类型为{contentType}',
+ },
+ searchForm: {
+ search: '查询',
+ reset: '重置',
+ },
+ },
+ list: {
+ expand: '展开',
+ selectedData: '选中数据',
+ end: '我已经到底啦~',
+ },
+ toolbar: {
+ noSupportType: '工具栏项类型:{itemType}暂不支持',
+ },
+ tree: {
+ subordinate: '下级',
+ },
+ wizardPanel: {
+ prev: '上一步',
+ next: '下一步',
+ finish: '完成',
+ },
+ },
// 编辑器
editor: {
common: {
+ entityConfigErr: '请配置实体和实体数据集',
+ selectViewConfigErr: '请配置数据选择视图',
linkViewConfigErr: '请配置数据链接视图',
+ cancel: '取消',
+ confirm: '确定',
+ },
+ cascader: {
+ ibizCascader: {
+ title: '标题{index}',
+ },
+ },
+ datePicker: {
+ title: '选择日期',
+ cancel: '取消',
+ confirm: '确认',
+ year: '年',
+ month: '月',
+ day: '日',
+ hour: '时',
+ min: '分',
+ sec: '秒',
+ },
+ dropdownList: {
+ noSupportTreePicker: '暂未支持树形下拉选择',
+ confirm: '确定',
+ },
+ markdown: {
+ uploadJsonFormatErr: '配置uploadparams没有按标准JSON格式',
+ exportJsonFormatErr: '配置exportparams没有按标准JSON格式',
+ downloadFailedErr: '下载文件失败',
+ noExistentErr: '文件流数据不存在',
+ },
+ notSupportedEditor: {
+ unsupportedType: '未支持的编辑器类型 - {type}',
},
stepper: {
pleaseEnter: '请输入',
--
Gitee
From 8420ef1599c30bc038fb585e354f506b1eac4d6f Mon Sep 17 00:00:00 2001
From: zhf <1204297681@qq.com>
Date: Tue, 6 Aug 2024 16:47:21 +0800
Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A5=E6=9C=9F?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E6=9C=AA=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=BC=82=E5=B8=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../date-picker/ibiz-date-picker/ibiz-date-picker.scss | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.scss b/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.scss
index 34d4799feed..35a54098975 100644
--- a/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.scss
+++ b/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.scss
@@ -23,4 +23,12 @@
@include m(readonly) {
color: getCssVar('form-item', 'readonly-color');
}
+}
+
+.rolldate-container .rolldate-mask.rolldate-mask {
+ z-index: 9998;
+}
+
+.rolldate-container .rolldate-panel.rolldate-panel {
+ z-index: 9999;
}
\ No newline at end of file
--
Gitee
From c5ab0ccf5f10d69c083fbbe263e83f40423e2ac3 Mon Sep 17 00:00:00 2001
From: zhf <1204297681@qq.com>
Date: Tue, 6 Aug 2024 16:48:09 +0800
Subject: [PATCH 5/5] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E5=BA=94?=
=?UTF-8?q?=E7=94=A8=E7=BA=A7=E5=8A=9F=E8=83=BD=E5=B7=A5=E5=85=B7=E6=96=B9?=
=?UTF-8?q?=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mob-app/main.ts | 2 +
src/util/app-util/app-util.ts | 188 ++++++++++++++++++++++++++++++++++
src/util/index.ts | 1 +
3 files changed, 191 insertions(+)
create mode 100644 src/util/app-util/app-util.ts
diff --git a/src/mob-app/main.ts b/src/mob-app/main.ts
index cf53e7e9870..e47765f1941 100644
--- a/src/mob-app/main.ts
+++ b/src/mob-app/main.ts
@@ -16,6 +16,7 @@ import { createVueApp } from './create-vue-app';
import { AppRouter } from './router';
import { UnauthorizedHandler } from './util';
import {
+ AppUtil,
ConfirmUtil,
LoadingUtil,
MessageUtil,
@@ -73,6 +74,7 @@ export async function runApp(plugins?: Plugin[]): Promise {
app.use(router);
+ ibiz.appUtil = new AppUtil(router);
ibiz.openView = new OpenViewUtil(router);
ibiz.message = new MessageUtil();
ibiz.modal = new ModalUtil();
diff --git a/src/util/app-util/app-util.ts b/src/util/app-util/app-util.ts
new file mode 100644
index 00000000000..57fb284add9
--- /dev/null
+++ b/src/util/app-util/app-util.ts
@@ -0,0 +1,188 @@
+/* eslint-disable no-unused-vars */
+/* eslint-disable @typescript-eslint/no-unused-vars */
+import { Router } from 'vue-router';
+import { IAppUtil, IAuthResult } from '@ibiz-template/runtime';
+
+export class AppUtil implements IAppUtil {
+ /**
+ * Creates an instance of AppUtil.
+ * @author tony001
+ * @date 2024-05-14 17:05:00
+ * @param {Router} router
+ */
+ constructor(protected router: Router) {}
+
+ /**
+ * 登录
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:41
+ * @param {string} loginName
+ * @param {string} password
+ * @param {(boolean | undefined)} [remember]
+ * @param {(IData | undefined)} [headers]
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ async login(
+ loginName: string,
+ password: string,
+ remember?: boolean | undefined,
+ headers?: IData | undefined,
+ opts?: IData | undefined,
+ ): Promise {
+ const bol = await ibiz.auth.login(loginName, password, remember, headers);
+ if (bol === true) {
+ window.location.hash =
+ (this.router.currentRoute.value.query.ru as string) || '/';
+ // 重置会话记录state,防止直接返回到登录页
+ window.history.pushState({}, '');
+ window.location.reload();
+ }
+ return bol;
+ }
+
+ /**
+ * 登出
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:02
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ async logout(opts?: IData | undefined): Promise {
+ const bol = await ibiz.auth.logout();
+ if (bol) {
+ const path = window.location;
+ if (path.search.indexOf('isAnonymous=true') !== -1) {
+ const href = `${path.origin}${path.pathname}${path.hash}`;
+ window.history.replaceState({}, '', href);
+ }
+ await this.router.push(
+ // `/login?ru=${encodeURIComponent(
+ // window.location.hash.replace('#/', '/'),
+ // )}`,
+ '/login',
+ );
+ ibiz.util.showAppLoading();
+ window.location.reload();
+ }
+ return bol;
+ }
+
+ /**
+ * 变更密码
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:11
+ * @param {string} oldPwd
+ * @param {string} newPwd
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ async changePwd(
+ oldPwd: string,
+ newPwd: string,
+ opts?: IData | undefined,
+ ): Promise {
+ if (this.validatePwd(oldPwd, newPwd, opts)) {
+ const result = await ibiz.auth.changePwd(oldPwd, newPwd);
+ return result;
+ }
+ return { ok: false, result: {} };
+ }
+
+ /**
+ * 切换组织
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:20
+ * @param {string} oldOrgId
+ * @param {string} newOrgId
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ switchOrg(
+ oldOrgId: string,
+ newOrgId: string,
+ opts?: IData | undefined,
+ ): Promise {
+ throw new Error('Method not implemented.');
+ }
+
+ /**
+ * 切换主题
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:30
+ * @param {string} oldTheme
+ * @param {string} newTheme
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ switchTheme(
+ oldTheme: string,
+ newTheme: string,
+ opts?: IData | undefined,
+ ): Promise {
+ throw new Error('Method not implemented.');
+ }
+
+ /**
+ * 切换语言
+ *
+ * @author tony001
+ * @date 2024-05-14 16:05:42
+ * @param {string} oldLanguage
+ * @param {string} newLanguage
+ * @param {(IData | undefined)} [opts]
+ * @return {*} {Promise}
+ */
+ switchLanguage(
+ oldLanguage: string,
+ newLanguage: string,
+ opts?: IData | undefined,
+ ): Promise {
+ throw new Error('Method not implemented.');
+ }
+
+ /**
+ * 校验密码
+ *
+ * @author tony001
+ * @date 2024-05-14 17:05:31
+ * @protected
+ * @param {string} oldPwd
+ * @param {string} newPwd
+ * @param {IData} [opts={}]
+ * @return {*} {boolean}
+ */
+ protected validatePwd(
+ oldPwd: string,
+ newPwd: string,
+ opts: IData = {},
+ ): boolean {
+ const { surePwd } = opts;
+ if (!oldPwd) {
+ ibiz.message.error('原密码不能为空');
+ return false;
+ }
+ if (!newPwd) {
+ ibiz.message.error('新密码不能为空');
+ return false;
+ }
+ if (!surePwd) {
+ ibiz.message.error('确认密码不能为空');
+ return false;
+ }
+ if (oldPwd === newPwd) {
+ ibiz.message.error('新密码不能与旧密码一致');
+ return false;
+ }
+ if (newPwd !== surePwd) {
+ ibiz.message.error('两次密码不一致');
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/src/util/index.ts b/src/util/index.ts
index 0f8af4c0730..6acfe1e93a7 100644
--- a/src/util/index.ts
+++ b/src/util/index.ts
@@ -6,4 +6,5 @@ export { OpenViewUtil } from './open-view-util/open-view-util';
export { OverlayController } from './overlay-controller/overlay-controller';
export { loadingDirective } from './directive/loading';
export { ConfirmUtil } from './confirm-util/confirm-util';
+export { AppUtil } from './app-util/app-util';
export * from './store';
--
Gitee