@ibiz-template/vue3-components 0.7.12 → 0.7.13
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-5IjaPupj.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-Zf9d2PeX.js → xlsx-util-8i01yifN.js} +1 -1
- package/es/control/app-menu/app-menu.mjs +1 -1
- package/es/control/context-menu/context-menu.css +1 -1
- package/es/control/context-menu/context-menu.d.ts +1 -0
- package/es/control/context-menu/context-menu.mjs +63 -6
- package/es/control/context-menu/index.d.ts +1 -0
- package/es/control/form/form/form.css +1 -1
- package/es/control/form/form-detail/form-page/form-page.css +1 -1
- package/es/control/form/form-detail/form-page/form-page.d.ts +1 -0
- package/es/control/form/form-detail/form-page/form-page.mjs +10 -4
- package/es/control/form/form-detail/form-page/index.d.ts +1 -0
- package/es/control/toolbar/export-excel/export-excel.css +1 -1
- package/es/control/toolbar/short-cut-button/short-cut-button.css +0 -0
- package/es/control/toolbar/short-cut-button/short-cut-button.d.ts +48 -0
- package/es/control/toolbar/short-cut-button/short-cut-button.mjs +71 -0
- package/es/control/toolbar/toolbar.mjs +11 -0
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -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 +15 -3
- package/es/index.mjs +1 -0
- package/es/panel-component/auth-captcha/auth-captcha.controller.d.ts +20 -0
- package/es/panel-component/auth-captcha/auth-captcha.controller.mjs +70 -16
- package/es/panel-component/auth-captcha/auth-captcha.css +1 -1
- package/es/panel-component/auth-captcha/auth-captcha.d.ts +1 -0
- package/es/panel-component/auth-captcha/auth-captcha.mjs +12 -3
- package/es/panel-component/auth-captcha/auth-captcha.state.d.ts +7 -0
- package/es/panel-component/auth-captcha/auth-captcha.state.mjs +7 -0
- package/es/panel-component/auth-captcha/index.d.ts +1 -0
- package/es/panel-component/auth-userinfo/auth-userinfo.d.ts +1 -1
- package/es/panel-component/auth-userinfo/auth-userinfo.mjs +2 -7
- package/es/panel-component/auth-userinfo/index.d.ts +1 -1
- package/es/panel-component/panel-button/panel-button.controller.mjs +7 -1
- package/es/panel-component/short-cut/index.d.ts +21 -4
- package/es/panel-component/short-cut/short-cut.css +1 -1
- package/es/panel-component/short-cut/short-cut.d.ts +21 -4
- package/es/panel-component/short-cut/short-cut.mjs +45 -28
- package/es/util/app-util/app-util.d.ts +90 -0
- package/es/util/app-util/app-util.mjs +152 -0
- package/es/util/index.d.ts +1 -0
- package/es/util/index.mjs +1 -0
- package/es/view-engine/login-view.engine.d.ts +3 -1
- package/es/view-engine/login-view.engine.mjs +4 -3
- package/es/web-app/main.mjs +2 -0
- package/lib/control/app-menu/app-menu.cjs +1 -1
- package/lib/control/context-menu/context-menu.cjs +63 -6
- package/lib/control/context-menu/context-menu.css +1 -1
- package/lib/control/form/form/form.css +1 -1
- package/lib/control/form/form-detail/form-page/form-page.cjs +10 -4
- package/lib/control/form/form-detail/form-page/form-page.css +1 -1
- package/lib/control/toolbar/export-excel/export-excel.css +1 -1
- package/lib/control/toolbar/short-cut-button/short-cut-button.cjs +73 -0
- package/lib/control/toolbar/short-cut-button/short-cut-button.css +0 -0
- package/lib/control/toolbar/toolbar.cjs +11 -0
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +14 -2
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/lib/index.cjs +2 -0
- package/lib/panel-component/auth-captcha/auth-captcha.cjs +12 -3
- package/lib/panel-component/auth-captcha/auth-captcha.controller.cjs +70 -16
- package/lib/panel-component/auth-captcha/auth-captcha.css +1 -1
- package/lib/panel-component/auth-captcha/auth-captcha.state.cjs +7 -0
- package/lib/panel-component/auth-userinfo/auth-userinfo.cjs +2 -7
- package/lib/panel-component/panel-button/panel-button.controller.cjs +7 -1
- package/lib/panel-component/short-cut/short-cut.cjs +44 -27
- package/lib/panel-component/short-cut/short-cut.css +1 -1
- package/lib/util/app-util/app-util.cjs +154 -0
- package/lib/util/index.cjs +2 -0
- package/lib/view-engine/login-view.engine.cjs +4 -3
- package/lib/web-app/main.cjs +2 -0
- package/package.json +4 -4
- package/dist/index-3xonNDdv.js +0 -4
|
@@ -21,7 +21,7 @@ const AuthCaptcha = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
const c = props.controller;
|
|
22
22
|
const classArr = computed(() => {
|
|
23
23
|
let result = [ns.b(), ns.m(c.model.id)];
|
|
24
|
-
result = [...result, ...props.controller.containerClass, ns.is("hidden", !props.controller.state.visible)];
|
|
24
|
+
result = [...result, ...props.controller.containerClass, ns.is("hidden", !props.controller.state.visible), ns.is("error", !!c.state.error)];
|
|
25
25
|
return result;
|
|
26
26
|
});
|
|
27
27
|
const onClick = () => {
|
|
@@ -29,11 +29,16 @@ const AuthCaptcha = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
c.loadCaptcha();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
const onChange = () => {
|
|
33
|
+
c.onChange();
|
|
34
|
+
c.validate();
|
|
35
|
+
};
|
|
32
36
|
return {
|
|
33
37
|
c,
|
|
34
38
|
ns,
|
|
35
39
|
classArr,
|
|
36
|
-
onClick
|
|
40
|
+
onClick,
|
|
41
|
+
onChange
|
|
37
42
|
};
|
|
38
43
|
},
|
|
39
44
|
render() {
|
|
@@ -43,6 +48,8 @@ const AuthCaptcha = /* @__PURE__ */ defineComponent({
|
|
|
43
48
|
"modelValue": this.c.state.code,
|
|
44
49
|
"onUpdate:modelValue": ($event) => this.c.state.code = $event,
|
|
45
50
|
"class": this.ns.e("captcha"),
|
|
51
|
+
"onInput": this.onChange,
|
|
52
|
+
"onBlur": this.onChange,
|
|
46
53
|
"placeholder": "\u9A8C\u8BC1\u7801"
|
|
47
54
|
}, null), withDirectives(createVNode(resolveComponent("el-image"), {
|
|
48
55
|
"src": this.c.state.image,
|
|
@@ -56,7 +63,9 @@ const AuthCaptcha = /* @__PURE__ */ defineComponent({
|
|
|
56
63
|
"class": [this.ns.em("image", "hint"), this.ns.is("loading", this.c.state.loading)]
|
|
57
64
|
}, [this.c.state.loading ? "\u52A0\u8F7D\u4E2D..." : "\u52A0\u8F7D\u5931\u8D25"]);
|
|
58
65
|
}
|
|
59
|
-
}), [[resolveDirective("loading"), this.c.state.loading]])
|
|
66
|
+
}), [[resolveDirective("loading"), this.c.state.loading]]), this.c.state.error && createVNode("div", {
|
|
67
|
+
"class": this.ns.e("error")
|
|
68
|
+
}, [this.c.state.error])]);
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
|
|
@@ -38,6 +38,13 @@ class AuthCaptchaState extends PanelItemState {
|
|
|
38
38
|
* @memberof AuthCaptchaState
|
|
39
39
|
*/
|
|
40
40
|
__publicField(this, "loading", false);
|
|
41
|
+
/**
|
|
42
|
+
* 错误信息
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof AuthCaptchaState
|
|
46
|
+
*/
|
|
47
|
+
__publicField(this, "error");
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
|
|
@@ -12,6 +12,7 @@ export declare const IBizAuthCaptcha: import("@ibiz-template/vue3-util").TypeWit
|
|
|
12
12
|
ns: import("@ibiz-template/core").Namespace;
|
|
13
13
|
classArr: import("vue").ComputedRef<(string | false)[]>;
|
|
14
14
|
onClick: () => void;
|
|
15
|
+
onChange: () => void;
|
|
15
16
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
17
|
modelData: {
|
|
17
18
|
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
@@ -14,7 +14,7 @@ export declare const AuthUserinfo: import("vue").DefineComponent<{
|
|
|
14
14
|
}, {
|
|
15
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
16
|
c: PanelItemController<import("@ibiz/model-core").IPanelItem>;
|
|
17
|
-
onClick: () =>
|
|
17
|
+
onClick: () => void;
|
|
18
18
|
srfusername: any;
|
|
19
19
|
srfpersonname: any;
|
|
20
20
|
router: import("vue-router").Router;
|
|
@@ -33,13 +33,8 @@ const AuthUserinfo = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
}
|
|
34
34
|
return "LEFT";
|
|
35
35
|
});
|
|
36
|
-
const onClick =
|
|
37
|
-
|
|
38
|
-
if (bol) {
|
|
39
|
-
await router.push("/login?ru=".concat(encodeURIComponent(window.location.hash.replace("#/", "/"))));
|
|
40
|
-
ibiz.util.showAppLoading();
|
|
41
|
-
window.location.reload();
|
|
42
|
-
}
|
|
36
|
+
const onClick = () => {
|
|
37
|
+
ibiz.hub.controller.logout();
|
|
43
38
|
};
|
|
44
39
|
const isCollapse = computed(() => {
|
|
45
40
|
return c.panel.view.state.isCollapse;
|
|
@@ -10,7 +10,7 @@ export declare const IBizAuthUserinfo: import("@ibiz-template/vue3-util").TypeWi
|
|
|
10
10
|
}, {
|
|
11
11
|
ns: import("@ibiz-template/core").Namespace;
|
|
12
12
|
c: import("@ibiz-template/runtime").PanelItemController<import("@ibiz/model-core").IPanelItem>;
|
|
13
|
-
onClick: () =>
|
|
13
|
+
onClick: () => void;
|
|
14
14
|
srfusername: any;
|
|
15
15
|
srfpersonname: any;
|
|
16
16
|
router: import("vue-router").Router;
|
|
@@ -99,13 +99,19 @@ class PanelButtonController extends PanelItemController {
|
|
|
99
99
|
}
|
|
100
100
|
event.stopPropagation();
|
|
101
101
|
event.preventDefault();
|
|
102
|
+
const view = this.panel.view;
|
|
103
|
+
if (actionType === "UIACTION" && uiactionId === "login" && view.model.viewType === "APPLOGINVIEW" && !await view.validate(
|
|
104
|
+
this.dataParent.model.id
|
|
105
|
+
)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
102
108
|
await UIActionUtil.execAndResolved(
|
|
103
109
|
uiactionId,
|
|
104
110
|
{
|
|
105
111
|
context: this.panel.context,
|
|
106
112
|
params: this.panel.params,
|
|
107
113
|
data: [this.data],
|
|
108
|
-
view
|
|
114
|
+
view,
|
|
109
115
|
event,
|
|
110
116
|
noWaitRoute: true
|
|
111
117
|
},
|
|
@@ -9,9 +9,9 @@ export declare const IBizShortCut: import("@ibiz-template/vue3-util").TypeWithIn
|
|
|
9
9
|
};
|
|
10
10
|
}, {
|
|
11
11
|
ns: import("@ibiz-template/core").Namespace;
|
|
12
|
-
data:
|
|
12
|
+
data: {
|
|
13
13
|
key: string;
|
|
14
|
-
|
|
14
|
+
caption: string;
|
|
15
15
|
appViewId: string;
|
|
16
16
|
context: {
|
|
17
17
|
[x: string]: any;
|
|
@@ -23,8 +23,25 @@ export declare const IBizShortCut: import("@ibiz-template/vue3-util").TypeWithIn
|
|
|
23
23
|
};
|
|
24
24
|
params: IParams;
|
|
25
25
|
openMode: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
fullPath: string;
|
|
27
|
+
icon?: {
|
|
28
|
+
codeName?: string | undefined;
|
|
29
|
+
cssClass?: string | undefined;
|
|
30
|
+
cssClassX?: string | undefined;
|
|
31
|
+
glyph?: string | undefined;
|
|
32
|
+
height?: number | undefined;
|
|
33
|
+
imagePath?: string | undefined;
|
|
34
|
+
imagePathX?: string | undefined;
|
|
35
|
+
rawContent?: string | undefined;
|
|
36
|
+
width?: number | undefined;
|
|
37
|
+
appId: string;
|
|
38
|
+
id?: string | undefined;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
userParam?: Record<string, string> | undefined;
|
|
41
|
+
modelId?: string | undefined;
|
|
42
|
+
modelType?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
}[];
|
|
28
45
|
isShowToolbar: import("vue").Ref<boolean>;
|
|
29
46
|
onChange: (evt: IData) => void;
|
|
30
47
|
onShowChange: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-short-cut{bottom:4px;right:4px;z-index:2;position:fixed;display:flex;align-items:center;border-radius:4px;box-shadow:0 0 16px rgba(0,0,0,.0784313725);border:1px solid var(--ibiz-color-border);background:var(--ibiz-color-bg-1)}.ibiz-short-cut.is-
|
|
1
|
+
.ibiz-short-cut{bottom:4px;right:4px;z-index:2;position:fixed;display:flex;align-items:center;border-radius:4px;box-shadow:0 0 16px rgba(0,0,0,.0784313725);border:1px solid var(--ibiz-color-border);background:var(--ibiz-color-bg-1)}.ibiz-short-cut.is-conceal{visibility:hidden}.ibiz-short-cut__more{padding:2px;cursor:pointer}.ibiz-short-cut__more .el-tooltip__trigger{padding:8px;line-height:16px}.ibiz-short-cut__more .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__more--icon{font-size:16px;margin-left:8px}.ibiz-short-cut__recover{padding:2px;display:flex;cursor:pointer;align-items:center}.ibiz-short-cut__recover .el-tooltip__trigger{padding:8px;line-height:16px}.ibiz-short-cut__recover .el-tooltip__trigger:hover{border-radius:2px;color:var(--ibiz-color-primary);background-color:var(--ibiz-color-primary-light-default)}.ibiz-short-cut__item{display:flex;cursor:pointer;position:relative;align-items:center;flex-flow:row nowrap;place-content:center flex-start}.ibiz-short-cut__item .icon{flex-shrink:0;font-size:16px}.ibiz-short-cut__item .caption-icon,.ibiz-short-cut__item .expand-icon{margin-right:8px}.ibiz-short-cut__item .close-icon,.ibiz-short-cut__item .drag-icon{visibility:hidden}.ibiz-short-cut__item .close-icon:hover{color:var(--ibiz-color-danger-hover)}.ibiz-short-cut__item--caption{flex-grow:1;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ibiz-short-cut__item:hover .close-icon,.ibiz-short-cut__item:hover .drag-icon{visibility:visible}.ibiz-short-cut .is-horizontal{display:flex;padding:8px 0}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item{max-width:168px;min-width:84px;padding:0 12px;border-right:1px solid var(--ibiz-color-border)}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item .close-icon{right:0;position:absolute;padding-right:4px;background-color:var(--ibiz-color-white);box-shadow:-10px 0 20px 8px var(--ibiz-color-white)}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item .drag-icon{display:none;margin-right:8px}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item:hover .drag-icon{display:block}.ibiz-short-cut .is-horizontal .ibiz-short-cut__item:hover .caption-icon{display:none}.ibiz-short-cut__popover.el-popover.el-popper{padding:10px 0}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item{width:225px;height:44px;padding:9px 20px}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item .drag-icon{left:5px;position:absolute}.ibiz-short-cut__popover .is-vertical .ibiz-short-cut__item:hover{background-color:var(--ibiz-color-fill-1)}
|
|
@@ -13,9 +13,9 @@ export declare const ShortCut: import("vue").DefineComponent<{
|
|
|
13
13
|
};
|
|
14
14
|
}, {
|
|
15
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
|
-
data:
|
|
16
|
+
data: {
|
|
17
17
|
key: string;
|
|
18
|
-
|
|
18
|
+
caption: string;
|
|
19
19
|
appViewId: string;
|
|
20
20
|
context: {
|
|
21
21
|
[x: string]: any;
|
|
@@ -27,8 +27,25 @@ export declare const ShortCut: import("vue").DefineComponent<{
|
|
|
27
27
|
};
|
|
28
28
|
params: IParams;
|
|
29
29
|
openMode: string;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
fullPath: string;
|
|
31
|
+
icon?: {
|
|
32
|
+
codeName?: string | undefined;
|
|
33
|
+
cssClass?: string | undefined;
|
|
34
|
+
cssClassX?: string | undefined;
|
|
35
|
+
glyph?: string | undefined;
|
|
36
|
+
height?: number | undefined;
|
|
37
|
+
imagePath?: string | undefined;
|
|
38
|
+
imagePathX?: string | undefined;
|
|
39
|
+
rawContent?: string | undefined;
|
|
40
|
+
width?: number | undefined;
|
|
41
|
+
appId: string;
|
|
42
|
+
id?: string | undefined;
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
userParam?: Record<string, string> | undefined;
|
|
45
|
+
modelId?: string | undefined;
|
|
46
|
+
modelType?: string | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
}[];
|
|
32
49
|
isShowToolbar: import("vue").Ref<boolean>;
|
|
33
50
|
onChange: (evt: IData) => void;
|
|
34
51
|
onShowChange: () => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { getCurrentInstance, ref, createVNode, resolveComponent, defineComponent } from 'vue';
|
|
1
|
+
import { getCurrentInstance, ref, reactive, onMounted, onUnmounted, createVNode, resolveComponent, defineComponent } from 'vue';
|
|
2
|
+
import { useRouter } from 'vue-router';
|
|
2
3
|
import { PanelItemController, OpenAppViewCommand } from '@ibiz-template/runtime';
|
|
3
4
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
4
5
|
import draggable from 'vuedraggable';
|
|
5
|
-
import './short-cut.css';
|
|
6
6
|
import { IBizContext } from '@ibiz-template/core';
|
|
7
|
+
import './short-cut.css';
|
|
7
8
|
|
|
8
9
|
"use strict";
|
|
9
10
|
const ShortCut = /* @__PURE__ */ defineComponent({
|
|
@@ -24,35 +25,47 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
24
25
|
setup(props) {
|
|
25
26
|
const ns = useNamespace("short-cut");
|
|
26
27
|
const vue = getCurrentInstance().proxy;
|
|
28
|
+
const router = useRouter();
|
|
27
29
|
const isShowToolbar = ref(false);
|
|
28
30
|
const isShowMore = ref(false);
|
|
29
|
-
const data =
|
|
31
|
+
const data = reactive(ibiz.util.shortCut.data);
|
|
30
32
|
const dragCache = {
|
|
31
33
|
newIndex: 0,
|
|
32
34
|
oldIndex: 0
|
|
33
35
|
};
|
|
36
|
+
const openModeMap = /* @__PURE__ */ new Map([["ROUTE_MODAL", "INDEXVIEWTAB_POPUPMODAL"], ["MODAL", "POPUPMODAL"], ["DRAWER", "DRAWER_RIGHT"]]);
|
|
37
|
+
const onShortCutChange = (items) => {
|
|
38
|
+
if (data.length === 0 && isShowMore.value) {
|
|
39
|
+
isShowMore.value = false;
|
|
40
|
+
}
|
|
41
|
+
vue.$forceUpdate();
|
|
42
|
+
};
|
|
43
|
+
onMounted(() => {
|
|
44
|
+
ibiz.util.shortCut.onChange(onShortCutChange);
|
|
45
|
+
});
|
|
46
|
+
onUnmounted(() => {
|
|
47
|
+
ibiz.util.shortCut.offChange(onShortCutChange);
|
|
48
|
+
});
|
|
34
49
|
const onShowChange = () => {
|
|
35
50
|
isShowToolbar.value = !isShowToolbar.value;
|
|
36
51
|
if (isShowToolbar.value) {
|
|
37
52
|
isShowMore.value = false;
|
|
38
53
|
}
|
|
39
54
|
};
|
|
40
|
-
const getOpenMode = (openMode) => {
|
|
41
|
-
switch (openMode) {
|
|
42
|
-
case "ROUTE_MODAL":
|
|
43
|
-
return "INDEXVIEWTAB_POPUPMODAL";
|
|
44
|
-
case "MODAL":
|
|
45
|
-
return "POPUPMODAL";
|
|
46
|
-
case "DRAWER":
|
|
47
|
-
return "DRAWER_RIGHT";
|
|
48
|
-
default:
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
55
|
const onClick = (item) => {
|
|
52
56
|
isShowMore.value = false;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
if (item.openMode === "ROUTE") {
|
|
58
|
+
const fullPath = item.fullPath.substring(1);
|
|
59
|
+
if (router.currentRoute.value.fullPath !== fullPath) {
|
|
60
|
+
router.push({
|
|
61
|
+
path: item.fullPath.substring(1)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
ibiz.commands.execute(OpenAppViewCommand.TAG, item.appViewId, IBizContext.create(item.context), item.params, {
|
|
66
|
+
openMode: openModeMap.get(item.openMode)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
56
69
|
};
|
|
57
70
|
const onChange = (evt) => {
|
|
58
71
|
if (evt.moved) {
|
|
@@ -63,18 +76,16 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
63
76
|
dragCache.oldIndex = evt.removed.oldIndex;
|
|
64
77
|
ibiz.util.shortCut.changeIndex(dragCache.newIndex, dragCache.oldIndex);
|
|
65
78
|
}
|
|
66
|
-
vue.$forceUpdate();
|
|
67
79
|
};
|
|
68
80
|
const onDelete = (event, key) => {
|
|
69
81
|
event.stopPropagation();
|
|
70
82
|
ibiz.util.shortCut.removeShortCut(key);
|
|
71
|
-
vue.$forceUpdate();
|
|
72
83
|
};
|
|
73
84
|
const renderDraggable = (isVertical) => {
|
|
74
85
|
return createVNode(draggable, {
|
|
75
86
|
"itemKey": "key",
|
|
76
87
|
"class": [ns.e("draggable"), ns.is("vertical", isVertical), ns.is("horizontal", !isVertical)],
|
|
77
|
-
"modelValue": data
|
|
88
|
+
"modelValue": data,
|
|
78
89
|
"group": props.controller.model.id,
|
|
79
90
|
"onChange": (evt) => onChange(evt)
|
|
80
91
|
}, {
|
|
@@ -85,13 +96,14 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
85
96
|
if (isVertical && !isShowToolbar.value || isVertical && isShowToolbar.value && index > 5 || !isVertical && index < 6) {
|
|
86
97
|
return createVNode("div", {
|
|
87
98
|
"class": ns.e("item"),
|
|
99
|
+
"title": element.caption,
|
|
88
100
|
"onClick": () => onClick(element)
|
|
89
101
|
}, [createVNode("svg", {
|
|
90
102
|
"viewBox": "0 0 16 16",
|
|
91
103
|
"class": ["drag-icon", "icon"],
|
|
92
104
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
93
|
-
"height": "
|
|
94
|
-
"width": "
|
|
105
|
+
"height": "16px",
|
|
106
|
+
"width": "16px",
|
|
95
107
|
"focusable": "false"
|
|
96
108
|
}, [createVNode("g", {
|
|
97
109
|
"id": "drag-icon/drag--",
|
|
@@ -104,14 +116,17 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
104
116
|
}, [createVNode("path", {
|
|
105
117
|
"d": "M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z",
|
|
106
118
|
"id": "drag-icon-air"
|
|
107
|
-
}, null)])])]), createVNode("
|
|
108
|
-
"class": ["icon", "
|
|
119
|
+
}, null)])])]), element.icon ? createVNode(resolveComponent("iBizIcon"), {
|
|
120
|
+
"class": ["caption-icon", "icon"],
|
|
121
|
+
"icon": element.icon
|
|
122
|
+
}, null) : createVNode("ion-icon", {
|
|
123
|
+
"class": ["caption-icon", "icon"],
|
|
109
124
|
"name": "ellipsis-horizontal-circle-outline"
|
|
110
125
|
}, null), createVNode("div", {
|
|
111
126
|
"class": ns.em("item", "caption")
|
|
112
|
-
}, [element.
|
|
113
|
-
"class": ["close-icon", "icon"],
|
|
127
|
+
}, [element.caption]), createVNode("ion-icon", {
|
|
114
128
|
"name": "close-outline",
|
|
129
|
+
"class": ["close-icon", "icon"],
|
|
115
130
|
"onClick": (event) => onDelete(event, element.key)
|
|
116
131
|
}, null)]);
|
|
117
132
|
}
|
|
@@ -122,6 +137,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
122
137
|
"class": [ns.e("item"), ns.e("action")],
|
|
123
138
|
"onClick": onShowChange
|
|
124
139
|
}, [createVNode("ion-icon", {
|
|
140
|
+
"class": ["expand-icon", "icon"],
|
|
125
141
|
"name": "chevron-back-outline"
|
|
126
142
|
}, null), createVNode("div", {
|
|
127
143
|
"class": ns.em("item", "caption")
|
|
@@ -148,7 +164,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
148
164
|
}, {
|
|
149
165
|
default: () => [createVNode("div", null, [createVNode("span", {
|
|
150
166
|
"class": ns.em("more", "caption")
|
|
151
|
-
}, [isShowToolbar.value ? "6/".concat(data.
|
|
167
|
+
}, [isShowToolbar.value ? "6/".concat(data.length) : data.length]), createVNode("i", {
|
|
152
168
|
"class": ["fa", ns.em("more", "icon"), isShowMore.value ? "fa-angle-double-down" : "fa-angle-double-up"],
|
|
153
169
|
"aria-hidden": "true"
|
|
154
170
|
}, null)])]
|
|
@@ -171,7 +187,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
171
187
|
},
|
|
172
188
|
render() {
|
|
173
189
|
return createVNode("div", {
|
|
174
|
-
"class": [this.ns.b(), ...this.controller.containerClass, this.ns.is("
|
|
190
|
+
"class": [this.ns.b(), ...this.controller.containerClass, this.ns.is("conceal", this.data.length === 0)]
|
|
175
191
|
}, [this.isShowToolbar && this.renderDraggable(false), (!this.isShowToolbar || this.data.length > 6) && this.renderMoreToolbar(), this.isShowToolbar && createVNode("div", {
|
|
176
192
|
"class": this.ns.e("recover"),
|
|
177
193
|
"onClick": this.onShowChange
|
|
@@ -181,6 +197,7 @@ const ShortCut = /* @__PURE__ */ defineComponent({
|
|
|
181
197
|
"placement": "top"
|
|
182
198
|
}, {
|
|
183
199
|
default: () => [createVNode("ion-icon", {
|
|
200
|
+
"class": ["recover-icon", "icon"],
|
|
184
201
|
"name": "chevron-forward-outline"
|
|
185
202
|
}, null)]
|
|
186
203
|
})])]);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Router } from 'vue-router';
|
|
2
|
+
import { IAppUtil } from '@ibiz-template/runtime';
|
|
3
|
+
export declare class AppUtil implements IAppUtil {
|
|
4
|
+
protected router: Router;
|
|
5
|
+
/**
|
|
6
|
+
* Creates an instance of AppUtil.
|
|
7
|
+
* @author tony001
|
|
8
|
+
* @date 2024-05-14 17:05:00
|
|
9
|
+
* @param {Router} router
|
|
10
|
+
*/
|
|
11
|
+
constructor(router: Router);
|
|
12
|
+
/**
|
|
13
|
+
* 登录
|
|
14
|
+
*
|
|
15
|
+
* @author tony001
|
|
16
|
+
* @date 2024-05-14 16:05:41
|
|
17
|
+
* @param {string} loginName
|
|
18
|
+
* @param {string} password
|
|
19
|
+
* @param {(boolean | undefined)} [remember]
|
|
20
|
+
* @param {(IData | undefined)} [headers]
|
|
21
|
+
* @param {(IData | undefined)} [opts]
|
|
22
|
+
* @return {*} {Promise<boolean>}
|
|
23
|
+
*/
|
|
24
|
+
login(loginName: string, password: string, remember?: boolean | undefined, headers?: IData | undefined, opts?: IData | undefined): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* 登出
|
|
27
|
+
*
|
|
28
|
+
* @author tony001
|
|
29
|
+
* @date 2024-05-14 16:05:02
|
|
30
|
+
* @param {(IData | undefined)} [opts]
|
|
31
|
+
* @return {*} {Promise<boolean>}
|
|
32
|
+
*/
|
|
33
|
+
logout(opts?: IData | undefined): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* 变更密码
|
|
36
|
+
*
|
|
37
|
+
* @author tony001
|
|
38
|
+
* @date 2024-05-14 16:05:11
|
|
39
|
+
* @param {string} oldPwd
|
|
40
|
+
* @param {string} newPwd
|
|
41
|
+
* @param {(IData | undefined)} [opts]
|
|
42
|
+
* @return {*} {Promise<boolean>}
|
|
43
|
+
*/
|
|
44
|
+
changePwd(oldPwd: string, newPwd: string, opts?: IData | undefined): Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* 切换组织
|
|
47
|
+
*
|
|
48
|
+
* @author tony001
|
|
49
|
+
* @date 2024-05-14 16:05:20
|
|
50
|
+
* @param {string} oldOrgId
|
|
51
|
+
* @param {string} newOrgId
|
|
52
|
+
* @param {(IData | undefined)} [opts]
|
|
53
|
+
* @return {*} {Promise<boolean>}
|
|
54
|
+
*/
|
|
55
|
+
switchOrg(oldOrgId: string, newOrgId: string, opts?: IData | undefined): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* 切换主题
|
|
58
|
+
*
|
|
59
|
+
* @author tony001
|
|
60
|
+
* @date 2024-05-14 16:05:30
|
|
61
|
+
* @param {string} oldTheme
|
|
62
|
+
* @param {string} newTheme
|
|
63
|
+
* @param {(IData | undefined)} [opts]
|
|
64
|
+
* @return {*} {Promise<boolean>}
|
|
65
|
+
*/
|
|
66
|
+
switchTheme(oldTheme: string, newTheme: string, opts?: IData | undefined): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* 切换语言
|
|
69
|
+
*
|
|
70
|
+
* @author tony001
|
|
71
|
+
* @date 2024-05-14 16:05:42
|
|
72
|
+
* @param {string} oldLanguage
|
|
73
|
+
* @param {string} newLanguage
|
|
74
|
+
* @param {(IData | undefined)} [opts]
|
|
75
|
+
* @return {*} {Promise<boolean>}
|
|
76
|
+
*/
|
|
77
|
+
switchLanguage(oldLanguage: string, newLanguage: string, opts?: IData | undefined): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* 校验密码
|
|
80
|
+
*
|
|
81
|
+
* @author tony001
|
|
82
|
+
* @date 2024-05-14 17:05:31
|
|
83
|
+
* @protected
|
|
84
|
+
* @param {string} oldPwd
|
|
85
|
+
* @param {string} newPwd
|
|
86
|
+
* @param {IData} [opts={}]
|
|
87
|
+
* @return {*} {boolean}
|
|
88
|
+
*/
|
|
89
|
+
protected validatePwd(oldPwd: string, newPwd: string, opts?: IData): boolean;
|
|
90
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
class AppUtil {
|
|
3
|
+
/**
|
|
4
|
+
* Creates an instance of AppUtil.
|
|
5
|
+
* @author tony001
|
|
6
|
+
* @date 2024-05-14 17:05:00
|
|
7
|
+
* @param {Router} router
|
|
8
|
+
*/
|
|
9
|
+
constructor(router) {
|
|
10
|
+
this.router = router;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 登录
|
|
14
|
+
*
|
|
15
|
+
* @author tony001
|
|
16
|
+
* @date 2024-05-14 16:05:41
|
|
17
|
+
* @param {string} loginName
|
|
18
|
+
* @param {string} password
|
|
19
|
+
* @param {(boolean | undefined)} [remember]
|
|
20
|
+
* @param {(IData | undefined)} [headers]
|
|
21
|
+
* @param {(IData | undefined)} [opts]
|
|
22
|
+
* @return {*} {Promise<boolean>}
|
|
23
|
+
*/
|
|
24
|
+
async login(loginName, password, remember, headers, opts) {
|
|
25
|
+
const bol = await ibiz.auth.login(loginName, password, remember, headers);
|
|
26
|
+
if (bol === true) {
|
|
27
|
+
window.location.hash = this.router.currentRoute.value.query.ru || "/";
|
|
28
|
+
window.history.pushState({}, "");
|
|
29
|
+
window.location.reload();
|
|
30
|
+
}
|
|
31
|
+
return bol;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 登出
|
|
35
|
+
*
|
|
36
|
+
* @author tony001
|
|
37
|
+
* @date 2024-05-14 16:05:02
|
|
38
|
+
* @param {(IData | undefined)} [opts]
|
|
39
|
+
* @return {*} {Promise<boolean>}
|
|
40
|
+
*/
|
|
41
|
+
async logout(opts) {
|
|
42
|
+
const bol = await ibiz.auth.logout();
|
|
43
|
+
if (bol) {
|
|
44
|
+
const path = window.location;
|
|
45
|
+
if (path.search.indexOf("isAnonymous=true") !== -1) {
|
|
46
|
+
const href = "".concat(path.origin).concat(path.pathname).concat(path.hash);
|
|
47
|
+
window.history.replaceState({}, "", href);
|
|
48
|
+
}
|
|
49
|
+
await this.router.push(
|
|
50
|
+
"/login?ru=".concat(encodeURIComponent(
|
|
51
|
+
window.location.hash.replace("#/", "/")
|
|
52
|
+
))
|
|
53
|
+
);
|
|
54
|
+
ibiz.util.showAppLoading();
|
|
55
|
+
window.location.reload();
|
|
56
|
+
}
|
|
57
|
+
return bol;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 变更密码
|
|
61
|
+
*
|
|
62
|
+
* @author tony001
|
|
63
|
+
* @date 2024-05-14 16:05:11
|
|
64
|
+
* @param {string} oldPwd
|
|
65
|
+
* @param {string} newPwd
|
|
66
|
+
* @param {(IData | undefined)} [opts]
|
|
67
|
+
* @return {*} {Promise<boolean>}
|
|
68
|
+
*/
|
|
69
|
+
async changePwd(oldPwd, newPwd, opts) {
|
|
70
|
+
let bol = this.validatePwd(oldPwd, newPwd, opts);
|
|
71
|
+
if (bol) {
|
|
72
|
+
bol = await ibiz.auth.changePwd(oldPwd, newPwd);
|
|
73
|
+
}
|
|
74
|
+
return bol;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 切换组织
|
|
78
|
+
*
|
|
79
|
+
* @author tony001
|
|
80
|
+
* @date 2024-05-14 16:05:20
|
|
81
|
+
* @param {string} oldOrgId
|
|
82
|
+
* @param {string} newOrgId
|
|
83
|
+
* @param {(IData | undefined)} [opts]
|
|
84
|
+
* @return {*} {Promise<boolean>}
|
|
85
|
+
*/
|
|
86
|
+
switchOrg(oldOrgId, newOrgId, opts) {
|
|
87
|
+
throw new Error("Method not implemented.");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 切换主题
|
|
91
|
+
*
|
|
92
|
+
* @author tony001
|
|
93
|
+
* @date 2024-05-14 16:05:30
|
|
94
|
+
* @param {string} oldTheme
|
|
95
|
+
* @param {string} newTheme
|
|
96
|
+
* @param {(IData | undefined)} [opts]
|
|
97
|
+
* @return {*} {Promise<boolean>}
|
|
98
|
+
*/
|
|
99
|
+
switchTheme(oldTheme, newTheme, opts) {
|
|
100
|
+
throw new Error("Method not implemented.");
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 切换语言
|
|
104
|
+
*
|
|
105
|
+
* @author tony001
|
|
106
|
+
* @date 2024-05-14 16:05:42
|
|
107
|
+
* @param {string} oldLanguage
|
|
108
|
+
* @param {string} newLanguage
|
|
109
|
+
* @param {(IData | undefined)} [opts]
|
|
110
|
+
* @return {*} {Promise<boolean>}
|
|
111
|
+
*/
|
|
112
|
+
switchLanguage(oldLanguage, newLanguage, opts) {
|
|
113
|
+
throw new Error("Method not implemented.");
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 校验密码
|
|
117
|
+
*
|
|
118
|
+
* @author tony001
|
|
119
|
+
* @date 2024-05-14 17:05:31
|
|
120
|
+
* @protected
|
|
121
|
+
* @param {string} oldPwd
|
|
122
|
+
* @param {string} newPwd
|
|
123
|
+
* @param {IData} [opts={}]
|
|
124
|
+
* @return {*} {boolean}
|
|
125
|
+
*/
|
|
126
|
+
validatePwd(oldPwd, newPwd, opts = {}) {
|
|
127
|
+
const { surePwd } = opts;
|
|
128
|
+
if (!oldPwd) {
|
|
129
|
+
ibiz.message.error("\u539F\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (!newPwd) {
|
|
133
|
+
ibiz.message.error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
if (!surePwd) {
|
|
137
|
+
ibiz.message.error("\u786E\u8BA4\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A");
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (oldPwd === newPwd) {
|
|
141
|
+
ibiz.message.error("\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E0E\u65E7\u5BC6\u7801\u4E00\u81F4");
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
if (newPwd !== surePwd) {
|
|
145
|
+
ibiz.message.error("\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4");
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export { AppUtil };
|
package/es/util/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export { OverlayController } from './overlay-controller/overlay-controller';
|
|
|
8
8
|
export { usePagination } from './pagination/use-pagination';
|
|
9
9
|
export { NoticeUtil } from './notice-util/notice-util';
|
|
10
10
|
export { RenderUtil } from './render-util/render-util';
|
|
11
|
+
export { AppUtil } from './app-util/app-util';
|
package/es/util/index.mjs
CHANGED
|
@@ -8,5 +8,6 @@ export { OverlayController } from './overlay-controller/overlay-controller.mjs';
|
|
|
8
8
|
export { usePagination } from './pagination/use-pagination.mjs';
|
|
9
9
|
export { NoticeUtil } from './notice-util/notice-util.mjs';
|
|
10
10
|
export { RenderUtil } from './render-util/render-util.mjs';
|
|
11
|
+
export { AppUtil } from './app-util/app-util.mjs';
|
|
11
12
|
|
|
12
13
|
"use strict";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ViewController, ViewEngineBase } from '@ibiz-template/runtime';
|
|
1
|
+
import { ViewController, ViewEngineBase, AppLoginViewController, IViewState, IViewEvent } from '@ibiz-template/runtime';
|
|
2
2
|
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
3
|
+
import { IAppView } from '@ibiz/model-core';
|
|
3
4
|
export declare class LoginViewEngine extends ViewEngineBase {
|
|
4
5
|
route: RouteLocationNormalizedLoaded;
|
|
6
|
+
protected view: AppLoginViewController<IAppView, IViewState, IViewEvent>;
|
|
5
7
|
get AppLoginView(): ViewController;
|
|
6
8
|
onMounted(): Promise<void>;
|
|
7
9
|
onDestroyed(): Promise<void>;
|