diff --git a/src/common/action-toolbar/action-toolbar.tsx b/src/common/action-toolbar/action-toolbar.tsx
index 1f31789f3eaf6c4c8dcbfdad34fde328d1e54041..ab330137d53caf9be61eaa54eadd8bf2ec3b6b6d 100644
--- a/src/common/action-toolbar/action-toolbar.tsx
+++ b/src/common/action-toolbar/action-toolbar.tsx
@@ -74,6 +74,8 @@ export const IBizActionToolbar = defineComponent({
);
}
// 下拉模式
- return
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 e9c73dd2be962023d336ebce206429bcb146717b..85ffff350c267f01795c0220671ef1a18ef80f1e 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 56935ec42cac50afe03505a845579283bda8f424..1b9b858ce06543cb755d594d6f727567bcfac435 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 9075281505c52d6b5e07a47e90110c96b1e3bc2a..74388778204c53d4039adaa4c67ad663f5bac83e 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 af5cf6d85779f2a13cb6a0eb8bc24fed947db03a..59b936b9e05474ad41a7e3d7a0a849a9e528c1e5 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 6ac30d932464d84663d64beb7afae78da99f8a46..26d53ce8f7346736671756a18ab4ec122c91949f 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 6cb4e026ea60e80cd9ba850dd28dd668515a5e0a..e0ab4e68b34c4295ea6f2e6b59b9a3d1f163d490 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 d481f5b1a44e36d7f50cf3ff62ba9ab1ccafb6b0..af0caf8fd1b78e47da1dfa19ee0bfcc1e990791e 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 970727429fe1604999b9e1361dd48a60b704e84e..39f0cfeb86fca6346ab8bcab47bdd4cbb47cfccd 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 5b17c3d94c292b2d6149df2d96086f519929099d..ae99beaa5c52e8c879a1794c878bdd851d55b5fb 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 42c9935b3ce6e602284e2ef43b6b57bf66fd81cd..d89304751c58b5d5b0225e4349472c1e01883f86 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 8231def2b9efab0c80ae82a9f89da371a998efc6..2ba0d4edd454934cc5f05f79d248127cd5693180 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 f623245c4756189c972115c242c13e22b4c15686..bd8db913d2720eb12920a7cff4d08f006ac06a31 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 8530aa88aacd5578e992e8f13e5ea63dd48c62c0..e214c7faa16227da5797a1d055d9bb68427ed447 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 a4c8a77fd8a52375113039742c01c0784a774921..23a8107be45d23c6266f68a80acec388d816d219 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 48be7e924009b6624a072b67e976203ba3321d80..be7c0bbc831af96cb3e6180e7e88e747e5bcee12 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 f90e6cca166c3e6fd9438382bbf419a28cf3c49b..b941107b5a3897ad7520d8ea42bf1f6bfc9cadd4 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 1890818337e89764e8d370b526099d7c63a65c4e..3632d188f33a38f48f77380903154dca2f065506 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 2a4f7ab0c15a0be65eb317b820ef2468ec24484d..d30728e35739e1cfc5de9ea0344c31376236e6df 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.scss b/src/editor/date-picker/ibiz-date-picker/ibiz-date-picker.scss
index 34d4799feededa78cb89ba77619a5d245f5204b1..35a540989755eb176aa693f3d5b701ab014d0c20 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
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 a860f05543272973fa3319c420aad47e916423d8..2c91ffa05a3819b0e03f10587aaa9841fb12de05 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 1a0240212788fa19a06ea77942e532826b6c31e8..dda1132120bc7f87f42c9f6c1e895898f027bbf4 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 5a8300facc713443d9054201c218dccf70eaa253..86d9de836ab31c9b54b94b2d4e6d5f2f4aaf1b84 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 d6e61896010d4f8c1a762f200bcf0fb5ff138067..9e8c361067f69cca2fc2fde67df1adb960090fa8 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/editor/span/span-editor.controller.ts b/src/editor/span/span-editor.controller.ts
index b9aa1a9e9e4971fb7db4e12a63fb0284e79f4cc2..d15a5f1f0a97e89beabc5b43a4700446e96d4727 100644
--- a/src/editor/span/span-editor.controller.ts
+++ b/src/editor/span/span-editor.controller.ts
@@ -52,7 +52,10 @@ export class SpanEditorController extends CodeListEditorController {
}
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/stepper/stepper-editor.controller.ts b/src/editor/stepper/stepper-editor.controller.ts
index be31f108a561b08b71533b42842f781bf84d675f..44e9efa8220341dcaabf5c7aee3914c6d6d0ae81 100644
--- a/src/editor/stepper/stepper-editor.controller.ts
+++ b/src/editor/stepper/stepper-editor.controller.ts
@@ -15,5 +15,5 @@ export class StepperEditorController extends EditorController {
* @author: zhujiamin
* @Date: 2022-08-25 14:33:14
*/
- public placeHolder = '请输入';
+ public placeHolder = ibiz.i18n.t('editor.stepper.pleaseEnter');
}
diff --git a/src/editor/upload/upload-editor.controller.ts b/src/editor/upload/upload-editor.controller.ts
index c61895ef1997736b0ab7ada6998add4418f5a4d3..06647d72ca101446d10c246490fcd40c41869ba4 100644
--- a/src/editor/upload/upload-editor.controller.ts
+++ b/src/editor/upload/upload-editor.controller.ts
@@ -119,7 +119,7 @@ export class UploadEditorController extends EditorController {
} catch (error) {
throw new RuntimeModelError(
uploadParams,
- `配置uploadParams没有按标准JSON格式`,
+ ibiz.i18n.t('editor.upload.uploadJsonFormatErr'),
);
}
}
@@ -129,7 +129,7 @@ export class UploadEditorController extends EditorController {
} catch (error) {
throw new RuntimeModelError(
exportParams,
- `配置exportParams没有按标准JSON格式`,
+ ibiz.i18n.t('editor.upload.exportJsonFormatErr'),
);
}
}
diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts
index 103ef1e62872cfa4d577daff904338ab1ca81249..49cd643b199cf28347516507f6a1274e7036620c 100644
--- a/src/locale/en/index.ts
+++ b/src/locale/en/index.ts
@@ -1,3 +1,198 @@
+import { en as runTimeEn } from '@ibiz-template/runtime';
+import { en as vue3UtilEn } from '@ibiz-template/vue3-util';
+import { en as modelHelperEn } from '@ibiz-template/model-helper';
+import { en as coreEn } from '@ibiz-template/core';
+
export default {
- name: 'zhangsan',
+ // 应用级
+ app: {
+ noSupport: 'Not supported currently',
+ add: 'Add',
+ delete: 'Delete',
+ retract: 'Retract',
+ },
+ // 组件
+ component: {
+ actionToolbar: {
+ noSupportDropDown: 'The drop-down mode is not supported',
+ },
+ rawItem: {
+ errorConfig: '{type} type custom parameter configuration error',
+ noSupportVideo: 'Your browser does not support video tags',
+ },
+ },
+ // 部件
+ 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',
+ },
+ upload: {
+ uploadJsonFormatErr:
+ 'The configuration of uploadparams did not follow the standard JSON format',
+ exportJsonFormatErr:
+ 'The configuration of exportparams did not follow the standard JSON format',
+ },
+ },
+ // 多语言
+ locale: {
+ prompt: 'Prompt',
+ switchLanguagePrompt:
+ 'Switching languages requires refreshing the page, are you sure to switch?',
+ },
+ mobApp: {
+ unauthorizedHandler: {
+ noFoundEnvParams: 'Unable to find environment parameter casLoginUrl',
+ prohibitAccessPrompt: 'Access to the current account is prohibited',
+ exitPrompt: 'Do you want to exit the current account?',
+ },
+ },
+ // 面板组件
+ panelComponent: {
+ authUserinfo: {
+ visitor: 'Visitor',
+ },
+ navPosIndex: {
+ noSupportPrompt:
+ 'Non routing mode navigation placeholder is not supported',
+ },
+ panelVideoPlayer: {
+ noSupportPrompt: 'Your device does not support video tags',
+ },
+ wfStepTrace: {
+ processingComplete: 'Processing completion time',
+ processingSteps: 'Processing steps',
+ processingPersonnel: 'Processing personnel',
+ submissionPath: 'Submission path',
+ },
+ },
+ // 工具
+ util: {
+ loading: 'Loading',
+ notAchieved: 'Not implemented',
+ unrealized: 'Unrealized',
+ cacheWarningPrompt:
+ 'There is only one item in the cache stack and it cannot be navigated back',
+ },
+ // 视图
+ view: {
+ fillInUserName: 'Please fill in user the name',
+ fillInPassword: 'Please fill in the password',
+ loginFailed: 'Login failed',
+ enterUserName: 'Please enter the username',
+ enterPassword: 'Please enter the password',
+ userName: 'User name',
+ password: 'Password',
+ login: 'Login',
+ },
+ // 视图引擎
+ viewEngine: {
+ closeRemind: 'Close reminder',
+ confirmClosePrompt:
+ 'The form data has been modified, are you sure you want to close it?',
+ noExistVersionErr: 'The current workflow version does not exist',
+ noFoundFormModel: 'Unable to find the model for form {name}',
+ missingToolbarModel: 'Missing toolbar component model',
+ notReceivedPrompt: 'No appDataElementId received',
+ },
+ // runTime
+ ...runTimeEn,
+ // vue3Util
+ ...vue3UtilEn,
+ // core
+ ...coreEn,
+ // modelHelper
+ ...modelHelperEn,
};
diff --git a/src/locale/index.ts b/src/locale/index.ts
index d32a2695ba646ad703f307c4fe5850d5f556c5bb..7c4222289e9ad3240d5be2316b2e8d3bae75f364 100644
--- a/src/locale/index.ts
+++ b/src/locale/index.ts
@@ -70,8 +70,8 @@ export class IBizI18n implements I18n {
setLang(lang: string): void {
ibiz.confirm
.warning({
- title: '提示',
- desc: '切换语言需要刷新页面,确认切换?',
+ title: ibiz.i18n.t('locale.prompt'),
+ desc: ibiz.i18n.t('locale.switchLanguagePrompt'),
})
.then(() => {
localStorage.setItem('language', lang);
diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts
index 58a41a16323673bf6bafb812c6071e443144aacd..580beb3bc672070ee3cf431c469c974421d767e5 100644
--- a/src/locale/zh-CN/index.ts
+++ b/src/locale/zh-CN/index.ts
@@ -1,3 +1,188 @@
+import { zhCn as runTimeZhCN } from '@ibiz-template/runtime';
+import { zhCn as vue3UtilZhCN } from '@ibiz-template/vue3-util';
+import { zhCn as modelHelperZhCN } from '@ibiz-template/model-helper';
+import { zhCn as coreZhCN } from '@ibiz-template/core';
+
export default {
- name: '张三',
+ // 应用级
+ app: {
+ noSupport: '暂未支持',
+ add: '添加',
+ delete: '删除',
+ retract: '收起',
+ },
+ // 组件
+ component: {
+ actionToolbar: {
+ noSupportDropDown: '下拉模式暂不支持',
+ },
+ rawItem: {
+ errorConfig: '{type} 类型自定义参数配置错误',
+ noSupportVideo: '你的浏览器不支持video标签',
+ },
+ },
+ // 部件
+ 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: '请输入',
+ },
+ upload: {
+ uploadJsonFormatErr: '配置uploadparams没有按标准JSON格式',
+ exportJsonFormatErr: '配置exportparams没有按标准JSON格式',
+ },
+ },
+ // 多语言
+ locale: {
+ prompt: '提示',
+ switchLanguagePrompt: '切换语言需要刷新页面,确认切换?',
+ },
+ mobApp: {
+ unauthorizedHandler: {
+ noFoundEnvParams: '找不到环境参数casLoginUrl',
+ prohibitAccessPrompt: '当前账户被禁止访问',
+ exitPrompt: '是否要退出当前账户?',
+ },
+ },
+ // 面板组件
+ panelComponent: {
+ authUserinfo: {
+ visitor: '游客',
+ },
+ navPosIndex: {
+ noSupportPrompt: '非路由模式导航占位暂未支持',
+ },
+ panelVideoPlayer: {
+ noSupportPrompt: '您的设备不支持video标签',
+ },
+ wfStepTrace: {
+ processingComplete: '处理完成时间',
+ processingSteps: '处理环节',
+ processingPersonnel: '处理人',
+ submissionPath: '提交路径',
+ },
+ },
+ // 工具
+ util: {
+ loading: '加载中',
+ notAchieved: '没有实现',
+ unrealized: '未实现',
+ cacheWarningPrompt: '堆栈只有一个缓存不能后退了',
+ },
+ // 视图
+ view: {
+ fillInUserName: '请填写用户名',
+ fillInPassword: '请填写密码',
+ loginFailed: '登录失败',
+ enterUserName: '请输入用户名',
+ enterPassword: '请输入密码',
+ userName: '用户名',
+ password: '密码',
+ login: '登录',
+ },
+ // 视图引擎
+ viewEngine: {
+ closeRemind: '关闭提醒',
+ confirmClosePrompt: '表单数据已经修改,确定要关闭?',
+ noExistVersionErr: '当前工作流版本不存在',
+ noFoundFormModel: '找不到表单{name}的模型',
+ missingToolbarModel: '缺少工具栏部件模型',
+ notReceivedPrompt: '没有接收到appDataEntityId',
+ },
+ // runTime
+ ...runTimeZhCN,
+ // vue3Util
+ ...vue3UtilZhCN,
+ // core
+ ...coreZhCN,
+ // modelHelper
+ ...modelHelperZhCN,
};
diff --git a/src/mob-app/main.ts b/src/mob-app/main.ts
index cf53e7e987074699fcee4b533cfb81029c657d9c..e47765f194154fc96be58829e868b8fb57536378 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/mob-app/util/unauthorized-handler/unauthorized-handler.ts b/src/mob-app/util/unauthorized-handler/unauthorized-handler.ts
index 82a4cefa9999987a7fb128ab6b9207b42a2e037c..925cf9fd4c4d3de957f33be4d8afae03d754b4c1 100644
--- a/src/mob-app/util/unauthorized-handler/unauthorized-handler.ts
+++ b/src/mob-app/util/unauthorized-handler/unauthorized-handler.ts
@@ -33,7 +33,9 @@ export class UnauthorizedHandler implements IErrorHandler {
*/
protected async casLogin(): Promise {
if (!ibiz.env.casLoginUrl) {
- throw new RuntimeError('找不到环境参数casLoginUrl');
+ throw new RuntimeError(
+ ibiz.i18n.t('mobApp.unauthorizedHandler.noFoundEnvParams'),
+ );
}
const { origin } = window.location;
const baseUrl = `${origin}${ibiz.env.baseUrl}`;
@@ -91,8 +93,8 @@ export class UnauthorizedHandler implements IErrorHandler {
*/
protected async handle403(): Promise {
const result = await ibiz.modal.confirm({
- title: '当前账户被禁止访问',
- desc: '是否要退出当前账户?',
+ title: ibiz.i18n.t('mobApp.unauthorizedHandler.prohibitAccessPrompt'),
+ desc: ibiz.i18n.t('mobApp.unauthorizedHandler.exitPrompt'),
});
if (result) {
const bol = await ibiz.auth.logout();
diff --git a/src/panel-component/auth-userinfo/auth-userinfo.tsx b/src/panel-component/auth-userinfo/auth-userinfo.tsx
index 52e469df630b0176d7ce3e1739e6be3883ae8f01..11cd501baeb8662bcec4ffb72d2abbbc806b4f35 100644
--- a/src/panel-component/auth-userinfo/auth-userinfo.tsx
+++ b/src/panel-component/auth-userinfo/auth-userinfo.tsx
@@ -20,7 +20,7 @@ export const AuthUserinfo = defineComponent({
const ns = useNamespace('user-info');
const c = prop.controller;
const {
- srfusername = '游客',
+ srfusername = ibiz.i18n.t('panelComponent.authUserinfo.visitor'),
srfpersonname,
srforgname,
} = ibiz.appData?.context || {};
diff --git a/src/panel-component/nav-pos-index/nav-pos-index.tsx b/src/panel-component/nav-pos-index/nav-pos-index.tsx
index 50104867395bfefe095b99f41a7fe682ec36ed28..277c76dda8b5d12af599e3f7825188390a4882de 100644
--- a/src/panel-component/nav-pos-index/nav-pos-index.tsx
+++ b/src/panel-component/nav-pos-index/nav-pos-index.tsx
@@ -70,7 +70,7 @@ export const NavPosIndex = defineComponent({
}}
) : (
- 非路由模式导航占位暂未支持
+ {ibiz.i18n.t('panelComponent.navPosIndex.noSupportPrompt')}
)}
);
diff --git a/src/panel-component/panel-video-player/panel-video-player.tsx b/src/panel-component/panel-video-player/panel-video-player.tsx
index b51b26a903c620fdc2e4215120e939ecc76a826f..d1dea0b7f3fea8fba2375319ba5ad4aa2bb3edc4 100644
--- a/src/panel-component/panel-video-player/panel-video-player.tsx
+++ b/src/panel-component/panel-video-player/panel-video-player.tsx
@@ -54,7 +54,7 @@ export const PanelVideoPlayer = defineComponent({
- 您的设备不支持video标签
+ {ibiz.i18n.t('panelComponent.panelVideoPlayer.noSupportPrompt')}
diff --git a/src/panel-component/wf-action-button/wf-action-button.tsx b/src/panel-component/wf-action-button/wf-action-button.tsx
index a4ffc63abcbbde104c97ae79d767dcd3bd67657e..edf54cbf40a6316e7727348363857e5935709d89 100644
--- a/src/panel-component/wf-action-button/wf-action-button.tsx
+++ b/src/panel-component/wf-action-button/wf-action-button.tsx
@@ -89,7 +89,7 @@ export const WFActionButton = defineComponent({
v-model:show={this.show}
actions={wfButtons}
close-on-click-overlay
- cancel-text='取消'
+ cancel-text={ibiz.i18n.t('app.cancel')}
close-on-click-action
onSelect={this.handleButtonClick}
>,
diff --git a/src/panel-component/wf-step-trace/wf-step-trace.tsx b/src/panel-component/wf-step-trace/wf-step-trace.tsx
index cd9db94197151ff9a6d3904b26509c41048c916e..acec0e25c06af8722ea0bd7f05dbb5c1b8753bf7 100644
--- a/src/panel-component/wf-step-trace/wf-step-trace.tsx
+++ b/src/panel-component/wf-step-trace/wf-step-trace.tsx
@@ -34,28 +34,36 @@ export const WFStepTrace = defineComponent({
diff --git a/src/util/app-util/app-util.ts b/src/util/app-util/app-util.ts
new file mode 100644
index 0000000000000000000000000000000000000000..57fb284add9f067534463fdd6c889471eb9041fa
--- /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/directive/loading.ts b/src/util/directive/loading.ts
index 8e21006024d558c60a42d66110eb37d4bba2a739..d450c9c3d794aab08b877f0ee16e01dc7be5a278 100644
--- a/src/util/directive/loading.ts
+++ b/src/util/directive/loading.ts
@@ -29,7 +29,7 @@ export interface ElementLoading extends HTMLElement {
const createInstance = (el: ElementLoading) => {
const ns = useNamespace('loading');
const options: ToastOptions = {
- message: '加载中...',
+ message: `${ibiz.i18n.t('util.loading')}...`,
forbidClick: true,
teleport: el,
className: ns.b(),
diff --git a/src/util/index.ts b/src/util/index.ts
index 0f8af4c0730682ad75b7eb32338a86a66cf84a7d..6acfe1e93a7eef7d7f27d2f488d53951cf66ea65 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';
diff --git a/src/util/loading-util/loading-util.ts b/src/util/loading-util/loading-util.ts
index cbb3a8a6ec87b7d7fbd8f31a4ee0cdefe974edcd..5b22176c7701ad779ea1ea8a4282589c3a36e8e4 100644
--- a/src/util/loading-util/loading-util.ts
+++ b/src/util/loading-util/loading-util.ts
@@ -50,7 +50,7 @@ export class LoadingUtil implements ILoadingUtil {
const ns = useNamespace('loading');
if (this.count === 0) {
this.loading = showLoadingToast({
- message: '加载中...',
+ message: `${ibiz.i18n.t('util.loading')}...`,
forbidClick: true,
className: ns.b(),
loadingType: 'spinner',
diff --git a/src/util/message-util/message-util.ts b/src/util/message-util/message-util.ts
index 14b407ed5eaac6658341e9e6b96754d221804021..7212bd7dacd49d6288a32385ee3710a25b9b667a 100644
--- a/src/util/message-util/message-util.ts
+++ b/src/util/message-util/message-util.ts
@@ -47,6 +47,6 @@ export class MessageUtil implements IMessageUtil {
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
notice(params: IMessageParams): void {
- throw new RuntimeError('没有实现');
+ throw new RuntimeError(ibiz.i18n.t('util.notAchieved'));
}
}
diff --git a/src/util/notification-util/notification-util.ts b/src/util/notification-util/notification-util.ts
index 9d6870a5b37ceaf86290a6d507af2377c0358575..2699592b9eaedabb0d9bfa55af7dd0c2beacf010 100644
--- a/src/util/notification-util/notification-util.ts
+++ b/src/util/notification-util/notification-util.ts
@@ -12,7 +12,7 @@ import { showNotify } from 'vant';
*/
export class NotificationUtil implements INotificationUtil {
default(_params: NotificationParams): void {
- throw new Error('未实现');
+ throw new Error(ibiz.i18n.t('util.unrealized'));
}
info(params: NotificationParams): void {
diff --git a/src/util/store/view-stack/view-stack.ts b/src/util/store/view-stack/view-stack.ts
index e888df3ce5a1611b7c05e177332d66f0b10ea082..7e9a3c958011cb20725759272fd4093a23634682 100644
--- a/src/util/store/view-stack/view-stack.ts
+++ b/src/util/store/view-stack/view-stack.ts
@@ -105,7 +105,7 @@ export const useViewStack = defineStore('viewStack', () => {
*/
const pop = () => {
if (viewStack.cacheKeys.length < 2) {
- throw new RuntimeError('堆栈只有一个缓存不能后退了');
+ throw new RuntimeError(ibiz.i18n.t('util.cacheWarningPrompt'));
}
evt.emit('onBeforeStackChange', 'pop');
const popKey = viewStack.cacheKeys.pop();
diff --git a/src/view-engine/mob-edit-view.engine.ts b/src/view-engine/mob-edit-view.engine.ts
index 301e97513eca6b14f1d193c7e716c45f5604a058..4bb36b1b8305f06a1659a314f32c6994d49944ea 100644
--- a/src/view-engine/mob-edit-view.engine.ts
+++ b/src/view-engine/mob-edit-view.engine.ts
@@ -40,8 +40,8 @@ export class MobEditViewEngine extends ViewEngineBase {
modal.hooks.shouldDismiss.tapPromise(async context => {
if (this.form.state.modified) {
const isAllow = await ibiz.modal.confirm({
- title: '关闭提醒',
- desc: '表单数据已经修改,确定要关闭?',
+ title: ibiz.i18n.t('viewEngine.closeRemind'),
+ desc: ibiz.i18n.t('viewEngine.confirmClosePrompt'),
});
if (!isAllow) {
context.allowClose = false;
@@ -216,7 +216,7 @@ export class MobEditViewEngine extends ViewEngineBase {
data.srfwftag ?? this.view.params.srfwftag ?? this.view.context.srfwftag,
);
if (res.data.length === 0) {
- throw new RuntimeError('当前工作流版本不存在');
+ throw new RuntimeError(ibiz.i18n.t('viewEngine.noExistVersionErr'));
}
// todo 多个的情况要出一个确认框选择后走后续逻辑
diff --git a/src/view-engine/mob-wf-dyna-edit-view.engine.ts b/src/view-engine/mob-wf-dyna-edit-view.engine.ts
index 72a9fac8f591e6dd15b2722cdc593afeab3e9410..9428a1f21dcb8c2df5f39ee274c51df40d4e926b 100644
--- a/src/view-engine/mob-wf-dyna-edit-view.engine.ts
+++ b/src/view-engine/mob-wf-dyna-edit-view.engine.ts
@@ -187,7 +187,7 @@ export class MobWFDynaEditViewEngine extends MobEditViewEngine {
if (!formModel) {
throw new RuntimeModelError(
this.view.model,
- `找不到表单${processForm}的模型`,
+ ibiz.i18n.t('viewEngine.noFoundFormModel', { name: processForm }),
);
}
this.processForm = formModel;
@@ -208,7 +208,10 @@ export class MobWFDynaEditViewEngine extends MobEditViewEngine {
*/
async calcWfToolbar(): Promise {
if (!this.wfToolbar) {
- throw new RuntimeModelError(this.view.model, '缺少工具栏部件模型');
+ throw new RuntimeModelError(
+ this.view.model,
+ ibiz.i18n.t('viewEngine.missingToolbarModel'),
+ );
}
this.wfToolbar?.clearExtraButtons();
diff --git a/src/view-engine/wf-step-trace-view.engine.ts b/src/view-engine/wf-step-trace-view.engine.ts
index 74d8d1d32bc0f640fcad1dd17c4449a0c06b9640..8a675c4290ac343052f7685c20e8f8f448fb8aaf 100644
--- a/src/view-engine/wf-step-trace-view.engine.ts
+++ b/src/view-engine/wf-step-trace-view.engine.ts
@@ -50,7 +50,7 @@ export class WFStepTraceViewEngine extends ViewEngineBase {
await super.onMounted();
const appDataEntityId = this.view.parentView?.model.appDataEntityId;
if (!appDataEntityId) {
- throw new RuntimeError('没有接收到appDataEntityId');
+ throw new RuntimeError(ibiz.i18n.t('viewEngine.notReceivedPrompt'));
}
const app = ibiz.hub.getApp(this.view.context.srfappid);
this.entityService = await app.deService.getService(
diff --git a/src/view/login-view/login-view.tsx b/src/view/login-view/login-view.tsx
index 479d607cbd41549cd2e460436138663c880480a2..f77f77eeec3a5b93dcb5e8c673686503841cf4a2 100644
--- a/src/view/login-view/login-view.tsx
+++ b/src/view/login-view/login-view.tsx
@@ -21,13 +21,13 @@ export const LoginView = defineComponent({
try {
if (!loginData.username) {
ibiz.notification.error({
- desc: '请填写用户名',
+ desc: ibiz.i18n.t('view.fillInUserName'),
});
return;
}
if (!loginData.password) {
ibiz.notification.error({
- desc: '请填写密码',
+ desc: ibiz.i18n.t('view.fillInPassword'),
});
return;
}
@@ -43,7 +43,9 @@ export const LoginView = defineComponent({
loading.value = false;
} catch (error) {
ibiz.notification.error({
- desc: (error as IData)?.response?.data?.message || '登录失败',
+ desc:
+ (error as IData)?.response?.data?.message ||
+ ibiz.i18n.t('view.loginFailed'),
});
loading.value = false;
}
@@ -67,20 +69,24 @@ export const LoginView = defineComponent({
@@ -90,7 +96,7 @@ export const LoginView = defineComponent({
class={ns.b('login-btn')}
onClick={this.login}
>
- 登录
+ {ibiz.i18n.t('view.login')}