@ibiz-template/vue3-components 0.6.3 → 0.6.5
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-g46jPHhP.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-c9vmypX3.js → xlsx-util-pbX8mbMO.js} +1 -1
- package/es/common/data-import/data-import.d.ts +16 -0
- package/es/common/data-import/data-import.mjs +10 -2
- package/es/control/calendar/calendar.css +1 -1
- package/es/control/calendar/calendar.d.ts +1 -0
- package/es/control/calendar/calendar.mjs +32 -11
- package/es/control/calendar/index.d.ts +1 -0
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.mjs +1 -0
- package/es/control/drbar/drbar.d.ts +1 -0
- package/es/control/drbar/drbar.mjs +35 -5
- package/es/control/drbar/index.d.ts +1 -0
- package/es/control/drtab/drtab.mjs +30 -3
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +16 -16
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/kanban/kanban.css +1 -1
- package/es/control/toolbar/toolbar.css +1 -1
- package/es/control/toolbar/toolbar.mjs +15 -2
- package/es/control/tree-grid-ex/tree-grid-ex.css +1 -1
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.d.ts +1 -0
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.mjs +9 -2
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +4 -1
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +1 -0
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +17 -2
- package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.d.ts +1 -0
- package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.mjs +9 -2
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.d.ts +1 -0
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.mjs +9 -2
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -0
- package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +1 -1
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.d.ts +1 -0
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.mjs +11 -1
- package/es/editor/text-box/input/input.css +1 -1
- package/es/editor/text-box/input/input.d.ts +2 -0
- package/es/editor/text-box/input/input.mjs +14 -1
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.d.ts +8 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.mjs +27 -17
- package/es/panel-component/user-message/user-message.css +1 -1
- package/es/panel-component/user-message/user-message.mjs +6 -4
- package/es/util/notification-util/notification-util.mjs +3 -1
- package/es/view-engine/edit-view.engine.mjs +5 -1
- package/es/view-engine/opt-view.engine.mjs +5 -1
- package/es/web-app/guard/auth-guard/auth-guard.d.ts +7 -0
- package/es/web-app/guard/auth-guard/auth-guard.mjs +31 -1
- package/es/web-app/main.mjs +2 -2
- package/lib/common/data-import/data-import.cjs +10 -2
- package/lib/control/calendar/calendar.cjs +32 -11
- package/lib/control/calendar/calendar.css +1 -1
- package/lib/control/dashboard/custom-dashboard-container/custom-dashboard-container.cjs +1 -0
- package/lib/control/drbar/drbar.cjs +32 -2
- package/lib/control/drtab/drtab.cjs +27 -0
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/kanban/kanban.css +1 -1
- package/lib/control/toolbar/toolbar.cjs +15 -2
- package/lib/control/toolbar/toolbar.css +1 -1
- package/lib/control/tree-grid-ex/tree-grid-ex.css +1 -1
- package/lib/editor/cascader/ibiz-cascader/ibiz-cascader.cjs +9 -2
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +4 -1
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +17 -2
- package/lib/editor/date-picker/ibiz-date-picker/ibiz-date-picker.cjs +9 -2
- package/lib/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.cjs +9 -2
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -0
- package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +1 -1
- package/lib/editor/text-box/ibiz-input-ip/ibiz-input-ip.cjs +11 -1
- package/lib/editor/text-box/input/input.cjs +14 -1
- package/lib/editor/text-box/input/input.css +1 -1
- package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.cjs +27 -17
- package/lib/panel-component/user-message/user-message.cjs +5 -3
- package/lib/panel-component/user-message/user-message.css +1 -1
- package/lib/util/notification-util/notification-util.cjs +3 -1
- package/lib/view-engine/edit-view.engine.cjs +5 -1
- package/lib/view-engine/opt-view.engine.cjs +5 -1
- package/lib/web-app/guard/auth-guard/auth-guard.cjs +30 -0
- package/lib/web-app/main.cjs +2 -2
- package/package.json +4 -4
- package/dist/index-9YFoUwI0.js +0 -4
|
@@ -22,10 +22,20 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
22
22
|
const editorModel = c.model;
|
|
23
23
|
const isEditable = vue.ref(false);
|
|
24
24
|
const editorRef = vue.ref();
|
|
25
|
+
const showLimit = vue.ref(true);
|
|
26
|
+
const isAuto = vue.ref(false);
|
|
25
27
|
const rows = vue.ref(2);
|
|
26
28
|
if (editorModel.editorType === "TEXTAREA_10") {
|
|
27
29
|
rows.value = 10;
|
|
28
30
|
}
|
|
31
|
+
if (c.editorParams) {
|
|
32
|
+
if (c.editorParams.SHOWLIMIT === "false") {
|
|
33
|
+
showLimit.value = false;
|
|
34
|
+
}
|
|
35
|
+
if (c.editorParams.ISAUTO === "true") {
|
|
36
|
+
isAuto.value = true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
29
39
|
const type = vue.computed(() => {
|
|
30
40
|
switch (editorModel.editorType) {
|
|
31
41
|
case "TEXTBOX":
|
|
@@ -225,6 +235,8 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
225
235
|
shouldAutoComplete,
|
|
226
236
|
isEditable,
|
|
227
237
|
setEditable,
|
|
238
|
+
showLimit,
|
|
239
|
+
isAuto,
|
|
228
240
|
showFormDefaultContent
|
|
229
241
|
};
|
|
230
242
|
},
|
|
@@ -267,9 +279,10 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
|
|
|
267
279
|
"type": this.type,
|
|
268
280
|
"rows": this.rows,
|
|
269
281
|
"resize": "none",
|
|
282
|
+
"autosize": this.isAuto,
|
|
270
283
|
"maxlength": this.c.model.maxLength,
|
|
271
284
|
"minlength": this.c.model.minLength,
|
|
272
|
-
"show-word-limit": this.c.model.showMaxLength,
|
|
285
|
+
"show-word-limit": this.showLimit && this.c.model.showMaxLength,
|
|
273
286
|
"onInput": this.handleChange,
|
|
274
287
|
"onKeyup": this.handleKeyUp,
|
|
275
288
|
"onBlur": this.onBlur,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-input{width:100%;height:100%;font-size:var(--ibiz-form-item-font-size);font-weight:var(--ibiz-form-item-regular);--ibiz-input-min-height:var(--ibiz-editor-default-line-height)}.ibiz-input__ai-chat{position:absolute;right:10px;bottom:10px;width:36px;height:36px;padding:8px;font-size:18px;color:var(--ibiz-color-primary-text);cursor:pointer;background-color:var(--ibiz-color-primary);border-radius:15px}.ibiz-input__ai-chat:hover{color:var(--ibiz-color-primary-hover-text);background-color:var(--ibiz-color-primary-hover)}.ibiz-input .el-input .el-input__inner{height:100%}.ibiz-input .el-input .el-input__inner::-moz-placeholder{color:var(--ibiz-form-item-placeholder-color)}.ibiz-input .el-input .el-input__inner::placeholder{color:var(--ibiz-form-item-placeholder-color)}.ibiz-input .el-textarea .el-textarea__inner{height:100%}.ibiz-input .el-textarea .el-textarea__inner::-moz-placeholder{color:var(--ibiz-form-item-placeholder-color);word-break:break-word;white-space:pre-wrap}.ibiz-input .el-textarea .el-textarea__inner::placeholder{color:var(--ibiz-form-item-placeholder-color);word-break:break-word;white-space:pre-wrap}.ibiz-input .ibiz-input-input{height:100%}.ibiz-input .ibiz-input-input .el-input__wrapper{width:100%;min-height:var(--ibiz-input-min-height)}.ibiz-input--readonly{height:auto;line-height:var(--ibiz-input-min-height);color:var(--ibiz-form-item-readonly-color)}.ibiz-input .el-input__suffix .ibiz-input__unit{font-style:normal}.ibiz-input-form-default-content{display:none}.ibiz-form-item .ibiz-input.is-show-default.is-textarea{padding:var(--ibiz-form-item-hover-edit-padding)}.ibiz-form-item .ibiz-input.is-show-default.is-textarea .ibiz-input-form-default-content{display:
|
|
1
|
+
.ibiz-input{width:100%;height:100%;font-size:var(--ibiz-form-item-font-size);font-weight:var(--ibiz-form-item-regular);--ibiz-input-min-height:var(--ibiz-editor-default-line-height)}.ibiz-input__ai-chat{position:absolute;right:10px;bottom:10px;width:36px;height:36px;padding:8px;font-size:18px;color:var(--ibiz-color-primary-text);cursor:pointer;background-color:var(--ibiz-color-primary);border-radius:15px}.ibiz-input__ai-chat:hover{color:var(--ibiz-color-primary-hover-text);background-color:var(--ibiz-color-primary-hover)}.ibiz-input .el-input .el-input__inner{height:100%}.ibiz-input .el-input .el-input__inner::-moz-placeholder{color:var(--ibiz-form-item-placeholder-color)}.ibiz-input .el-input .el-input__inner::placeholder{color:var(--ibiz-form-item-placeholder-color)}.ibiz-input .el-textarea .el-textarea__inner{height:100%}.ibiz-input .el-textarea .el-textarea__inner::-moz-placeholder{color:var(--ibiz-form-item-placeholder-color);word-break:break-word;white-space:pre-wrap}.ibiz-input .el-textarea .el-textarea__inner::placeholder{color:var(--ibiz-form-item-placeholder-color);word-break:break-word;white-space:pre-wrap}.ibiz-input .ibiz-input-input{height:100%}.ibiz-input .ibiz-input-input .el-input__wrapper{width:100%;min-height:var(--ibiz-input-min-height)}.ibiz-input--readonly{height:auto;line-height:var(--ibiz-input-min-height);color:var(--ibiz-form-item-readonly-color)}.ibiz-input .el-input__suffix .ibiz-input__unit{font-style:normal}.ibiz-input-form-default-content{display:none}.ibiz-form-item .ibiz-input.is-show-default.is-textarea{padding:var(--ibiz-form-item-hover-edit-padding)}.ibiz-form-item .ibiz-input.is-show-default.is-textarea .ibiz-input-form-default-content{display:block}.ibiz-form-item .ibiz-input.is-show-default.is-textarea .ibiz-input-input{display:none}.ibiz-form-item .ibiz-input.is-show-default:hover .ibiz-input-form-default-content{display:none}.ibiz-form-item .ibiz-input.is-show-default:hover .ibiz-input-input{display:inline-flex}.ibiz-form-item .ibiz-input.is-show-default .ibiz-input-form-default-content{display:flex;align-items:center;width:100%;padding:var(--ibiz-form-item-hover-edit-padding);font-family:Arial,sans-serif;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-text-color)}.ibiz-form-item .ibiz-input.is-show-default .ibiz-input-input{display:none;font-family:Arial,sans-serif}.ibiz-form-item .ibiz-input.is-show-default.is-editable .ibiz-input-form-default-content{display:none}.ibiz-form-item .ibiz-input.is-show-default.is-editable .ibiz-input-input{display:inline-flex}
|
|
@@ -27,16 +27,7 @@ class InternalMessageDefaultProvider {
|
|
|
27
27
|
async onClick(message, _event) {
|
|
28
28
|
await ibiz.hub.notice.internalMessage.markRead(message);
|
|
29
29
|
const redirectUrl = ibiz.env.isMob ? message.mobile_url : message.url;
|
|
30
|
-
|
|
31
|
-
if (redirectUrl.startsWith("view://")) {
|
|
32
|
-
this.openRedirectView(message, redirectUrl);
|
|
33
|
-
} else if (redirectUrl.startsWith("route://")) {
|
|
34
|
-
const routeUrl = "/".concat(redirectUrl.split("route://")[1]);
|
|
35
|
-
this.router.push(routeUrl);
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
30
|
+
return this.openViewByUrl(redirectUrl);
|
|
40
31
|
}
|
|
41
32
|
/**
|
|
42
33
|
* 解析url并打开对应视图,打开视图前会先标记已读
|
|
@@ -48,13 +39,32 @@ class InternalMessageDefaultProvider {
|
|
|
48
39
|
*/
|
|
49
40
|
async openRedirectView(msg, redirectUrl) {
|
|
50
41
|
await ibiz.hub.notice.internalMessage.markRead(msg);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
this.openViewByUrl(redirectUrl);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 解析url并打开对应视图
|
|
46
|
+
* @param {string} redirectUrl
|
|
47
|
+
* @return {*}
|
|
48
|
+
* @author: zhujiamin
|
|
49
|
+
* @Date: 2024-03-04 11:16:40
|
|
50
|
+
*/
|
|
51
|
+
openViewByUrl(redirectUrl) {
|
|
52
|
+
if (redirectUrl) {
|
|
53
|
+
if (redirectUrl.startsWith("view://")) {
|
|
54
|
+
const { viewId, context, params } = runtime.parseViewProtocol(redirectUrl);
|
|
55
|
+
ibiz.commands.execute(
|
|
56
|
+
runtime.OpenAppViewCommand.TAG,
|
|
57
|
+
viewId,
|
|
58
|
+
core.IBizContext.create(context),
|
|
59
|
+
params
|
|
60
|
+
);
|
|
61
|
+
} else if (redirectUrl.startsWith("route://")) {
|
|
62
|
+
const routeUrl = "/".concat(redirectUrl.split("route://")[1]);
|
|
63
|
+
this.router.push(routeUrl);
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
|
|
@@ -6,6 +6,8 @@ var runtime = require('@ibiz-template/runtime');
|
|
|
6
6
|
require('./user-message.css');
|
|
7
7
|
var asyncActionTab = require('./async-action/async-action-tab/async-action-tab.cjs');
|
|
8
8
|
require('./internal-message/index.cjs');
|
|
9
|
+
require('./internal-message/common/index.cjs');
|
|
10
|
+
var internalMessageDefault_provider = require('./internal-message/common/internal-message-default/internal-message-default.provider.cjs');
|
|
9
11
|
var internalMessageTab = require('./internal-message/internal-message-tab/internal-message-tab.cjs');
|
|
10
12
|
|
|
11
13
|
"use strict";
|
|
@@ -27,6 +29,8 @@ const UserMessage = /* @__PURE__ */ vue.defineComponent({
|
|
|
27
29
|
const noticeController = ibiz.hub.notice;
|
|
28
30
|
const showPopover = vue.ref(false);
|
|
29
31
|
let hiddenTime = 0;
|
|
32
|
+
noticeController.internalMessage.ns = ns;
|
|
33
|
+
noticeController.internalMessage.provider = new internalMessageDefault_provider.InternalMessageDefaultProvider();
|
|
30
34
|
const currentTab = vue.ref("notification");
|
|
31
35
|
const sysImage = props.modelData.sysImage || {
|
|
32
36
|
imagePath: "svg/message.svg"
|
|
@@ -40,9 +44,6 @@ const UserMessage = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
44
|
noticeNum.value = total;
|
|
41
45
|
};
|
|
42
46
|
noticeController.evt.on("totalChange", onNumChange);
|
|
43
|
-
vue.onUnmounted(() => {
|
|
44
|
-
noticeController.evt.off("totalChange", onNumChange);
|
|
45
|
-
});
|
|
46
47
|
const onBatchReadClick = () => {
|
|
47
48
|
noticeController.internalMessage.batchMarkRead();
|
|
48
49
|
};
|
|
@@ -67,6 +68,7 @@ const UserMessage = /* @__PURE__ */ vue.defineComponent({
|
|
|
67
68
|
document.addEventListener("visibilitychange", handleVisibleChange);
|
|
68
69
|
});
|
|
69
70
|
vue.onUnmounted(() => {
|
|
71
|
+
noticeController.evt.off("totalChange", onNumChange);
|
|
70
72
|
document.removeEventListener("visibilitychange", handleVisibleChange);
|
|
71
73
|
});
|
|
72
74
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-user-message{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ibiz-user-message__image{width:28px;height:28px;cursor:pointer}.ibiz-user-message__badge .el-badge__content{top:4px;right:calc(7px + var(--el-badge-size)/ 2);border-width:0}.ibiz-user-message-popover{width:500px!important;height:500px!important}.ibiz-user-message-popover.el-popover{padding-top:2px;padding-bottom:0}.ibiz-user-message-popover-content-box{position:relative;height:100%}.ibiz-user-message-popover-icons{position:absolute;top:10px;right:0}.ibiz-user-message-popover-icons .ibiz-user-message-popover-icons-read{cursor:pointer}.ibiz-user-message-popover-icons .ibiz-user-message-popover-icons-read:hover{color:var(--ibiz-color-primary)}.ibiz-user-message-popover-content{height:100%}.ibiz-user-message-popover-content>.el-tabs__content{height:calc(100% - 55px)}.ibiz-user-message-popover-content>.el-tabs__content>.el-tab-pane{height:100%;overflow:auto}
|
|
1
|
+
.ibiz-user-message{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ibiz-user-message__image{width:28px;height:28px;cursor:pointer}.ibiz-user-message__badge .el-badge__content{top:4px;right:calc(7px + var(--el-badge-size)/ 2);border-width:0}.ibiz-user-message-popover{width:500px!important;height:500px!important}.ibiz-user-message-popover.el-popover{padding-top:2px;padding-bottom:0}.ibiz-user-message-popover-content-box{position:relative;height:100%}.ibiz-user-message-popover-icons{position:absolute;top:10px;right:0}.ibiz-user-message-popover-icons .ibiz-user-message-popover-icons-read{cursor:pointer}.ibiz-user-message-popover-icons .ibiz-user-message-popover-icons-read:hover{color:var(--ibiz-color-primary)}.ibiz-user-message-popover-content{height:100%}.ibiz-user-message-popover-content>.el-tabs__content{height:calc(100% - 55px)}.ibiz-user-message-popover-content>.el-tabs__content>.el-tab-pane{height:100%;overflow:auto}.ibiz-user-message-notice{padding:var(--ibiz-spacing-tight)}.ibiz-user-message-notice .el-notification__group{margin:0}
|
|
@@ -60,13 +60,17 @@ class EditViewEngine extends runtime.ViewEngineBase {
|
|
|
60
60
|
}
|
|
61
61
|
this.view.slotProps.toolbar.manualCalcButtonState = true;
|
|
62
62
|
modal.hooks.shouldDismiss.tapPromise(async (context) => {
|
|
63
|
-
|
|
63
|
+
const uiDomain = ibiz.uiDomainManager.get(this.view.context.srfsessionid);
|
|
64
|
+
const isChange = (this.form.state.modified || uiDomain.dataModification) && this.view.model.enableDirtyChecking === true;
|
|
65
|
+
if (isChange && context.allowClose == null) {
|
|
64
66
|
const isAllow = await ibiz.confirm.error({
|
|
65
67
|
title: "\u5173\u95ED\u63D0\u9192",
|
|
66
68
|
desc: "\u8868\u5355\u6570\u636E\u5DF2\u7ECF\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5173\u95ED\uFF1F"
|
|
67
69
|
});
|
|
68
70
|
if (!isAllow) {
|
|
69
71
|
context.allowClose = false;
|
|
72
|
+
} else {
|
|
73
|
+
context.allowClose = true;
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
});
|
|
@@ -32,13 +32,17 @@ class OptViewEngine extends runtime.ViewEngineBase {
|
|
|
32
32
|
}
|
|
33
33
|
this.view.slotProps.toolbar.manualCalcButtonState = true;
|
|
34
34
|
modal.hooks.shouldDismiss.tapPromise(async (context) => {
|
|
35
|
-
|
|
35
|
+
const uiDomain = ibiz.uiDomainManager.get(this.view.context.srfsessionid);
|
|
36
|
+
const isChange = (this.form.state.modified || uiDomain.dataModification) && this.view.model.enableDirtyChecking === true;
|
|
37
|
+
if (isChange && context.allowClose == null) {
|
|
36
38
|
const isAllow = await ibiz.confirm.error({
|
|
37
39
|
title: "\u5173\u95ED\u63D0\u9192",
|
|
38
40
|
desc: "\u8868\u5355\u6570\u636E\u5DF2\u7ECF\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5173\u95ED\uFF1F"
|
|
39
41
|
});
|
|
40
42
|
if (!isAllow) {
|
|
41
43
|
context.allowClose = false;
|
|
44
|
+
} else {
|
|
45
|
+
context.allowClose = true;
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var core = require('@ibiz-template/core');
|
|
4
4
|
var ramda = require('ramda');
|
|
5
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
+
var qxUtil = require('qx-util');
|
|
6
7
|
|
|
7
8
|
"use strict";
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
@@ -107,6 +108,7 @@ class AuthGuard {
|
|
|
107
108
|
if (ibiz.env.isSaaSMode === true) {
|
|
108
109
|
await this.loadOrgData();
|
|
109
110
|
}
|
|
111
|
+
await this.refreshToken();
|
|
110
112
|
await this.loadAppData();
|
|
111
113
|
await this.initModel();
|
|
112
114
|
await ibiz.auth.extendLogin();
|
|
@@ -215,6 +217,34 @@ class AuthGuard {
|
|
|
215
217
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
218
|
});
|
|
217
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* 根据refreshToken获取新token
|
|
222
|
+
* @return {*}
|
|
223
|
+
* @author: zhujiamin
|
|
224
|
+
* @Date: 2024-03-05 11:38:20
|
|
225
|
+
*/
|
|
226
|
+
async refreshToken() {
|
|
227
|
+
const remember = qxUtil.getCookie(core.CoreConst.TOKEN_REMEMBER);
|
|
228
|
+
const token = qxUtil.getCookie(core.CoreConst.TOKEN);
|
|
229
|
+
const refreshToken = qxUtil.getCookie(core.CoreConst.REFRESH_TOKEN);
|
|
230
|
+
const cacheDay = remember ? 7 : 0;
|
|
231
|
+
if (!token && refreshToken != null && refreshToken !== "") {
|
|
232
|
+
const res = await ibiz.net.get("/uaa/refresh_token/".concat(refreshToken));
|
|
233
|
+
if (res.ok) {
|
|
234
|
+
qxUtil.setCookie(core.CoreConst.TOKEN, res.data.token, cacheDay, true);
|
|
235
|
+
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (res.data.expirein || 7199) * 1e3;
|
|
236
|
+
qxUtil.setCookie(core.CoreConst.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay, true);
|
|
237
|
+
if (res.data.refresh_token) {
|
|
238
|
+
qxUtil.setCookie(
|
|
239
|
+
core.CoreConst.REFRESH_TOKEN,
|
|
240
|
+
res.data.refresh_token,
|
|
241
|
+
cacheDay,
|
|
242
|
+
true
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
218
248
|
}
|
|
219
249
|
|
|
220
250
|
exports.AuthGuard = AuthGuard;
|
package/lib/web-app/main.cjs
CHANGED
|
@@ -10,6 +10,7 @@ require('./util/index.cjs');
|
|
|
10
10
|
var index = require('./router/index.cjs');
|
|
11
11
|
require('../util/index.cjs');
|
|
12
12
|
require('./guard/index.cjs');
|
|
13
|
+
var unauthorizedHandler = require('./util/unauthorized-handler/unauthorized-handler.cjs');
|
|
13
14
|
var dynaAuthGuard = require('./guard/auth-guard/dyna-auth-guard.cjs');
|
|
14
15
|
var openViewUtil = require('../util/open-view-util/open-view-util.cjs');
|
|
15
16
|
var messageUtil = require('../util/message-util/message-util.cjs');
|
|
@@ -19,7 +20,6 @@ var notificationUtil = require('../util/notification-util/notification-util.cjs'
|
|
|
19
20
|
var loadingUtil = require('../util/loading-util/loading-util.cjs');
|
|
20
21
|
var noticeUtil = require('../util/notice-util/notice-util.cjs');
|
|
21
22
|
var overlayController = require('../util/overlay-controller/overlay-controller.cjs');
|
|
22
|
-
var unauthorizedHandler = require('./util/unauthorized-handler/unauthorized-handler.cjs');
|
|
23
23
|
|
|
24
24
|
"use strict";
|
|
25
25
|
async function runApp(plugins, opts) {
|
|
@@ -33,6 +33,7 @@ async function runApp(plugins, opts) {
|
|
|
33
33
|
core.install();
|
|
34
34
|
runtime.install();
|
|
35
35
|
ibiz.plugin = new vue3Util.PluginFactory();
|
|
36
|
+
ibiz.util.error.register(new unauthorizedHandler.UnauthorizedHandler());
|
|
36
37
|
const app = createVueApp.createVueApp(App.default);
|
|
37
38
|
vue3Util.OverlayContainer.createVueApp = createVueApp.createVueApp;
|
|
38
39
|
window.onerror = function(_event, _source, _lineno, _colno, error) {
|
|
@@ -66,7 +67,6 @@ async function runApp(plugins, opts) {
|
|
|
66
67
|
ibiz.util.text.format = (value, code) => {
|
|
67
68
|
return app.config.globalProperties.$textFormat(value, code);
|
|
68
69
|
};
|
|
69
|
-
ibiz.util.error.register(new unauthorizedHandler.UnauthorizedHandler());
|
|
70
70
|
await ibiz.i18n.init();
|
|
71
71
|
app.mount("#app");
|
|
72
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "使用 rollup 编译 vue 组件或者 jsx",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"@ibiz-template-plugin/gantt": "0.1.3-alpha.41",
|
|
33
33
|
"@ibiz-template/core": "0.6.3",
|
|
34
34
|
"@ibiz-template/devtool": "0.0.1-dev.6",
|
|
35
|
-
"@ibiz-template/model-helper": "0.6.
|
|
36
|
-
"@ibiz-template/runtime": "0.6.
|
|
35
|
+
"@ibiz-template/model-helper": "0.6.5",
|
|
36
|
+
"@ibiz-template/runtime": "0.6.5",
|
|
37
37
|
"@ibiz-template/theme": "^0.6.0",
|
|
38
|
-
"@ibiz-template/vue3-util": "0.6.
|
|
38
|
+
"@ibiz-template/vue3-util": "0.6.5",
|
|
39
39
|
"@ibiz-template/web-theme": "^1.1.11",
|
|
40
40
|
"@ibiz/model-core": "^0.1.14",
|
|
41
41
|
"@imengyu/vue3-context-menu": "^1.3.5",
|