@ibiz-template/vue3-components 0.7.6 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/index-Rqr5SnvQ.js +1 -0
  2. package/dist/index-ntRuv0hC.js +4 -0
  3. package/dist/index-x-jLCilD.js +1 -0
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/wang-editor-0uYWEddj.js +1 -0
  7. package/dist/{xlsx-util-QjtIWX97.js → xlsx-util-2u3vZn2l.js} +1 -1
  8. package/es/common/action-toolbar/action-toolbar.d.ts +3 -0
  9. package/es/common/action-toolbar/action-toolbar.mjs +13 -3
  10. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +5 -0
  11. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.d.ts +1 -0
  12. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +4 -0
  13. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +45 -0
  14. package/es/control/toolbar/toolbar.mjs +14 -8
  15. package/es/editor/code/monaco-editor/monaco-editor.css +1 -1
  16. package/es/editor/code/monaco-editor/monaco-editor.d.ts +7 -0
  17. package/es/editor/code/monaco-editor/monaco-editor.mjs +179 -16
  18. package/es/editor/html/wang-editor/wang-editor.mjs +7 -3
  19. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +1 -0
  20. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +10 -3
  21. package/es/editor/text-box/input/input.d.ts +1 -0
  22. package/es/editor/text-box/input/input.mjs +9 -2
  23. package/es/ibiz-vue3.mjs +2 -0
  24. package/es/index.mjs +1 -0
  25. package/es/locale/en/index.d.ts +9 -1
  26. package/es/locale/en/index.mjs +10 -2
  27. package/es/locale/zh-CN/index.d.ts +9 -1
  28. package/es/locale/zh-CN/index.mjs +10 -2
  29. package/es/util/open-view-util/open-view-util.mjs +2 -3
  30. package/es/view/403-view/403-view.css +1 -0
  31. package/es/view/403-view/403-view.d.ts +6 -0
  32. package/es/view/403-view/403-view.mjs +45 -0
  33. package/es/view/404-view/404-view.mjs +2 -2
  34. package/es/view/index.d.ts +1 -0
  35. package/es/view/index.mjs +1 -0
  36. package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +5 -2
  37. package/es/web-app/util/unauthorized-handler/unauthorized-handler.d.ts +1 -1
  38. package/es/web-app/util/unauthorized-handler/unauthorized-handler.mjs +3 -12
  39. package/lib/common/action-toolbar/action-toolbar.cjs +13 -3
  40. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +4 -0
  41. package/lib/control/toolbar/toolbar.cjs +14 -8
  42. package/lib/editor/code/monaco-editor/monaco-editor.cjs +178 -15
  43. package/lib/editor/code/monaco-editor/monaco-editor.css +1 -1
  44. package/lib/editor/html/wang-editor/wang-editor.cjs +6 -2
  45. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +10 -3
  46. package/lib/editor/text-box/input/input.cjs +9 -2
  47. package/lib/ibiz-vue3.cjs +2 -0
  48. package/lib/index.cjs +2 -0
  49. package/lib/locale/en/index.cjs +10 -2
  50. package/lib/locale/zh-CN/index.cjs +10 -2
  51. package/lib/util/open-view-util/open-view-util.cjs +2 -3
  52. package/lib/view/403-view/403-view.cjs +47 -0
  53. package/lib/view/403-view/403-view.css +1 -0
  54. package/lib/view/404-view/404-view.cjs +2 -2
  55. package/lib/view/index.cjs +2 -0
  56. package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +4 -1
  57. package/lib/web-app/util/unauthorized-handler/unauthorized-handler.cjs +3 -12
  58. package/package.json +7 -7
  59. package/dist/index-13Oh42A8.js +0 -1
  60. package/dist/index-ZIuDbCjc.js +0 -1
  61. package/dist/index-rHXmoO9Y.js +0 -4
  62. package/dist/wang-editor-Zc_Y0dGt.js +0 -1
@@ -1,6 +1,7 @@
1
- import { ref, watch, nextTick, onMounted, onUnmounted, createVNode, defineComponent } from 'vue';
1
+ import { ref, watch, nextTick, createVNode, onMounted, onUnmounted, resolveComponent, defineComponent } from 'vue';
2
2
  import './monaco-editor.css';
