@ibiz-template/vue3-util 0.7.38-alpha.45 → 0.7.38-alpha.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/badge/badge.d.ts +9 -0
- package/es/common/badge/badge.d.ts.map +1 -1
- package/es/common/badge/badge.mjs +5 -1
- package/es/common/code-list/code-list.d.ts +1 -1
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +1 -1
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +1 -3
- package/es/common/custom-render/custom-render.css +1 -0
- package/es/common/custom-render/custom-render.d.ts +18 -0
- package/es/common/custom-render/custom-render.d.ts.map +1 -0
- package/es/common/custom-render/custom-render.mjs +85 -0
- package/es/common/index.d.ts +1 -0
- package/es/common/index.d.ts.map +1 -1
- package/es/common/index.mjs +1 -0
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +1 -0
- package/es/index.mjs +3 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts +15 -0
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.mjs +37 -20
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.mjs +23 -9
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.mjs +4 -2
- package/es/props/editor/common.d.ts +2 -2
- package/es/props/editor/common.d.ts.map +1 -1
- package/es/props/editor/common.mjs +2 -2
- package/es/use/index.mjs +1 -0
- package/es/use/view/index.d.ts +1 -0
- package/es/use/view/index.d.ts.map +1 -1
- package/es/use/view/index.mjs +1 -0
- package/es/use/view/use-view-operation/use-view-operation.d.ts +11 -0
- package/es/use/view/use-view-operation/use-view-operation.d.ts.map +1 -0
- package/es/use/view/use-view-operation/use-view-operation.mjs +27 -0
- package/es/util/index.mjs +1 -1
- package/es/util/render/render.d.ts +10 -0
- package/es/util/render/render.d.ts.map +1 -1
- package/es/util/render/render.mjs +8 -1
- package/es/util/route/route.d.ts.map +1 -1
- package/es/util/route/route.mjs +10 -4
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +2 -0
- package/lib/common/badge/badge.cjs +5 -1
- package/lib/common/code-list/code-list.cjs +1 -1
- package/lib/common/control-base/control-base.cjs +1 -3
- package/lib/common/custom-render/custom-render.cjs +87 -0
- package/lib/common/custom-render/custom-render.css +1 -0
- package/lib/common/index.cjs +2 -0
- package/lib/common/view-shell/view-shell.cjs +1 -0
- package/lib/index.cjs +5 -0
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.cjs +22 -8
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.cjs +35 -18
- package/lib/panel-component/nav-pos/nav-pos.controller.cjs +4 -2
- package/lib/props/editor/common.cjs +2 -2
- package/lib/use/index.cjs +2 -0
- package/lib/use/view/index.cjs +2 -0
- package/lib/use/view/use-view-operation/use-view-operation.cjs +29 -0
- package/lib/util/index.cjs +1 -0
- package/lib/util/render/render.cjs +8 -0
- package/lib/util/route/route.cjs +10 -4
- package/lib/view/common/view.cjs +2 -0
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ControlController } from '@ibiz-template/runtime';
|
|
1
2
|
/**
|
|
2
3
|
* 把未知格式的值绘制成字符串
|
|
3
4
|
* - 空值输出空字符串
|
|
@@ -10,4 +11,13 @@
|
|
|
10
11
|
* @return {*} {string}
|
|
11
12
|
*/
|
|
12
13
|
export declare function renderString(value: unknown): string;
|
|
14
|
+
/**
|
|
15
|
+
* 检查部件绘制器集合是否具有无数据绘制器
|
|
16
|
+
* @author ljx
|
|
17
|
+
* @date 2024-01-17 18:51:23
|
|
18
|
+
* @export
|
|
19
|
+
* @param {ControlController} c 部件控制器
|
|
20
|
+
* @return {*} 返回一个布尔值,表示是否具有无数据绘制器
|
|
21
|
+
*/
|
|
22
|
+
export declare const hasEmptyPanelRenderer: (c: ControlController) => boolean;
|
|
13
23
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/util/render/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/util/render/render.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAiBnD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,MAAO,iBAAiB,KAAG,OAO5D,CAAC"}
|
|
@@ -19,5 +19,12 @@ function renderString(value) {
|
|
|
19
19
|
}
|
|
20
20
|
return "";
|
|
21
21
|
}
|
|
22
|
+
const hasEmptyPanelRenderer = (c) => {
|
|
23
|
+
const controlRenders = c == null ? void 0 : c.model.controlRenders;
|
|
24
|
+
if (!controlRenders || controlRenders.length === 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return !!controlRenders.find((item) => item.id === "emptypanel");
|
|
28
|
+
};
|
|
22
29
|
|
|
23
|
-
export { renderString };
|
|
30
|
+
export { hasEmptyPanelRenderer, renderString };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/util/route/route.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,IAAI,KAAK,EAAY,MAAM,YAAY,CAAC;AAE9E,OAAO,EAGL,WAAW,EAGZ,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/util/route/route.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,IAAI,KAAK,EAAY,MAAM,YAAY,CAAC;AAE9E,OAAO,EAGL,WAAW,EAGZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAkB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE7E;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,YAAY,GAAE,OAAe,GAC5B,UAAU,CAsEZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAuD9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAc7D;AA+BD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAYpC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,QAAQ,EACjB,eAAe,CAAC,EAAE,MAAM,EACxB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAkE3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAkC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,YAAY,GAAE,OAAe,GAC5B,OAAO,CAAC,cAAc,CAAC,CAoEzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,OAAc,GACvB,MAAM,CA4BR;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,EAClE,KAAK,EAAE,MAAM,GACZ,IAAI,CAaN"}
|
package/es/util/route/route.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import qs from 'qs';
|
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import { watch } from 'vue';
|
|
6
6
|
import { RouteConst, ViewType, getMatchResPath, calcDeCodeNameById } from '@ibiz-template/runtime';
|
|
7
|
+
import { isNil } from 'ramda';
|
|
7
8
|
|
|
8
9
|
"use strict";
|
|
9
10
|
function route2routePath(route, isRouteModal = false) {
|
|
@@ -106,7 +107,7 @@ function getOwnRouteContext(context) {
|
|
|
106
107
|
"toRouteDepth"
|
|
107
108
|
];
|
|
108
109
|
Object.keys(ownContext).forEach((key) => {
|
|
109
|
-
if (excludeKeys.includes(key)) {
|
|
110
|
+
if (excludeKeys.includes(key) || isNil(ownContext[key])) {
|
|
110
111
|
delete ownContext[key];
|
|
111
112
|
}
|
|
112
113
|
});
|
|
@@ -168,9 +169,11 @@ async function generateRoutePath(appView, route, context, params) {
|
|
|
168
169
|
depth = context.toRouteDepth;
|
|
169
170
|
context.toRouteDepth = void 0;
|
|
170
171
|
} else if (ibiz.env.isMob) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
if (ibiz.env.mobMenuShowMode === "DEFAULT") {
|
|
173
|
+
routePath.pathNodes[0] = {
|
|
174
|
+
viewName: "home"
|
|
175
|
+
};
|
|
176
|
+
}
|
|
174
177
|
}
|
|
175
178
|
routePath.pathNodes.splice(depth - 1, routePath.pathNodes.length - depth + 1);
|
|
176
179
|
if (context.currentSrfNav) {
|
|
@@ -263,6 +266,9 @@ async function parseRouteViewData(route, depth, isRouteModal = false) {
|
|
|
263
266
|
if (notNilEmpty(pathNode.context)) {
|
|
264
267
|
Object.assign(context, pathNode.context);
|
|
265
268
|
}
|
|
269
|
+
if (index === depth - 1 && (!pathNode.context || isNil(pathNode.context.srfnavctrlid))) {
|
|
270
|
+
delete context.srfnavctrlid;
|
|
271
|
+
}
|
|
266
272
|
}
|
|
267
273
|
}
|
|
268
274
|
const { params, srfnav } = routePath.pathNodes[depth - 1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EACN,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAGL,QAAQ,EAER,KAAK,EAIN,MAAM,KAAK,CAAC;AACb,OAAO,aAAa,CAAC;AAGrB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EACN,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAGL,QAAQ,EAER,KAAK,EAIN,MAAM,KAAK,CAAC;AACb,OAAO,aAAa,CAAC;AAGrB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;uCAyDC,0BAA0B,KACrC,IAAI;yBAmBqB,QAAQ,cAAa,KAAK,KAAQ,OAAO;0BAkBxC,QAAQ,cAAa,KAAK,KAAQ,KAAK;+BA/DlC,QAAQ,KAAG,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;MAuLjE,CAAC"}
|
package/es/view/common/view.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import './view.css';
|
|
|
4
4
|
import '../../use/index.mjs';
|
|
5
5
|
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
6
6
|
import { useViewController } from '../../use/view/use-view-controller/use-view-controller.mjs';
|
|
7
|
+
import { useViewOperation } from '../../use/view/use-view-operation/use-view-operation.mjs';
|
|
7
8
|
|
|
8
9
|
"use strict";
|
|
9
10
|
function _isSlot(s) {
|
|
@@ -36,6 +37,7 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
36
37
|
}) {
|
|
37
38
|
const ns = useNamespace("view");
|
|
38
39
|
const c = useViewController((...args) => new ViewController(...args));
|
|
40
|
+
useViewOperation(c);
|
|
39
41
|
const allControls = getControlsByView(c.model);
|
|
40
42
|
const teleportControls = [];
|
|
41
43
|
const teleportTags = /* @__PURE__ */ new Map();
|
|
@@ -17,6 +17,10 @@ const IBizBadge = /* @__PURE__ */ vue.defineComponent({
|
|
|
17
17
|
type: String,
|
|
18
18
|
default: "danger"
|
|
19
19
|
},
|
|
20
|
+
max: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 99
|
|
23
|
+
},
|
|
20
24
|
counterMode: {
|
|
21
25
|
type: Number
|
|
22
26
|
}
|
|
@@ -36,7 +40,7 @@ const IBizBadge = /* @__PURE__ */ vue.defineComponent({
|
|
|
36
40
|
}
|
|
37
41
|
return vue.createVNode("div", {
|
|
38
42
|
"class": [this.ns.b(), this.ns.m(this.type)]
|
|
39
|
-
}, [this.value]);
|
|
43
|
+
}, [this.value > this.max ? "".concat(this.max, "+") : this.value]);
|
|
40
44
|
}
|
|
41
45
|
});
|
|
42
46
|
|
|
@@ -125,7 +125,7 @@ const IBizCodeList = /* @__PURE__ */ vue.defineComponent({
|
|
|
125
125
|
}, {
|
|
126
126
|
immediate: true
|
|
127
127
|
});
|
|
128
|
-
const emptyText = props.codeList.emptyText === ibiz.i18n.t("vue3Util.common.undefined") ?
|
|
128
|
+
const emptyText = props.codeList.emptyText === ibiz.i18n.t("vue3Util.common.undefined") || !props.codeList.emptyText ? ibiz.config.common.emptyText : props.codeList.emptyText;
|
|
129
129
|
return {
|
|
130
130
|
items,
|
|
131
131
|
ns,
|
|
@@ -74,9 +74,7 @@ const IBizControlBase = /* @__PURE__ */ vue.defineComponent({
|
|
|
74
74
|
};
|
|
75
75
|
const getControlRender = (data) => {
|
|
76
76
|
var _a, _b;
|
|
77
|
-
const
|
|
78
|
-
controlRenders
|
|
79
|
-
} = model;
|
|
77
|
+
const controlRenders = model.controlRenders ? model.controlRenders.filter((item) => item.id !== "emptypanel") : void 0;
|
|
80
78
|
if (!controlRenders || controlRenders.length === 0) {
|
|
81
79
|
return void 0;
|
|
82
80
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
|
+
var core = require('@ibiz-template/core');
|
|
6
|
+
require('../../use/index.cjs');
|
|
7
|
+
require('./custom-render.css');
|
|
8
|
+
var namespace = require('../../use/namespace/namespace.cjs');
|
|
9
|
+
|
|
10
|
+
"use strict";
|
|
11
|
+
const IBizCustomRender = /* @__PURE__ */ vue.defineComponent({
|
|
12
|
+
name: "IBizCustomRender",
|
|
13
|
+
props: {
|
|
14
|
+
controller: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
const ns = namespace.useNamespace("custom-render");
|
|
21
|
+
const handleHtmlEvent = async (e, eventName) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
const scriptCode = e.target.getAttribute(eventName);
|
|
24
|
+
const data = e.target.getAttribute("data");
|
|
25
|
+
const context = props.controller.context.clone();
|
|
26
|
+
const _context = e.target.getAttribute("context");
|
|
27
|
+
if (_context) {
|
|
28
|
+
Object.assign(context, core.fixJsonString(_context));
|
|
29
|
+
}
|
|
30
|
+
const params = {
|
|
31
|
+
...props.controller.params
|
|
32
|
+
};
|
|
33
|
+
const _params = e.target.getAttribute("params");
|
|
34
|
+
if (_params) {
|
|
35
|
+
Object.assign(params, core.fixJsonString(_params));
|
|
36
|
+
}
|
|
37
|
+
if (scriptCode) {
|
|
38
|
+
await runtime.ScriptFactory.asyncExecScriptFn({
|
|
39
|
+
...props.controller.getEventArgs(),
|
|
40
|
+
context,
|
|
41
|
+
params,
|
|
42
|
+
data: data ? core.fixJsonString(data) : null
|
|
43
|
+
}, scriptCode);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getControlRender = () => {
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
const controlRenders = (_a = props.controller) == null ? void 0 : _a.model.controlRenders;
|
|
49
|
+
if (!controlRenders || controlRenders.length === 0) {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
const noDataRender = controlRenders.find((item) => item.id === "emptypanel");
|
|
53
|
+
if (!noDataRender)
|
|
54
|
+
return void 0;
|
|
55
|
+
if (noDataRender.renderType === "LAYOUTPANEL_MODEL" && noDataRender.layoutPanelModel) {
|
|
56
|
+
const htmlCode = runtime.ScriptFactory.execScriptFn({
|
|
57
|
+
...props.controller.getEventArgs()
|
|
58
|
+
}, noDataRender.layoutPanelModel, {
|
|
59
|
+
isAsync: false
|
|
60
|
+
});
|
|
61
|
+
return vue.createVNode("div", {
|
|
62
|
+
"innerHTML": htmlCode,
|
|
63
|
+
"onClick": (e) => handleHtmlEvent(e, "click"),
|
|
64
|
+
"onDblclick": (e) => handleHtmlEvent(e, "dbclick"),
|
|
65
|
+
"class": [ns.b(), ns.e((_b = noDataRender.renderName) == null ? void 0 : _b.toLowerCase())]
|
|
66
|
+
}, null);
|
|
67
|
+
}
|
|
68
|
+
if (noDataRender.renderType === "LAYOUTPANEL" && noDataRender.layoutPanel) {
|
|
69
|
+
return vue.createVNode(vue.resolveComponent("iBizControlShell"), {
|
|
70
|
+
"class": [ns.b(), ns.e((_c = noDataRender.renderName) == null ? void 0 : _c.toLowerCase())],
|
|
71
|
+
"params": props.controller.params,
|
|
72
|
+
"context": props.controller.context,
|
|
73
|
+
"modelData": noDataRender.layoutPanel
|
|
74
|
+
}, null);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
ns,
|
|
79
|
+
getControlRender
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
render() {
|
|
83
|
+
return this.getControlRender();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
exports.IBizCustomRender = IBizCustomRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-custom-render{width:100%;height:100%}
|
package/lib/common/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var viewShell = require('./view-shell/view-shell.cjs');
|
|
|
8
8
|
var codeList = require('./code-list/code-list.cjs');
|
|
9
9
|
var controlLoadingPlaceholder = require('./control-loading-placeholder/control-loading-placeholder.cjs');
|
|
10
10
|
var badge = require('./badge/badge.cjs');
|
|
11
|
+
var customRender = require('./custom-render/custom-render.cjs');
|
|
11
12
|
|
|
12
13
|
"use strict";
|
|
13
14
|
|
|
@@ -19,3 +20,4 @@ exports.IBizViewShell = viewShell.IBizViewShell;
|
|
|
19
20
|
exports.IBizCodeList = codeList.IBizCodeList;
|
|
20
21
|
exports.ControlLoadingPlaceholder = controlLoadingPlaceholder.ControlLoadingPlaceholder;
|
|
21
22
|
exports.IBizBadge = badge.IBizBadge;
|
|
23
|
+
exports.IBizCustomRender = customRender.IBizCustomRender;
|
package/lib/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var viewShell = require('./common/view-shell/view-shell.cjs');
|
|
|
20
20
|
var codeList = require('./common/code-list/code-list.cjs');
|
|
21
21
|
var controlLoadingPlaceholder = require('./common/control-loading-placeholder/control-loading-placeholder.cjs');
|
|
22
22
|
var badge = require('./common/badge/badge.cjs');
|
|
23
|
+
var customRender = require('./common/custom-render/custom-render.cjs');
|
|
23
24
|
var panelContainer_state = require('./panel-component/panel-container/panel-container.state.cjs');
|
|
24
25
|
var panelContainer_controller = require('./panel-component/panel-container/panel-container.controller.cjs');
|
|
25
26
|
var index = require('./panel-component/panel-container/index.cjs');
|
|
@@ -79,6 +80,7 @@ var namespace = require('./use/namespace/namespace.cjs');
|
|
|
79
80
|
var route = require('./use/route/route.cjs');
|
|
80
81
|
var index$o = require('./use/util/index.cjs');
|
|
81
82
|
var useViewController = require('./use/view/use-view-controller/use-view-controller.cjs');
|
|
83
|
+
var useViewOperation = require('./use/view/use-view-operation/use-view-operation.cjs');
|
|
82
84
|
var vue = require('./use/vue/vue.cjs');
|
|
83
85
|
var codelistListen = require('./use/codeList-listen/codelist-listen.cjs');
|
|
84
86
|
var index$p = require('./use/storage/index.cjs');
|
|
@@ -135,6 +137,7 @@ exports.IBizViewShell = viewShell.IBizViewShell;
|
|
|
135
137
|
exports.IBizCodeList = codeList.IBizCodeList;
|
|
136
138
|
exports.ControlLoadingPlaceholder = controlLoadingPlaceholder.ControlLoadingPlaceholder;
|
|
137
139
|
exports.IBizBadge = badge.IBizBadge;
|
|
140
|
+
exports.IBizCustomRender = customRender.IBizCustomRender;
|
|
138
141
|
exports.PanelContainerState = panelContainer_state.PanelContainerState;
|
|
139
142
|
exports.PanelContainerController = panelContainer_controller.PanelContainerController;
|
|
140
143
|
exports.IBizPanelContainer = index.IBizPanelContainer;
|
|
@@ -196,6 +199,7 @@ exports.useRouterQuery = route.useRouterQuery;
|
|
|
196
199
|
exports.useCtx = index$o.useCtx;
|
|
197
200
|
exports.useMobCtx = index$o.useMobCtx;
|
|
198
201
|
exports.useViewController = useViewController.useViewController;
|
|
202
|
+
exports.useViewOperation = useViewOperation.useViewOperation;
|
|
199
203
|
exports.EmptyVNode = vue.EmptyVNode;
|
|
200
204
|
exports.getOrigin = vue.getOrigin;
|
|
201
205
|
exports.isEmptyVNode = vue.isEmptyVNode;
|
|
@@ -223,6 +227,7 @@ exports.routePath2string = route$1.routePath2string;
|
|
|
223
227
|
exports.RouteListener = routeListener.RouteListener;
|
|
224
228
|
exports.withInstall = install.withInstall;
|
|
225
229
|
exports.prepareControl = prepareControl.prepareControl;
|
|
230
|
+
exports.hasEmptyPanelRenderer = render.hasEmptyPanelRenderer;
|
|
226
231
|
exports.renderString = render.renderString;
|
|
227
232
|
exports.createOverlayView = overlayViewUtil.createOverlayView;
|
|
228
233
|
exports.getDrawerPlacement = overlayViewUtil.getDrawerPlacement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
+
var vueRouter = require('vue-router');
|
|
4
5
|
require('../../use/index.cjs');
|
|
5
6
|
require('./auth-wxmp-qrcode.css');
|
|
6
7
|
var namespace = require('../../use/namespace/namespace.cjs');
|
|
@@ -20,15 +21,28 @@ const AuthWxmpQrcode = /* @__PURE__ */ vue.defineComponent({
|
|
|
20
21
|
},
|
|
21
22
|
setup(props) {
|
|
22
23
|
const ns = namespace.useNamespace("auth-wxmp-qrcode");
|
|
24
|
+
const {
|
|
25
|
+
state
|
|
26
|
+
} = props.controller;
|
|
27
|
+
const route = vueRouter.useRoute();
|
|
28
|
+
props.controller.setRouter(route);
|
|
29
|
+
const loadQrcode = async () => {
|
|
30
|
+
await props.controller.loadQrcode();
|
|
31
|
+
};
|
|
32
|
+
vue.watch(() => state.visible, () => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (state.visible && (state.keepAlive && !((_a = state.qrcode) == null ? void 0 : _a.expirein) || !state.keepAlive)) {
|
|
35
|
+
loadQrcode();
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
immediate: true
|
|
39
|
+
});
|
|
23
40
|
vue.onUnmounted(() => {
|
|
24
41
|
props.controller.destroy();
|
|
25
42
|
});
|
|
26
|
-
const refreshQrcode = async () => {
|
|
27
|
-
await props.controller.loadQrcode();
|
|
28
|
-
};
|
|
29
43
|
return {
|
|
30
44
|
ns,
|
|
31
|
-
|
|
45
|
+
loadQrcode
|
|
32
46
|
};
|
|
33
47
|
},
|
|
34
48
|
render() {
|
|
@@ -37,17 +51,17 @@ const AuthWxmpQrcode = /* @__PURE__ */ vue.defineComponent({
|
|
|
37
51
|
"class": this.ns.b()
|
|
38
52
|
}, [vue.createVNode("div", {
|
|
39
53
|
"class": this.ns.e("content")
|
|
40
|
-
}, [vue.createVNode("img", {
|
|
54
|
+
}, [this.controller.state.qrcode && vue.createVNode("img", {
|
|
41
55
|
"class": this.ns.e("qrcode"),
|
|
42
56
|
"src": (_a = this.controller.state.qrcode) == null ? void 0 : _a.url
|
|
43
|
-
}, null), ((_b = this.controller.state.qrcode) == null ? void 0 : _b.expirein)
|
|
57
|
+
}, null), !((_b = this.controller.state.qrcode) == null ? void 0 : _b.expirein) && vue.createVNode("div", {
|
|
44
58
|
"class": this.ns.e("mask")
|
|
45
59
|
}, [vue.createVNode("ion-icon", {
|
|
46
60
|
"title": ibiz.i18n.t("vue3Util.panelComponent.refresh"),
|
|
47
61
|
"name": "reload-outline",
|
|
48
|
-
"onClick": this.
|
|
62
|
+
"onClick": this.loadQrcode,
|
|
49
63
|
"class": this.ns.em("mask", "icon")
|
|
50
|
-
}, null)])
|
|
64
|
+
}, null)])]), vue.createVNode("div", {
|
|
51
65
|
"class": this.ns.e("caption")
|
|
52
66
|
}, [this.controller.state.tips])]);
|
|
53
67
|
}
|
|
@@ -47,7 +47,15 @@ class AuthWxmpQrcodeController extends runtime.PanelItemController {
|
|
|
47
47
|
await super.onInit();
|
|
48
48
|
this.handleRawItemParams();
|
|
49
49
|
this.initParams();
|
|
50
|
-
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 设置 Route 对象
|
|
53
|
+
*
|
|
54
|
+
* @param {RouteLocationNormalizedLoaded} route
|
|
55
|
+
* @memberof AuthWxmpQrcodeController
|
|
56
|
+
*/
|
|
57
|
+
setRouter(route) {
|
|
58
|
+
this.route = route;
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
53
61
|
* 处理自定义补充参数
|
|
@@ -130,24 +138,33 @@ class AuthWxmpQrcodeController extends runtime.PanelItemController {
|
|
|
130
138
|
async pollingLogin() {
|
|
131
139
|
try {
|
|
132
140
|
if (this.state.qrcode && this.state.qrcode.expirein > 0) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
if (this.state.visible) {
|
|
142
|
+
const res = await ibiz.net.get(
|
|
143
|
+
"/uaa/open/wxmp/qrcode/".concat(this.state.qrcode.ticket),
|
|
144
|
+
{},
|
|
145
|
+
{ srfdcsystem: ibiz.env.dcSystem }
|
|
146
|
+
);
|
|
147
|
+
const { data, ok } = res;
|
|
148
|
+
if (ok && (data == null ? void 0 : data.token)) {
|
|
149
|
+
clearInterval(this.pollingTimer);
|
|
150
|
+
const cacheDay = 30;
|
|
151
|
+
core.setAppCookie(core.CoreConst.TOKEN_REMEMBER, "1", cacheDay);
|
|
152
|
+
core.setAppCookie(core.CoreConst.TOKEN, data.token, cacheDay);
|
|
153
|
+
const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (data.expirein || 7199) * 1e3;
|
|
154
|
+
core.setAppCookie(core.CoreConst.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay);
|
|
155
|
+
if (data.refresh_token) {
|
|
156
|
+
core.setAppCookie(
|
|
157
|
+
core.CoreConst.REFRESH_TOKEN,
|
|
158
|
+
data.refresh_token,
|
|
159
|
+
cacheDay
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
core.clearAppCookie(core.CoreConst.IS_ANONYMOUS);
|
|
163
|
+
const ru = this.route.query.ru || "/";
|
|
164
|
+
window.location.hash = ru || "/";
|
|
165
|
+
window.history.pushState({}, "");
|
|
166
|
+
window.location.reload();
|
|
146
167
|
}
|
|
147
|
-
qxUtil.clearCookie(core.CoreConst.IS_ANONYMOUS, true);
|
|
148
|
-
window.location.hash = "/";
|
|
149
|
-
window.history.pushState({}, "");
|
|
150
|
-
window.location.reload();
|
|
151
168
|
}
|
|
152
169
|
} else {
|
|
153
170
|
clearInterval(this.pollingTimer);
|
|
@@ -301,8 +301,10 @@ class NavPosController extends runtime.PanelItemController {
|
|
|
301
301
|
openViewMsg.params,
|
|
302
302
|
{
|
|
303
303
|
openMode: "INDEXVIEWTAB",
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
modalOption: {
|
|
305
|
+
replace: !this.state.currentKey,
|
|
306
|
+
...openViewMsg.modalOptions
|
|
307
|
+
}
|
|
306
308
|
}
|
|
307
309
|
);
|
|
308
310
|
this.state.isLoading = false;
|
|
@@ -29,7 +29,7 @@ function getEditorProps() {
|
|
|
29
29
|
function getEditorEmits() {
|
|
30
30
|
return {
|
|
31
31
|
/** 值变更事件 */
|
|
32
|
-
change: (_value, _name) => true,
|
|
32
|
+
change: (_value, _name, _ignore) => true,
|
|
33
33
|
/** 失焦事件 */
|
|
34
34
|
blur: (_event) => true,
|
|
35
35
|
/** 聚焦事件 */
|
|
@@ -43,7 +43,7 @@ function getEditorEmits() {
|
|
|
43
43
|
function getGridEditorEmits() {
|
|
44
44
|
return {
|
|
45
45
|
/** 值变更事件 */
|
|
46
|
-
change: (_value, _name) => true,
|
|
46
|
+
change: (_value, _name, _ignore) => true,
|
|
47
47
|
/** 是否正在操作事件 */
|
|
48
48
|
rowSave: () => true
|
|
49
49
|
};
|
package/lib/use/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ var index$1 = require('./storage/index.cjs');
|
|
|
14
14
|
var autofocusBlur = require('./autofocus-blur/autofocus-blur.cjs');
|
|
15
15
|
var useControlController = require('./control/use-control-controller/use-control-controller.cjs');
|
|
16
16
|
var useViewController = require('./view/use-view-controller/use-view-controller.cjs');
|
|
17
|
+
var useViewOperation = require('./view/use-view-operation/use-view-operation.cjs');
|
|
17
18
|
|
|
18
19
|
"use strict";
|
|
19
20
|
|
|
@@ -38,3 +39,4 @@ exports.useLocalCacheKey = index$1.useLocalCacheKey;
|
|
|
38
39
|
exports.useAutoFocusBlur = autofocusBlur.useAutoFocusBlur;
|
|
39
40
|
exports.useControlController = useControlController.useControlController;
|
|
40
41
|
exports.useViewController = useViewController.useViewController;
|
|
42
|
+
exports.useViewOperation = useViewOperation.useViewOperation;
|
package/lib/use/view/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var useViewController = require('./use-view-controller/use-view-controller.cjs');
|
|
4
|
+
var useViewOperation = require('./use-view-operation/use-view-operation.cjs');
|
|
4
5
|
|
|
5
6
|
"use strict";
|
|
6
7
|
|
|
7
8
|
exports.useViewController = useViewController.useViewController;
|
|
9
|
+
exports.useViewOperation = useViewOperation.useViewOperation;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function useViewOperation(view) {
|
|
8
|
+
let listenJSEventFuncs = [];
|
|
9
|
+
vue.onMounted(() => {
|
|
10
|
+
const viewElement = document.getElementById(view.id);
|
|
11
|
+
const listenJSEventNames = ["keydown", "click"];
|
|
12
|
+
if (!viewElement)
|
|
13
|
+
return;
|
|
14
|
+
listenJSEventFuncs = listenJSEventNames.map((eventName) => {
|
|
15
|
+
return core.listenJSEvent(viewElement, eventName, (event) => {
|
|
16
|
+
view.setOperateState("MANUAL");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
vue.onUnmounted(() => {
|
|
21
|
+
if (listenJSEventFuncs && listenJSEventFuncs.length > 0) {
|
|
22
|
+
listenJSEventFuncs.forEach((listenJSEventFunc) => {
|
|
23
|
+
listenJSEventFunc();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.useViewOperation = useViewOperation;
|
package/lib/util/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ exports.routePath2string = route.routePath2string;
|
|
|
28
28
|
exports.RouteListener = routeListener.RouteListener;
|
|
29
29
|
exports.withInstall = install.withInstall;
|
|
30
30
|
exports.prepareControl = prepareControl.prepareControl;
|
|
31
|
+
exports.hasEmptyPanelRenderer = render.hasEmptyPanelRenderer;
|
|
31
32
|
exports.renderString = render.renderString;
|
|
32
33
|
exports.OverlayContainer = overlayContainer.OverlayContainer;
|
|
33
34
|
exports.OverlayPopoverContainer = overlayPopoverContainer.OverlayPopoverContainer;
|
|
@@ -21,5 +21,13 @@ function renderString(value) {
|
|
|
21
21
|
}
|
|
22
22
|
return "";
|
|
23
23
|
}
|
|
24
|
+
const hasEmptyPanelRenderer = (c) => {
|
|
25
|
+
const controlRenders = c == null ? void 0 : c.model.controlRenders;
|
|
26
|
+
if (!controlRenders || controlRenders.length === 0) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return !!controlRenders.find((item) => item.id === "emptypanel");
|
|
30
|
+
};
|
|
24
31
|
|
|
32
|
+
exports.hasEmptyPanelRenderer = hasEmptyPanelRenderer;
|
|
25
33
|
exports.renderString = renderString;
|
package/lib/util/route/route.cjs
CHANGED
|
@@ -6,6 +6,7 @@ var qs = require('qs');
|
|
|
6
6
|
var vueRouter = require('vue-router');
|
|
7
7
|
var vue = require('vue');
|
|
8
8
|
var runtime = require('@ibiz-template/runtime');
|
|
9
|
+
var ramda = require('ramda');
|
|
9
10
|
|
|
10
11
|
"use strict";
|
|
11
12
|
function route2routePath(route, isRouteModal = false) {
|
|
@@ -108,7 +109,7 @@ function getOwnRouteContext(context) {
|
|
|
108
109
|
"toRouteDepth"
|
|
109
110
|
];
|
|
110
111
|
Object.keys(ownContext).forEach((key) => {
|
|
111
|
-
if (excludeKeys.includes(key)) {
|
|
112
|
+
if (excludeKeys.includes(key) || ramda.isNil(ownContext[key])) {
|
|
112
113
|
delete ownContext[key];
|
|
113
114
|
}
|
|
114
115
|
});
|
|
@@ -170,9 +171,11 @@ async function generateRoutePath(appView, route, context, params) {
|
|
|
170
171
|
depth = context.toRouteDepth;
|
|
171
172
|
context.toRouteDepth = void 0;
|
|
172
173
|
} else if (ibiz.env.isMob) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
if (ibiz.env.mobMenuShowMode === "DEFAULT") {
|
|
175
|
+
routePath.pathNodes[0] = {
|
|
176
|
+
viewName: "home"
|
|
177
|
+
};
|
|
178
|
+
}
|
|
176
179
|
}
|
|
177
180
|
routePath.pathNodes.splice(depth - 1, routePath.pathNodes.length - depth + 1);
|
|
178
181
|
if (context.currentSrfNav) {
|
|
@@ -265,6 +268,9 @@ async function parseRouteViewData(route, depth, isRouteModal = false) {
|
|
|
265
268
|
if (qxUtil.notNilEmpty(pathNode.context)) {
|
|
266
269
|
Object.assign(context, pathNode.context);
|
|
267
270
|
}
|
|
271
|
+
if (index === depth - 1 && (!pathNode.context || ramda.isNil(pathNode.context.srfnavctrlid))) {
|
|
272
|
+
delete context.srfnavctrlid;
|
|
273
|
+
}
|
|
268
274
|
}
|
|
269
275
|
}
|
|
270
276
|
const { params, srfnav } = routePath.pathNodes[depth - 1];
|
package/lib/view/common/view.cjs
CHANGED
|
@@ -6,6 +6,7 @@ require('./view.css');
|
|
|
6
6
|
require('../../use/index.cjs');
|
|
7
7
|
var namespace = require('../../use/namespace/namespace.cjs');
|
|
8
8
|
var useViewController = require('../../use/view/use-view-controller/use-view-controller.cjs');
|
|
9
|
+
var useViewOperation = require('../../use/view/use-view-operation/use-view-operation.cjs');
|
|
9
10
|
|
|
10
11
|
"use strict";
|
|
11
12
|
function _isSlot(s) {
|
|
@@ -38,6 +39,7 @@ const View = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
39
|
}) {
|
|
39
40
|
const ns = namespace.useNamespace("view");
|
|
40
41
|
const c = useViewController.useViewController((...args) => new runtime.ViewController(...args));
|
|
42
|
+
useViewOperation.useViewOperation(c);
|
|
41
43
|
const allControls = runtime.getControlsByView(c.model);
|
|
42
44
|
const teleportControls = [];
|
|
43
45
|
const teleportTags = /* @__PURE__ */ new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.7.38-alpha.
|
|
3
|
+
"version": "0.7.38-alpha.57",
|
|
4
4
|
"description": "vue3 工具包",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ibiz-template/cli": "^0.3.10",
|
|
43
|
-
"@ibiz-template/core": "^0.7.38-alpha.
|
|
44
|
-
"@ibiz-template/runtime": "^0.7.38-alpha.
|
|
43
|
+
"@ibiz-template/core": "^0.7.38-alpha.57",
|
|
44
|
+
"@ibiz-template/runtime": "^0.7.38-alpha.57",
|
|
45
45
|
"@ibiz-template/theme": "^0.7.32",
|
|
46
46
|
"@ibiz/model-core": "^0.1.64",
|
|
47
47
|
"@types/path-browserify": "^1.0.2",
|