@ibiz-template/mob-vue3-components 0.7.41-alpha.7 → 0.7.41-alpha.9

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 (142) hide show
  1. package/dist/{index-O-XmMUt3.js → index-JSf84k9b.js} +2 -2
  2. package/dist/index-JSf84k9b.js.map +1 -0
  3. package/dist/{index-NP0RBfWK.js → index-OsiEgFnw.js} +2 -2
  4. package/dist/index-OsiEgFnw.js.map +1 -0
  5. package/dist/index-m5kpisiW.js +76 -0
  6. package/dist/index-m5kpisiW.js.map +1 -0
  7. package/dist/index.min.css +8 -8
  8. package/dist/index.system.min.js +1 -1
  9. package/dist/{quill-editor-preview-Dui7L0ne.js → quill-editor-preview-4GJgBqkz.js} +2 -2
  10. package/dist/{quill-editor-preview-Dui7L0ne.js.map → quill-editor-preview-4GJgBqkz.js.map} +1 -1
  11. package/dist/{quill-editor-BMC0diFC.js → quill-editor-wtClM5Dv.js} +2 -2
  12. package/dist/{quill-editor-BMC0diFC.js.map → quill-editor-wtClM5Dv.js.map} +1 -1
  13. package/dist/{quill-O7hIDmrl.js → quill-fQu2PNuh.js} +2 -2
  14. package/dist/{quill-O7hIDmrl.js.map → quill-fQu2PNuh.js.map} +1 -1
  15. package/es/common/button-list/button-list.d.ts +1 -0
  16. package/es/common/date-range-picker/components/range-picker/range-picker.d.ts +1 -1
  17. package/es/common/date-range-picker/date-range-picker.d.ts +2 -2
  18. package/es/common/emoji-select/components/emoji-list/emoji-list.d.ts +1 -1
  19. package/es/common/emoji-select/icons/search.d.ts +1 -0
  20. package/es/common/index.mjs +2 -1
  21. package/es/common/md-ctrl-setting/md-ctrl-setting.d.ts +3 -3
  22. package/es/control/app-menu/custom-menu-design/custom-menu-design.d.ts +1 -1
  23. package/es/control/dashboard/portlet/portlet-part/portlet-part.state.d.ts +1 -0
  24. package/es/control/dashboard/portlet/portlet-part/portlet-part.state.mjs +1 -0
  25. package/es/control/data-view/data-view.d.ts +2 -2
  26. package/es/control/data-view/data-view.mjs +2 -3
  27. package/es/control/data-view/index.d.ts +2 -2
  28. package/es/control/drbar/drbar.controller.d.ts +1 -0
  29. package/es/control/drbar/drbar.controller.mjs +3 -0
  30. package/es/control/drbar/drbar.d.ts +2 -2
  31. package/es/control/drbar/index.d.ts +2 -2
  32. package/es/control/drtab/drtab.controller.d.ts +1 -0
  33. package/es/control/drtab/drtab.controller.mjs +3 -0
  34. package/es/control/drtab/drtab.d.ts +2 -2
  35. package/es/control/drtab/index.d.ts +2 -2
  36. package/es/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
  37. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.d.ts +1 -1
  38. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.d.ts +1 -1
  39. package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.d.ts +3 -3
  40. package/es/control/list/list/index.d.ts +2 -2
  41. package/es/control/list/list/list.d.ts +2 -2
  42. package/es/control/list/list-render-util.d.ts +1 -0
  43. package/es/control/list/md-ctrl/index.d.ts +2 -2
  44. package/es/control/list/md-ctrl/md-ctrl.d.ts +2 -2
  45. package/es/control/pickup-view-panel/pickup-view-panel.controller.d.ts +2 -0
  46. package/es/control/pickup-view-panel/pickup-view-panel.controller.mjs +3 -0
  47. package/es/control/search-bar/filter-tree/filter-tree.d.ts +2 -2
  48. package/es/control/toolbar/index.d.ts +2 -2
  49. package/es/control/toolbar/popper-toolbar/popper-toolbar.d.ts +1 -1
  50. package/es/control/toolbar/toolbar.d.ts +2 -2
  51. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.d.ts +1 -1
  52. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +144 -26
  53. package/es/editor/data-picker/ibiz-picker/ibiz-picker.d.ts +2 -2
  54. package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.d.ts +2 -2
  55. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.d.ts +2 -2
  56. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -0
  57. package/es/editor/index.mjs +7 -1
  58. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +1 -1
  59. package/es/editor/text-box/index.d.ts +1 -0
  60. package/es/editor/text-box/index.mjs +1 -0
  61. package/es/editor/text-box/signature/signature.css +1 -0
  62. package/es/editor/text-box/signature/signature.d.ts +104 -0
  63. package/es/editor/text-box/signature/signature.mjs +256 -0
  64. package/es/editor/text-box/text-box-editor.provider.mjs +3 -0
  65. package/es/index.mjs +1 -0
  66. package/es/locale/en/index.d.ts +28 -5
  67. package/es/locale/en/index.mjs +14 -0
  68. package/es/locale/zh-CN/index.d.ts +28 -5
  69. package/es/locale/zh-CN/index.mjs +14 -0
  70. package/es/mob-app/App.mjs +17 -1
  71. package/es/mob-app/guard/auth-guard/auth-guard.mjs +95 -2
  72. package/es/mob-app/util/unauthorized-handler/unauthorized-handler.d.ts +13 -5
  73. package/es/mob-app/util/unauthorized-handler/unauthorized-handler.mjs +50 -15
  74. package/es/panel-component/auth-sso/auth-sso.css +1 -1
  75. package/es/panel-component/auth-sso/auth-sso.d.ts +8 -3
  76. package/es/panel-component/auth-sso/auth-sso.mjs +78 -6
  77. package/es/panel-component/auth-sso/index.d.ts +7 -1
  78. package/es/panel-component/user-message/index.d.ts +1 -1
  79. package/es/panel-component/user-message/user-message.d.ts +1 -1
  80. package/es/util/app-util/app-util.d.ts +59 -1
  81. package/es/util/app-util/app-util.mjs +56 -1
  82. package/es/view-engine/login-view.engine.d.ts +2 -2
  83. package/es/view-engine/login-view.engine.mjs +2 -0
  84. package/es/view-engine/mob-data-view-engine.d.ts +2 -2
  85. package/es/view-engine/mob-data-view-engine.mjs +0 -1
  86. package/es/view-engine/mob-edit-view.engine.d.ts +2 -2
  87. package/es/view-engine/mob-edit-view.engine.mjs +5 -1
  88. package/es/view-engine/mob-md-view-engine.d.ts +2 -2
  89. package/es/view-engine/mob-md-view-engine.mjs +0 -1
  90. package/es/view-engine/mob-mpickup-view-engine.d.ts +20 -14
  91. package/es/view-engine/mob-mpickup-view-engine.mjs +34 -26
  92. package/es/view-engine/mob-opt-view.engine.d.ts +2 -2
  93. package/es/view-engine/mob-pickup-md-view.engine.d.ts +2 -2
  94. package/es/view-engine/mob-pickup-md-view.engine.mjs +0 -1
  95. package/es/view-engine/mob-pickup-view.engine.d.ts +9 -2
  96. package/es/view-engine/mob-pickup-view.engine.mjs +15 -1
  97. package/es/view-engine/mob-tab-search-view.engine.d.ts +2 -2
  98. package/es/view-engine/mob-tab-search-view.engine.mjs +0 -1
  99. package/es/view-engine/mob-wf-dyna-action-view.engine.d.ts +2 -2
  100. package/es/view-engine/mob-wf-dyna-action-view.engine.mjs +0 -1
  101. package/es/view-engine/mob-wf-dyna-edit-view.engine.d.ts +2 -2
  102. package/es/view-engine/mob-wf-dyna-edit-view.engine.mjs +0 -1
  103. package/es/view-engine/mob-wf-dyna-start-view.engine.d.ts +2 -2
  104. package/es/view-engine/mob-wf-dyna-start-view.engine.mjs +0 -1
  105. package/lib/common/index.cjs +1 -0
  106. package/lib/control/dashboard/portlet/portlet-part/portlet-part.state.cjs +1 -0
  107. package/lib/control/data-view/data-view.cjs +2 -3
  108. package/lib/control/drbar/drbar.controller.cjs +3 -0
  109. package/lib/control/drtab/drtab.controller.cjs +3 -0
  110. package/lib/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
  111. package/lib/control/pickup-view-panel/pickup-view-panel.controller.cjs +3 -0
  112. package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +144 -26
  113. package/lib/editor/index.cjs +7 -0
  114. package/lib/editor/text-box/index.cjs +2 -0
  115. package/lib/editor/text-box/signature/signature.cjs +258 -0
  116. package/lib/editor/text-box/signature/signature.css +1 -0
  117. package/lib/editor/text-box/text-box-editor.provider.cjs +3 -0
  118. package/lib/index.cjs +2 -0
  119. package/lib/locale/en/index.cjs +14 -0
  120. package/lib/locale/zh-CN/index.cjs +14 -0
  121. package/lib/mob-app/App.cjs +16 -0
  122. package/lib/mob-app/guard/auth-guard/auth-guard.cjs +95 -2
  123. package/lib/mob-app/util/unauthorized-handler/unauthorized-handler.cjs +50 -15
  124. package/lib/panel-component/auth-sso/auth-sso.cjs +77 -5
  125. package/lib/panel-component/auth-sso/auth-sso.css +1 -1
  126. package/lib/util/app-util/app-util.cjs +55 -0
  127. package/lib/view-engine/login-view.engine.cjs +2 -0
  128. package/lib/view-engine/mob-data-view-engine.cjs +0 -1
  129. package/lib/view-engine/mob-edit-view.engine.cjs +5 -1
  130. package/lib/view-engine/mob-md-view-engine.cjs +0 -1
  131. package/lib/view-engine/mob-mpickup-view-engine.cjs +34 -26
  132. package/lib/view-engine/mob-pickup-md-view.engine.cjs +0 -1
  133. package/lib/view-engine/mob-pickup-view.engine.cjs +15 -1
  134. package/lib/view-engine/mob-tab-search-view.engine.cjs +0 -1
  135. package/lib/view-engine/mob-wf-dyna-action-view.engine.cjs +0 -1
  136. package/lib/view-engine/mob-wf-dyna-edit-view.engine.cjs +0 -1
  137. package/lib/view-engine/mob-wf-dyna-start-view.engine.cjs +0 -1
  138. package/package.json +6 -6
  139. package/dist/index-NP0RBfWK.js.map +0 -1
  140. package/dist/index-O-XmMUt3.js.map +0 -1
  141. package/dist/index-komJV5bQ.js +0 -76
  142. package/dist/index-komJV5bQ.js.map +0 -1
