@ibiz-template/vue3-components 0.5.7-alpha.3 → 0.5.7-alpha.4
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/ibiz-markdown-editor-anJxfRF1.js +1 -0
- package/dist/index-knHzHtox.js +2 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-R2mUYWuB.js +1 -0
- package/dist/{xlsx-util-15YjErDj.js → xlsx-util-kzUgnbtt.js} +1 -1
- package/es/common/data-import2/data-import2.mjs +7 -1
- package/es/common/doing-notice/doing-notice.css +1 -0
- package/es/common/doing-notice/doing-notice.d.ts +19 -0
- package/es/common/doing-notice/doing-notice.mjs +38 -0
- package/es/common/index.d.ts +1 -0
- package/es/common/index.mjs +3 -1
- package/es/editor/html/html-editor.controller.d.ts +0 -26
- package/es/editor/html/html-editor.controller.mjs +1 -64
- package/es/editor/html/wang-editor/wang-editor.mjs +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +5 -17
- package/es/editor/markdown/markdown-editor.controller.d.ts +0 -26
- package/es/editor/markdown/markdown-editor.controller.mjs +2 -64
- package/es/editor/upload/upload-editor.controller.d.ts +0 -26
- package/es/editor/upload/upload-editor.controller.mjs +2 -64
- package/es/editor/upload/use/use-ibiz-upload.mjs +6 -1
- package/es/editor/upload/use/use-iview-upload.mjs +7 -2
- package/es/index.mjs +2 -0
- package/es/panel-component/user-message/async-action/async-action/async-action.d.ts +18 -4
- package/es/panel-component/user-message/async-action/async-action/async-action.mjs +34 -15
- package/es/panel-component/user-message/async-action/async-action/async-action.provider.d.ts +35 -2
- package/es/panel-component/user-message/async-action/async-action/async-action.provider.mjs +9 -2
- package/es/panel-component/user-message/async-action/async-action-tab/async-action-tab.d.ts +11 -51
- package/es/panel-component/user-message/async-action/async-action-tab/async-action-tab.mjs +22 -44
- package/es/panel-component/user-message/index.d.ts +1 -0
- package/es/panel-component/user-message/index.mjs +7 -0
- package/es/panel-component/user-message/internal-message/index.d.ts +2 -0
- package/es/panel-component/user-message/internal-message/index.mjs +2 -0
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.mjs +6 -5
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.d.ts +19 -3
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.mjs +9 -3
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.d.ts +35 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.mjs +80 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.d.ts +40 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.mjs +55 -0
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.d.ts +10 -1
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.mjs +18 -34
- package/es/panel-component/user-message/user-message.d.ts +1 -0
- package/es/panel-component/user-message/user-message.mjs +4 -0
- package/es/util/app-popover/app-popover-component.d.ts +4 -2
- package/es/util/app-popover/app-popover-component.mjs +6 -2
- package/es/util/index.d.ts +1 -0
- package/es/util/index.mjs +1 -0
- package/es/util/notice-util/notice-util.d.ts +13 -0
- package/es/util/notice-util/notice-util.mjs +62 -0
- package/es/util/open-view-util/open-view-util.d.ts +10 -9
- package/es/util/open-view-util/open-view-util.mjs +6 -6
- package/es/util/overlay-controller/overlay-controller.d.ts +3 -2
- package/lib/common/data-import2/data-import2.cjs +7 -1
- package/lib/common/doing-notice/doing-notice.cjs +40 -0
- package/lib/common/doing-notice/doing-notice.css +1 -0
- package/lib/common/index.cjs +3 -0
- package/lib/editor/html/html-editor.controller.cjs +0 -63
- package/lib/editor/html/wang-editor/wang-editor.cjs +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +5 -17
- package/lib/editor/markdown/markdown-editor.controller.cjs +0 -62
- package/lib/editor/upload/upload-editor.controller.cjs +0 -62
- package/lib/editor/upload/use/use-ibiz-upload.cjs +6 -1
- package/lib/editor/upload/use/use-iview-upload.cjs +7 -2
- package/lib/index.cjs +4 -0
- package/lib/panel-component/user-message/async-action/async-action/async-action.cjs +34 -15
- package/lib/panel-component/user-message/async-action/async-action/async-action.provider.cjs +9 -2
- package/lib/panel-component/user-message/async-action/async-action-tab/async-action-tab.cjs +20 -42
- package/lib/panel-component/user-message/index.cjs +7 -0
- package/lib/panel-component/user-message/internal-message/index.cjs +4 -0
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.cjs +6 -5
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.cjs +9 -3
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.cjs +82 -0
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -0
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.cjs +57 -0
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.cjs +17 -33
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/lib/panel-component/user-message/user-message.cjs +4 -0
- package/lib/util/app-popover/app-popover-component.cjs +6 -2
- package/lib/util/index.cjs +2 -0
- package/lib/util/notice-util/notice-util.cjs +64 -0
- package/lib/util/open-view-util/open-view-util.cjs +6 -6
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-RaswfMqH.js +0 -1
- package/dist/index-5ErnlgZ5.js +0 -2
- package/dist/wang-editor-8iEE3iXJ.js +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IInternalMessage } from '@ibiz-template/core/src/interface';
|
|
2
|
+
import { IInternalMessageProvider } from '@ibiz-template/runtime';
|
|
3
|
+
import { VNode } from 'vue';
|
|
4
|
+
export declare class InternalMessageJSONtProvider implements IInternalMessageProvider {
|
|
5
|
+
component: import("vue").DefineComponent<{
|
|
6
|
+
message: {
|
|
7
|
+
type: import("vue").PropType<import("@ibiz-template/core").IInternalMessage>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
provider: {
|
|
11
|
+
type: import("vue").PropType<IInternalMessageProvider>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
16
|
+
clickable: import("vue").ComputedRef<boolean>;
|
|
17
|
+
jsonContent: import("vue").ComputedRef<{
|
|
18
|
+
html?: string | undefined;
|
|
19
|
+
redirecturl?: string | undefined;
|
|
20
|
+
} | null>;
|
|
21
|
+
onClick: (event: MouseEvent) => Promise<void>;
|
|
22
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
close: () => true;
|
|
24
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
message: {
|
|
26
|
+
type: import("vue").PropType<import("@ibiz-template/core").IInternalMessage>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
provider: {
|
|
30
|
+
type: import("vue").PropType<IInternalMessageProvider>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
}>> & {
|
|
34
|
+
onClose?: (() => any) | undefined;
|
|
35
|
+
}, {}, {}>;
|
|
36
|
+
render(props: IData & {
|
|
37
|
+
message: IInternalMessage;
|
|
38
|
+
}): VNode;
|
|
39
|
+
onClick(msg: IInternalMessage, _event: MouseEvent): Promise<boolean>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
+
import { OpenAppViewCommand } from '@ibiz-template/runtime';
|
|
3
|
+
import { h } from 'vue';
|
|
4
|
+
import { InternalMessageJSON } from './internal-message-json.mjs';
|
|
5
|
+
|
|
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
|
+
};
|
|
13
|
+
class InternalMessageJSONtProvider {
|
|
14
|
+
constructor() {
|
|
15
|
+
__publicField(this, "component", InternalMessageJSON);
|
|
16
|
+
}
|
|
17
|
+
render(props) {
|
|
18
|
+
return h(this.component, {
|
|
19
|
+
provider: this,
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async onClick(msg, _event) {
|
|
24
|
+
if (msg.content_type === "JSON" && msg.short_content) {
|
|
25
|
+
const json = JSON.parse(msg.short_content);
|
|
26
|
+
if (json.redirecturl) {
|
|
27
|
+
let viewId = "";
|
|
28
|
+
const params = {};
|
|
29
|
+
const url = new URL(json.redirecturl);
|
|
30
|
+
if (url.searchParams.size > 0) {
|
|
31
|
+
url.searchParams.forEach((value, _key) => {
|
|
32
|
+
params[_key] = value;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const rdTagItems = url.pathname.replace("//", "").split("/");
|
|
36
|
+
const [appOrViewTag, viewTag] = rdTagItems;
|
|
37
|
+
if (viewTag) {
|
|
38
|
+
viewId = viewTag;
|
|
39
|
+
} else {
|
|
40
|
+
viewId = appOrViewTag;
|
|
41
|
+
}
|
|
42
|
+
ibiz.commands.execute(
|
|
43
|
+
OpenAppViewCommand.TAG,
|
|
44
|
+
viewId,
|
|
45
|
+
IBizContext.create({}),
|
|
46
|
+
params
|
|
47
|
+
);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { InternalMessageJSONtProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-internal-message-tab{--ibiz-internal-message-tab-load-more-height:30px;width:100%;height:100%}.ibiz-internal-message-tab__item{min-height:60px;padding:
|
|
1
|
+
.ibiz-internal-message-tab{--ibiz-internal-message-tab-load-more-height:30px;width:100%;height:100%}.ibiz-internal-message-tab__item{min-height:60px;padding:var(--ibiz-spacing-tight)}.ibiz-internal-message-tab__item:hover{background-color:var(--ibiz-color-fill-1)}.ibiz-internal-message-tab__nodata{display:flex;align-items:center;justify-content:center;height:calc(100% - var(--ibiz-internal-message-tab-load-more-height))}.ibiz-internal-message-tab__load-more{height:var(--ibiz-internal-message-tab-load-more-height);line-height:var(--ibiz-internal-message-tab-load-more-height);text-align:center}.ibiz-internal-message-tab__load-more:hover{color:var(--ibiz-color-primary-hover);cursor:pointer}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IInternalMessageController } from '@ibiz-template/runtime';
|
|
1
3
|
import './internal-message-tab.scss';
|
|
2
4
|
export declare const InternalMessageTab: import("vue").DefineComponent<{
|
|
5
|
+
controller: {
|
|
6
|
+
type: PropType<IInternalMessageController>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
3
9
|
showPopover: {
|
|
4
10
|
type: BooleanConstructor;
|
|
5
11
|
required: true;
|
|
@@ -25,7 +31,6 @@ export declare const InternalMessageTab: import("vue").DefineComponent<{
|
|
|
25
31
|
}[]>;
|
|
26
32
|
state: {
|
|
27
33
|
total: number;
|
|
28
|
-
curPage: number;
|
|
29
34
|
pageSize: number;
|
|
30
35
|
};
|
|
31
36
|
hiddenPopover: () => void;
|
|
@@ -33,6 +38,10 @@ export declare const InternalMessageTab: import("vue").DefineComponent<{
|
|
|
33
38
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
39
|
hiddenPopover: () => true;
|
|
35
40
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
41
|
+
controller: {
|
|
42
|
+
type: PropType<IInternalMessageController>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
36
45
|
showPopover: {
|
|
37
46
|
type: BooleanConstructor;
|
|
38
47
|
required: true;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { ref, reactive,
|
|
1
|
+
import { ref, reactive, createVNode, createTextVNode, defineComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { getInternalMessageProvider } from '@ibiz-template/runtime';
|
|
4
4
|
import './internal-message-tab.css';
|
|
5
|
+
import { clone } from 'ramda';
|
|
5
6
|
|
|
6
7
|
"use strict";
|
|
7
8
|
const InternalMessageTab = /* @__PURE__ */ defineComponent({
|
|
8
9
|
name: "IBizInternalMessageTab",
|
|
9
10
|
props: {
|
|
11
|
+
controller: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
10
15
|
showPopover: {
|
|
11
16
|
type: Boolean,
|
|
12
17
|
required: true
|
|
@@ -22,38 +27,22 @@ const InternalMessageTab = /* @__PURE__ */ defineComponent({
|
|
|
22
27
|
const hiddenPopover = () => {
|
|
23
28
|
emit("hiddenPopover");
|
|
24
29
|
};
|
|
30
|
+
const c = props.controller;
|
|
25
31
|
const allItems = ref([]);
|
|
26
32
|
const state = reactive({
|
|
27
33
|
total: 0,
|
|
28
|
-
|
|
29
|
-
pageSize: 20
|
|
34
|
+
pageSize: 0
|
|
30
35
|
});
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...params
|
|
36
|
-
});
|
|
37
|
-
if (res.ok) {
|
|
38
|
-
if (typeof res.total === "number") {
|
|
39
|
-
state.total = res.total;
|
|
40
|
-
}
|
|
41
|
-
if (typeof res.page === "number") {
|
|
42
|
-
state.curPage = res.page;
|
|
43
|
-
}
|
|
44
|
-
if (state.curPage === 0) {
|
|
45
|
-
allItems.value = res.data;
|
|
46
|
-
} else {
|
|
47
|
-
allItems.value.push(...res.data);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
36
|
+
const updateData = () => {
|
|
37
|
+
allItems.value = clone(c.messages);
|
|
38
|
+
state.total = c.total;
|
|
39
|
+
state.pageSize = c.size;
|
|
50
40
|
};
|
|
41
|
+
updateData();
|
|
42
|
+
c.evt.on("dataChange", updateData);
|
|
51
43
|
const showMore = () => {
|
|
52
|
-
|
|
53
|
-
page: state.curPage + 1
|
|
54
|
-
});
|
|
44
|
+
c.loadMore();
|
|
55
45
|
};
|
|
56
|
-
load();
|
|
57
46
|
return {
|
|
58
47
|
ns,
|
|
59
48
|
allItems,
|
|
@@ -74,15 +63,10 @@ const InternalMessageTab = /* @__PURE__ */ defineComponent({
|
|
|
74
63
|
ibiz.log.error(error);
|
|
75
64
|
}
|
|
76
65
|
if (provider) {
|
|
77
|
-
return
|
|
66
|
+
return provider.render({
|
|
78
67
|
class: this.ns.e("item"),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (isClose) {
|
|
82
|
-
this.hiddenPopover();
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
message: msg
|
|
68
|
+
message: msg,
|
|
69
|
+
onClose: this.hiddenPopover
|
|
86
70
|
});
|
|
87
71
|
}
|
|
88
72
|
return createVNode("div", {
|
|
@@ -14,6 +14,7 @@ export declare const UserMessage: import("vue").DefineComponent<{
|
|
|
14
14
|
}, {
|
|
15
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
16
|
c: PanelItemController<import("@ibiz/model-core").IPanelItem>;
|
|
17
|
+
noticeController: import("@ibiz-template/runtime").INoticeController;
|
|
17
18
|
noticeNum: import("vue").Ref<number>;
|
|
18
19
|
popoverRef: import("vue").Ref<any>;
|
|
19
20
|
showPopover: import("vue").Ref<boolean>;
|
|
@@ -22,6 +22,7 @@ const UserMessage = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
setup(props) {
|
|
23
23
|
const ns = useNamespace("user-message");
|
|
24
24
|
const c = props.controller;
|
|
25
|
+
const noticeController = ibiz.hub.notice;
|
|
25
26
|
const showPopover = ref(false);
|
|
26
27
|
const currentTab = ref("notification");
|
|
27
28
|
const sysImage = props.modelData.sysImage || {
|
|
@@ -35,6 +36,7 @@ const UserMessage = /* @__PURE__ */ defineComponent({
|
|
|
35
36
|
return {
|
|
36
37
|
ns,
|
|
37
38
|
c,
|
|
39
|
+
noticeController,
|
|
38
40
|
noticeNum,
|
|
39
41
|
popoverRef,
|
|
40
42
|
showPopover,
|
|
@@ -78,6 +80,7 @@ const UserMessage = /* @__PURE__ */ defineComponent({
|
|
|
78
80
|
"name": "notification"
|
|
79
81
|
}, {
|
|
80
82
|
default: () => [createVNode(InternalMessageTab, {
|
|
83
|
+
"controller": this.noticeController.internalMessage,
|
|
81
84
|
"showPopover": this.showPopover,
|
|
82
85
|
"onHiddenPopover": this.hiddenPopover
|
|
83
86
|
}, null)]
|
|
@@ -86,6 +89,7 @@ const UserMessage = /* @__PURE__ */ defineComponent({
|
|
|
86
89
|
"name": "async-action"
|
|
87
90
|
}, {
|
|
88
91
|
default: () => [createVNode(AsyncActionTab, {
|
|
92
|
+
"controller": this.noticeController.asyncAction,
|
|
89
93
|
"showPopover": this.showPopover,
|
|
90
94
|
"onHiddenPopover": this.hiddenPopover
|
|
91
95
|
}, null)]
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ComputePositionConfig } from '@floating-ui/dom';
|
|
1
2
|
import { IPopoverOptions } from '@ibiz-template/runtime';
|
|
2
3
|
import { OverlayPopoverContainer } from '@ibiz-template/vue3-util';
|
|
3
4
|
import { VNode } from 'vue';
|
|
4
5
|
import './app-popover-component.scss';
|
|
6
|
+
export type FloatingUIConfig = Partial<ComputePositionConfig>;
|
|
5
7
|
/**
|
|
6
8
|
* 创建飘窗
|
|
7
9
|
*
|
|
@@ -9,7 +11,7 @@ import './app-popover-component.scss';
|
|
|
9
11
|
* @date 2022-12-29 15:12:59
|
|
10
12
|
* @export
|
|
11
13
|
* @param {() => VNode} render
|
|
12
|
-
* @param {IPopoverOptions} [opts]
|
|
14
|
+
* @param {IPopoverOptions<FloatingUIConfig>} [opts]
|
|
13
15
|
* @return {*} {OverlayPopoverContainer}
|
|
14
16
|
*/
|
|
15
|
-
export declare function createPopover(render: () => VNode, opts?: IPopoverOptions): OverlayPopoverContainer;
|
|
17
|
+
export declare function createPopover(render: () => VNode, opts?: IPopoverOptions<FloatingUIConfig>): OverlayPopoverContainer;
|
|
@@ -12,11 +12,15 @@ async function computePos(element, el, arrEl, opts) {
|
|
|
12
12
|
element: arrEl
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const config = {
|
|
16
16
|
placement: opts.placement,
|
|
17
17
|
strategy: "absolute",
|
|
18
18
|
middleware: middlewareArr
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
if (opts.options) {
|
|
21
|
+
Object.assign(config, opts.options);
|
|
22
|
+
}
|
|
23
|
+
const options = await computePosition(element, el, config);
|
|
20
24
|
{
|
|
21
25
|
const {
|
|
22
26
|
x,
|
package/es/util/index.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export { NotificationUtil } from './notification-util/notification-util';
|
|
|
6
6
|
export { OpenViewUtil } from './open-view-util/open-view-util';
|
|
7
7
|
export { OverlayController } from './overlay-controller/overlay-controller';
|
|
8
8
|
export { usePagination } from './pagination/use-pagination';
|
|
9
|
+
export { NoticeUtil } from './notice-util/notice-util';
|
package/es/util/index.mjs
CHANGED
|
@@ -6,5 +6,6 @@ export { NotificationUtil } from './notification-util/notification-util.mjs';
|
|
|
6
6
|
export { OpenViewUtil } from './open-view-util/open-view-util.mjs';
|
|
7
7
|
export { OverlayController } from './overlay-controller/overlay-controller.mjs';
|
|
8
8
|
export { usePagination } from './pagination/use-pagination.mjs';
|
|
9
|
+
export { NoticeUtil } from './notice-util/notice-util.mjs';
|
|
9
10
|
|
|
10
11
|
"use strict";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
2
|
+
import { INoticeUtil } from '@ibiz-template/runtime';
|
|
3
|
+
export declare class NoticeUtil implements INoticeUtil {
|
|
4
|
+
doingNotice?: {
|
|
5
|
+
info: IData;
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
showAsyncAction(asyncAction: IPortalAsyncAction): Promise<void>;
|
|
9
|
+
showDoingNotice(info: {
|
|
10
|
+
num: number;
|
|
11
|
+
}): void;
|
|
12
|
+
closeDoingNotice(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { getAsyncActionProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import { ElNotification } from 'element-plus';
|
|
3
|
+
import { reactive, h } from 'vue';
|
|
4
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
5
|
+
import '../../common/index.mjs';
|
|
6
|
+
import { DoingNotice } from '../../common/doing-notice/doing-notice.mjs';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __publicField = (obj, key, value) => {
|
|
12
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
class NoticeUtil {
|
|
16
|
+
constructor() {
|
|
17
|
+
__publicField(this, "doingNotice");
|
|
18
|
+
}
|
|
19
|
+
async showAsyncAction(asyncAction) {
|
|
20
|
+
const ns = useNamespace("async-action-notice");
|
|
21
|
+
const porvider = await getAsyncActionProvider(asyncAction);
|
|
22
|
+
if (porvider.render) {
|
|
23
|
+
const ins = ElNotification({
|
|
24
|
+
customClass: ns.b(),
|
|
25
|
+
message: porvider.render({
|
|
26
|
+
action: asyncAction,
|
|
27
|
+
onClose: () => {
|
|
28
|
+
ins.close();
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
position: "bottom-right",
|
|
32
|
+
duration: 0
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
showDoingNotice(info) {
|
|
37
|
+
if (!this.doingNotice) {
|
|
38
|
+
const reactiveInfo = reactive(info);
|
|
39
|
+
const ins = ElNotification({
|
|
40
|
+
message: h(DoingNotice, {
|
|
41
|
+
info: reactiveInfo
|
|
42
|
+
}),
|
|
43
|
+
onClose: () => {
|
|
44
|
+
this.closeDoingNotice();
|
|
45
|
+
},
|
|
46
|
+
position: "bottom-right",
|
|
47
|
+
duration: 0
|
|
48
|
+
});
|
|
49
|
+
this.doingNotice = { info: reactiveInfo, close: () => ins.close() };
|
|
50
|
+
} else {
|
|
51
|
+
Object.assign(this.doingNotice.info, info);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
closeDoingNotice() {
|
|
55
|
+
if (this.doingNotice) {
|
|
56
|
+
this.doingNotice.close();
|
|
57
|
+
this.doingNotice = void 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { NoticeUtil };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IModalData, IOpenViewUtil } from '@ibiz-template/runtime';
|
|
1
|
+
import { IModalData, IOpenViewUtil, IPopoverOptions } from '@ibiz-template/runtime';
|
|
2
2
|
import { Router } from 'vue-router';
|
|
3
|
+
import { FloatingUIConfig } from '../app-popover/app-popover-component';
|
|
3
4
|
/**
|
|
4
5
|
* 打开视图方式工具类
|
|
5
6
|
*
|
|
@@ -22,22 +23,22 @@ export declare class OpenViewUtil implements IOpenViewUtil {
|
|
|
22
23
|
* @author lxm
|
|
23
24
|
* @date 2022-09-12 01:09:06
|
|
24
25
|
* @param {string} appViewId
|
|
25
|
-
* @param {(IContext
|
|
26
|
-
* @param {(IParams
|
|
26
|
+
* @param {(IContext)} [context]
|
|
27
|
+
* @param {(IParams)} [params]
|
|
27
28
|
* @returns {*} {Promise<IModalData>}
|
|
28
29
|
*/
|
|
29
|
-
modal(appViewId: string, context: IContext, params?: IParams
|
|
30
|
-
popover(appViewId: string, event: MouseEvent, context: IContext, params?: IParams
|
|
30
|
+
modal(appViewId: string, context: IContext, params?: IParams): Promise<IModalData>;
|
|
31
|
+
popover(appViewId: string, event: MouseEvent, context: IContext, params?: IParams, options?: IPopoverOptions<FloatingUIConfig>): Promise<IModalData>;
|
|
31
32
|
/**
|
|
32
33
|
* 抽屉打开视图
|
|
33
34
|
*
|
|
34
35
|
* @author lxm
|
|
35
36
|
* @date 2022-09-15 15:09:50
|
|
36
37
|
* @param {string} appViewId
|
|
37
|
-
* @param {(IContext
|
|
38
|
-
* @param {(IParams
|
|
38
|
+
* @param {(IContext)} [context]
|
|
39
|
+
* @param {(IParams)} [params]
|
|
39
40
|
* @returns {*} {Promise<IModalData>}
|
|
40
41
|
*/
|
|
41
|
-
drawer(appViewId: string, context: IContext, params?: IParams
|
|
42
|
-
custom(appViewId: string, context: IContext, params?: IParams
|
|
42
|
+
drawer(appViewId: string, context: IContext, params?: IParams): Promise<IModalData>;
|
|
43
|
+
custom(appViewId: string, context: IContext, params?: IParams): Promise<IModalData>;
|
|
43
44
|
}
|
|
@@ -35,8 +35,8 @@ class OpenViewUtil {
|
|
|
35
35
|
* @author lxm
|
|
36
36
|
* @date 2022-09-12 01:09:06
|
|
37
37
|
* @param {string} appViewId
|
|
38
|
-
* @param {(IContext
|
|
39
|
-
* @param {(IParams
|
|
38
|
+
* @param {(IContext)} [context]
|
|
39
|
+
* @param {(IParams)} [params]
|
|
40
40
|
* @returns {*} {Promise<IModalData>}
|
|
41
41
|
*/
|
|
42
42
|
async modal(appViewId, context, params) {
|
|
@@ -55,7 +55,7 @@ class OpenViewUtil {
|
|
|
55
55
|
opts
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
async popover(appViewId, event, context, params) {
|
|
58
|
+
async popover(appViewId, event, context, params, options = {}) {
|
|
59
59
|
const appView = await ibiz.hub.config.view.get(appViewId);
|
|
60
60
|
return openViewPopover(
|
|
61
61
|
event,
|
|
@@ -64,7 +64,7 @@ class OpenViewUtil {
|
|
|
64
64
|
params,
|
|
65
65
|
viewId: appView.id
|
|
66
66
|
},
|
|
67
|
-
{ autoClose: true, placement: "bottom" }
|
|
67
|
+
{ autoClose: true, placement: "bottom", ...options }
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -73,8 +73,8 @@ class OpenViewUtil {
|
|
|
73
73
|
* @author lxm
|
|
74
74
|
* @date 2022-09-15 15:09:50
|
|
75
75
|
* @param {string} appViewId
|
|
76
|
-
* @param {(IContext
|
|
77
|
-
* @param {(IParams
|
|
76
|
+
* @param {(IContext)} [context]
|
|
77
|
+
* @param {(IParams)} [params]
|
|
78
78
|
* @returns {*} {Promise<IModalData>}
|
|
79
79
|
*/
|
|
80
80
|
async drawer(appViewId, context, params) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IOverlayController, IDrawerOptions, IPopoverOptions, IModalOptions, IOverlayContainer, IOverlayPopoverContainer, IFloatWindowOptions } from '@ibiz-template/runtime';
|
|
2
|
+
import { FloatingUIConfig } from '../app-popover/app-popover-component';
|
|
2
3
|
/**
|
|
3
4
|
* 用不同呈现方式绘制组件的通用工具类
|
|
4
5
|
*
|
|
@@ -9,8 +10,8 @@ import { IOverlayController, IDrawerOptions, IPopoverOptions, IModalOptions, IOv
|
|
|
9
10
|
* @implements {IOverlayController}
|
|
10
11
|
*/
|
|
11
12
|
export declare class OverlayController implements IOverlayController {
|
|
12
|
-
popover<T = void>(element: HTMLElement, component: unknown, props?: IParams, opts?: IPopoverOptions): Promise<T>;
|
|
13
|
-
createPopover(component: unknown, props?: IParams, opts?: IPopoverOptions): IOverlayPopoverContainer;
|
|
13
|
+
popover<T = void>(element: HTMLElement, component: unknown, props?: IParams, opts?: IPopoverOptions<FloatingUIConfig>): Promise<T>;
|
|
14
|
+
createPopover(component: unknown, props?: IParams, opts?: IPopoverOptions<FloatingUIConfig>): IOverlayPopoverContainer;
|
|
14
15
|
drawer<T = void>(component: unknown, props?: IParams, opts?: IDrawerOptions): Promise<T>;
|
|
15
16
|
createDrawer(component: unknown, props?: IParams, opts?: IDrawerOptions): IOverlayContainer;
|
|
16
17
|
modal<T = void>(component: unknown, props?: IParams, opts?: IModalOptions): Promise<T>;
|
|
@@ -282,7 +282,13 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
282
282
|
Authorization: "Bearer ".concat(qxUtil.getCookie(core.CoreConst.TOKEN))
|
|
283
283
|
});
|
|
284
284
|
const UploadUrl = vue.computed(() => {
|
|
285
|
-
let
|
|
285
|
+
let uploadFileUrl;
|
|
286
|
+
if (ibiz.env.uploadFileUrl.indexOf("{cat}") !== -1) {
|
|
287
|
+
uploadFileUrl = ibiz.env.uploadFileUrl.replace("/{cat}", "/temp");
|
|
288
|
+
} else {
|
|
289
|
+
uploadFileUrl = "".concat(ibiz.env.uploadFileUrl, "/temp");
|
|
290
|
+
}
|
|
291
|
+
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(uploadFileUrl);
|
|
286
292
|
uploadUrl += qs.stringify({
|
|
287
293
|
preview: true
|
|
288
294
|
}, {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
|
+
require('./doing-notice.css');
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const DoingNotice = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
name: "DoingNotice",
|
|
10
|
+
props: {
|
|
11
|
+
info: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup() {
|
|
17
|
+
const ns = vue3Util.useNamespace("doing-notice");
|
|
18
|
+
return {
|
|
19
|
+
ns
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
render() {
|
|
23
|
+
return vue.createVNode("div", {
|
|
24
|
+
"class": [this.ns.b()]
|
|
25
|
+
}, [vue.createVNode("span", {
|
|
26
|
+
"class": this.ns.e("text")
|
|
27
|
+
}, [vue.createTextVNode("\u6709"), vue.createVNode("span", {
|
|
28
|
+
"class": this.ns.e("num")
|
|
29
|
+
}, [this.info.num]), vue.createTextVNode("\u4E2A\u5F02\u6B65\u64CD\u4F5C\u6B63\u5728\u6267\u884C\uFF0C\u8BF7\u7A0D\u540E")]), vue.createVNode("svg", {
|
|
30
|
+
"class": this.ns.e("loading-icon"),
|
|
31
|
+
"viewBox": "-10, -10, 50, 50"
|
|
32
|
+
}, [vue.createVNode("path", {
|
|
33
|
+
"class": "path",
|
|
34
|
+
"d": "M 30 15 L 28 17 M 25.61 25.61 A 15 15, 0, 0, 1, 15 30 A 15 15, 0, 1, 1, 27.99 7.5 L 15 15",
|
|
35
|
+
"style": "stroke-width: 4px; fill: rgba(0, 0, 0, 0)"
|
|
36
|
+
}, null)])]);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.DoingNotice = DoingNotice;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-async-action-notice.el-notification{width:auto}.ibiz-async-action-notice.el-notification .el-notification__group{margin:0}.ibiz-async-action-notice.el-notification .el-notification__closeBtn{top:5px;right:5px}.ibiz-doing-notice__text{margin-right:8px}.ibiz-doing-notice__num{margin:0 8px;font-size:18px;font-weight:700;color:var(--ibiz-color-danger)}.ibiz-doing-notice__loading-icon{width:18px;height:18px;margin-right:6px;vertical-align:middle;animation:loading-rotate 2s linear infinite}.ibiz-doing-notice__loading-icon .path{stroke:var(--ibiz-color-primary);stroke-dasharray:90,150;stroke-dashoffset:0;stroke-linecap:round;stroke-width:2;animation:loading-dash 1.5s ease-in-out infinite}
|
package/lib/common/index.cjs
CHANGED
|
@@ -20,12 +20,14 @@ var dataImport2 = require('./data-import2/data-import2.cjs');
|
|
|
20
20
|
var dataImport2Table = require('./data-import2-table/data-import2-table.cjs');
|
|
21
21
|
var dataImport2Select = require('./data-import2-select/data-import2-select.cjs');
|
|
22
22
|
var gridSetting = require('./grid-setting/grid-setting.cjs');
|
|
23
|
+
var doingNotice = require('./doing-notice/doing-notice.cjs');
|
|
23
24
|
|
|
24
25
|
"use strict";
|
|
25
26
|
const IBizCommonComponents = {
|
|
26
27
|
install: (v) => {
|
|
27
28
|
v.component(vue3Util.IBizControlBase.name, vue3Util.IBizControlBase);
|
|
28
29
|
v.component(vue3Util.IBizIcon.name, vue3Util.IBizIcon);
|
|
30
|
+
v.component(doingNotice.DoingNotice.name, doingNotice.DoingNotice);
|
|
29
31
|
v.component(row.IBizRow.name, row.IBizRow);
|
|
30
32
|
v.component(col.IBizCol.name, col.IBizCol);
|
|
31
33
|
v.component(vue3Util.IBizRouterView.name, vue3Util.IBizRouterView);
|
|
@@ -63,5 +65,6 @@ exports.IBizRawItem = rawitem.IBizRawItem;
|
|
|
63
65
|
exports.IBizSplit = split.IBizSplit;
|
|
64
66
|
exports.IBizSplitTrigger = splitTrigger.IBizSplitTrigger;
|
|
65
67
|
exports.IBizSortBar = sortBar.IBizSortBar;
|
|
68
|
+
exports.DoingNotice = doingNotice.DoingNotice;
|
|
66
69
|
exports.IBizCommonComponents = IBizCommonComponents;
|
|
67
70
|
exports.default = IBizCommonComponents;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var core = require('@ibiz-template/core');
|
|
4
3
|
var runtime = require('@ibiz-template/runtime');
|
|
5
|
-
var qs = require('qs');
|
|
6
4
|
|
|
7
5
|
"use strict";
|
|
8
6
|
var __defProp = Object.defineProperty;
|
|
@@ -51,67 +49,6 @@ class HtmlEditorController extends runtime.EditorController {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
|
-
/**
|
|
55
|
-
* 计算文件的上传路径和下载路径
|
|
56
|
-
* 下载路径文件id用%fileId%占位,替换即可
|
|
57
|
-
* 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
|
|
58
|
-
*
|
|
59
|
-
* @author lxm
|
|
60
|
-
* @date 2022-11-17 13:11:43
|
|
61
|
-
* @param {IData} data
|
|
62
|
-
* @returns {*} {{ uploadUrl: string; downloadUrl: string }}
|
|
63
|
-
*/
|
|
64
|
-
calcBaseUrl(data) {
|
|
65
|
-
let uploadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl);
|
|
66
|
-
let downloadUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl, "/%fileId%");
|
|
67
|
-
let uploadParams = {};
|
|
68
|
-
let exportParams = {};
|
|
69
|
-
if (this.uploadParams) {
|
|
70
|
-
uploadParams = runtime.convertNavData(
|
|
71
|
-
this.uploadParams,
|
|
72
|
-
data,
|
|
73
|
-
this.params,
|
|
74
|
-
this.context
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
if (this.exportParams) {
|
|
78
|
-
exportParams = runtime.convertNavData(
|
|
79
|
-
this.exportParams,
|
|
80
|
-
data,
|
|
81
|
-
this.params,
|
|
82
|
-
this.context
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
uploadUrl += qs.stringify(uploadParams, { addQueryPrefix: true });
|
|
86
|
-
downloadUrl += qs.stringify(exportParams, { addQueryPrefix: true });
|
|
87
|
-
return { uploadUrl, downloadUrl };
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* 请求url获取文件流,并用JS触发文件下载
|
|
91
|
-
*
|
|
92
|
-
* @author lxm
|
|
93
|
-
* @date 2022-11-17 14:11:09
|
|
94
|
-
* @param {string} url
|
|
95
|
-
* @param {IData} file
|
|
96
|
-
*/
|
|
97
|
-
fileDownload(file) {
|
|
98
|
-
ibiz.net.request(file.url, {
|
|
99
|
-
method: "get",
|
|
100
|
-
responseType: "blob",
|
|
101
|
-
baseURL: ""
|
|
102
|
-
// 已经有baseURL了,这里无需再写
|
|
103
|
-
}).then((response) => {
|
|
104
|
-
if (response.status !== 200) {
|
|
105
|
-
throw new core.RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
106
|
-
}
|
|
107
|
-
if (!response.data) {
|
|
108
|
-
throw new core.RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
109
|
-
} else {
|
|
110
|
-
const fileName = file.name;
|
|
111
|
-
core.downloadFileFromBlob(response.data, fileName);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
52
|
}
|
|
116
53
|
|
|
117
54
|
exports.HtmlEditorController = HtmlEditorController;
|
|
@@ -51,7 +51,7 @@ const IBizHtml = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
51
|
}
|
|
52
52
|
vue.watch(() => props.data, (newVal) => {
|
|
53
53
|
if (newVal) {
|
|
54
|
-
const urls = c.
|
|
54
|
+
const urls = ibiz.util.file.calcFileUpDownUrl(c.context, c.params, newVal, c.editorParams);
|
|
55
55
|
uploadUrl.value = urls.uploadUrl;
|
|
56
56
|
downloadUrl.value = urls.downloadUrl;
|
|
57
57
|
}
|