3
3
  import { getCodeProps, getEditorEmits, useNamespace, useUIStore } from '@ibiz-template/vue3-util';
4
+ import { ElMessageBox } from 'element-plus';
4
5
  import '../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.45.0/node_modules/@monaco-editor/loader/lib/es/index.mjs';
5
6
  import loader from '../../../node_modules/.pnpm/@monaco-editor_loader@1.4.0_monaco-editor@0.45.0/node_modules/@monaco-editor/loader/lib/es/loader/index.mjs';
6
7
 
@@ -13,7 +14,24 @@ const IBizCode = /* @__PURE__ */ defineComponent({
13
14
  emit
14
15
  }) {
15
16
  const ns = useNamespace("code");
17
+ const c = props.controller;
16
18
  const currentVal = ref("");
19
+ const enableEdit = ref(true);
20
+ const hasEnableEdit = ref(false);
21
+ const readonlyState = ref(false);
22
+ const enableFullScreen = ref(false);
23
+ const isFullScreen = ref(false);
24
+ const editorModel = c.model;
25
+ if (editorModel.editorParams) {
26
+ if (editorModel.editorParams.enableEdit) {
27
+ hasEnableEdit.value = true;
28
+ readonlyState.value = true;
29
+ enableEdit.value = c.toBoolean(editorModel.editorParams.enableEdit) && !props.readonly && !props.disabled;
30
+ }
31
+ if (editorModel.editorParams.enableFullScreen) {
32
+ enableFullScreen.value = c.toBoolean(editorModel.editorParams.enableFullScreen);
33
+ }
34
+ }
17
35
  let editor;
18
36
  let monacoEditor;
19
37
  const {
@@ -33,13 +51,22 @@ const IBizCode = /* @__PURE__ */ defineComponent({
33
51
  }, {
34
52
  immediate: true
35
53
  });
36
- watch(() => props.readonly, (newVal) => {
37
- if (editor) {
38
- editor.updateOptions({
39
- readOnly: newVal
40
- });
54
+ const updateEditorOptions = () => {
55
+ if (!editor) {
56
+ return;
41
57
  }
42
- }, {
58
+ if (props.readonly || props.disabled) {
59
+ hasEnableEdit.value = false;
60
+ readonlyState.value = true;
61
+ }
62
+ editor.updateOptions({
63
+ readOnly: hasEnableEdit.value ? readonlyState.value : props.readonly || props.disabled
64
+ });
65
+ };
66
+ watch(() => props.readonly, updateEditorOptions, {
67
+ immediate: true
68
+ });
69
+ watch(() => props.disabled, updateEditorOptions, {
43
70
  immediate: true
44
71
  });
45
72
  const codeEditBox = ref();
@@ -65,10 +92,10 @@ const IBizCode = /* @__PURE__ */ defineComponent({
65
92
  minimap: {
66
93
  enabled: true
67
94
  },
68
- readOnly: props.readonly,
95
+ readOnly: hasEnableEdit.value ? readonlyState.value : props.readonly || props.disabled,
69
96
  // 只读
70
97
  readOnlyMessage: {
71
- value: "\u5F53\u524D\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u4E0D\u53EF\u7F16\u8F91"
98
+ value: ibiz.i18n.t("editor.code.readOnlyPrompt")
72
99
  },
73
100
  fontSize: 16,
74
101
  // 字体大小
@@ -83,8 +110,10 @@ const IBizCode = /* @__PURE__ */ defineComponent({
83
110
  editor.setValue(currentVal.value);
84
111
  });
85
112
  editor.onDidChangeModelContent(() => {
86
- currentVal.value = editor.getValue();
87
- emit("change", currentVal.value);
113
+ if (!hasEnableEdit.value) {
114
+ currentVal.value = editor.getValue();
115
+ emit("change", currentVal.value);
116
+ }
88
117
  });
89
118
  window.addEventListener("resize", () => {
90
119
  editor.layout();
@@ -92,6 +121,115 @@ const IBizCode = /* @__PURE__ */ defineComponent({
92
121
  });
93
122
  });
94
123
  };
124
+ const changeEditState = () => {
125
+ readonlyState.value = !readonlyState.value;
126
+ if (!editor)
127
+ return;
128
+ if (!readonlyState.value) {
129
+ editor.updateOptions({
130
+ readOnly: false
131
+ });
132
+ } else {
133
+ editor.updateOptions({
134
+ readOnly: true
135
+ });
136
+ }
137
+ };
138
+ const changeFullScreenState = async () => {
139
+ currentVal.value = String(editor == null ? void 0 : editor.getValue());
140
+ editor == null ? void 0 : editor.dispose();
141
+ editor = null;
142
+ isFullScreen.value = !isFullScreen.value;
143
+ editorInit();
144
+ };
145
+ const isAllowRenderFullScreen = () => {
146
+ if (enableFullScreen.value) {
147
+ if (isFullScreen.value) {
148
+ return createVNode("i", {
149
+ "class": "fa fa-compress",
150
+ "aria-hidden": "true",
151
+ "onClick": () => changeFullScreenState()
152
+ }, null);
153
+ }
154
+ return createVNode("i", {
155
+ "class": "fa fa-expand",
156
+ "aria-hidden": "true",
157
+ "onClick": () => changeFullScreenState()
158
+ }, null);
159
+ }
160
+ return null;
161
+ };
162
+ const renderCancelMessage = () => {
163
+ return createVNode("div", {
164
+ "class": ns.be("message", "message-content")
165
+ }, [createVNode("p", null, [ibiz.i18n.t("editor.code.confirmCancelPrompt")]), createVNode("p", {
166
+ "class": ns.bem("message", "message-content", "message-tip")
167
+ }, [ibiz.i18n.t("editor.code.cancelEditPrompt")])]);
168
+ };
169
+ const cancelEdit = () => {
170
+ if (props.value !== (editor == null ? void 0 : editor.getValue())) {
171
+ ElMessageBox({
172
+ title: ibiz.i18n.t("editor.code.confirmCancel"),
173
+ type: "warning",
174
+ customClass: ns.b("message"),
175
+ message: renderCancelMessage(),
176
+ showCancelButton: true,
177
+ cancelButtonClass: ns.be("message", "message-cancel"),
178
+ confirmButtonClass: ns.be("message", "message-comfire")
179
+ }).then(() => {
180
+ editor == null ? void 0 : editor.setValue(String(props.value || ""));
181
+ changeEditState();
182
+ }).catch(() => {
183
+ editor == null ? void 0 : editor.focus();
184
+ });
185
+ } else {
186
+ changeEditState();
187
+ }
188
+ };
189
+ const save = () => {
190
+ changeEditState();
191
+ if (editor) {
192
+ currentVal.value = editor.getValue();
193
+ emit("change", currentVal.value);
194
+ }
195
+ if (isFullScreen.value) {
196
+ changeFullScreenState();
197
+ }
198
+ };
199
+ const renderFooter = () => {
200
+ if (hasEnableEdit.value) {
201
+ return createVNode("div", {
202
+ "class": [ns.b("footer"), {
203
+ [ns.b("footer-dialog")]: isFullScreen.value
204
+ }]
205
+ }, [createVNode("div", {
206
+ "class": ns.be("footer", "cancel"),
207
+ "onClick": () => cancelEdit()
208
+ }, [ibiz.i18n.t("app.cancel")]), createVNode("div", {
209
+ "class": ns.be("footer", "save"),
210
+ "onClick": () => save()
211
+ }, [ibiz.i18n.t("app.save")])]);
212
+ }
213
+ return null;
214
+ };
215
+ const renderHeaderToolbar = () => {
216
+ if (hasEnableEdit.value || enableFullScreen.value) {
217
+ return createVNode("div", {
218
+ "class": ns.b("toolbar")
219
+ }, [hasEnableEdit.value && enableEdit.value && readonlyState.value ? createVNode("i", {
220
+ "class": "fa fa-edit",
221
+ "aria-hidden": "true",
222
+ "onClick": () => changeEditState()
223
+ }, null) : null, isAllowRenderFullScreen()]);
224
+ }
225
+ return null;
226
+ };
227
+ const renderCodeContent = () => {
228
+ return createVNode("div", {
229
+ "ref": codeEditBox,
230
+ "class": ns.e("box")
231
+ }, null);
232
+ };
95
233
  onMounted(() => {
96
234
  editorInit();
97
235
  });
@@ -101,14 +239,39 @@ const IBizCode = /* @__PURE__ */ defineComponent({
101
239
  return {
102
240
  ns,
103
241
  currentVal,
104
- codeEditBox
242
+ codeEditBox,
243
+ isFullScreen,
244
+ hasEnableEdit,
245
+ readonlyState,
246
+ renderFooter,
247
+ renderHeaderToolbar,
248
+ renderCodeContent,
249
+ changeFullScreenState
105
250
  };
106
251
  },
107
252
  render() {
108
- return createVNode("div", {
109
- "ref": "codeEditBox",
110
- "class": this.ns.b()
111
- }, null);
253
+ return !this.isFullScreen ? createVNode("div", {
254
+ "class": [this.ns.b(), {
255
+ [this.ns.b("editor-readonly")]: this.readonlyState
256
+ }, {
257
+ [this.ns.b("editor-enable")]: !this.readonlyState
258
+ }]
259
+ }, [this.renderHeaderToolbar(), this.renderCodeContent(), this.hasEnableEdit && !this.readonlyState ? this.renderFooter() : null]) : createVNode(resolveComponent("el-dialog"), {
260
+ "modelValue": this.isFullScreen,
261
+ "onUpdate:modelValue": ($event) => this.isFullScreen = $event,
262
+ "width": "80%",
263
+ "top": "10vh",
264
+ "class": this.ns.b("dialog-full-screen"),
265
+ "onClose": () => this.changeFullScreenState()
266
+ }, {
267
+ default: () => [createVNode("div", {
268
+ "class": [this.ns.b(), {
269
+ [this.ns.b("editor-readonly")]: this.readonlyState
270
+ }, {
271
+ [this.ns.b("editor-enable")]: !this.readonlyState
272
+ }]
273
+ }, [this.renderHeaderToolbar(), this.renderCodeContent(), this.hasEnableEdit && !this.readonlyState ? this.renderFooter() : null])]
274
+ });
112
275
  }
113
276
  });
114
277
 
@@ -1,4 +1,4 @@
1
- import { ref, shallowRef, watch, onBeforeUnmount, onMounted, createTextVNode, createVNode, nextTick, onUnmounted, resolveComponent, defineComponent } from 'vue';
1
+ import { ref, shallowRef, watch, onBeforeUnmount, nextTick, onMounted, createTextVNode, createVNode, onUnmounted, resolveComponent, defineComponent } from 'vue';
2
2
  import { Toolbar, Editor } from '@wangeditor/editor-for-vue';
3
3
  import { getCookie } from 'qx-util';
4
4
  import { isNil } from 'ramda';
@@ -198,9 +198,13 @@ const IBizHtml = /* @__PURE__ */ defineComponent({
198
198
  watch(() => props.value, (newVal, oldVal) => {
199
199
  if (newVal !== oldVal && (typeof props.value === "string" || newVal == null)) {
200
200
  if (newVal == null) {
201
- valueHtml.value = "";
201
+ nextTick(() => {
202
+ valueHtml.value = "";
203
+ });
202
204
  } else {
203
- valueHtml.value = newVal;
205
+ nextTick(() => {
206
+ valueHtml.value = newVal;
207
+ });
204
208
  }
205
209
  }
206
210
  }, {
@@ -36,6 +36,7 @@ export declare const IBizInputNumber: import("vue").DefineComponent<{
36
36
  showFormDefaultContent: import("vue").ComputedRef<boolean>;
37
37
  max: number;
38
38
  min: number;
39
+ currentFormatVal: import("vue").ComputedRef<string>;
39
40
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
41
  change: (_value: unknown, _name?: string | undefined) => boolean;
41
42
  blur: (_event?: IData | undefined) => boolean;
@@ -42,6 +42,12 @@ const IBizInputNumber = /* @__PURE__ */ defineComponent({
42
42
  }, {
43
43
  immediate: true
44
44
  });
45
+ const currentFormatVal = computed(() => {
46
+ if (currentVal.value || currentVal.value === 0) {
47
+ return props.controller.formatValue(currentVal.value);
48
+ }
49
+ return "";
50
+ });
45
51
  const setEditable = (flag) => {
46
52
  if (flag) {
47
53
  isEditable.value = flag;
@@ -86,7 +92,8 @@ const IBizInputNumber = /* @__PURE__ */ defineComponent({
86
92
  setEditable,
87
93
  showFormDefaultContent,
88
94
  max,
89
- min
95
+ min,
96
+ currentFormatVal
90
97
  };
91
98
  },
92
99
  render() {
@@ -95,7 +102,7 @@ const IBizInputNumber = /* @__PURE__ */ defineComponent({
95
102
  } = this.c.parent;
96
103
  let content = null;
97
104
  if (this.readonly) {
98
- content = isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentVal);
105
+ content = isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentFormatVal);
99
106
  if (content && unitName) {
100
107
  content += unitName;
101
108
  }
@@ -120,7 +127,7 @@ const IBizInputNumber = /* @__PURE__ */ defineComponent({
120
127
  }
121
128
  const formDefaultContent = createVNode("div", {
122
129
  "class": this.ns.b("form-default-content")
123
- }, [this.currentVal || this.currentVal === 0 ? this.currentVal : "-"]);
130
+ }, [this.currentVal || this.currentVal === 0 ? this.currentFormatVal : "-"]);
124
131
  return createVNode("div", {
125
132
  "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)]
126
133
  }, [this.showFormDefaultContent && formDefaultContent, content]);
@@ -41,6 +41,7 @@ export declare const IBizInput: import("vue").DefineComponent<{
41
41
  showLimit: import("vue").Ref<boolean>;
42
42
  isAuto: import("vue").Ref<boolean>;
43
43
  showFormDefaultContent: import("vue").ComputedRef<boolean>;
44
+ currentFormatVal: import("vue").ComputedRef<string>;
44
45
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
46
  change: (_value: unknown, _name?: string | undefined) => boolean;
46
47
  blur: (_event?: IData | undefined) => boolean;
@@ -64,6 +64,12 @@ const IBizInput = /* @__PURE__ */ defineComponent({
64
64
  }, {
65
65
  immediate: true
66
66
  });
67
+ const currentFormatVal = computed(() => {
68
+ if (currentVal.value) {
69
+ return props.controller.formatValue(currentVal.value);
70
+ }
71
+ return "";
72
+ });
67
73
  const setEditable = (flag) => {
68
74
  if (flag) {
69
75
  isEditable.value = flag;
@@ -216,7 +222,8 @@ const IBizInput = /* @__PURE__ */ defineComponent({
216
222
  setEditable,
217
223
  showLimit,
218
224
  isAuto,
219
- showFormDefaultContent
225
+ showFormDefaultContent,
226
+ currentFormatVal
220
227
  };
221
228
  },
222
229
  render() {
@@ -276,7 +283,7 @@ const IBizInput = /* @__PURE__ */ defineComponent({
276
283
  }
277
284
  const formDefaultContent = createVNode("div", {
278
285
  "class": this.ns.b("form-default-content")
279
- }, [this.currentVal ? this.type === "password" ? this.currentVal.split("").map((_item) => "\u2022") : this.currentVal : "-"]);
286
+ }, [this.currentVal ? this.type === "password" ? this.currentVal.split("").map((_item) => "\u2022") : this.currentFormatVal : "-"]);
280
287
  return createVNode("div", {
281
288
  "class": [this.ns.b(), this.ns.is("textarea", Object.is(this.type, "textarea")), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)],
282
289
  "style": {
package/es/ibiz-vue3.mjs CHANGED
@@ -8,6 +8,7 @@ import './view/index.mjs';
8
8
  import { iBizI18n } from './locale/index.mjs';
9
9
  import { IBizViewEngine } from './view-engine/index.mjs';
10
10
  import { View404 } from './view/404-view/404-view.mjs';
11
+ import { View403 } from './view/403-view/403-view.mjs';
11
12
  import { IBizWFStepTraceView } from './view/wf-step-trace-view/index.mjs';
12
13
  import { IBizSubAppRefView } from './view/sub-app-ref-view/index.mjs';
13
14
  import { IBizDataViewControl } from './control/data-view/index.mjs';
@@ -51,6 +52,7 @@ var IBizVue3 = {
51
52
  ibiz.i18n = iBizI18n;
52
53
  ibiz.util.getExcelUtil = () => import('./util/xlsx-util/xlsx-util.mjs');
53
54
  registerErrorViewProvider("404", () => ({ component: View404 }));
55
+ registerErrorViewProvider("403", () => ({ component: View403 }));
54
56
  v.use(IBizCommonComponents);
55
57
  v.use(IBizPanelComponents);
56
58
  v.use(IBizViewEngine);
package/es/index.mjs CHANGED
@@ -100,6 +100,7 @@ export { IBizPanelIndexViewSearch } from './panel-component/panel-index-view-sea
100
100
  export { IBizIndexActions } from './panel-component/index-actions/index.mjs';
101
101
  export { IBizUserAction } from './panel-component/user-action/index.mjs';
102
102
  export { View404 } from './view/404-view/404-view.mjs';
103
+ export { View403 } from './view/403-view/403-view.mjs';
103
104
  export { LoginView } from './view/login-view/login-view.mjs';
104
105
  export { IBizWFStepTraceView } from './view/wf-step-trace-view/index.mjs';
105
106
  export { IBizSubAppRefView } from './view/sub-app-ref-view/index.mjs';
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  noSupport: string;
12
12
  add: string;
13
13
  delete: string;
14
+ save: string;
14
15
  };
15
16
  view: {};
16
17
  control: {
@@ -103,6 +104,13 @@ declare const _default: {
103
104
  more: string;
104
105
  };
105
106
  };
106
- editor: {};
107
+ editor: {
108
+ code: {
109
+ readOnlyPrompt: string;
110
+ confirmCancelPrompt: string;
111
+ cancelEditPrompt: string;
112
+ confirmCancel: string;
113
+ };
114
+ };
107
115
  };
108
116
  export default _default;
@@ -12,7 +12,8 @@ var index = {
12
12
  refresh: "Refresh",
13
13
  noSupport: "Not supported currently",
14
14
  add: "Add",
15
- delete: "Delete"
15
+ delete: "Delete",
16
+ save: "Save"
16
17
  },
17
18
  // 视图
18
19
  view: {},
@@ -109,7 +110,14 @@ var index = {
109
110
  }
110
111
  },
111
112
  // 编辑器
112
- editor: {}
113
+ editor: {
114
+ code: {
115
+ readOnlyPrompt: "Currently in read-only mode, not editable",
116
+ confirmCancelPrompt: "Are you sure you want to cancel editing?",
117
+ cancelEditPrompt: "Canceling editing will prevent the modified content from being saved and cannot be retrieved.",
118
+ confirmCancel: "Confirm cancel"
119
+ }
120
+ }
113
121
  };
114
122
 
115
123
  export { index as default };
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  noSupport: string;
12
12
  add: string;
13
13
  delete: string;
14
+ save: string;
14
15
  };
15
16
  view: {};
16
17
  control: {
@@ -103,6 +104,13 @@ declare const _default: {
103
104
  more: string;
104
105
  };
105
106
  };
106
- editor: {};
107
+ editor: {
108
+ code: {
109
+ readOnlyPrompt: string;
110
+ confirmCancelPrompt: string;
111
+ cancelEditPrompt: string;
112
+ confirmCancel: string;
113
+ };
114
+ };
107
115
  };
108
116
  export default _default;
@@ -12,7 +12,8 @@ var index = {
12
12
  refresh: "\u5237\u65B0",
13
13
  noSupport: "\u6682\u672A\u652F\u6301",
14
14
  add: "\u6DFB\u52A0",
15
- delete: "\u5220\u9664"
15
+ delete: "\u5220\u9664",
16
+ save: "\u4FDD\u5B58"
16
17
  },
17
18
  // 视图
18
19
  view: {},
@@ -109,7 +110,14 @@ var index = {
109
110
  }
110
111
  },
111
112
  // 编辑器
112
- editor: {}
113
+ editor: {
114
+ code: {
115
+ readOnlyPrompt: "\u5F53\u524D\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u4E0D\u53EF\u7F16\u8F91",
116
+ confirmCancelPrompt: "\u786E\u5B9A\u8981\u53D6\u6D88\u7F16\u8F91\u5417\uFF1F",
117
+ cancelEditPrompt: "\u53D6\u6D88\u7F16\u8F91\u5C06\u65E0\u6CD5\u4FDD\u5B58\u4FEE\u6539\u7684\u5185\u5BB9\uFF0C\u4E14\u4E0D\u80FD\u627E\u56DE\u3002",
118
+ confirmCancel: "\u786E\u8BA4\u53D6\u6D88"
119
+ }
120
+ }
113
121
  };
114
122
 
115
123
  export { index as default };
@@ -22,7 +22,7 @@ class OpenViewUtil {
22
22
  } else {
23
23
  this.router.push({ path });
24
24
  }
25
- return { ok: true };
25
+ return { ok: false };
26
26
  }
27
27
  async rootByModal(appViewId, context, params) {
28
28
  const appView = await ibiz.hub.config.view.get(appViewId);
@@ -32,8 +32,7 @@ class OpenViewUtil {
32
32
  context,
33
33
  params
34
34
  );
35
- this.router.push({ path });
36
- return { ok: true };
35
+ return this.push(path);
37
36
  }
38
37
  /**
39
38
  * 模态打开视图
@@ -0,0 +1 @@
1
+ .ibiz-403-view{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px}.ibiz-403-view .ibiz-403-view-text{margin-top:40px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.ibiz-403-view-text__text1{margin-bottom:20px}.ibiz-403-view-text__text2 a{color:#557da5;cursor:pointer}.ibiz-403-view.is-top{width:100vw;height:100vh}
@@ -0,0 +1,6 @@
1
+ import './403-view.scss';
2
+ export declare const View403: import("vue").DefineComponent<{}, {
3
+ ns: import("@ibiz-template/core").Namespace;
4
+ isTop: import("vue").ComputedRef<boolean>;
5
+ gotoIndexView: () => Promise<void>;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
@@ -0,0 +1,45 @@
1
+ import { onMounted, computed, createVNode, createTextVNode, defineComponent } from 'vue';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { useRouter, useRoute } from 'vue-router';
4
+ import './403-view.css';
5
+
6
+ "use strict";
7
+ const View403 = /* @__PURE__ */ defineComponent({
8
+ name: "IBizView403",
9
+ setup() {
10
+ const ns = useNamespace("403-view");
11
+ const router = useRouter();
12
+ const route = useRoute();
13
+ const gotoIndexView = async () => {
14
+ await router.push("/");
15
+ window.location.reload();
16
+ };
17
+ onMounted(() => ibiz.util.hiddenAppLoading());
18
+ const isTop = computed(() => {
19
+ return route && !route.params.view1;
20
+ });
21
+ return {
22
+ ns,
23
+ isTop,
24
+ gotoIndexView
25
+ };
26
+ },
27
+ render() {
28
+ return createVNode("div", {
29
+ "class": [this.ns.b(), this.ns.is("top", this.isTop)]
30
+ }, [createVNode("img", {
31
+ "class": this.ns.b("img"),
32
+ "src": "./assets/images/404.png"
33
+ }, null), createVNode("div", {
34
+ "class": this.ns.b("text")
35
+ }, [createVNode("div", {
36
+ "class": this.ns.be("text", "text1")
37
+ }, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u6CA1\u6709\u8BBF\u95EE\u8BE5\u9875\u9762\u7684\u6743\u9650")]), this.isTop ? createVNode("div", {
38
+ "class": this.ns.be("text", "text2")
39
+ }, [createTextVNode("\u60A8\u6CA1\u6709\u8BBF\u95EE\u8BE5\u9875\u9762\u7684\u6743\u9650\uFF0C\u8BF7"), createVNode("a", {
40
+ "onClick": this.gotoIndexView
41
+ }, [createTextVNode("\u8FD4\u56DE\u9996\u9875")]), createTextVNode("\u7EE7\u7EED\u6D4F\u89C8")]) : null])]);
42
+ }
43
+ });
44
+
45
+ export { View403 };
@@ -34,9 +34,9 @@ const View404 = /* @__PURE__ */ defineComponent({
34
34
  "class": this.ns.b("text")
35
35
  }, [createVNode("div", {
36
36
  "class": this.ns.be("text", "text1")
37
- }, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728\uFF01")]), this.isTop ? createVNode("div", {
37
+ }, [createTextVNode("\u62B1\u6B49\uFF0C\u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728")]), this.isTop ? createVNode("div", {
38
38
  "class": this.ns.be("text", "text2")
39
- }, [createTextVNode("\u60A8\u8981\u627E\u7684\u9875\u9762\u4E0D\u5B58\u5728\uFF0C\u8BF7"), createVNode("a", {
39
+ }, [createTextVNode("\u60A8\u8981\u627E\u7684\u8D44\u6E90\u4E0D\u5B58\u5728\uFF0C\u8BF7"), createVNode("a", {
40
40
  "onClick": this.gotoIndexView
41
41
  }, [createTextVNode("\u8FD4\u56DE\u9996\u9875")]), createTextVNode("\u7EE7\u7EED\u6D4F\u89C8")]) : null])]);
42
42
  }
@@ -1,4 +1,5 @@
1
1
  export * from './404-view/404-view';
2
+ export * from './403-view/403-view';
2
3
  export * from './login-view/login-view';
3
4
  export * from './wf-step-trace-view/index';
4
5
  export * from './sub-app-ref-view';
package/es/view/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  export { View404 } from './404-view/404-view.mjs';
2
+ export { View403 } from './403-view/403-view.mjs';
2
3
  export { LoginView } from './login-view/login-view.mjs';
3
4
  export { IBizWFStepTraceView } from './wf-step-trace-view/index.mjs';
4
5
  export { IBizSubAppRefView } from './sub-app-ref-view/index.mjs';
@@ -1,5 +1,5 @@
1
1
  import { ref, toRaw, onUnmounted, createVNode, defineComponent } from 'vue';
2
- import { parseRouteViewData, createOverlayView } from '@ibiz-template/vue3-util';
2
+ import { parseRouteViewData, createOverlayView, routerCallback } from '@ibiz-template/vue3-util';
3
3
  import { useRoute, useRouter } from 'vue-router';
4
4
  import { IBizContext } from '@ibiz-template/core';
5
5
  import { RouteConst } from '@ibiz-template/runtime';
@@ -97,7 +97,7 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
97
97
  };
98
98
  overlay = ibiz.overlay.createModal(component, void 0, opts);
99
99
  overlay.present();
100
- await overlay.onWillDismiss();
100
+ const result = await overlay.onWillDismiss();
101
101
  overlay = null;
102
102
  if (isDestroyed.value === false) {
103
103
  if ((_a = window.history.state) == null ? void 0 : _a.back) {
@@ -107,6 +107,9 @@ const ModalRouterShell = /* @__PURE__ */ defineComponent({
107
107
  const index = path.indexOf("/".concat(RouteConst.ROUTE_MODAL_TAG, "/"));
108
108
  router.replace(path.substring(0, index));
109
109
  }
110
+ routerCallback.close(router.currentRoute.value.fullPath, result || {
111
+ ok: false
112
+ });
110
113
  }
111
114
  };
112
115
  openView();
@@ -34,7 +34,7 @@ export declare class UnauthorizedHandler implements IErrorHandler {
34
34
  * @protected
35
35
  * @return {*} {Promise<void>}
36
36
  */
37
- protected handle403(): Promise<void>;
37
+ protected handle403(error: unknown): Promise<void>;
38
38
  /**
39
39
  * 没有权限处理
40
40
  *
@@ -60,17 +60,8 @@ class UnauthorizedHandler {
60
60
  * @protected
61
61
  * @return {*} {Promise<void>}
62
62
  */
63
- async handle403() {
64
- const result = await ibiz.confirm.warning({
65
- title: "\u5F53\u524D\u8D26\u6237\u88AB\u7981\u6B62\u8BBF\u95EE",
66
- desc: "\u662F\u5426\u8981\u9000\u51FA\u5F53\u524D\u8D26\u6237\uFF1F"
67
- });
68
- if (result) {
69
- const bol = await ibiz.hub.controller.logout();
70
- if (bol) {
71
- window.location.reload();
72
- }
73
- }
63
+ async handle403(error) {
64
+ ibiz.mc.error.send(error);
74
65
  }
75
66
  /**
76
67
  * 没有权限处理
@@ -97,7 +88,7 @@ class UnauthorizedHandler {
97
88
  return true;
98
89
  }
99
90
  if (error.status === 403) {
100
- this.handle403();
91
+ this.handle403(error);
101
92
  return true;
102
93
  }
103
94
  }