@@ -0,0 +1,256 @@
1
+ import { ref, nextTick, watch, createVNode, resolveComponent, defineComponent } from 'vue';
2
+ import { getPlatformType, PlatformType } from '@ibiz-template/runtime';
3
+ import { getInputProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
4
+ import { CoreConst, getAppCookie, base64ToBlob } from '@ibiz-template/core';
5
+ import './signature.css';
6
+
7
+ "use strict";
8
+ const IBizSignature = /* @__PURE__ */ defineComponent({
9
+ name: "IBizSignature",
10
+ props: getInputProps(),
11
+ emits: getEditorEmits(),
12
+ setup(props, {
13
+ emit
14
+ }) {
15
+ const ns = useNamespace("signature");
16
+ const c = props.controller;
17
+ const editorModel = c.model;
18
+ const headers = ref({
19
+ [`${ibiz.env.tokenHeader}Authorization`]: `${ibiz.env.tokenPrefix}Bearer ${getAppCookie(CoreConst.TOKEN)}`
20
+ });
21
+ const uploadUrl = ref("");
22
+ const downloadUrl = ref("");
23
+ const signatureRef = ref();
24
+ const fullScreen = ref(false);
25
+ const currentDataURL = ref("");
26
+ const currentVal = ref("");
27
+ let saveMode = "img";
28
+ let buttons = [{
29
+ label: ibiz.i18n.t("editor.signature.undo"),
30
+ type: "UNDO"
31
+ }, {
32
+ label: ibiz.i18n.t("editor.signature.rewrite"),
33
+ type: "REWRITE"
34
+ }, {
35
+ label: ibiz.i18n.t("editor.signature.confirm"),
36
+ type: "CONFIRM",
37
+ buttonType: "PRIMARY"
38
+ }];
39
+ if (editorModel.editorParams) {
40
+ if (editorModel.editorParams.mode) {
41
+ saveMode = editorModel.editorParams.mode;
42
+ }
43
+ if (editorModel.editorParams.buttons) {
44
+ try {
45
+ buttons = JSON.parse(editorModel.editorParams.buttons);
46
+ } catch (error) {
47
+ ibiz.log.error(error);
48
+ }
49
+ }
50
+ }
51
+ const getSafeDistance = () => {
52
+ switch (getPlatformType()) {
53
+ case PlatformType.ANDROID:
54
+ return "52px";
55
+ case PlatformType.IOS:
56
+ return "82px";
57
+ default:
58
+ return "0px";
59
+ }
60
+ };
61
+ const restCavans = () => {
62
+ var _a;
63
+ (_a = signatureRef.value) == null ? void 0 : _a.updateSignaturePad(() => {
64
+ nextTick(() => {
65
+ var _a2, _b;
66
+ if (currentDataURL.value) {
67
+ (_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.fromDataURL(currentDataURL.value, {
68
+ // 旋转适配横屏
69
+ rotation: 90
70
+ });
71
+ } else {
72
+ (_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
73
+ }
74
+ });
75
+ });
76
+ };
77
+ const handleCurrentVal = async () => {
78
+ var _a, _b;
79
+ if (currentVal.value) {
80
+ ibiz.loading.showRedirect();
81
+ if (saveMode === "img") {
82
+ currentDataURL.value = currentVal.value;
83
+ } else if (downloadUrl.value) {
84
+ const fileData = JSON.parse(currentVal.value)[0];
85
+ const _url = downloadUrl.value.replace("%fileId%", fileData.id);
86
+ try {
87
+ const fileBlob = await ibiz.util.file.requestFile(_url);
88
+ const dataUrl = await ((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.blobToDataURL(fileBlob));
89
+ currentDataURL.value = dataUrl;
90
+ } catch (error) {
91
+ ibiz.log.error(error);
92
+ }
93
+ }
94
+ (_b = signatureRef.value) == null ? void 0 : _b.signaturePad.loadImage(currentDataURL.value, () => {
95
+ ibiz.loading.hideRedirect();
96
+ });
97
+ }
98
+ };
99
+ watch(() => props.data, (newVal) => {
100
+ if (newVal) {
101
+ const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
102
+ uploadUrl.value = urls.uploadUrl;
103
+ downloadUrl.value = urls.downloadUrl;
104
+ }
105
+ }, {
106
+ immediate: true,
107
+ deep: true
108
+ });
109
+ watch(() => props.value, async (newVal, oldVal) => {
110
+ if (newVal !== oldVal) {
111
+ if (!newVal) {
112
+ currentVal.value = "";
113
+ } else {
114
+ currentVal.value = newVal;
115
+ }
116
+ await handleCurrentVal();
117
+ }
118
+ }, {
119
+ immediate: true
120
+ });
121
+ const handleEmit = (_value) => {
122
+ emit("change", _value);
123
+ };
124
+ const handleUpload = async (dataURL) => {
125
+ const blob = base64ToBlob(dataURL);
126
+ const file = await ibiz.util.file.fileUpload(uploadUrl.value, blob, headers.value);
127
+ return file;
128
+ };
129
+ const handleModalClick = () => {
130
+ fullScreen.value = true;
131
+ restCavans();
132
+ };
133
+ const handleRemove = (_evt) => {
134
+ var _a;
135
+ _evt.stopPropagation();
136
+ (_a = signatureRef.value) == null ? void 0 : _a.signaturePad.clear();
137
+ currentDataURL.value = "";
138
+ handleEmit("");
139
+ };
140
+ const handlePadContainerClick = () => {
141
+ if (props.disabled || props.readonly)
142
+ fullScreen.value = false;
143
+ };
144
+ const handleFileChange = async (dataURL) => {
145
+ const file = await handleUpload(dataURL);
146
+ handleEmit(JSON.stringify([{
147
+ name: file.name,
148
+ id: file.id
149
+ }]));
150
+ };
151
+ const handleConfirm = () => {
152
+ var _a, _b, _c;
153
+ fullScreen.value = false;
154
+ if (((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.isEmpty()) || !((_b = signatureRef.value) == null ? void 0 : _b.signaturePad.isRedrawn()))
155
+ return;
156
+ const dataURL = (_c = signatureRef.value) == null ? void 0 : _c.signaturePad.toDataURL(void 0, {
157
+ // 旋转为述评适配预览
158
+ rotation: -90
159
+ });
160
+ currentDataURL.value = dataURL;
161
+ switch (saveMode) {
162
+ case "file":
163
+ handleFileChange(dataURL);
164
+ break;
165
+ case "img":
166
+ default:
167
+ handleEmit(dataURL);
168
+ break;
169
+ }
170
+ };
171
+ const handleButtonClick = (_type) => {
172
+ var _a, _b;
173
+ switch (_type) {
174
+ case "UNDO":
175
+ (_a = signatureRef.value) == null ? void 0 : _a.signaturePad.undoLastStep();
176
+ break;
177
+ case "REWRITE":
178
+ (_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
179
+ break;
180
+ case "CONFIRM":
181
+ handleConfirm();
182
+ break;
183
+ default:
184
+ break;
185
+ }
186
+ };
187
+ return {
188
+ c,
189
+ ns,
190
+ signatureRef,
191
+ fullScreen,
192
+ currentDataURL,
193
+ buttons,
194
+ getSafeDistance,
195
+ handleModalClick,
196
+ handleConfirm,
197
+ handleRemove,
198
+ handlePadContainerClick,
199
+ handleButtonClick
200
+ };
201
+ },
202
+ render() {
203
+ return createVNode("div", {
204
+ "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
205
+ }, [createVNode("div", {
206
+ "class": this.ns.e("modal"),
207
+ "onClick": this.handleModalClick
208
+ }, [createVNode("div", {
209
+ "class": this.ns.em("modal", "background")
210
+ }, null), createVNode("div", {
211
+ "class": this.ns.em("modal", "toolbar")
212
+ }, [this.currentDataURL && createVNode(resolveComponent("van-button"), {
213
+ "round": true,
214
+ "disabled": this.disabled,
215
+ "icon": "cross",
216
+ "type": "primary",
217
+ "onClick": this.handleRemove
218
+ }, null)]), !this.currentDataURL && createVNode("span", {
219
+ "class": this.ns.em("modal", "caption")
220
+ }, [ibiz.i18n.t("editor.signature.addSignature")])]), createVNode("div", {
221
+ "class": this.ns.e("content"),
222
+ "style": {
223
+ backgroundImage: `url(${this.currentDataURL})`
224
+ }
225
+ }, null), createVNode("div", {
226
+ "class": [this.ns.b("overlay"), this.ns.is("full-screen", this.fullScreen), this.ns.is("disabled", this.disabled), this.ns.is("readonly", this.readonly)],
227
+ "style": {
228
+ [this.ns.cssVarBlockName("overlay-padding-bottom")]: this.getSafeDistance()
229
+ },
230
+ "onClick": this.handlePadContainerClick
231
+ }, [createVNode("div", {
232
+ "class": this.ns.be("overlay", "container")
233
+ }, [createVNode("div", {
234
+ "class": this.ns.be("overlay", "header")
235
+ }, [ibiz.i18n.t("editor.signature.signaturePrompt")]), createVNode(resolveComponent("iBizSignaturePad"), {
236
+ "ref": "signatureRef",
237
+ "class": this.ns.be("overlay", "pad"),
238
+ "options": {
239
+ ...this.c.model.editorParams,
240
+ ...this.$attrs
241
+ }
242
+ }, null), createVNode("div", {
243
+ "class": this.ns.be("overlay", "footer")
244
+ }, [this.buttons.map((_btn) => {
245
+ return createVNode(resolveComponent("van-button"), {
246
+ "disabled": this.disabled,
247
+ "type": _btn.buttonType && _btn.buttonType.toLowerCase() || "default",
248
+ "onClick": () => this.handleButtonClick(_btn.type)
249
+ }, {
250
+ default: () => [_btn.label]
251
+ });
252
+ })])])])]);
253
+ }
254
+ });
255
+
256
+ export { IBizSignature };
@@ -14,6 +14,9 @@ class TextBoxEditorProvider {
14
14
  if (editorType === "NUMBER") {
15
15
  this.formEditor = "IBizInputNumber";
16
16
  this.gridEditor = "IBizInputNumber";
17
+ } else if (editorType === "SIGNATURE") {
18
+ this.formEditor = "IBizSignature";
19
+ this.gridEditor = "IBizSignature";
17
20
  }
18
21
  }
19
22
  async createController(editorModel, parentController) {
package/es/index.mjs CHANGED
@@ -137,6 +137,7 @@ export { SwitchEditorController } from './editor/switch/switch-editor.controller
137
137
  export { SwitchEditorProvider } from './editor/switch/switch-editor.provider.mjs';
138
138
  export { IBizInput } from './editor/text-box/input/input.mjs';
139
139
  export { IBizInputNumber } from './editor/text-box/ibiz-input-number/ibiz-input-number.mjs';
140
+ export { IBizSignature } from './editor/text-box/signature/signature.mjs';
140
141
  export { TextBoxEditorController } from './editor/text-box/text-box-editor.controller.mjs';
141
142
  export { TextBoxEditorProvider } from './editor/text-box/text-box-editor.provider.mjs';
142
143
  export { IBizFileUpload } from './editor/upload/ibiz-file-upload/ibiz-file-upload.mjs';
@@ -43,6 +43,7 @@ declare const _default: {
43
43
  onFoundCorrespondingPart: string;
44
44
  noFoundViewModel: string;
45
45
  noSupportLoadingDynamic: string;
46
+ invalidPointCoordinates: string;
46
47
  };
47
48
  control: {
48
49
  unsupportedPanel: string;
@@ -136,6 +137,13 @@ declare const _default: {
136
137
  changeGroupError: string;
137
138
  computeMoveMetaError: string;
138
139
  unclassified: string;
140
+ today: string;
141
+ adjustmentsGroup: string;
142
+ noAllowReorder: string;
143
+ sortingProperties: string;
144
+ invalidSortType: string;
145
+ logicOpendata: string;
146
+ logicNewdata: string;
139
147
  };
140
148
  editor: {
141
149
  editorNoConfigured: string;
@@ -157,7 +165,6 @@ declare const _default: {
157
165
  noConfigured: string;
158
166
  };
159
167
  calendar: {
160
- missingViewLogic: string;
161
168
  noFoundModel: string;
162
169
  };
163
170
  chart: {
@@ -172,6 +179,10 @@ declare const _default: {
172
179
  classificationNotArray: string;
173
180
  classificationNotString: string;
174
181
  errorJson: string;
182
+ value: string;
183
+ percent: string;
184
+ serieGroup: string;
185
+ catalogField: string;
175
186
  };
176
187
  dataView: {
177
188
  noBehaviourGroup: string;
@@ -239,12 +250,8 @@ declare const _default: {
239
250
  interfaceBehavior: string;
240
251
  };
241
252
  kanban: {
242
- sortingProperties: string;
243
253
  sortDirection: string;
244
254
  groupedOn: string;
245
- adjustmentsGroup: string;
246
- noAllowReorder: string;
247
- invalidSortType: string;
248
255
  };
249
256
  meditViewPanel: {
250
257
  DraftNew: string;
@@ -597,6 +604,7 @@ declare const _default: {
597
604
  withdrawalConfirmed: string;
598
605
  noFoundBehaviorModel: string;
599
606
  noEnableAI: string;
607
+ exportWithNoDataSet: string;
600
608
  };
601
609
  uiLogic: {
602
610
  interfaceConnectionConditional: string;
@@ -682,6 +690,7 @@ declare const _default: {
682
690
  };
683
691
  fileUtil: {
684
692
  fileUploadFailed: string;
693
+ getDownloadTicketFailed: string;
685
694
  };
686
695
  handlebars: {
687
696
  noInitHandlebars: string;
@@ -800,6 +809,16 @@ declare const _default: {
800
809
  formItemContainer: {
801
810
  more: string;
802
811
  };
812
+ mpicker: {
813
+ simpleErr: string;
814
+ };
815
+ signature: {
816
+ undo: string;
817
+ rewrite: string;
818
+ confirm: string;
819
+ addSignature: string;
820
+ signaturePrompt: string;
821
+ };
803
822
  };
804
823
  control: {
805
824
  common: {
@@ -941,6 +960,10 @@ declare const _default: {
941
960
  switchLanguagePrompt: string;
942
961
  };
943
962
  mobApp: {
963
+ authGuard: {
964
+ loginFailed: string;
965
+ noPermission: string;
966
+ };
944
967
  unauthorizedHandler: {
945
968
  noFoundEnvParams: string;
946
969
  prohibitAccessPrompt: string;
@@ -64,6 +64,16 @@ var index = {
64
64
  },
65
65
  formItemContainer: {
66
66
  more: "More"
67
+ },
68
+ mpicker: {
69
+ simpleErr: "The value of the SIMPLE type address bar {props.value} does not meet the requirements of a JSON string"
70
+ },
71
+ signature: {
72
+ undo: "Undo",
73
+ rewrite: "Rewrite",
74
+ confirm: "Confirm",
75
+ addSignature: "Click here to add signature",
76
+ signaturePrompt: "Please write horizontally in the blank area"
67
77
  }
68
78
  },
69
79
  // 部件
@@ -207,6 +217,10 @@ var index = {
207
217
  switchLanguagePrompt: "Switching languages requires refreshing the page, are you sure to switch?"
208
218
  },
209
219
  mobApp: {
220
+ authGuard: {
221
+ loginFailed: "Anonymous user login failed",
222
+ noPermission: "No permission to access!"
223
+ },
210
224
  unauthorizedHandler: {
211
225
  noFoundEnvParams: "Unable to find environment parameter casLoginUrl",
212
226
  prohibitAccessPrompt: "Access to the current account is prohibited",
@@ -43,6 +43,7 @@ declare const _default: {
43
43
  onFoundCorrespondingPart: string;
44
44
  noFoundViewModel: string;
45
45
  noSupportLoadingDynamic: string;
46
+ invalidPointCoordinates: string;
46
47
  };
47
48
  control: {
48
49
  unsupportedPanel: string;
@@ -136,6 +137,13 @@ declare const _default: {
136
137
  changeGroupError: string;
137
138
  computeMoveMetaError: string;
138
139
  unclassified: string;
140
+ today: string;
141
+ adjustmentsGroup: string;
142
+ noAllowReorder: string;
143
+ sortingProperties: string;
144
+ invalidSortType: string;
145
+ logicOpendata: string;
146
+ logicNewdata: string;
139
147
  };
140
148
  editor: {
141
149
  editorNoConfigured: string;
@@ -157,7 +165,6 @@ declare const _default: {
157
165
  noConfigured: string;
158
166
  };
159
167
  calendar: {
160
- missingViewLogic: string;
161
168
  noFoundModel: string;
162
169
  };
163
170
  chart: {
@@ -172,6 +179,10 @@ declare const _default: {
172
179
  classificationNotArray: string;
173
180
  classificationNotString: string;
174
181
  errorJson: string;
182
+ value: string;
183
+ percent: string;
184
+ serieGroup: string;
185
+ catalogField: string;
175
186
  };
176
187
  dataView: {
177
188
  noBehaviourGroup: string;
@@ -239,12 +250,8 @@ declare const _default: {
239
250
  interfaceBehavior: string;
240
251
  };
241
252
  kanban: {
242
- sortingProperties: string;
243
253
  sortDirection: string;
244
254
  groupedOn: string;
245
- adjustmentsGroup: string;
246
- noAllowReorder: string;
247
- invalidSortType: string;
248
255
  };
249
256
  meditViewPanel: {
250
257
  DraftNew: string;
@@ -596,6 +603,7 @@ declare const _default: {
596
603
  withdrawalConfirmed: string;
597
604
  noFoundBehaviorModel: string;
598
605
  noEnableAI: string;
606
+ exportWithNoDataSet: string;
599
607
  };
600
608
  uiLogic: {
601
609
  interfaceConnectionConditional: string;
@@ -681,6 +689,7 @@ declare const _default: {
681
689
  };
682
690
  fileUtil: {
683
691
  fileUploadFailed: string;
692
+ getDownloadTicketFailed: string;
684
693
  };
685
694
  handlebars: {
686
695
  noInitHandlebars: string;
@@ -934,12 +943,26 @@ declare const _default: {
934
943
  dateRangePicker: {
935
944
  selectRange: string;
936
945
  };
946
+ mpicker: {
947
+ simpleErr: string;
948
+ };
949
+ signature: {
950
+ undo: string;
951
+ rewrite: string;
952
+ confirm: string;
953
+ addSignature: string;
954
+ signaturePrompt: string;
955
+ };
937
956
  };
938
957
  locale: {
939
958
  prompt: string;
940
959
  switchLanguagePrompt: string;
941
960
  };
942
961
  mobApp: {
962
+ authGuard: {
963
+ loginFailed: string;
964
+ noPermission: string;
965
+ };
943
966
  unauthorizedHandler: {
944
967
  noFoundEnvParams: string;
945
968
  prohibitAccessPrompt: string;
@@ -199,6 +199,16 @@ var index = {
199
199
  },
200
200
  dateRangePicker: {
201
201
  selectRange: "\u8BF7\u9009\u62E9\u65E5\u671F\u8303\u56F4"
202
+ },
203
+ mpicker: {
204
+ simpleErr: "SIMPLE\u7C7B\u578B\u5730\u5740\u680F\u503C\u683C\u5F0F{props.value}\u4E0D\u7B26\u5408JSON\u5B57\u7B26\u4E32\u8981\u6C42"
205
+ },
206
+ signature: {
207
+ undo: "\u64A4\u9500",
208
+ rewrite: "\u91CD\u5199",
209
+ confirm: "\u786E\u8BA4",
210
+ addSignature: "\u70B9\u51FB\u6B64\u5904\u6DFB\u52A0\u7B7E\u540D",
211
+ signaturePrompt: "\u8BF7\u5728\u7A7A\u767D\u533A\u57DF\u5185\u6A2A\u5411\u4E66\u5199"
202
212
  }
203
213
  },
204
214
  // 多语言
@@ -207,6 +217,10 @@ var index = {
207
217
  switchLanguagePrompt: "\u5207\u6362\u8BED\u8A00\u9700\u8981\u5237\u65B0\u9875\u9762\uFF0C\u786E\u8BA4\u5207\u6362?"
208
218
  },
209
219
  mobApp: {
220
+ authGuard: {
221
+ loginFailed: "\u533F\u540D\u7528\u6237\u767B\u5F55\u5931\u8D25",
222
+ noPermission: "\u65E0\u6743\u9650\u8BBF\u95EE\uFF01"
223
+ },
210
224
  unauthorizedHandler: {
211
225
  noFoundEnvParams: "\u627E\u4E0D\u5230\u73AF\u5883\u53C2\u6570casLoginUrl",
212
226
  prohibitAccessPrompt: "\u5F53\u524D\u8D26\u6237\u88AB\u7981\u6B62\u8BBF\u95EE",
@@ -1,4 +1,4 @@
1
- import { ref, onUnmounted, resolveComponent, createVNode, defineComponent } from 'vue';
1
+ import { ref, onUnmounted, onMounted, onBeforeUnmount, resolveComponent, createVNode, defineComponent } from 'vue';
2
2
  import { AppHooks, routerCallback } from '@ibiz-template/vue3-util';
3
3
  import { ViewMode, Modal } from '@ibiz-template/runtime';
4
4
  import '../util/index.mjs';
@@ -40,6 +40,22 @@ var App = /* @__PURE__ */ defineComponent({
40
40
  }
41
41
  return viewModals.get(key);
42
42
  };
43
+ let watermarkDestroy;
44
+ onMounted(() => {
45
+ AppHooks.initedApp.tapPromise(async ({
46
+ context
47
+ }) => {
48
+ var _a;
49
+ watermarkDestroy == null ? void 0 : watermarkDestroy();
50
+ watermarkDestroy = ibiz.util.watermark.mount(ibiz.config.watermark, void 0, {
51
+ ...context,
52
+ ...(_a = ibiz.appData) == null ? void 0 : _a.context
53
+ });
54
+ });
55
+ });
56
+ onBeforeUnmount(() => {
57
+ watermarkDestroy == null ? void 0 : watermarkDestroy();
58
+ });
43
59
  return {
44
60
  viewStack,
45
61
  getViewModal,
@@ -1,3 +1,4 @@
1
+ import { HttpError, CoreConst, getAppCookie } from '@ibiz-template/core';
1
2
  import { ModelHelper } from '@ibiz-template/model-helper';
2
3
  import { mergeDeepRight } from 'ramda';
3
4
  import { AppHooks } from '@ibiz-template/vue3-util';
@@ -135,18 +136,110 @@ async function appInit(context) {
135
136
  await ibiz.auth.extendLogin(context);
136
137
  await ibiz.hub.notice.init();
137
138
  }
139
+ function throw401() {
140
+ throw new HttpError({
141
+ response: {
142
+ status: 401,
143
+ statusText: ibiz.i18n.t("mobApp.authGuard.noPermission")
144
+ }
145
+ });
146
+ }
147
+ async function anonymousValidate(context) {
148
+ const authInfo = ibiz.auth.getAuthInfo();
149
+ if (authInfo && !authInfo.isAnonymous) {
150
+ try {
151
+ await appInit(context);
152
+ return;
153
+ } catch (error) {
154
+ const { status } = error;
155
+ if (status === 401) {
156
+ const refreshToken = getAppCookie(CoreConst.REFRESH_TOKEN);
157
+ if (refreshToken) {
158
+ await ibiz.auth.refreshToken();
159
+ await appInit(context);
160
+ return;
161
+ }
162
+ ibiz.auth.clearAuthData();
163
+ } else {
164
+ throw error;
165
+ }
166
+ }
167
+ }
168
+ if (authInfo == null ? void 0 : authInfo.token) {
169
+ try {
170
+ await appInit(context);
171
+ } catch (error) {
172
+ const { status } = error;
173
+ if (status === 401) {
174
+ const loginResult = await ibiz.auth.anonymousLogin();
175
+ if (!loginResult) {
176
+ throw401();
177
+ return;
178
+ }
179
+ await appInit(context);
180
+ } else {
181
+ throw error;
182
+ }
183
+ }
184
+ }
185
+ if (!authInfo || !authInfo.token) {
186
+ const loginResult = await ibiz.auth.anonymousLogin();
187
+ if (!loginResult) {
188
+ throw401();
189
+ return;
190
+ }
191
+ await appInit(context);
192
+ }
193
+ const urlPaths = window.location.hash.split("/");
194
+ const viewName = urlPaths[urlPaths.length - 2];
195
+ let viewModel;
196
+ try {
197
+ if (viewName === "#" && ibiz.hub.defaultPage) {
198
+ viewModel = await ibiz.hub.getAppView(ibiz.hub.defaultPage.id);
199
+ } else {
200
+ viewModel = await ibiz.hub.getAppView(viewName);
201
+ }
202
+ } catch (error) {
203
+ ibiz.log.error(error);
204
+ }
205
+ if (!viewModel) {
206
+ ibiz.log.error(
207
+ `\u627E\u4E0D\u5230\u89C6\u56FE\u6A21\u578B${viewName},\u8BF7\u786E\u4FDD\u8BE5\u89C6\u56FE\u914D\u7F6E\u4E86\u533F\u540D\u8BBF\u95EE\u548C\u7528\u6237\u5F15\u7528`
208
+ );
209
+ throw401();
210
+ return;
211
+ }
212
+ if (viewModel.accUserMode !== 3) {
213
+ throw401();
214
+ }
215
+ }
138
216
  async function AuthGuard(appContext, permission = true) {
139
217
  if (permission) {
140
218
  let result = true;
141
219
  try {
142
- await appInit(appContext);
220
+ if (ibiz.env.enableAnonymous) {
221
+ await anonymousValidate(appContext);
222
+ } else {
223
+ await appInit(appContext);
224
+ }
143
225
  } catch (error) {
144
226
  result = false;
227
+ error.tag = "APPINIT";
145
228
  ibiz.util.error.handle(error);
146
229
  }
147
230
  return result;
148
231
  }
149
- await initModel(appContext, false);
232
+ if (ibiz.env.enableAnonymous) {
233
+ try {
234
+ await anonymousValidate(appContext);
235
+ } catch (error) {
236
+ error.tag = "APPINIT";
237
+ ibiz.util.error.handle(error);
238
+ return false;
239
+ }
240
+ } else {
241
+ await initModel(appContext, false);
242
+ }
150
243
  return true;
151
244
  }
152
245