@ibiz-template/vue3-components 0.6.17 → 0.7.0
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/chart-jfPZ04eU.js +1 -0
- package/dist/index-Wk7Kbc7Z.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-tKOH6BvT.js → xlsx-util-keqImqNu.js} +1 -1
- package/es/common/pagination/pagination.d.ts +9 -0
- package/es/common/pagination/pagination.mjs +12 -2
- package/es/common/view-message/view-message.css +1 -1
- package/es/common/view-message/view-message.d.ts +27 -1
- package/es/common/view-message/view-message.mjs +130 -17
- package/es/control/chart/chart.css +1 -1
- package/es/control/chart/chart.d.ts +3 -1
- package/es/control/chart/chart.mjs +70 -6
- package/es/control/data-view/data-view.mjs +1 -0
- package/es/control/drbar/drbar.controller.d.ts +9 -0
- package/es/control/drbar/drbar.controller.mjs +16 -1
- package/es/control/drtab/drtab.controller.d.ts +9 -0
- package/es/control/drtab/drtab.controller.mjs +16 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.d.ts +2 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.mjs +13 -4
- package/es/control/form/form-detail/form-mdctrl/index.d.ts +1 -0
- package/es/control/form/form-detail/form-rawitem/form-rawitem.d.ts +2 -1
- package/es/control/form/form-detail/form-rawitem/form-rawitem.mjs +31 -1
- package/es/control/form/form-detail/form-rawitem/index.d.ts +1 -0
- package/es/control/grid/grid/grid.mjs +1 -0
- package/es/control/list/list.mjs +1 -0
- package/es/control/search-bar/filter-tree/filter-tree.d.ts +3 -3
- package/es/control/search-bar/filter-tree/filter-tree.mjs +98 -37
- package/es/control/search-bar/index.d.ts +1 -0
- package/es/control/search-bar/index.mjs +2 -0
- package/es/control/search-bar/quick-search-select/quick-search-select.css +1 -0
- package/es/control/search-bar/quick-search-select/quick-search-select.d.ts +16 -0
- package/es/control/search-bar/quick-search-select/quick-search-select.mjs +72 -0
- package/es/control/search-bar/search-bar.css +1 -1
- package/es/control/search-bar/search-bar.d.ts +1 -0
- package/es/control/search-bar/search-bar.mjs +14 -3
- package/es/control/tree-grid/tree-grid.mjs +1 -0
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +11 -3
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +13 -2
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +13 -5
- package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +7 -0
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.mjs +3 -3
- package/es/panel-component/index.mjs +2 -0
- package/es/panel-component/panel-index-view-search/index.d.ts +1 -0
- package/es/panel-component/panel-index-view-search/panel-index-view-search.d.ts +1 -0
- package/es/panel-component/panel-index-view-search/panel-index-view-search.mjs +22 -2
- package/es/panel-component/view-msg-pos/index.d.ts +25 -0
- package/es/panel-component/view-msg-pos/index.mjs +16 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.controller.d.ts +21 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.controller.mjs +48 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.d.ts +25 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.mjs +47 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.provider.d.ts +16 -0
- package/es/panel-component/view-msg-pos/view-msg-pos.provider.mjs +21 -0
- package/es/view-engine/index.mjs +4 -0
- package/es/view-engine/panel-view-engine.d.ts +2 -2
- package/es/web-app/App.mjs +9 -1
- package/lib/common/pagination/pagination.cjs +12 -2
- package/lib/common/view-message/view-message.cjs +129 -16
- package/lib/common/view-message/view-message.css +1 -1
- package/lib/control/chart/chart.cjs +69 -5
- package/lib/control/chart/chart.css +1 -1
- package/lib/control/data-view/data-view.cjs +1 -0
- package/lib/control/drbar/drbar.controller.cjs +16 -1
- package/lib/control/drtab/drtab.controller.cjs +16 -1
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.cjs +13 -4
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -1
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.cjs +30 -0
- package/lib/control/grid/grid/grid.cjs +1 -0
- package/lib/control/list/list.cjs +1 -0
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +98 -37
- package/lib/control/search-bar/index.cjs +2 -0
- package/lib/control/search-bar/quick-search-select/quick-search-select.cjs +74 -0
- package/lib/control/search-bar/quick-search-select/quick-search-select.css +1 -0
- package/lib/control/search-bar/search-bar.cjs +14 -3
- package/lib/control/search-bar/search-bar.css +1 -1
- package/lib/control/tree-grid/tree-grid.cjs +1 -0
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +11 -3
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +13 -2
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +13 -5
- package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +7 -0
- package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs +2 -2
- package/lib/panel-component/index.cjs +2 -0
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.cjs +21 -1
- package/lib/panel-component/view-msg-pos/index.cjs +22 -0
- package/lib/panel-component/view-msg-pos/view-msg-pos.cjs +49 -0
- package/lib/panel-component/view-msg-pos/view-msg-pos.controller.cjs +50 -0
- package/lib/panel-component/view-msg-pos/view-msg-pos.provider.cjs +23 -0
- package/lib/view-engine/index.cjs +4 -0
- package/lib/web-app/App.cjs +8 -0
- package/package.json +12 -12
- package/dist/chart-IsmrW_d0.js +0 -1
- package/dist/index-fN8w56IX.js +0 -4
|
@@ -47,6 +47,13 @@ const IBizRaw = /* @__PURE__ */ defineComponent({
|
|
|
47
47
|
ibiz.log.error("JSON\u5B57\u7B26\u4E32\u8F6C\u6362\u9519\u8BEF");
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
if (!Array.isArray(obj)) {
|
|
51
|
+
Object.assign(obj, {
|
|
52
|
+
data: {
|
|
53
|
+
...props.data
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
50
57
|
content.value = await ibiz.util.hbs.render(template, obj || newVal);
|
|
51
58
|
}
|
|
52
59
|
}
|
|
@@ -2,7 +2,7 @@ import { ref, computed, watch, resolveComponent, createVNode, mergeProps, define
|
|
|
2
2
|
import { getInputProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-searchcond-edit.css';
|
|
4
4
|
import { isNilOrEmpty } from 'qx-util';
|
|
5
|
-
import { getOriginFilterNodes,
|
|
5
|
+
import { getOriginFilterNodes, SearchCondEx2filterNode, calcSearchCondExs } from '@ibiz-template/runtime';
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
8
|
const IBizSearchCondEdit = /* @__PURE__ */ defineComponent({
|
|
@@ -36,7 +36,7 @@ const IBizSearchCondEdit = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
if (newVal) {
|
|
37
37
|
try {
|
|
38
38
|
const searchconds = JSON.parse(newVal);
|
|
39
|
-
filterNodes.value = searchconds.map((item) =>
|
|
39
|
+
filterNodes.value = searchconds.map((item) => SearchCondEx2filterNode(item));
|
|
40
40
|
} catch (error) {
|
|
41
41
|
ibiz.log.error("".concat(newVal, "\u503C\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4E3Ajson\u5B57\u7B26\u4E32"));
|
|
42
42
|
}
|
|
@@ -82,7 +82,7 @@ const IBizSearchCondEdit = /* @__PURE__ */ defineComponent({
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
const getCurrentValByFilterNodes = () => {
|
|
85
|
-
const searchconds =
|
|
85
|
+
const searchconds = calcSearchCondExs(filterNodes.value);
|
|
86
86
|
if (searchconds) {
|
|
87
87
|
currentVal.value = JSON.stringify(searchconds, null, 2);
|
|
88
88
|
}
|
|
@@ -19,6 +19,7 @@ import { IBizSearchFormButtons } from './searchform-buttons/index.mjs';
|
|
|
19
19
|
import { IBizViewMessage } from './view-message/index.mjs';
|
|
20
20
|
import { IBizPanelStaticCarousel } from './panel-static-carousel/index.mjs';
|
|
21
21
|
import { IBizCoopPos } from './coop-pos/index.mjs';
|
|
22
|
+
import { IBizViewMsgPos } from './view-msg-pos/index.mjs';
|
|
22
23
|
export { NavPosIndexState } from './nav-pos-index/nav-pos-index.state.mjs';
|
|
23
24
|
export { NavPosIndexController } from './nav-pos-index/nav-pos-index.controller.mjs';
|
|
24
25
|
export { PanelButtonController } from './panel-button/panel-button.controller.mjs';
|
|
@@ -63,6 +64,7 @@ const IBizPanelComponents = {
|
|
|
63
64
|
v.use(IBizTeleportPlaceholder);
|
|
64
65
|
v.use(IBizPanelContainerTabs);
|
|
65
66
|
v.use(IBizCoopPos);
|
|
67
|
+
v.use(IBizViewMsgPos);
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
70
|
|
|
@@ -12,6 +12,7 @@ export declare const IBizPanelIndexViewSearch: import("@ibiz-template/vue3-util"
|
|
|
12
12
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
13
13
|
isCollapse: import("vue").ComputedRef<any>;
|
|
14
14
|
onInput: (value: string) => void;
|
|
15
|
+
onSearch: () => Promise<void>;
|
|
15
16
|
c: import("@ibiz-template/runtime").PanelItemController<import("@ibiz/model-core").IPanelItem>;
|
|
16
17
|
query: import("vue").Ref<string>;
|
|
17
18
|
menuAlign: import("vue").ComputedRef<string>;
|
|
@@ -16,6 +16,7 @@ export declare const PanelIndexViewSearch: import("vue").DefineComponent<{
|
|
|
16
16
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
17
17
|
isCollapse: import("vue").ComputedRef<any>;
|
|
18
18
|
onInput: (value: string) => void;
|
|
19
|
+
onSearch: () => Promise<void>;
|
|
19
20
|
c: PanelItemController<import("@ibiz/model-core").IPanelItem>;
|
|
20
21
|
query: import("vue").Ref<string>;
|
|
21
22
|
menuAlign: import("vue").ComputedRef<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, inject, computed, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
-
import { PanelItemController } from '@ibiz-template/runtime';
|
|
3
|
+
import { PanelItemController, AppFuncCommand } from '@ibiz-template/runtime';
|
|
4
4
|
import { debounce } from 'lodash-es';
|
|
5
5
|
import './panel-index-view-search.css';
|
|
6
6
|
|
|
@@ -45,11 +45,30 @@ const PanelIndexViewSearch = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
result.push(...props.controller.containerClass);
|
|
46
46
|
return result;
|
|
47
47
|
});
|
|
48
|
+
const onSearch = async () => {
|
|
49
|
+
const id = props.modelData.id;
|
|
50
|
+
const menuC = c.panel.view.getController("appmenu");
|
|
51
|
+
if (menuC) {
|
|
52
|
+
const targetMenu = menuC.allAppMenuItems.find((item) => {
|
|
53
|
+
return item.id === id;
|
|
54
|
+
});
|
|
55
|
+
if (targetMenu) {
|
|
56
|
+
const tempContext = c.panel.context.clone();
|
|
57
|
+
const tempParam = c.panel.params;
|
|
58
|
+
tempContext.srfappid = targetMenu.appId || ibiz.env.appId;
|
|
59
|
+
await ibiz.commands.execute(AppFuncCommand.TAG, targetMenu.appFuncId, tempContext, {
|
|
60
|
+
...tempParam,
|
|
61
|
+
query: query.value
|
|
62
|
+
}, {});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
48
66
|
return {
|
|
49
67
|
ns,
|
|
50
68
|
classArr,
|
|
51
69
|
isCollapse,
|
|
52
70
|
onInput,
|
|
71
|
+
onSearch,
|
|
53
72
|
c,
|
|
54
73
|
query,
|
|
55
74
|
menuAlign
|
|
@@ -65,7 +84,8 @@ const PanelIndexViewSearch = /* @__PURE__ */ defineComponent({
|
|
|
65
84
|
"model-value": this.query,
|
|
66
85
|
"class": this.ns.b("search"),
|
|
67
86
|
"placeholder": ibiz.i18n.t("component.indexSearch.placeholder"),
|
|
68
|
-
"onInput": this.onInput
|
|
87
|
+
"onInput": this.onInput,
|
|
88
|
+
"onChange": this.onSearch
|
|
69
89
|
}, {
|
|
70
90
|
prefix: () => {
|
|
71
91
|
return createVNode("ion-icon", {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ViewMsgPosController } from './view-msg-pos.controller';
|
|
2
|
+
export { ViewMsgPosController };
|
|
3
|
+
export declare const IBizViewMsgPos: import("@ibiz-template/vue3-util").TypeWithInstall<import("vue").DefineComponent<{
|
|
4
|
+
modelData: {
|
|
5
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
controller: {
|
|
9
|
+
type: typeof ViewMsgPosController;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
14
|
+
view: import("@ibiz-template/runtime").IViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
15
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
modelData: {
|
|
17
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
controller: {
|
|
21
|
+
type: typeof ViewMsgPosController;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}, {}>>;
|
|
25
|
+
export default IBizViewMsgPos;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { withInstall } from '@ibiz-template/vue3-util';
|
|
2
|
+
import { registerPanelItemProvider } from '@ibiz-template/runtime';
|
|
3
|
+
import { ViewMsgPos } from './view-msg-pos.mjs';
|
|
4
|
+
import { ViewMsgPosProvider } from './view-msg-pos.provider.mjs';
|
|
5
|
+
export { ViewMsgPosController } from './view-msg-pos.controller.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizViewMsgPos = withInstall(ViewMsgPos, function(v) {
|
|
9
|
+
v.component(ViewMsgPos.name, ViewMsgPos);
|
|
10
|
+
registerPanelItemProvider(
|
|
11
|
+
"RAWITEM_VIEWMSG_POS",
|
|
12
|
+
() => new ViewMsgPosProvider()
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { IBizViewMsgPos, IBizViewMsgPos as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelRawItem } from '@ibiz/model-core';
|
|
3
|
+
export declare class ViewMsgPosController extends PanelItemController<IPanelRawItem> {
|
|
4
|
+
/**
|
|
5
|
+
* 直接内容项参数
|
|
6
|
+
*
|
|
7
|
+
* @author zhanghengfeng
|
|
8
|
+
* @date 2024-04-08 19:04:15
|
|
9
|
+
* @type {IData}
|
|
10
|
+
*/
|
|
11
|
+
rawItemParams: IData;
|
|
12
|
+
protected onInit(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* 处理直接内容项参数
|
|
15
|
+
*
|
|
16
|
+
* @author zhanghengfeng
|
|
17
|
+
* @date 2024-04-08 19:04:59
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
protected handleRawItemParams(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
class ViewMsgPosController extends PanelItemController {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* 直接内容项参数
|
|
15
|
+
*
|
|
16
|
+
* @author zhanghengfeng
|
|
17
|
+
* @date 2024-04-08 19:04:15
|
|
18
|
+
* @type {IData}
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "rawItemParams", {});
|
|
21
|
+
}
|
|
22
|
+
async onInit() {
|
|
23
|
+
await super.onInit();
|
|
24
|
+
this.handleRawItemParams();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 处理直接内容项参数
|
|
28
|
+
*
|
|
29
|
+
* @author zhanghengfeng
|
|
30
|
+
* @date 2024-04-08 19:04:59
|
|
31
|
+
* @protected
|
|
32
|
+
*/
|
|
33
|
+
handleRawItemParams() {
|
|
34
|
+
var _a;
|
|
35
|
+
const rawItemParams = (_a = this.model.rawItem) == null ? void 0 : _a.rawItemParams;
|
|
36
|
+
if (Array.isArray(rawItemParams)) {
|
|
37
|
+
rawItemParams.forEach((item) => {
|
|
38
|
+
const key = item.key;
|
|
39
|
+
const value = item.value;
|
|
40
|
+
if (key && value) {
|
|
41
|
+
this.rawItemParams[key.toLowerCase()] = value;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { ViewMsgPosController };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IPanelRawItem } from '@ibiz/model-core';
|
|
3
|
+
import { ViewMsgPosController } from './view-msg-pos.controller';
|
|
4
|
+
export declare const ViewMsgPos: import("vue").DefineComponent<{
|
|
5
|
+
modelData: {
|
|
6
|
+
type: PropType<IPanelRawItem>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
controller: {
|
|
10
|
+
type: typeof ViewMsgPosController;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
15
|
+
view: import("@ibiz-template/runtime").IViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
16
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
modelData: {
|
|
18
|
+
type: PropType<IPanelRawItem>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
controller: {
|
|
22
|
+
type: typeof ViewMsgPosController;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>>, {}, {}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace, useCtx } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { ViewMsgPosController } from './view-msg-pos.controller.mjs';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const ViewMsgPos = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "IBizViewMsgPos",
|
|
8
|
+
props: {
|
|
9
|
+
modelData: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
controller: {
|
|
14
|
+
type: ViewMsgPosController,
|
|
15
|
+
required: true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup() {
|
|
19
|
+
const ns = useNamespace("view-msg-pos");
|
|
20
|
+
const ctx = useCtx();
|
|
21
|
+
const view = ctx.view;
|
|
22
|
+
return {
|
|
23
|
+
ns,
|
|
24
|
+
view
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
render() {
|
|
28
|
+
const c = this.controller;
|
|
29
|
+
if (!this.view.state.isCreated) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const position = c.rawItemParams.position || "BODY";
|
|
33
|
+
const scroll = c.rawItemParams.scroll === "true";
|
|
34
|
+
const viewMessages = this.view.state.viewMessages[position];
|
|
35
|
+
if (viewMessages == null ? void 0 : viewMessages.length) {
|
|
36
|
+
return createVNode("div", {
|
|
37
|
+
"class": this.ns.b()
|
|
38
|
+
}, [createVNode(resolveComponent("view-message"), {
|
|
39
|
+
"messages": viewMessages,
|
|
40
|
+
"scroll": scroll
|
|
41
|
+
}, null)]);
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { ViewMsgPos };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPanelItemProvider, PanelController, PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelItem } from '@ibiz/model-core';
|
|
3
|
+
import { ViewMsgPosController } from './view-msg-pos.controller';
|
|
4
|
+
/**
|
|
5
|
+
* 预置视图消息适配器
|
|
6
|
+
*
|
|
7
|
+
* @author zk
|
|
8
|
+
* @date 2024-01-25 02:01:01
|
|
9
|
+
* @export
|
|
10
|
+
* @class ViewMessageProvider
|
|
11
|
+
* @implements {IPanelItemProvider}
|
|
12
|
+
*/
|
|
13
|
+
export declare class ViewMsgPosProvider implements IPanelItemProvider {
|
|
14
|
+
component: string;
|
|
15
|
+
createController(panelItem: IPanelItem, panel: PanelController, parent: PanelItemController | undefined): Promise<ViewMsgPosController>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ViewMsgPosController } from './view-msg-pos.controller.mjs';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
class ViewMsgPosProvider {
|
|
11
|
+
constructor() {
|
|
12
|
+
__publicField(this, "component", "IBizViewMsgPos");
|
|
13
|
+
}
|
|
14
|
+
async createController(panelItem, panel, parent) {
|
|
15
|
+
const c = new ViewMsgPosController(panelItem, panel, parent);
|
|
16
|
+
await c.init();
|
|
17
|
+
return c;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { ViewMsgPosProvider };
|
package/es/view-engine/index.mjs
CHANGED
|
@@ -180,6 +180,10 @@ const IBizViewEngine = {
|
|
|
180
180
|
"VIEW_DEPANELVIEW",
|
|
181
181
|
(c) => new PanelViewEngine(c)
|
|
182
182
|
);
|
|
183
|
+
ibiz.engine.register(
|
|
184
|
+
"VIEW_APPPANELVIEW",
|
|
185
|
+
(c) => new PanelViewEngine(c)
|
|
186
|
+
);
|
|
183
187
|
ibiz.engine.register(
|
|
184
188
|
"VIEW_DECUSTOMVIEW",
|
|
185
189
|
(c) => new CustomViewEngine(c)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewEngineBase, ViewController,
|
|
1
|
+
import { ViewEngineBase, ViewController, IPanelController, IPanelViewEvent, IPanelViewState } from '@ibiz-template/runtime';
|
|
2
2
|
import { IAppView } from '@ibiz/model-core';
|
|
3
3
|
export declare class PanelViewEngine extends ViewEngineBase {
|
|
4
4
|
/**
|
|
@@ -16,6 +16,6 @@ export declare class PanelViewEngine extends ViewEngineBase {
|
|
|
16
16
|
* @readonly
|
|
17
17
|
* @memberof PanelViewEngine
|
|
18
18
|
*/
|
|
19
|
-
get panel():
|
|
19
|
+
get panel(): IPanelController;
|
|
20
20
|
onMounted(): Promise<void>;
|
|
21
21
|
}
|
package/es/web-app/App.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponent, createVNode, defineComponent } from 'vue';
|
|
1
|
+
import { onUnmounted, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { ViewMode, Modal } from '@ibiz-template/runtime';
|
|
3
3
|
import { AppHooks } from '@ibiz-template/vue3-util';
|
|
4
4
|
import './App.css';
|
|
@@ -20,6 +20,14 @@ var App = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
document.addEventListener("keydown", listenDevtool);
|
|
23
|
+
const destroyAppHub = () => {
|
|
24
|
+
window.removeEventListener("unload", destroyAppHub);
|
|
25
|
+
ibiz.hub.destroy();
|
|
26
|
+
};
|
|
27
|
+
window.addEventListener("unload", destroyAppHub);
|
|
28
|
+
onUnmounted(() => {
|
|
29
|
+
destroyAppHub();
|
|
30
|
+
});
|
|
23
31
|
return {
|
|
24
32
|
modal
|
|
25
33
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
|
+
var ramda = require('ramda');
|
|
5
6
|
require('./pagination.css');
|
|
6
7
|
|
|
7
8
|
"use strict";
|
|
@@ -19,6 +20,10 @@ const IBizPagination = /* @__PURE__ */ vue.defineComponent({
|
|
|
19
20
|
size: {
|
|
20
21
|
type: Number,
|
|
21
22
|
required: true
|
|
23
|
+
},
|
|
24
|
+
totalPages: {
|
|
25
|
+
type: Number || void 0,
|
|
26
|
+
required: false
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
emits: ["change", "pageSizeChange", "pageRefresh"],
|
|
@@ -44,6 +49,9 @@ const IBizPagination = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
49
|
const inputChange = (event) => {
|
|
45
50
|
event.stopPropagation();
|
|
46
51
|
};
|
|
52
|
+
const calcTotalPages = vue.computed(() => {
|
|
53
|
+
return Math.ceil(props.total / props.size);
|
|
54
|
+
});
|
|
47
55
|
return {
|
|
48
56
|
ns,
|
|
49
57
|
start,
|
|
@@ -51,7 +59,8 @@ const IBizPagination = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
59
|
onPageChange,
|
|
52
60
|
onPageSizeChange,
|
|
53
61
|
pageRefresh,
|
|
54
|
-
inputChange
|
|
62
|
+
inputChange,
|
|
63
|
+
calcTotalPages
|
|
55
64
|
};
|
|
56
65
|
},
|
|
57
66
|
render() {
|
|
@@ -61,6 +70,7 @@ const IBizPagination = /* @__PURE__ */ vue.defineComponent({
|
|
|
61
70
|
"layout": "slot, prev, pager, next, sizes, jumper",
|
|
62
71
|
"background": true,
|
|
63
72
|
"total": this.total,
|
|
73
|
+
"page-count": !ramda.isNil(this.totalPages) && this.calcTotalPages === this.totalPages ? this.calcTotalPages : this.totalPages,
|
|
64
74
|
"current-page": this.curPage,
|
|
65
75
|
"page-size": this.size,
|
|
66
76
|
"page-sizes": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
|
|
@@ -78,7 +88,7 @@ const IBizPagination = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
88
|
default: () => [vue.createVNode("ion-icon", {
|
|
79
89
|
"name": "refresh"
|
|
80
90
|
}, null)]
|
|
81
|
-
})]), vue.createVNode("span", null, [ibiz.i18n.t("component.pagination.display"), vue.createTextVNode("\xA0"), this.start, vue.createTextVNode("\xA0-\xA0"), this.end, vue.createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.piece"), vue.createTextVNode("\uFF0C"), ibiz.i18n.t("component.pagination.total"), vue.createTextVNode("\xA0"), this.total, vue.createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.pieceData")])]
|
|
91
|
+
})]), ramda.isNil(this.totalPages) || this.calcTotalPages === this.totalPages ? vue.createVNode("span", null, [ibiz.i18n.t("component.pagination.display"), vue.createTextVNode("\xA0"), this.start, vue.createTextVNode("\xA0-\xA0"), this.end, vue.createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.piece"), vue.createTextVNode("\uFF0C")]) : null, vue.createVNode("span", null, [ibiz.i18n.t("component.pagination.total"), vue.createTextVNode("\xA0"), this.total, vue.createTextVNode("\xA0"), ibiz.i18n.t("component.pagination.pieceData")])]
|
|
82
92
|
})]);
|
|
83
93
|
}
|
|
84
94
|
});
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
|
+
var qxUtil = require('qx-util');
|
|
5
6
|
require('./view-message.css');
|
|
6
7
|
|
|
7
8
|
"use strict";
|
|
9
|
+
function _isSlot(s) {
|
|
10
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
11
|
+
}
|
|
8
12
|
const ViewMessage = /* @__PURE__ */ vue.defineComponent({
|
|
9
13
|
name: "ViewMessage",
|
|
10
14
|
props: {
|
|
11
15
|
messages: {
|
|
12
16
|
type: Array
|
|
17
|
+
},
|
|
18
|
+
scroll: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
13
21
|
}
|
|
14
22
|
},
|
|
15
|
-
setup() {
|
|
23
|
+
setup(props) {
|
|
16
24
|
const ns = vue3Util.useNamespace("view-message");
|
|
17
25
|
const getType = (messageType) => {
|
|
18
26
|
switch (messageType) {
|
|
@@ -24,27 +32,132 @@ const ViewMessage = /* @__PURE__ */ vue.defineComponent({
|
|
|
24
32
|
return "info";
|
|
25
33
|
}
|
|
26
34
|
};
|
|
35
|
+
const items = vue.ref([]);
|
|
36
|
+
const initialIndex = vue.ref(0);
|
|
37
|
+
const uuid = vue.ref("");
|
|
38
|
+
const isHiddenContainer = vue.ref(false);
|
|
39
|
+
vue.watch(() => props.messages, () => {
|
|
40
|
+
initialIndex.value = 0;
|
|
41
|
+
uuid.value = qxUtil.createUUID();
|
|
42
|
+
if (Array.isArray(props.messages)) {
|
|
43
|
+
items.value = props.messages.filter((item) => item.title || item.message).map((item) => {
|
|
44
|
+
return {
|
|
45
|
+
...item
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
isHiddenContainer.value = false;
|
|
49
|
+
} else {
|
|
50
|
+
items.value = [];
|
|
51
|
+
isHiddenContainer.value = true;
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
immediate: true
|
|
55
|
+
});
|
|
56
|
+
const container = vue.ref(null);
|
|
57
|
+
const carouselHeight = vue.ref("");
|
|
58
|
+
vue.onMounted(() => {
|
|
59
|
+
vue.nextTick(() => {
|
|
60
|
+
const el = container.value;
|
|
61
|
+
if (!el) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const alertEl = el.querySelector(".el-alert");
|
|
65
|
+
if (alertEl) {
|
|
66
|
+
carouselHeight.value = "".concat(alertEl.offsetHeight, "px");
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const handleAlertClose = (index) => {
|
|
71
|
+
items.value[index].hidden = true;
|
|
72
|
+
const isHiddenCarouse = items.value.every((item) => item.hidden);
|
|
73
|
+
if (isHiddenCarouse) {
|
|
74
|
+
isHiddenContainer.value = true;
|
|
75
|
+
}
|
|
76
|
+
uuid.value = qxUtil.createUUID();
|
|
77
|
+
};
|
|
78
|
+
const handleChange = (index) => {
|
|
79
|
+
initialIndex.value = index;
|
|
80
|
+
};
|
|
27
81
|
return {
|
|
28
82
|
ns,
|
|
29
|
-
getType
|
|
83
|
+
getType,
|
|
84
|
+
items,
|
|
85
|
+
container,
|
|
86
|
+
carouselHeight,
|
|
87
|
+
initialIndex,
|
|
88
|
+
uuid,
|
|
89
|
+
isHiddenContainer,
|
|
90
|
+
handleAlertClose,
|
|
91
|
+
handleChange
|
|
30
92
|
};
|
|
31
93
|
},
|
|
32
94
|
render() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
95
|
+
const renderScrollMessages = () => {
|
|
96
|
+
let _slot;
|
|
97
|
+
return vue.createVNode("div", {
|
|
98
|
+
"class": [this.ns.b(), this.isHiddenContainer && this.ns.m("hidden")],
|
|
99
|
+
"ref": "container"
|
|
100
|
+
}, [vue.createVNode(vue.resolveComponent("el-carousel"), {
|
|
101
|
+
"key": this.uuid,
|
|
102
|
+
"indicatorPosition": "none",
|
|
103
|
+
"arrow": "never",
|
|
104
|
+
"height": this.carouselHeight,
|
|
105
|
+
"initialIndex": this.initialIndex,
|
|
106
|
+
"onChange": this.handleChange
|
|
107
|
+
}, _isSlot(_slot = this.items.map((item, i) => {
|
|
108
|
+
if (item.hidden) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
return vue.createVNode(vue.resolveComponent("el-carousel-item"), null, {
|
|
112
|
+
default: () => [vue.createVNode(vue.resolveComponent("el-alert"), {
|
|
113
|
+
"type": this.getType(item.messageType),
|
|
114
|
+
"class": this.ns.b("carousel-alert"),
|
|
115
|
+
"closable": item.removeMode !== 0,
|
|
116
|
+
"onClose": () => this.handleAlertClose(i)
|
|
117
|
+
}, {
|
|
118
|
+
title: () => {
|
|
119
|
+
return vue.createVNode("div", {
|
|
120
|
+
"class": this.ns.be("carousel-alert", "title")
|
|
121
|
+
}, [item.title || ""]);
|
|
122
|
+
},
|
|
123
|
+
default: () => {
|
|
124
|
+
return vue.createVNode("div", {
|
|
125
|
+
"class": this.ns.be("carousel-alert", "message")
|
|
126
|
+
}, [item.message || ""]);
|
|
127
|
+
}
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
})) ? _slot : {
|
|
131
|
+
default: () => [_slot]
|
|
132
|
+
})]);
|
|
133
|
+
};
|
|
134
|
+
const renderMessages = () => {
|
|
135
|
+
return vue.createVNode("div", {
|
|
136
|
+
"class": [this.ns.b(), this.isHiddenContainer && this.ns.m("hidden")]
|
|
137
|
+
}, [this.items.map((item, i) => {
|
|
138
|
+
return vue.createVNode(vue.resolveComponent("el-alert"), {
|
|
139
|
+
"type": this.getType(item.messageType),
|
|
140
|
+
"class": [this.ns.b("alert"), this.ns.bm("alert", item.title && item.message ? "" : "single"), this.ns.bm("alert", !item.title && item.message ? "single-message" : "")],
|
|
141
|
+
"closable": item.removeMode !== 0,
|
|
142
|
+
"onClose": () => this.handleAlertClose(i)
|
|
143
|
+
}, {
|
|
144
|
+
title: () => {
|
|
145
|
+
return vue.createVNode("div", {
|
|
146
|
+
"class": this.ns.be("alert", "title")
|
|
147
|
+
}, [item.title || ""]);
|
|
148
|
+
},
|
|
149
|
+
default: () => {
|
|
150
|
+
return vue.createVNode("div", {
|
|
151
|
+
"class": this.ns.be("alert", "message")
|
|
152
|
+
}, [item.message || ""]);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
})]);
|
|
156
|
+
};
|
|
157
|
+
if (this.items.length > 1 && this.scroll) {
|
|
158
|
+
return renderScrollMessages();
|
|
36
159
|
}
|
|
37
|
-
return
|
|
38
|
-
"class": [this.ns.b()]
|
|
39
|
-
}, [(_b = this.messages) == null ? void 0 : _b.map((message) => {
|
|
40
|
-
return vue.createVNode(vue.resolveComponent("el-alert"), {
|
|
41
|
-
"type": this.getType(message.messageType),
|
|
42
|
-
"title": message.title,
|
|
43
|
-
"class": [this.ns.e("alert"), this.ns.is("no-title", !message.title)],
|
|
44
|
-
"description": message.message,
|
|
45
|
-
"closable": message.removeMode !== 0
|
|
46
|
-
}, null);
|
|
47
|
-
})]);
|
|
160
|
+
return renderMessages();
|
|
48
161
|
}
|
|
49
162
|
});
|
|
50
163
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-view-
|
|
1
|
+
.ibiz-view-message{--ibiz-view-message-border--warning:1px solid var(--ibiz-color-warning-active);--ibiz-view-message-border--error:1px solid var(--ibiz-color-danger-active);--ibiz-view-message-border--info:1px solid var(--ibiz-color-info-active);padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-none)}.ibiz-view-message--hidden{display:none}.ibiz-view-message .el-alert--warning.is-light{border:var(--ibiz-view-message-border--warning)}.ibiz-view-message .el-alert--error.is-light{border:var(--ibiz-view-message-border--error)}.ibiz-view-message .el-alert--info.is-light{border:var(--ibiz-view-message-border--info)}.ibiz-view-message-alert{margin-bottom:var(--ibiz-spacing-tight)}.ibiz-view-message-alert:last-child{margin-bottom:var(--ibiz-spacing-none)}.ibiz-view-message-alert--single .el-alert__description{margin:0}.ibiz-view-message-alert--single-message .el-alert__close-btn{top:calc(var(--ibiz-spacing-tight) + var(--ibiz-spacing-super-tight))}.ibiz-view-message-alert__title{line-height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight))}.ibiz-view-message-alert__message{line-height:var(--ibiz-spacing-base)}.ibiz-view-message-carousel-alert .el-alert__content{overflow:hidden}.ibiz-view-message-carousel-alert__title{height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight));overflow:hidden;line-height:calc(var(--ibiz-spacing-base-loose) - var(--ibiz-spacing-super-tight));text-overflow:ellipsis;white-space:nowrap}.ibiz-view-message-carousel-alert__message{height:var(--ibiz-spacing-base);overflow:hidden;line-height:var(--ibiz-spacing-base);text-overflow:ellipsis;white-space:nowrap}
|