@ibiz-template/mob-vue3-components 0.7.41-alpha.7 → 0.7.41-alpha.8
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.
- package/dist/{index-O-XmMUt3.js → index-JSf84k9b.js} +2 -2
- package/dist/index-JSf84k9b.js.map +1 -0
- package/dist/{index-NP0RBfWK.js → index-OsiEgFnw.js} +2 -2
- package/dist/index-OsiEgFnw.js.map +1 -0
- package/dist/index-xh-oAbbH.js +76 -0
- package/dist/index-xh-oAbbH.js.map +1 -0
- package/dist/index.min.css +4 -4
- package/dist/index.system.min.js +1 -1
- package/dist/{quill-editor-BMC0diFC.js → quill-editor-8Y2QTf1T.js} +2 -2
- package/dist/{quill-editor-BMC0diFC.js.map → quill-editor-8Y2QTf1T.js.map} +1 -1
- package/dist/{quill-editor-preview-Dui7L0ne.js → quill-editor-preview-Afg5ZCWy.js} +2 -2
- package/dist/{quill-editor-preview-Dui7L0ne.js.map → quill-editor-preview-Afg5ZCWy.js.map} +1 -1
- package/dist/{quill-O7hIDmrl.js → quill-sc_3kAlj.js} +2 -2
- package/dist/{quill-O7hIDmrl.js.map → quill-sc_3kAlj.js.map} +1 -1
- package/es/_virtual/index12.mjs +2 -2
- package/es/_virtual/index13.mjs +2 -2
- package/es/_virtual/index17.mjs +2 -2
- package/es/_virtual/index18.mjs +2 -2
- package/es/common/button-list/button-list.d.ts +1 -0
- package/es/common/date-range-picker/components/range-picker/range-picker.d.ts +1 -1
- package/es/common/date-range-picker/date-range-picker.d.ts +2 -2
- package/es/common/emoji-select/components/emoji-list/emoji-list.d.ts +1 -1
- package/es/common/emoji-select/icons/search.d.ts +1 -0
- package/es/common/index.mjs +2 -1
- package/es/common/md-ctrl-setting/md-ctrl-setting.d.ts +3 -3
- package/es/control/app-menu/custom-menu-design/custom-menu-design.d.ts +1 -1
- package/es/control/dashboard/portlet/portlet-part/portlet-part.state.d.ts +1 -0
- package/es/control/dashboard/portlet/portlet-part/portlet-part.state.mjs +1 -0
- package/es/control/data-view/data-view.d.ts +2 -2
- package/es/control/data-view/data-view.mjs +2 -3
- package/es/control/data-view/index.d.ts +2 -2
- package/es/control/drbar/drbar.controller.d.ts +1 -0
- package/es/control/drbar/drbar.controller.mjs +3 -0
- package/es/control/drbar/drbar.d.ts +2 -2
- package/es/control/drbar/index.d.ts +2 -2
- package/es/control/drtab/drtab.controller.d.ts +1 -0
- package/es/control/drtab/drtab.controller.mjs +3 -0
- package/es/control/drtab/drtab.d.ts +2 -2
- package/es/control/drtab/index.d.ts +2 -2
- package/es/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
- package/es/control/form/form-detail/form-item/form-item-container/form-item-container.d.ts +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.d.ts +1 -1
- package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.d.ts +3 -3
- package/es/control/list/list/index.d.ts +2 -2
- package/es/control/list/list/list.d.ts +2 -2
- package/es/control/list/list-render-util.d.ts +1 -0
- package/es/control/list/md-ctrl/index.d.ts +2 -2
- package/es/control/list/md-ctrl/md-ctrl.d.ts +2 -2
- package/es/control/pickup-view-panel/pickup-view-panel.controller.d.ts +2 -0
- package/es/control/pickup-view-panel/pickup-view-panel.controller.mjs +3 -0
- package/es/control/search-bar/filter-tree/filter-tree.d.ts +2 -2
- package/es/control/toolbar/index.d.ts +2 -2
- package/es/control/toolbar/popper-toolbar/popper-toolbar.d.ts +1 -1
- package/es/control/toolbar/toolbar.d.ts +2 -2
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.d.ts +1 -1
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +144 -26
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.d.ts +2 -2
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.d.ts +2 -2
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.d.ts +2 -2
- package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -0
- package/es/editor/index.mjs +7 -1
- package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +1 -1
- package/es/editor/text-box/index.d.ts +1 -0
- package/es/editor/text-box/index.mjs +1 -0
- package/es/editor/text-box/signature/signature.css +1 -0
- package/es/editor/text-box/signature/signature.d.ts +104 -0
- package/es/editor/text-box/signature/signature.mjs +256 -0
- package/es/editor/text-box/text-box-editor.provider.mjs +3 -0
- package/es/index.mjs +1 -0
- package/es/locale/en/index.d.ts +28 -5
- package/es/locale/en/index.mjs +14 -0
- package/es/locale/zh-CN/index.d.ts +28 -5
- package/es/locale/zh-CN/index.mjs +14 -0
- package/es/mob-app/App.mjs +17 -1
- package/es/mob-app/guard/auth-guard/auth-guard.mjs +83 -1
- package/es/mob-app/util/unauthorized-handler/unauthorized-handler.d.ts +13 -5
- package/es/mob-app/util/unauthorized-handler/unauthorized-handler.mjs +47 -15
- package/es/node_modules/.pnpm/dingtalk-jsapi@3.0.38/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.mjs +1 -1
- package/es/node_modules/.pnpm/dingtalk-jsapi@3.0.38/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.mjs +1 -1
- package/es/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.mjs +1 -1
- package/es/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.mjs +1 -1
- package/es/panel-component/auth-sso/auth-sso.css +1 -1
- package/es/panel-component/auth-sso/auth-sso.d.ts +8 -3
- package/es/panel-component/auth-sso/auth-sso.mjs +78 -6
- package/es/panel-component/auth-sso/index.d.ts +7 -1
- package/es/panel-component/user-message/index.d.ts +1 -1
- package/es/panel-component/user-message/user-message.d.ts +1 -1
- package/es/util/app-util/app-util.d.ts +59 -1
- package/es/util/app-util/app-util.mjs +56 -1
- package/es/view-engine/login-view.engine.d.ts +2 -2
- package/es/view-engine/login-view.engine.mjs +2 -0
- package/es/view-engine/mob-data-view-engine.d.ts +2 -2
- package/es/view-engine/mob-data-view-engine.mjs +0 -1
- package/es/view-engine/mob-edit-view.engine.d.ts +2 -2
- package/es/view-engine/mob-edit-view.engine.mjs +5 -1
- package/es/view-engine/mob-md-view-engine.d.ts +2 -2
- package/es/view-engine/mob-md-view-engine.mjs +0 -1
- package/es/view-engine/mob-mpickup-view-engine.d.ts +20 -14
- package/es/view-engine/mob-mpickup-view-engine.mjs +34 -26
- package/es/view-engine/mob-opt-view.engine.d.ts +2 -2
- package/es/view-engine/mob-pickup-md-view.engine.d.ts +2 -2
- package/es/view-engine/mob-pickup-md-view.engine.mjs +0 -1
- package/es/view-engine/mob-pickup-view.engine.d.ts +9 -2
- package/es/view-engine/mob-pickup-view.engine.mjs +15 -1
- package/es/view-engine/mob-tab-search-view.engine.d.ts +2 -2
- package/es/view-engine/mob-tab-search-view.engine.mjs +0 -1
- package/es/view-engine/mob-wf-dyna-action-view.engine.d.ts +2 -2
- package/es/view-engine/mob-wf-dyna-action-view.engine.mjs +0 -1
- package/es/view-engine/mob-wf-dyna-edit-view.engine.d.ts +2 -2
- package/es/view-engine/mob-wf-dyna-edit-view.engine.mjs +0 -1
- package/es/view-engine/mob-wf-dyna-start-view.engine.d.ts +2 -2
- package/es/view-engine/mob-wf-dyna-start-view.engine.mjs +0 -1
- package/lib/_virtual/index12.cjs +2 -2
- package/lib/_virtual/index13.cjs +2 -2
- package/lib/_virtual/index17.cjs +2 -2
- package/lib/_virtual/index18.cjs +2 -2
- package/lib/common/index.cjs +1 -0
- package/lib/control/dashboard/portlet/portlet-part/portlet-part.state.cjs +1 -0
- package/lib/control/data-view/data-view.cjs +2 -3
- package/lib/control/drbar/drbar.controller.cjs +3 -0
- package/lib/control/drtab/drtab.controller.cjs +3 -0
- package/lib/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
- package/lib/control/pickup-view-panel/pickup-view-panel.controller.cjs +3 -0
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +144 -26
- package/lib/editor/index.cjs +7 -0
- package/lib/editor/text-box/index.cjs +2 -0
- package/lib/editor/text-box/signature/signature.cjs +258 -0
- package/lib/editor/text-box/signature/signature.css +1 -0
- package/lib/editor/text-box/text-box-editor.provider.cjs +3 -0
- package/lib/index.cjs +2 -0
- package/lib/locale/en/index.cjs +14 -0
- package/lib/locale/zh-CN/index.cjs +14 -0
- package/lib/mob-app/App.cjs +16 -0
- package/lib/mob-app/guard/auth-guard/auth-guard.cjs +83 -1
- package/lib/mob-app/util/unauthorized-handler/unauthorized-handler.cjs +47 -15
- package/lib/node_modules/.pnpm/dingtalk-jsapi@3.0.38/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.cjs +1 -1
- package/lib/node_modules/.pnpm/dingtalk-jsapi@3.0.38/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.cjs +1 -1
- package/lib/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.cjs +1 -1
- package/lib/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.cjs +1 -1
- package/lib/panel-component/auth-sso/auth-sso.cjs +77 -5
- package/lib/panel-component/auth-sso/auth-sso.css +1 -1
- package/lib/util/app-util/app-util.cjs +55 -0
- package/lib/view-engine/login-view.engine.cjs +2 -0
- package/lib/view-engine/mob-data-view-engine.cjs +0 -1
- package/lib/view-engine/mob-edit-view.engine.cjs +5 -1
- package/lib/view-engine/mob-md-view-engine.cjs +0 -1
- package/lib/view-engine/mob-mpickup-view-engine.cjs +34 -26
- package/lib/view-engine/mob-pickup-md-view.engine.cjs +0 -1
- package/lib/view-engine/mob-pickup-view.engine.cjs +15 -1
- package/lib/view-engine/mob-tab-search-view.engine.cjs +0 -1
- package/lib/view-engine/mob-wf-dyna-action-view.engine.cjs +0 -1
- package/lib/view-engine/mob-wf-dyna-edit-view.engine.cjs +0 -1
- package/lib/view-engine/mob-wf-dyna-start-view.engine.cjs +0 -1
- package/package.json +6 -6
- package/dist/index-NP0RBfWK.js.map +0 -1
- package/dist/index-O-XmMUt3.js.map +0 -1
- package/dist/index-komJV5bQ.js +0 -76
- package/dist/index-komJV5bQ.js.map +0 -1
package/lib/editor/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ require('./check-box/index.cjs');
|
|
|
30
30
|
require('./common/index.cjs');
|
|
31
31
|
var input = require('./text-box/input/input.cjs');
|
|
32
32
|
var ibizInputNumber = require('./text-box/ibiz-input-number/ibiz-input-number.cjs');
|
|
33
|
+
var signature = require('./text-box/signature/signature.cjs');
|
|
33
34
|
var span = require('./span/span/span.cjs');
|
|
34
35
|
var ibizSwitch = require('./switch/ibiz-switch/ibiz-switch.cjs');
|
|
35
36
|
var ibizRadio = require('./radio-button-list/ibiz-radio/ibiz-radio.cjs');
|
|
@@ -105,6 +106,7 @@ const IBizEditor = {
|
|
|
105
106
|
v.component(notSupportedEditor.NotSupportedEditor.name, notSupportedEditor.NotSupportedEditor);
|
|
106
107
|
v.component(input.IBizInput.name, input.IBizInput);
|
|
107
108
|
v.component(ibizInputNumber.IBizInputNumber.name, ibizInputNumber.IBizInputNumber);
|
|
109
|
+
v.component(signature.IBizSignature.name, signature.IBizSignature);
|
|
108
110
|
v.component(span.IBizSpan.name, span.IBizSpan);
|
|
109
111
|
v.component(ibizSwitch.IBizSwitch.name, ibizSwitch.IBizSwitch);
|
|
110
112
|
v.component(ibizRadio.IBizRadio.name, ibizRadio.IBizRadio);
|
|
@@ -163,6 +165,10 @@ const IBizEditor = {
|
|
|
163
165
|
runtime.registerEditorProvider("PASSWORD", () => textBoxEditorProvider);
|
|
164
166
|
runtime.registerEditorProvider("TEXTAREA", () => textBoxEditorProvider);
|
|
165
167
|
runtime.registerEditorProvider("NUMBER", () => new textBoxEditor_provider.TextBoxEditorProvider("NUMBER"));
|
|
168
|
+
runtime.registerEditorProvider(
|
|
169
|
+
"MOBTEXT_SIGNATURE",
|
|
170
|
+
() => new textBoxEditor_provider.TextBoxEditorProvider("SIGNATURE")
|
|
171
|
+
);
|
|
166
172
|
runtime.registerEditorProvider(
|
|
167
173
|
"MOBDROPDOWNLIST",
|
|
168
174
|
() => new dropdownListEditor_provider.DropDownListEditorProvider()
|
|
@@ -384,6 +390,7 @@ const IBizEditor = {
|
|
|
384
390
|
|
|
385
391
|
exports.IBizInput = input.IBizInput;
|
|
386
392
|
exports.IBizInputNumber = ibizInputNumber.IBizInputNumber;
|
|
393
|
+
exports.IBizSignature = signature.IBizSignature;
|
|
387
394
|
exports.IBizSpan = span.IBizSpan;
|
|
388
395
|
exports.IBizSwitch = ibizSwitch.IBizSwitch;
|
|
389
396
|
exports.IBizRadio = ibizRadio.IBizRadio;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var input = require('./input/input.cjs');
|
|
4
4
|
var ibizInputNumber = require('./ibiz-input-number/ibiz-input-number.cjs');
|
|
5
|
+
var signature = require('./signature/signature.cjs');
|
|
5
6
|
var textBoxEditor_controller = require('./text-box-editor.controller.cjs');
|
|
6
7
|
var textBoxEditor_provider = require('./text-box-editor.provider.cjs');
|
|
7
8
|
|
|
@@ -9,5 +10,6 @@ var textBoxEditor_provider = require('./text-box-editor.provider.cjs');
|
|
|
9
10
|
|
|
10
11
|
exports.IBizInput = input.IBizInput;
|
|
11
12
|
exports.IBizInputNumber = ibizInputNumber.IBizInputNumber;
|
|
13
|
+
exports.IBizSignature = signature.IBizSignature;
|
|
12
14
|
exports.TextBoxEditorController = textBoxEditor_controller.TextBoxEditorController;
|
|
13
15
|
exports.TextBoxEditorProvider = textBoxEditor_provider.TextBoxEditorProvider;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
+
var core = require('@ibiz-template/core');
|
|
7
|
+
require('./signature.css');
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizSignature = /* @__PURE__ */ vue.defineComponent({
|
|
11
|
+
name: "IBizSignature",
|
|
12
|
+
props: vue3Util.getInputProps(),
|
|
13
|
+
emits: vue3Util.getEditorEmits(),
|
|
14
|
+
setup(props, {
|
|
15
|
+
emit
|
|
16
|
+
}) {
|
|
17
|
+
const ns = vue3Util.useNamespace("signature");
|
|
18
|
+
const c = props.controller;
|
|
19
|
+
const editorModel = c.model;
|
|
20
|
+
const headers = vue.ref({
|
|
21
|
+
[`${ibiz.env.tokenHeader}Authorization`]: `${ibiz.env.tokenPrefix}Bearer ${core.getAppCookie(core.CoreConst.TOKEN)}`
|
|
22
|
+
});
|
|
23
|
+
const uploadUrl = vue.ref("");
|
|
24
|
+
const downloadUrl = vue.ref("");
|
|
25
|
+
const signatureRef = vue.ref();
|
|
26
|
+
const fullScreen = vue.ref(false);
|
|
27
|
+
const currentDataURL = vue.ref("");
|
|
28
|
+
const currentVal = vue.ref("");
|
|
29
|
+
let saveMode = "img";
|
|
30
|
+
let buttons = [{
|
|
31
|
+
label: ibiz.i18n.t("editor.signature.undo"),
|
|
32
|
+
type: "UNDO"
|
|
33
|
+
}, {
|
|
34
|
+
label: ibiz.i18n.t("editor.signature.rewrite"),
|
|
35
|
+
type: "REWRITE"
|
|
36
|
+
}, {
|
|
37
|
+
label: ibiz.i18n.t("editor.signature.confirm"),
|
|
38
|
+
type: "CONFIRM",
|
|
39
|
+
buttonType: "PRIMARY"
|
|
40
|
+
}];
|
|
41
|
+
if (editorModel.editorParams) {
|
|
42
|
+
if (editorModel.editorParams.mode) {
|
|
43
|
+
saveMode = editorModel.editorParams.mode;
|
|
44
|
+
}
|
|
45
|
+
if (editorModel.editorParams.buttons) {
|
|
46
|
+
try {
|
|
47
|
+
buttons = JSON.parse(editorModel.editorParams.buttons);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
ibiz.log.error(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const getSafeDistance = () => {
|
|
54
|
+
switch (runtime.getPlatformType()) {
|
|
55
|
+
case runtime.PlatformType.ANDROID:
|
|
56
|
+
return "52px";
|
|
57
|
+
case runtime.PlatformType.IOS:
|
|
58
|
+
return "82px";
|
|
59
|
+
default:
|
|
60
|
+
return "0px";
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const restCavans = () => {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = signatureRef.value) == null ? void 0 : _a.updateSignaturePad(() => {
|
|
66
|
+
vue.nextTick(() => {
|
|
67
|
+
var _a2, _b;
|
|
68
|
+
if (currentDataURL.value) {
|
|
69
|
+
(_a2 = signatureRef.value) == null ? void 0 : _a2.signaturePad.fromDataURL(currentDataURL.value, {
|
|
70
|
+
// 旋转适配横屏
|
|
71
|
+
rotation: 90
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
(_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const handleCurrentVal = async () => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
if (currentVal.value) {
|
|
82
|
+
ibiz.loading.showRedirect();
|
|
83
|
+
if (saveMode === "img") {
|
|
84
|
+
currentDataURL.value = currentVal.value;
|
|
85
|
+
} else if (downloadUrl.value) {
|
|
86
|
+
const fileData = JSON.parse(currentVal.value)[0];
|
|
87
|
+
const _url = downloadUrl.value.replace("%fileId%", fileData.id);
|
|
88
|
+
try {
|
|
89
|
+
const fileBlob = await ibiz.util.file.requestFile(_url);
|
|
90
|
+
const dataUrl = await ((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.blobToDataURL(fileBlob));
|
|
91
|
+
currentDataURL.value = dataUrl;
|
|
92
|
+
} catch (error) {
|
|
93
|
+
ibiz.log.error(error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
(_b = signatureRef.value) == null ? void 0 : _b.signaturePad.loadImage(currentDataURL.value, () => {
|
|
97
|
+
ibiz.loading.hideRedirect();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
vue.watch(() => props.data, (newVal) => {
|
|
102
|
+
if (newVal) {
|
|
103
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
104
|
+
uploadUrl.value = urls.uploadUrl;
|
|
105
|
+
downloadUrl.value = urls.downloadUrl;
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
immediate: true,
|
|
109
|
+
deep: true
|
|
110
|
+
});
|
|
111
|
+
vue.watch(() => props.value, async (newVal, oldVal) => {
|
|
112
|
+
if (newVal !== oldVal) {
|
|
113
|
+
if (!newVal) {
|
|
114
|
+
currentVal.value = "";
|
|
115
|
+
} else {
|
|
116
|
+
currentVal.value = newVal;
|
|
117
|
+
}
|
|
118
|
+
await handleCurrentVal();
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
immediate: true
|
|
122
|
+
});
|
|
123
|
+
const handleEmit = (_value) => {
|
|
124
|
+
emit("change", _value);
|
|
125
|
+
};
|
|
126
|
+
const handleUpload = async (dataURL) => {
|
|
127
|
+
const blob = core.base64ToBlob(dataURL);
|
|
128
|
+
const file = await ibiz.util.file.fileUpload(uploadUrl.value, blob, headers.value);
|
|
129
|
+
return file;
|
|
130
|
+
};
|
|
131
|
+
const handleModalClick = () => {
|
|
132
|
+
fullScreen.value = true;
|
|
133
|
+
restCavans();
|
|
134
|
+
};
|
|
135
|
+
const handleRemove = (_evt) => {
|
|
136
|
+
var _a;
|
|
137
|
+
_evt.stopPropagation();
|
|
138
|
+
(_a = signatureRef.value) == null ? void 0 : _a.signaturePad.clear();
|
|
139
|
+
currentDataURL.value = "";
|
|
140
|
+
handleEmit("");
|
|
141
|
+
};
|
|
142
|
+
const handlePadContainerClick = () => {
|
|
143
|
+
if (props.disabled || props.readonly)
|
|
144
|
+
fullScreen.value = false;
|
|
145
|
+
};
|
|
146
|
+
const handleFileChange = async (dataURL) => {
|
|
147
|
+
const file = await handleUpload(dataURL);
|
|
148
|
+
handleEmit(JSON.stringify([{
|
|
149
|
+
name: file.name,
|
|
150
|
+
id: file.id
|
|
151
|
+
}]));
|
|
152
|
+
};
|
|
153
|
+
const handleConfirm = () => {
|
|
154
|
+
var _a, _b, _c;
|
|
155
|
+
fullScreen.value = false;
|
|
156
|
+
if (((_a = signatureRef.value) == null ? void 0 : _a.signaturePad.isEmpty()) || !((_b = signatureRef.value) == null ? void 0 : _b.signaturePad.isRedrawn()))
|
|
157
|
+
return;
|
|
158
|
+
const dataURL = (_c = signatureRef.value) == null ? void 0 : _c.signaturePad.toDataURL(void 0, {
|
|
159
|
+
// 旋转为述评适配预览
|
|
160
|
+
rotation: -90
|
|
161
|
+
});
|
|
162
|
+
currentDataURL.value = dataURL;
|
|
163
|
+
switch (saveMode) {
|
|
164
|
+
case "file":
|
|
165
|
+
handleFileChange(dataURL);
|
|
166
|
+
break;
|
|
167
|
+
case "img":
|
|
168
|
+
default:
|
|
169
|
+
handleEmit(dataURL);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const handleButtonClick = (_type) => {
|
|
174
|
+
var _a, _b;
|
|
175
|
+
switch (_type) {
|
|
176
|
+
case "UNDO":
|
|
177
|
+
(_a = signatureRef.value) == null ? void 0 : _a.signaturePad.undoLastStep();
|
|
178
|
+
break;
|
|
179
|
+
case "REWRITE":
|
|
180
|
+
(_b = signatureRef.value) == null ? void 0 : _b.signaturePad.clear();
|
|
181
|
+
break;
|
|
182
|
+
case "CONFIRM":
|
|
183
|
+
handleConfirm();
|
|
184
|
+
break;
|
|
185
|
+
default:
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return {
|
|
190
|
+
c,
|
|
191
|
+
ns,
|
|
192
|
+
signatureRef,
|
|
193
|
+
fullScreen,
|
|
194
|
+
currentDataURL,
|
|
195
|
+
buttons,
|
|
196
|
+
getSafeDistance,
|
|
197
|
+
handleModalClick,
|
|
198
|
+
handleConfirm,
|
|
199
|
+
handleRemove,
|
|
200
|
+
handlePadContainerClick,
|
|
201
|
+
handleButtonClick
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
render() {
|
|
205
|
+
return vue.createVNode("div", {
|
|
206
|
+
"class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
|
|
207
|
+
}, [vue.createVNode("div", {
|
|
208
|
+
"class": this.ns.e("modal"),
|
|
209
|
+
"onClick": this.handleModalClick
|
|
210
|
+
}, [vue.createVNode("div", {
|
|
211
|
+
"class": this.ns.em("modal", "background")
|
|
212
|
+
}, null), vue.createVNode("div", {
|
|
213
|
+
"class": this.ns.em("modal", "toolbar")
|
|
214
|
+
}, [this.currentDataURL && vue.createVNode(vue.resolveComponent("van-button"), {
|
|
215
|
+
"round": true,
|
|
216
|
+
"disabled": this.disabled,
|
|
217
|
+
"icon": "cross",
|
|
218
|
+
"type": "primary",
|
|
219
|
+
"onClick": this.handleRemove
|
|
220
|
+
}, null)]), !this.currentDataURL && vue.createVNode("span", {
|
|
221
|
+
"class": this.ns.em("modal", "caption")
|
|
222
|
+
}, [ibiz.i18n.t("editor.signature.addSignature")])]), vue.createVNode("div", {
|
|
223
|
+
"class": this.ns.e("content"),
|
|
224
|
+
"style": {
|
|
225
|
+
backgroundImage: `url(${this.currentDataURL})`
|
|
226
|
+
}
|
|
227
|
+
}, null), vue.createVNode("div", {
|
|
228
|
+
"class": [this.ns.b("overlay"), this.ns.is("full-screen", this.fullScreen), this.ns.is("disabled", this.disabled), this.ns.is("readonly", this.readonly)],
|
|
229
|
+
"style": {
|
|
230
|
+
[this.ns.cssVarBlockName("overlay-padding-bottom")]: this.getSafeDistance()
|
|
231
|
+
},
|
|
232
|
+
"onClick": this.handlePadContainerClick
|
|
233
|
+
}, [vue.createVNode("div", {
|
|
234
|
+
"class": this.ns.be("overlay", "container")
|
|
235
|
+
}, [vue.createVNode("div", {
|
|
236
|
+
"class": this.ns.be("overlay", "header")
|
|
237
|
+
}, [ibiz.i18n.t("editor.signature.signaturePrompt")]), vue.createVNode(vue.resolveComponent("iBizSignaturePad"), {
|
|
238
|
+
"ref": "signatureRef",
|
|
239
|
+
"class": this.ns.be("overlay", "pad"),
|
|
240
|
+
"options": {
|
|
241
|
+
...this.c.model.editorParams,
|
|
242
|
+
...this.$attrs
|
|
243
|
+
}
|
|
244
|
+
}, null), vue.createVNode("div", {
|
|
245
|
+
"class": this.ns.be("overlay", "footer")
|
|
246
|
+
}, [this.buttons.map((_btn) => {
|
|
247
|
+
return vue.createVNode(vue.resolveComponent("van-button"), {
|
|
248
|
+
"disabled": this.disabled,
|
|
249
|
+
"type": _btn.buttonType && _btn.buttonType.toLowerCase() || "default",
|
|
250
|
+
"onClick": () => this.handleButtonClick(_btn.type)
|
|
251
|
+
}, {
|
|
252
|
+
default: () => [_btn.label]
|
|
253
|
+
});
|
|
254
|
+
})])])])]);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
exports.IBizSignature = IBizSignature;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-signature{position:relative;width:100%;height:100%;overflow:hidden;border:none;border-radius:var(--ibiz-border-radius-large)}.ibiz-signature__modal{position:absolute;z-index:6;display:flex;align-items:center;justify-content:center;width:100%;height:100%}.ibiz-signature__modal--background{width:100%;height:100%;background-color:var(--ibiz-color-black);opacity:.1}.ibiz-signature__modal--caption{position:absolute;color:var(--ibiz-color-text-2)}.ibiz-signature__modal--toolbar{position:absolute;top:var(--ibiz-spacing-tight);right:var(--ibiz-spacing-tight)}.ibiz-signature__modal--toolbar .van-button{width:var(--ibiz-spacing-loose);height:auto;height:var(--ibiz-spacing-loose);background-color:var(--van-uploader-delete-background);border:var(--van-uploader-delete-background);opacity:.6}.ibiz-signature__modal--toolbar .van-button+.van-button{margin-left:var(--ibiz-spacing-loose)}.ibiz-signature__content{width:100%;height:100%;background-repeat:no-repeat;background-position:center center;background-size:contain}.ibiz-signature__readonly .ibiz-signature__modal--toolbar{display:none}.ibiz-signature-overlay{--ibiz-signature-overlay-padding-bottom:0px;position:absolute;z-index:1;width:0;height:0;background-color:var(--ibiz-color-bg-1);opacity:0}.ibiz-signature-overlay.is-full-screen{position:fixed;inset:0;z-index:9999;width:100vw;height:100vh;opacity:1}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__container{position:absolute;top:0;left:0;width:calc(100vh - var(--ibiz-signature-overlay-padding-bottom));height:100vw;transform:rotate(90deg) translateY(-100%);transform-origin:top left}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__header{position:absolute;z-index:6;padding:var(--ibiz-spacing-extra-tight);text-align:left}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__footer{position:absolute;right:var(--ibiz-spacing-tight);bottom:var(--ibiz-spacing-base);z-index:6}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__footer .van-button{height:auto;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-loose);font-size:var(--ibiz-font-size-header-6)}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__footer .van-button+.van-button{margin-left:var(--ibiz-spacing-loose)}.ibiz-signature-overlay.is-full-screen .ibiz-signature-overlay__pad{position:absolute;top:0;left:0;width:100vw;height:calc(100vh - var(--ibiz-signature-overlay-padding-bottom));transform:rotate(-90deg) translateX(-100%);transform-origin:top left}.ibiz-signature-overlay.is-readonly .ibiz-signature-pad-container__footer .van-button+.van-button,.ibiz-signature-overlay.is-readonly .ibiz-signature-pad-container__header{display:none}.ibiz-signature-overlay.is-readonly .ibiz-signature-pad{pointer-events:none}.ibiz-signature-overlay.is-disabled .ibiz-signature-pad{pointer-events:none}
|
|
@@ -16,6 +16,9 @@ class TextBoxEditorProvider {
|
|
|
16
16
|
if (editorType === "NUMBER") {
|
|
17
17
|
this.formEditor = "IBizInputNumber";
|
|
18
18
|
this.gridEditor = "IBizInputNumber";
|
|
19
|
+
} else if (editorType === "SIGNATURE") {
|
|
20
|
+
this.formEditor = "IBizSignature";
|
|
21
|
+
this.gridEditor = "IBizSignature";
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
async createController(editorModel, parentController) {
|
package/lib/index.cjs
CHANGED
|
@@ -139,6 +139,7 @@ var switchEditor_controller = require('./editor/switch/switch-editor.controller.
|
|
|
139
139
|
var switchEditor_provider = require('./editor/switch/switch-editor.provider.cjs');
|
|
140
140
|
var input = require('./editor/text-box/input/input.cjs');
|
|
141
141
|
var ibizInputNumber = require('./editor/text-box/ibiz-input-number/ibiz-input-number.cjs');
|
|
142
|
+
var signature = require('./editor/text-box/signature/signature.cjs');
|
|
142
143
|
var textBoxEditor_controller = require('./editor/text-box/text-box-editor.controller.cjs');
|
|
143
144
|
var textBoxEditor_provider = require('./editor/text-box/text-box-editor.provider.cjs');
|
|
144
145
|
var ibizFileUpload = require('./editor/upload/ibiz-file-upload/ibiz-file-upload.cjs');
|
|
@@ -319,6 +320,7 @@ exports.SwitchEditorController = switchEditor_controller.SwitchEditorController;
|
|
|
319
320
|
exports.SwitchEditorProvider = switchEditor_provider.SwitchEditorProvider;
|
|
320
321
|
exports.IBizInput = input.IBizInput;
|
|
321
322
|
exports.IBizInputNumber = ibizInputNumber.IBizInputNumber;
|
|
323
|
+
exports.IBizSignature = signature.IBizSignature;
|
|
322
324
|
exports.TextBoxEditorController = textBoxEditor_controller.TextBoxEditorController;
|
|
323
325
|
exports.TextBoxEditorProvider = textBoxEditor_provider.TextBoxEditorProvider;
|
|
324
326
|
exports.IBizFileUpload = ibizFileUpload.IBizFileUpload;
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -68,6 +68,16 @@ var index = {
|
|
|
68
68
|
},
|
|
69
69
|
formItemContainer: {
|
|
70
70
|
more: "More"
|
|
71
|
+
},
|
|
72
|
+
mpicker: {
|
|
73
|
+
simpleErr: "The value of the SIMPLE type address bar {props.value} does not meet the requirements of a JSON string"
|
|
74
|
+
},
|
|
75
|
+
signature: {
|
|
76
|
+
undo: "Undo",
|
|
77
|
+
rewrite: "Rewrite",
|
|
78
|
+
confirm: "Confirm",
|
|
79
|
+
addSignature: "Click here to add signature",
|
|
80
|
+
signaturePrompt: "Please write horizontally in the blank area"
|
|
71
81
|
}
|
|
72
82
|
},
|
|
73
83
|
// 部件
|
|
@@ -211,6 +221,10 @@ var index = {
|
|
|
211
221
|
switchLanguagePrompt: "Switching languages requires refreshing the page, are you sure to switch?"
|
|
212
222
|
},
|
|
213
223
|
mobApp: {
|
|
224
|
+
authGuard: {
|
|
225
|
+
loginFailed: "Anonymous user login failed",
|
|
226
|
+
noPermission: "No permission to access!"
|
|
227
|
+
},
|
|
214
228
|
unauthorizedHandler: {
|
|
215
229
|
noFoundEnvParams: "Unable to find environment parameter casLoginUrl",
|
|
216
230
|
prohibitAccessPrompt: "Access to the current account is prohibited",
|
|
@@ -203,6 +203,16 @@ var index = {
|
|
|
203
203
|
},
|
|
204
204
|
dateRangePicker: {
|
|
205
205
|
selectRange: "\u8BF7\u9009\u62E9\u65E5\u671F\u8303\u56F4"
|
|
206
|
+
},
|
|
207
|
+
mpicker: {
|
|
208
|
+
simpleErr: "SIMPLE\u7C7B\u578B\u5730\u5740\u680F\u503C\u683C\u5F0F{props.value}\u4E0D\u7B26\u5408JSON\u5B57\u7B26\u4E32\u8981\u6C42"
|
|
209
|
+
},
|
|
210
|
+
signature: {
|
|
211
|
+
undo: "\u64A4\u9500",
|
|
212
|
+
rewrite: "\u91CD\u5199",
|
|
213
|
+
confirm: "\u786E\u8BA4",
|
|
214
|
+
addSignature: "\u70B9\u51FB\u6B64\u5904\u6DFB\u52A0\u7B7E\u540D",
|
|
215
|
+
signaturePrompt: "\u8BF7\u5728\u7A7A\u767D\u533A\u57DF\u5185\u6A2A\u5411\u4E66\u5199"
|
|
206
216
|
}
|
|
207
217
|
},
|
|
208
218
|
// 多语言
|
|
@@ -211,6 +221,10 @@ var index = {
|
|
|
211
221
|
switchLanguagePrompt: "\u5207\u6362\u8BED\u8A00\u9700\u8981\u5237\u65B0\u9875\u9762\uFF0C\u786E\u8BA4\u5207\u6362?"
|
|
212
222
|
},
|
|
213
223
|
mobApp: {
|
|
224
|
+
authGuard: {
|
|
225
|
+
loginFailed: "\u533F\u540D\u7528\u6237\u767B\u5F55\u5931\u8D25",
|
|
226
|
+
noPermission: "\u65E0\u6743\u9650\u8BBF\u95EE\uFF01"
|
|
227
|
+
},
|
|
214
228
|
unauthorizedHandler: {
|
|
215
229
|
noFoundEnvParams: "\u627E\u4E0D\u5230\u73AF\u5883\u53C2\u6570casLoginUrl",
|
|
216
230
|
prohibitAccessPrompt: "\u5F53\u524D\u8D26\u6237\u88AB\u7981\u6B62\u8BBF\u95EE",
|
package/lib/mob-app/App.cjs
CHANGED
|
@@ -44,6 +44,22 @@ var App = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
}
|
|
45
45
|
return viewModals.get(key);
|
|
46
46
|
};
|
|
47
|
+
let watermarkDestroy;
|
|
48
|
+
vue.onMounted(() => {
|
|
49
|
+
vue3Util.AppHooks.initedApp.tapPromise(async ({
|
|
50
|
+
context
|
|
51
|
+
}) => {
|
|
52
|
+
var _a;
|
|
53
|
+
watermarkDestroy == null ? void 0 : watermarkDestroy();
|
|
54
|
+
watermarkDestroy = ibiz.util.watermark.mount(ibiz.config.watermark, void 0, {
|
|
55
|
+
...context,
|
|
56
|
+
...(_a = ibiz.appData) == null ? void 0 : _a.context
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
vue.onBeforeUnmount(() => {
|
|
61
|
+
watermarkDestroy == null ? void 0 : watermarkDestroy();
|
|
62
|
+
});
|
|
47
63
|
return {
|
|
48
64
|
viewStack: viewStack$1,
|
|
49
65
|
getViewModal,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
3
4
|
var modelHelper = require('@ibiz-template/model-helper');
|
|
4
5
|
var ramda = require('ramda');
|
|
5
6
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
@@ -137,13 +138,94 @@ async function appInit(context) {
|
|
|
137
138
|
await ibiz.auth.extendLogin(context);
|
|
138
139
|
await ibiz.hub.notice.init();
|
|
139
140
|
}
|
|
141
|
+
function throw401() {
|
|
142
|
+
throw new core.HttpError({
|
|
143
|
+
response: {
|
|
144
|
+
status: 401,
|
|
145
|
+
statusText: ibiz.i18n.t("mobApp.authGuard.noPermission")
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
async function anonymousValidate(context) {
|
|
150
|
+
const authInfo = ibiz.auth.getAuthInfo();
|
|
151
|
+
if (authInfo && !authInfo.isAnonymous) {
|
|
152
|
+
try {
|
|
153
|
+
await appInit(context);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
const { status } = error;
|
|
156
|
+
if (status === 401) {
|
|
157
|
+
const refreshToken = core.getAppCookie(core.CoreConst.REFRESH_TOKEN);
|
|
158
|
+
if (refreshToken) {
|
|
159
|
+
await ibiz.auth.refreshToken();
|
|
160
|
+
await appInit(context);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
ibiz.auth.clearAuthData();
|
|
164
|
+
} else {
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (authInfo == null ? void 0 : authInfo.token) {
|
|
170
|
+
try {
|
|
171
|
+
await appInit(context);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
const { status } = error;
|
|
174
|
+
if (status === 401) {
|
|
175
|
+
const loginResult = await ibiz.auth.anonymousLogin();
|
|
176
|
+
if (!loginResult) {
|
|
177
|
+
throw new core.RuntimeError(ibiz.i18n.t("mobApp.authGuard.loginFailed"));
|
|
178
|
+
}
|
|
179
|
+
await appInit(context);
|
|
180
|
+
} else {
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
await initModel(context, false);
|
|
186
|
+
const urlPaths = window.location.hash.split("/");
|
|
187
|
+
const viewName = urlPaths[urlPaths.length - 2];
|
|
188
|
+
let viewModel;
|
|
189
|
+
try {
|
|
190
|
+
if (viewName === "#" && ibiz.hub.defaultPage) {
|
|
191
|
+
viewModel = await ibiz.hub.getAppView(ibiz.hub.defaultPage.id);
|
|
192
|
+
} else {
|
|
193
|
+
viewModel = await ibiz.hub.getAppView(viewName);
|
|
194
|
+
}
|
|
195
|
+
} catch (error) {
|
|
196
|
+
ibiz.log.error(error);
|
|
197
|
+
}
|
|
198
|
+
if (!viewModel) {
|
|
199
|
+
ibiz.log.error(
|
|
200
|
+
`\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`
|
|
201
|
+
);
|
|
202
|
+
throw401();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (viewModel.accUserMode !== 3) {
|
|
206
|
+
throw401();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (!authInfo) {
|
|
210
|
+
const loginResult = await ibiz.auth.anonymousLogin();
|
|
211
|
+
if (!loginResult) {
|
|
212
|
+
throw new core.RuntimeError(ibiz.i18n.t("mobApp.authGuard.loginFailed"));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
await appInit(context);
|
|
216
|
+
}
|
|
140
217
|
async function AuthGuard(appContext, permission = true) {
|
|
141
218
|
if (permission) {
|
|
142
219
|
let result = true;
|
|
143
220
|
try {
|
|
144
|
-
|
|
221
|
+
if (ibiz.env.enableAnonymous) {
|
|
222
|
+
await anonymousValidate(appContext);
|
|
223
|
+
} else {
|
|
224
|
+
await appInit(appContext);
|
|
225
|
+
}
|
|
145
226
|
} catch (error) {
|
|
146
227
|
result = false;
|
|
228
|
+
error.tag = "APPINIT";
|
|
147
229
|
ibiz.util.error.handle(error);
|
|
148
230
|
}
|
|
149
231
|
return result;
|
|
@@ -4,7 +4,22 @@ var qs = require('qs');
|
|
|
4
4
|
var core = require('@ibiz-template/core');
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __publicField = (obj, key, value) => {
|
|
10
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
11
|
+
return value;
|
|
12
|
+
};
|
|
7
13
|
class UnauthorizedHandler {
|
|
14
|
+
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* @description 是否存在403错误未处理
|
|
17
|
+
* @protected
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @memberof UnauthorizedHandler
|
|
20
|
+
*/
|
|
21
|
+
__publicField(this, "hasPermErrPending", false);
|
|
22
|
+
}
|
|
8
23
|
match(error) {
|
|
9
24
|
return error instanceof core.HttpError && (error.status === 401 || error.status === 403);
|
|
10
25
|
}
|
|
@@ -77,22 +92,31 @@ class UnauthorizedHandler {
|
|
|
77
92
|
window.location.reload();
|
|
78
93
|
}
|
|
79
94
|
/**
|
|
80
|
-
* 处理403
|
|
81
|
-
* @author lxm
|
|
82
|
-
* @date 2023-12-06 10:19:12
|
|
95
|
+
* @description 处理403
|
|
83
96
|
* @protected
|
|
84
|
-
* @
|
|
97
|
+
* @param {HttpError} error
|
|
98
|
+
* @returns {*} {Promise<void>}
|
|
99
|
+
* @memberof UnauthorizedHandler
|
|
85
100
|
*/
|
|
86
|
-
async handle403() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
async handle403(error) {
|
|
102
|
+
if (error.tag === "APPINIT") {
|
|
103
|
+
if (this.hasPermErrPending) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.hasPermErrPending = true;
|
|
107
|
+
const result = await ibiz.modal.confirm({
|
|
108
|
+
title: ibiz.i18n.t("mobApp.unauthorizedHandler.prohibitAccessPrompt"),
|
|
109
|
+
desc: ibiz.i18n.t("mobApp.unauthorizedHandler.exitPrompt")
|
|
110
|
+
});
|
|
111
|
+
this.hasPermErrPending = false;
|
|
112
|
+
if (result) {
|
|
113
|
+
const bol = await ibiz.auth.logout();
|
|
114
|
+
if (bol) {
|
|
115
|
+
window.location.reload();
|
|
116
|
+
}
|
|
95
117
|
}
|
|
118
|
+
} else {
|
|
119
|
+
ibiz.mc.error.send(error);
|
|
96
120
|
}
|
|
97
121
|
}
|
|
98
122
|
/**
|
|
@@ -105,7 +129,15 @@ class UnauthorizedHandler {
|
|
|
105
129
|
handle(error) {
|
|
106
130
|
if (error instanceof core.HttpError) {
|
|
107
131
|
if (error.status === 401) {
|
|
108
|
-
|
|
132
|
+
const search = qs.parse(window.location.search.replace("?", ""));
|
|
133
|
+
if ((search.isAnonymous || ibiz.env.enableAnonymous) && // 匿名登录获取视图模型发生异常,走普通登录,防止循环执行
|
|
134
|
+
error.tag !== "APPINIT") {
|
|
135
|
+
ibiz.auth.anonymousLogin().then((bol) => {
|
|
136
|
+
if (bol) {
|
|
137
|
+
window.location.reload();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
} else if (ibiz.env.loginMode === core.LoginMode.CAS) {
|
|
109
141
|
this.casLogin();
|
|
110
142
|
} else if (ibiz.env.loginMode === core.LoginMode.OAUTH) {
|
|
111
143
|
this.oauthLogin();
|
|
@@ -115,7 +147,7 @@ class UnauthorizedHandler {
|
|
|
115
147
|
return true;
|
|
116
148
|
}
|
|
117
149
|
if (error.status === 403) {
|
|
118
|
-
this.handle403();
|
|
150
|
+
this.handle403(error);
|
|
119
151
|
return true;
|
|
120
152
|
}
|
|
121
153
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _commonjsHelpers = require('../../../../../../../../_virtual/_commonjsHelpers.cjs');
|
|
4
|
-
var index = require('../../../../../../../../_virtual/
|
|
4
|
+
var index = require('../../../../../../../../_virtual/index12.cjs');
|
|
5
5
|
|
|
6
6
|
var frameTalkClientPc = index.__module.exports;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _commonjsHelpers = require('../../../../../../../../_virtual/_commonjsHelpers.cjs');
|
|
4
|
-
var index = require('../../../../../../../../_virtual/
|
|
4
|
+
var index = require('../../../../../../../../_virtual/index13.cjs');
|
|
5
5
|
require('../../../../../../../../_virtual/bridge.cjs');
|
|
6
6
|
var retry = require('./retry.cjs');
|
|
7
7
|
require('../../../../../../../../_virtual/dealParamsAndResult.cjs');
|
package/lib/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _commonjsHelpers = require('../../../../../_virtual/_commonjsHelpers.cjs');
|
|
6
|
-
var index$1 = require('../../../../../_virtual/
|
|
6
|
+
var index$1 = require('../../../../../_virtual/index18.cjs');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* lodash (Custom Build) <https://lodash.com/>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _commonjsHelpers = require('../../../../../_virtual/_commonjsHelpers.cjs');
|
|
6
|
-
var index$1 = require('../../../../../_virtual/
|
|
6
|
+
var index$1 = require('../../../../../_virtual/index17.cjs');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Lodash (Custom Build) <https://lodash.com/>
|