@ibiz-template/vue3-util 0.7.38-alpha.33 → 0.7.38-alpha.45
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.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/code-list/code-list.mjs +1 -1
- package/es/common/control-base/control-base.css +1 -1
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +67 -2
- package/es/common/icon/icon.d.ts.map +1 -1
- package/es/common/icon/icon.mjs +5 -0
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +62 -62
- package/es/index.mjs +1 -0
- package/es/locale/en/index.d.ts +2 -0
- package/es/locale/en/index.d.ts.map +1 -1
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.d.ts +2 -0
- package/es/locale/zh-CN/index.d.ts.map +1 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts +111 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts.map +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.mjs +176 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +27 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts.map +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.mjs +54 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.d.ts +15 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.d.ts.map +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.mjs +15 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.d.ts +54 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.d.ts.map +1 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.mjs +7 -0
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts +24 -0
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts.map +1 -0
- package/es/panel-component/auth-wxmp-qrcode/index.mjs +19 -0
- package/es/panel-component/index.d.ts +1 -0
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +1 -0
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts +9 -0
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.mjs +15 -2
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts +8 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs +14 -2
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts +8 -0
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.mjs +14 -2
- package/lib/common/code-list/code-list.cjs +1 -1
- package/lib/common/control-base/control-base.cjs +66 -1
- package/lib/common/control-base/control-base.css +1 -1
- package/lib/common/icon/icon.cjs +5 -0
- package/lib/common/view-shell/view-shell.cjs +62 -62
- package/lib/index.cjs +25 -23
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.cjs +56 -0
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.cjs +178 -0
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -0
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.cjs +17 -0
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.cjs +9 -0
- package/lib/panel-component/auth-wxmp-qrcode/index.cjs +24 -0
- package/lib/panel-component/index.cjs +2 -0
- package/lib/panel-component/multi-data-container/multi-data-container.controller.cjs +14 -1
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs +13 -1
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +13 -1
- package/package.json +5 -5
|
@@ -96,77 +96,77 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
const init = async () => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
hasAuthority.value = await checkViewAuthority(viewModel);
|
|
104
|
-
if (!hasAuthority.value) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (viewModel.dynaSysMode === 1) {
|
|
108
|
-
const appDataEntityId = viewModel.appDataEntityId;
|
|
109
|
-
if (!appDataEntityId) {
|
|
110
|
-
throw new core.RuntimeError(ibiz.i18n.t("vue3Util.common.noSupportLoadingDynamic", {
|
|
111
|
-
codeName: viewModel.codeName
|
|
112
|
-
}));
|
|
99
|
+
try {
|
|
100
|
+
await initViewModel();
|
|
101
|
+
if (!viewModel) {
|
|
102
|
+
throw new core.RuntimeError(ibiz.i18n.t("vue3Util.common.noFoundViewModel"));
|
|
113
103
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
if (params.value.srfdatatype) {
|
|
119
|
-
loadModelParams.srfdatatype = params.value.srfdatatype;
|
|
104
|
+
hasAuthority.value = await checkViewAuthority(viewModel);
|
|
105
|
+
if (!hasAuthority.value) {
|
|
106
|
+
return;
|
|
120
107
|
}
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
108
|
+
if (viewModel.dynaSysMode === 1) {
|
|
109
|
+
const appDataEntityId = viewModel.appDataEntityId;
|
|
110
|
+
if (!appDataEntityId) {
|
|
111
|
+
throw new core.RuntimeError(ibiz.i18n.t("vue3Util.common.noSupportLoadingDynamic", {
|
|
112
|
+
codeName: viewModel.codeName
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
const loadModelParams = await runtime.calcDynaSysParams(appDataEntityId, context.value, {
|
|
116
|
+
viewParams: params.value,
|
|
117
|
+
appId: viewModel.appId
|
|
118
|
+
});
|
|
119
|
+
if (params.value.srfdatatype) {
|
|
120
|
+
loadModelParams.srfdatatype = params.value.srfdatatype;
|
|
121
|
+
}
|
|
122
|
+
if (params.value.srfwftag) {
|
|
123
|
+
loadModelParams.srfwftag = params.value.srfwftag;
|
|
124
|
+
} else if (appDataEntityId && viewModel.enableWF) {
|
|
125
|
+
if (loadModelParams.srfkey) {
|
|
126
|
+
const noSrfSessionId = ramda.isNil(context.value.srfsessionid) || ramda.isEmpty(context.value.srfsessionid);
|
|
127
|
+
const id = qxUtil.createUUID();
|
|
128
|
+
if (noSrfSessionId) {
|
|
129
|
+
const domain = ibiz.uiDomainManager.create(id);
|
|
130
|
+
context.value.srfsessionid = domain.id;
|
|
142
131
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
132
|
+
const app = ibiz.hub.getApp(viewModel.appId);
|
|
133
|
+
const service = await app.deService.getService(context.value, appDataEntityId);
|
|
134
|
+
const res = await service.get(context.value, params.value || {});
|
|
135
|
+
if (res.ok && res.data) {
|
|
136
|
+
const {
|
|
137
|
+
srfwftag,
|
|
138
|
+
processdefinitionkey,
|
|
139
|
+
taskdefinitionkey
|
|
140
|
+
} = res.data;
|
|
141
|
+
if (srfwftag) {
|
|
142
|
+
loadModelParams.srfwftag = srfwftag;
|
|
146
143
|
}
|
|
147
|
-
if (
|
|
148
|
-
params.value.
|
|
144
|
+
if (["DEWFDYNAEDITVIEW3", "DEWFDYNAEDITVIEW"].includes(viewModel.viewType)) {
|
|
145
|
+
if (ramda.isNil(params.value.processDefinitionKey)) {
|
|
146
|
+
params.value.processDefinitionKey = processdefinitionkey;
|
|
147
|
+
}
|
|
148
|
+
if (ramda.isNil(params.value.taskDefinitionKey)) {
|
|
149
|
+
params.value.taskDefinitionKey = taskdefinitionkey;
|
|
150
|
+
}
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
if (noSrfSessionId) {
|
|
154
|
+
ibiz.uiDomainManager.destroy(id);
|
|
155
|
+
}
|
|
154
156
|
}
|
|
155
157
|
}
|
|
158
|
+
const curDynaViewCacheKey = getDynaViewCacheKey(loadModelParams);
|
|
159
|
+
if (curDynaViewCacheKey === dynaViewCacheKey) {
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
isComplete.value = true;
|
|
162
|
+
});
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
viewModelData.value = await ibiz.hub.loadAppView(viewModel.appId, viewModel.id, loadModelParams);
|
|
166
|
+
dynaViewCacheKey = getDynaViewCacheKey(loadModelParams);
|
|
167
|
+
} else {
|
|
168
|
+
viewModelData.value = viewModel;
|
|
156
169
|
}
|
|
157
|
-
const curDynaViewCacheKey = getDynaViewCacheKey(loadModelParams);
|
|
158
|
-
if (curDynaViewCacheKey === dynaViewCacheKey) {
|
|
159
|
-
setTimeout(() => {
|
|
160
|
-
isComplete.value = true;
|
|
161
|
-
});
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
viewModelData.value = await ibiz.hub.loadAppView(viewModel.appId, viewModel.id, loadModelParams);
|
|
165
|
-
dynaViewCacheKey = getDynaViewCacheKey(loadModelParams);
|
|
166
|
-
} else {
|
|
167
|
-
viewModelData.value = viewModel;
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
170
|
provider.value = await runtime.getViewProvider(viewModel);
|
|
171
171
|
} catch (error) {
|
|
172
172
|
ibiz.log.error(error);
|
package/lib/index.cjs
CHANGED
|
@@ -61,14 +61,15 @@ var teleportPlaceholder_provider = require('./panel-component/teleport-placehold
|
|
|
61
61
|
var index$e = require('./panel-component/teleport-placeholder/index.cjs');
|
|
62
62
|
var index$f = require('./panel-component/panel-container-tabs/index.cjs');
|
|
63
63
|
var index$g = require('./panel-component/panel-ctrl-view-page-caption/index.cjs');
|
|
64
|
+
var index$h = require('./panel-component/auth-wxmp-qrcode/index.cjs');
|
|
64
65
|
var appRedirectView = require('./view/app-redirect-view/app-redirect-view.cjs');
|
|
65
|
-
var index$
|
|
66
|
+
var index$i = require('./view/common/index.cjs');
|
|
66
67
|
var todoRedirect = require('./view/todo-redirect/todo-redirect.cjs');
|
|
67
|
-
var index$
|
|
68
|
-
var index$
|
|
69
|
-
var index$
|
|
70
|
-
var index$
|
|
71
|
-
var index$
|
|
68
|
+
var index$j = require('./view/portal-view/index.cjs');
|
|
69
|
+
var index$k = require('./view/de-redirect-view/index.cjs');
|
|
70
|
+
var index$l = require('./view/html-view/index.cjs');
|
|
71
|
+
var index$m = require('./control/panel/view-layout-panel/index.cjs');
|
|
72
|
+
var index$n = require('./control/panel/panel/index.cjs');
|
|
72
73
|
var pluginFactory = require('./plugin/plugin-factory/plugin-factory.cjs');
|
|
73
74
|
var clickOutside = require('./use/click-outside/click-outside.cjs');
|
|
74
75
|
var useControlController = require('./use/control/use-control-controller/use-control-controller.cjs');
|
|
@@ -76,11 +77,11 @@ var event = require('./use/event/event.cjs');
|
|
|
76
77
|
var focusBlur = require('./use/focus-blur/focus-blur.cjs');
|
|
77
78
|
var namespace = require('./use/namespace/namespace.cjs');
|
|
78
79
|
var route = require('./use/route/route.cjs');
|
|
79
|
-
var index$
|
|
80
|
+
var index$o = require('./use/util/index.cjs');
|
|
80
81
|
var useViewController = require('./use/view/use-view-controller/use-view-controller.cjs');
|
|
81
82
|
var vue = require('./use/vue/vue.cjs');
|
|
82
83
|
var codelistListen = require('./use/codeList-listen/codelist-listen.cjs');
|
|
83
|
-
var index$
|
|
84
|
+
var index$p = require('./use/storage/index.cjs');
|
|
84
85
|
var autofocusBlur = require('./use/autofocus-blur/autofocus-blur.cjs');
|
|
85
86
|
var overlayContainer = require('./util/overlay-container/overlay-container.cjs');
|
|
86
87
|
var overlayPopoverContainer = require('./util/overlay-popover-container/overlay-popover-container.cjs');
|
|
@@ -93,7 +94,7 @@ var render = require('./util/render/render.cjs');
|
|
|
93
94
|
var overlayViewUtil = require('./util/overlay-view-util/overlay-view-util.cjs');
|
|
94
95
|
var appStore = require('./util/store/app-store/app-store.cjs');
|
|
95
96
|
var uiStore = require('./util/store/ui-store/ui-store.cjs');
|
|
96
|
-
var index$
|
|
97
|
+
var index$q = require('./util/store/index.cjs');
|
|
97
98
|
var common = require('./props/common.cjs');
|
|
98
99
|
var textBox = require('./props/editor/text-box.cjs');
|
|
99
100
|
var span = require('./props/editor/span.cjs');
|
|
@@ -120,8 +121,8 @@ var markdown = require('./props/editor/markdown.cjs');
|
|
|
120
121
|
var array = require('./props/editor/array.cjs');
|
|
121
122
|
var cascader = require('./props/editor/cascader.cjs');
|
|
122
123
|
var colorPicker = require('./props/editor/color-picker.cjs');
|
|
123
|
-
var index$
|
|
124
|
-
var index$
|
|
124
|
+
var index$r = require('./locale/en/index.cjs');
|
|
125
|
+
var index$s = require('./locale/zh-CN/index.cjs');
|
|
125
126
|
|
|
126
127
|
"use strict";
|
|
127
128
|
|
|
@@ -175,14 +176,15 @@ exports.TeleportPlaceholderProvider = teleportPlaceholder_provider.TeleportPlace
|
|
|
175
176
|
exports.IBizTeleportPlaceholder = index$e.IBizTeleportPlaceholder;
|
|
176
177
|
exports.IBizPanelContainerTabs = index$f.IBizPanelContainerTabs;
|
|
177
178
|
exports.IBizPanelCtrlViewPageCaption = index$g.IBizPanelCtrlViewPageCaption;
|
|
179
|
+
exports.IBizAuthWxmpQrcode = index$h.IBizAuthWxmpQrcode;
|
|
178
180
|
exports.AppRedirectView = appRedirectView.AppRedirectView;
|
|
179
|
-
exports.IBizView = index$
|
|
181
|
+
exports.IBizView = index$i.IBizView;
|
|
180
182
|
exports.TodoRedirect = todoRedirect.TodoRedirect;
|
|
181
|
-
exports.IBizPortalView = index$
|
|
182
|
-
exports.IBizDeRedirectView = index$
|
|
183
|
-
exports.IBizHtmlView = index$
|
|
184
|
-
exports.IBizViewLayoutPanelControl = index$
|
|
185
|
-
exports.IBizPanelControl = index$
|
|
183
|
+
exports.IBizPortalView = index$j.IBizPortalView;
|
|
184
|
+
exports.IBizDeRedirectView = index$k.IBizDeRedirectView;
|
|
185
|
+
exports.IBizHtmlView = index$l.IBizHtmlView;
|
|
186
|
+
exports.IBizViewLayoutPanelControl = index$m.IBizViewLayoutPanelControl;
|
|
187
|
+
exports.IBizPanelControl = index$n.IBizPanelControl;
|
|
186
188
|
exports.PluginFactory = pluginFactory.PluginFactory;
|
|
187
189
|
exports.useClickOutside = clickOutside.useClickOutside;
|
|
188
190
|
exports.useControlController = useControlController.useControlController;
|
|
@@ -191,8 +193,8 @@ exports.useFocusAndBlur = focusBlur.useFocusAndBlur;
|
|
|
191
193
|
exports.useNamespace = namespace.useNamespace;
|
|
192
194
|
exports.useRouteKey = route.useRouteKey;
|
|
193
195
|
exports.useRouterQuery = route.useRouterQuery;
|
|
194
|
-
exports.useCtx = index$
|
|
195
|
-
exports.useMobCtx = index$
|
|
196
|
+
exports.useCtx = index$o.useCtx;
|
|
197
|
+
exports.useMobCtx = index$o.useMobCtx;
|
|
196
198
|
exports.useViewController = useViewController.useViewController;
|
|
197
199
|
exports.EmptyVNode = vue.EmptyVNode;
|
|
198
200
|
exports.getOrigin = vue.getOrigin;
|
|
@@ -203,7 +205,7 @@ exports.useForceTogether = vue.useForceTogether;
|
|
|
203
205
|
exports.useProps = vue.useProps;
|
|
204
206
|
exports.usePropsWatch = vue.usePropsWatch;
|
|
205
207
|
exports.useCodeListListen = codelistListen.useCodeListListen;
|
|
206
|
-
exports.useLocalCacheKey = index$
|
|
208
|
+
exports.useLocalCacheKey = index$p.useLocalCacheKey;
|
|
207
209
|
exports.useAutoFocusBlur = autofocusBlur.useAutoFocusBlur;
|
|
208
210
|
exports.OverlayContainer = overlayContainer.OverlayContainer;
|
|
209
211
|
exports.OverlayPopoverContainer = overlayPopoverContainer.OverlayPopoverContainer;
|
|
@@ -230,7 +232,7 @@ exports.openViewModal = overlayViewUtil.openViewModal;
|
|
|
230
232
|
exports.openViewPopover = overlayViewUtil.openViewPopover;
|
|
231
233
|
exports.useAppStore = appStore.useAppStore;
|
|
232
234
|
exports.useUIStore = uiStore.useUIStore;
|
|
233
|
-
exports.piniaInstance = index$
|
|
235
|
+
exports.piniaInstance = index$q.piniaInstance;
|
|
234
236
|
exports.RequiredProp = common.RequiredProp;
|
|
235
237
|
exports.getGridInputIpProps = textBox.getGridInputIpProps;
|
|
236
238
|
exports.getGridInputNumberProps = textBox.getGridInputNumberProps;
|
|
@@ -288,5 +290,5 @@ exports.getCascaderProps = cascader.getCascaderProps;
|
|
|
288
290
|
exports.getGridCascaderProps = cascader.getGridCascaderProps;
|
|
289
291
|
exports.getColorPickerProps = colorPicker.getColorPickerProps;
|
|
290
292
|
exports.getGridColorPickerProps = colorPicker.getGridColorPickerProps;
|
|
291
|
-
exports.en = index$
|
|
292
|
-
exports.zhCn = index$
|
|
293
|
+
exports.en = index$r.en;
|
|
294
|
+
exports.zhCn = index$s.zhCn;
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -27,7 +27,9 @@ const en = {
|
|
|
27
27
|
noProvidedSlot: "No {id} slot provided",
|
|
28
28
|
cannotEmpty: "{caption} cannot be empty",
|
|
29
29
|
unadaptedLayout: "Unadapted layout placeholder {layoutPos}",
|
|
30
|
-
placeholderIdentifier: "The placeholder identifier for panel member {id} of view {viewCodeName} is:"
|
|
30
|
+
placeholderIdentifier: "The placeholder identifier for panel member {id} of view {viewCodeName} is:",
|
|
31
|
+
refresh: "Refresh",
|
|
32
|
+
wxQrcodeCaption: "Please use wechat to scan the QR code to log in"
|
|
31
33
|
},
|
|
32
34
|
plugin: {
|
|
33
35
|
failureConfigurationLoad: "Configuration load failure",
|
|
@@ -27,7 +27,9 @@ const zhCn = {
|
|
|
27
27
|
noProvidedSlot: "\u672A\u63D0\u4F9B{id}\u63D2\u69FD",
|
|
28
28
|
cannotEmpty: "{caption} \u4E0D\u80FD\u4E3A\u7A7A",
|
|
29
29
|
unadaptedLayout: "\u672A\u9002\u914D\u7684\u5E03\u5C40\u5360\u4F4D{layoutPos}",
|
|
30
|
-
placeholderIdentifier: "\u89C6\u56FE{viewCodeName}\u7684\u9762\u677F\u6210\u5458{id}\u7684\u5360\u4F4D\u6807\u8BC6\u662F\uFF1A"
|
|
30
|
+
placeholderIdentifier: "\u89C6\u56FE{viewCodeName}\u7684\u9762\u677F\u6210\u5458{id}\u7684\u5360\u4F4D\u6807\u8BC6\u662F\uFF1A",
|
|
31
|
+
refresh: "\u5237\u65B0",
|
|
32
|
+
wxQrcodeCaption: "\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801\u767B\u5F55"
|
|
31
33
|
},
|
|
32
34
|
plugin: {
|
|
33
35
|
failureConfigurationLoad: "\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
require('../../use/index.cjs');
|
|
5
|
+
require('./auth-wxmp-qrcode.css');
|
|
6
|
+
var namespace = require('../../use/namespace/namespace.cjs');
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
const AuthWxmpQrcode = /* @__PURE__ */ vue.defineComponent({
|
|
10
|
+
name: "IBizAuthWxmpQrcode",
|
|
11
|
+
props: {
|
|
12
|
+
modelData: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
controller: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(props) {
|
|
22
|
+
const ns = namespace.useNamespace("auth-wxmp-qrcode");
|
|
23
|
+
vue.onUnmounted(() => {
|
|
24
|
+
props.controller.destroy();
|
|
25
|
+
});
|
|
26
|
+
const refreshQrcode = async () => {
|
|
27
|
+
await props.controller.loadQrcode();
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
ns,
|
|
31
|
+
refreshQrcode
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
render() {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
return vue.createVNode("div", {
|
|
37
|
+
"class": this.ns.b()
|
|
38
|
+
}, [vue.createVNode("div", {
|
|
39
|
+
"class": this.ns.e("content")
|
|
40
|
+
}, [vue.createVNode("img", {
|
|
41
|
+
"class": this.ns.e("qrcode"),
|
|
42
|
+
"src": (_a = this.controller.state.qrcode) == null ? void 0 : _a.url
|
|
43
|
+
}, null), ((_b = this.controller.state.qrcode) == null ? void 0 : _b.expirein) === 0 ? vue.createVNode("div", {
|
|
44
|
+
"class": this.ns.e("mask")
|
|
45
|
+
}, [vue.createVNode("ion-icon", {
|
|
46
|
+
"title": ibiz.i18n.t("vue3Util.panelComponent.refresh"),
|
|
47
|
+
"name": "reload-outline",
|
|
48
|
+
"onClick": this.refreshQrcode,
|
|
49
|
+
"class": this.ns.em("mask", "icon")
|
|
50
|
+
}, null)]) : null]), vue.createVNode("div", {
|
|
51
|
+
"class": this.ns.e("caption")
|
|
52
|
+
}, [this.controller.state.tips])]);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
exports.AuthWxmpQrcode = AuthWxmpQrcode;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
4
|
+
var qxUtil = require('qx-util');
|
|
5
|
+
var runtime = require('@ibiz-template/runtime');
|
|
6
|
+
var authWxmpQrcode_state = require('./auth-wxmp-qrcode.state.cjs');
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
class AuthWxmpQrcodeController extends runtime.PanelItemController {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
/**
|
|
13
|
+
* 轮询时间(秒)
|
|
14
|
+
* - 默认2秒
|
|
15
|
+
* @private
|
|
16
|
+
* @type {number}
|
|
17
|
+
* @memberof AuthWxmpQrcodeController
|
|
18
|
+
*/
|
|
19
|
+
this.pollingTime = 2;
|
|
20
|
+
/**
|
|
21
|
+
* 自定义补充参数
|
|
22
|
+
*
|
|
23
|
+
* @type {IData}
|
|
24
|
+
* @memberof AuthWxmpQrcodeController
|
|
25
|
+
*/
|
|
26
|
+
this.rawItemParams = {};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 创建状态对象
|
|
30
|
+
*
|
|
31
|
+
* @protected
|
|
32
|
+
* @return {*} {AuthWxmpQrcodeState}
|
|
33
|
+
* @memberof AuthWxmpQrcodeController
|
|
34
|
+
*/
|
|
35
|
+
createState() {
|
|
36
|
+
var _a;
|
|
37
|
+
return new authWxmpQrcode_state.AuthWxmpQrcodeState((_a = this.parent) == null ? void 0 : _a.state);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 初始化
|
|
41
|
+
*
|
|
42
|
+
* @protected
|
|
43
|
+
* @return {*} {Promise<void>}
|
|
44
|
+
* @memberof AuthWxmpQrcodeController
|
|
45
|
+
*/
|
|
46
|
+
async onInit() {
|
|
47
|
+
await super.onInit();
|
|
48
|
+
this.handleRawItemParams();
|
|
49
|
+
this.initParams();
|
|
50
|
+
await this.loadQrcode();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 处理自定义补充参数
|
|
54
|
+
*
|
|
55
|
+
* @protected
|
|
56
|
+
* @memberof AuthWxmpQrcodeController
|
|
57
|
+
*/
|
|
58
|
+
handleRawItemParams() {
|
|
59
|
+
var _a;
|
|
60
|
+
let params = {};
|
|
61
|
+
const rawItemParams = (_a = this.model.rawItem) == null ? void 0 : _a.rawItemParams;
|
|
62
|
+
if (qxUtil.notNilEmpty(rawItemParams)) {
|
|
63
|
+
params = rawItemParams.reduce((param, item) => {
|
|
64
|
+
param[item.key.toLowerCase()] = item.value;
|
|
65
|
+
return param;
|
|
66
|
+
}, {});
|
|
67
|
+
}
|
|
68
|
+
Object.assign(this.rawItemParams, params);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 初始化参数
|
|
72
|
+
*
|
|
73
|
+
* @protected
|
|
74
|
+
* @memberof AuthWxmpQrcodeController
|
|
75
|
+
*/
|
|
76
|
+
initParams() {
|
|
77
|
+
const isNumeric = (str) => {
|
|
78
|
+
return !!str && isFinite(Number(str));
|
|
79
|
+
};
|
|
80
|
+
this.pollingTime = isNumeric(this.rawItemParams.pollingtime) ? Number(this.rawItemParams.pollingtime) : 2;
|
|
81
|
+
this.state.tips = this.model.caption || ibiz.i18n.t("vue3Util.panelComponent.wxQrcodeCaption");
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 加载二维码
|
|
85
|
+
*
|
|
86
|
+
* @protected
|
|
87
|
+
* @return {*} {Promise<void>}
|
|
88
|
+
* @memberof AuthWxmpQrcodeController
|
|
89
|
+
*/
|
|
90
|
+
async loadQrcode() {
|
|
91
|
+
try {
|
|
92
|
+
const res = await ibiz.net.get(
|
|
93
|
+
"/uaa/open/wxmp/createqrcode",
|
|
94
|
+
{},
|
|
95
|
+
{ srfdcsystem: ibiz.env.dcSystem }
|
|
96
|
+
);
|
|
97
|
+
if (res.ok && res.data) {
|
|
98
|
+
this.state.qrcode = res.data;
|
|
99
|
+
this.setTimer();
|
|
100
|
+
}
|
|
101
|
+
} catch (error) {
|
|
102
|
+
ibiz.log.error(error.message);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 设置定时器
|
|
107
|
+
*
|
|
108
|
+
* @protected
|
|
109
|
+
* @memberof AuthWxmpQrcodeController
|
|
110
|
+
*/
|
|
111
|
+
setTimer() {
|
|
112
|
+
this.expirationTimer = setInterval(() => {
|
|
113
|
+
if (this.state.qrcode && this.state.qrcode.expirein > 0) {
|
|
114
|
+
this.state.qrcode.expirein -= 1;
|
|
115
|
+
} else {
|
|
116
|
+
clearInterval(this.expirationTimer);
|
|
117
|
+
}
|
|
118
|
+
}, 1e3);
|
|
119
|
+
this.pollingTimer = setInterval(async () => {
|
|
120
|
+
await this.pollingLogin();
|
|
121
|
+
}, this.pollingTime * 1e3);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 轮询登录
|
|
125
|
+
*
|
|
126
|
+
* @protected
|
|
127
|
+
* @return {*} {Promise<void>}
|
|
128
|
+
* @memberof AuthWxmpQrcodeController
|
|
129
|
+
*/
|
|
130
|
+
async pollingLogin() {
|
|
131
|
+
try {
|
|
132
|
+
if (this.state.qrcode && this.state.qrcode.expirein > 0) {
|
|
133
|
+
const res = await ibiz.net.get(
|
|
134
|
+
"/uaa/open/wxmp/qrcode/".concat(this.state.qrcode.ticket),
|
|
135
|
+
{},
|
|
136
|
+
{ srfdcsystem: ibiz.env.dcSystem }
|
|
137
|
+
);
|
|
138
|
+
const { data, ok } = res;
|
|
139
|
+
if (ok && (data == null ? void 0 : data.token)) {
|
|
140
|
+
clearInterval(this.pollingTimer);
|
|
141
|
+
qxUtil.setCookie(core.CoreConst.TOKEN, data.token, 0, true);
|
|
142
|
+
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (data.expirein || 7199) * 1e3;
|
|
143
|
+
qxUtil.setCookie(core.CoreConst.TOKEN_EXPIRES, "".concat(expiredDate), 0, true);
|
|
144
|
+
if (data.refresh_token) {
|
|
145
|
+
qxUtil.setCookie(core.CoreConst.REFRESH_TOKEN, data.refresh_token, 0, true);
|
|
146
|
+
}
|
|
147
|
+
qxUtil.clearCookie(core.CoreConst.IS_ANONYMOUS, true);
|
|
148
|
+
window.location.hash = "/";
|
|
149
|
+
window.history.pushState({}, "");
|
|
150
|
+
window.location.reload();
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
clearInterval(this.pollingTimer);
|
|
154
|
+
}
|
|
155
|
+
} catch (error) {
|
|
156
|
+
ibiz.log.error(error.message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 销毁方法
|
|
161
|
+
*
|
|
162
|
+
* @return {*} {Promise<void>}
|
|
163
|
+
* @memberof AuthWxmpQrcodeController
|
|
164
|
+
*/
|
|
165
|
+
async destroy() {
|
|
166
|
+
await super.destroy();
|
|
167
|
+
if (this.pollingTimer) {
|
|
168
|
+
clearInterval(this.pollingTimer);
|
|
169
|
+
this.pollingTimer = void 0;
|
|
170
|
+
}
|
|
171
|
+
if (this.expirationTimer) {
|
|
172
|
+
clearInterval(this.expirationTimer);
|
|
173
|
+
this.expirationTimer = void 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
exports.AuthWxmpQrcodeController = AuthWxmpQrcodeController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-auth-wxmp-qrcode{width:100%;height:100%}.ibiz-auth-wxmp-qrcode__content{position:relative;width:100%;height:100%}.ibiz-auth-wxmp-qrcode__qrcode{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ibiz-auth-wxmp-qrcode__caption{font-size:var(--ibiz-font-size-small);text-align:center}.ibiz-auth-wxmp-qrcode__mask{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--ibiz-color-primary);background-color:rgba(255,255,255,.9)}.ibiz-auth-wxmp-qrcode__mask--icon{font-size:var(--ibiz-font-size-header-1);cursor:pointer}.ibiz-auth-wxmp-qrcode__mask--icon:hover{color:var(--ibiz-color-primary-hover)}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var authWxmpQrcode_controller = require('./auth-wxmp-qrcode.controller.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
class AuthWxmpQrcodeProvider {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.component = "IBizAuthWxmpQrcode";
|
|
9
|
+
}
|
|
10
|
+
async createController(panelItem, panel, parent) {
|
|
11
|
+
const c = new authWxmpQrcode_controller.AuthWxmpQrcodeController(panelItem, panel, parent);
|
|
12
|
+
await c.init();
|
|
13
|
+
return c;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.AuthWxmpQrcodeProvider = AuthWxmpQrcodeProvider;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var runtime = require('@ibiz-template/runtime');
|
|
6
|
+
require('../../util/index.cjs');
|
|
7
|
+
var authWxmpQrcode = require('./auth-wxmp-qrcode.cjs');
|
|
8
|
+
var authWxmpQrcode_provider = require('./auth-wxmp-qrcode.provider.cjs');
|
|
9
|
+
var install = require('../../util/install.cjs');
|
|
10
|
+
|
|
11
|
+
"use strict";
|
|
12
|
+
const IBizAuthWxmpQrcode = install.withInstall(
|
|
13
|
+
authWxmpQrcode.AuthWxmpQrcode,
|
|
14
|
+
function(v) {
|
|
15
|
+
v.component(authWxmpQrcode.AuthWxmpQrcode.name, authWxmpQrcode.AuthWxmpQrcode);
|
|
16
|
+
runtime.registerPanelItemProvider(
|
|
17
|
+
"RAWITEM_AUTH_WXMP_QRCODE",
|
|
18
|
+
() => new authWxmpQrcode_provider.AuthWxmpQrcodeProvider()
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
exports.IBizAuthWxmpQrcode = IBizAuthWxmpQrcode;
|
|
24
|
+
exports.default = IBizAuthWxmpQrcode;
|
|
@@ -17,6 +17,7 @@ var index$d = require('./panel-item-render/index.cjs');
|
|
|
17
17
|
var index$e = require('./teleport-placeholder/index.cjs');
|
|
18
18
|
var index$f = require('./panel-container-tabs/index.cjs');
|
|
19
19
|
var index$g = require('./panel-ctrl-view-page-caption/index.cjs');
|
|
20
|
+
var index$h = require('./auth-wxmp-qrcode/index.cjs');
|
|
20
21
|
var panelContainer_state = require('./panel-container/panel-container.state.cjs');
|
|
21
22
|
var panelContainer_controller = require('./panel-container/panel-container.controller.cjs');
|
|
22
23
|
var panelCtrlPos_controller = require('./panel-ctrl-pos/panel-ctrl-pos.controller.cjs');
|
|
@@ -61,6 +62,7 @@ exports.IBizPanelItemRender = index$d.IBizPanelItemRender;
|
|
|
61
62
|
exports.IBizTeleportPlaceholder = index$e.IBizTeleportPlaceholder;
|
|
62
63
|
exports.IBizPanelContainerTabs = index$f.IBizPanelContainerTabs;
|
|
63
64
|
exports.IBizPanelCtrlViewPageCaption = index$g.IBizPanelCtrlViewPageCaption;
|
|
65
|
+
exports.IBizAuthWxmpQrcode = index$h.IBizAuthWxmpQrcode;
|
|
64
66
|
exports.PanelContainerState = panelContainer_state.PanelContainerState;
|
|
65
67
|
exports.PanelContainerController = panelContainer_controller.PanelContainerController;
|
|
66
68
|
exports.PanelCtrlPosController = panelCtrlPos_controller.PanelCtrlPosController;
|
|
@@ -44,7 +44,20 @@ class MultiDataContainerController extends runtime.PanelItemController {
|
|
|
44
44
|
async onInit() {
|
|
45
45
|
await super.onInit();
|
|
46
46
|
await this.initPanelItemProviders();
|
|
47
|
-
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 面板状态变更通知
|
|
50
|
+
*
|
|
51
|
+
* @author tony001
|
|
52
|
+
* @date 2024-12-11 11:12:24
|
|
53
|
+
* @param {PanelNotifyState} _state
|
|
54
|
+
* @return {*} {Promise<void>}
|
|
55
|
+
*/
|
|
56
|
+
async panelStateNotify(_state) {
|
|
57
|
+
super.panelStateNotify(_state);
|
|
58
|
+
if (_state === runtime.PanelNotifyState.LOAD) {
|
|
59
|
+
this.initContainerData();
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
62
|
/**
|
|
50
63
|
* 初始化面板成员控制器
|
package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs
CHANGED
|
@@ -40,7 +40,19 @@ class MultiDataContainerRawController extends runtime.PanelItemController {
|
|
|
40
40
|
async onInit() {
|
|
41
41
|
await super.onInit();
|
|
42
42
|
await this.initPanelItemControllers();
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 面板状态变更通知
|
|
46
|
+
*
|
|
47
|
+
* @param {PanelNotifyState} _state
|
|
48
|
+
* @return {*} {Promise<void>}
|
|
49
|
+
* @memberof MultiDataContainerRawController
|
|
50
|
+
*/
|
|
51
|
+
async panelStateNotify(_state) {
|
|
52
|
+
super.panelStateNotify(_state);
|
|
53
|
+
if (_state === runtime.PanelNotifyState.LOAD) {
|
|
54
|
+
this.initContainerData();
|
|
55
|
+
}
|
|
44
56
|
}
|
|
45
57
|
/**
|
|
46
58
|
* 初始化面板子项控制器
|
|
@@ -43,7 +43,19 @@ class SingleDataContainerController extends runtime.PanelItemController {
|
|
|
43
43
|
async onInit() {
|
|
44
44
|
await super.onInit();
|
|
45
45
|
await this.initPanelItemControllers();
|
|
46
|
-
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 面板状态变更通知
|
|
49
|
+
*
|
|
50
|
+
* @param {PanelNotifyState} _state
|
|
51
|
+
* @return {*} {Promise<void>}
|
|
52
|
+
* @memberof SingleDataContainerController
|
|
53
|
+
*/
|
|
54
|
+
async panelStateNotify(_state) {
|
|
55
|
+
super.panelStateNotify(_state);
|
|
56
|
+
if (_state === runtime.PanelNotifyState.LOAD) {
|
|
57
|
+
this.initContainerData();
|
|
58
|
+
}
|
|
47
59
|
}
|
|
48
60
|
/**
|
|
49
61
|
* 初始化面板成员控制器
|