@ibiz-template/runtime 0.4.3-dev.1 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +224 -29
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +5 -1
- package/out/controller/control/chart/generator/chart-options-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/chart-options-generator.js +3 -0
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +8 -0
- package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/tree-exp-bar.controller.js +17 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.js +9 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js +7 -2
- package/out/controller/control/grid/grid/grid.controller.d.ts +8 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +15 -0
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.js +5 -0
- package/out/controller/control/tree/tree.controller.d.ts +8 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +38 -0
- package/out/controller/control/tree/tree.service.js +1 -1
- package/out/global/global-util/global-util.d.ts +8 -1
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +8 -1
- package/out/interface/common/i-plugin-factory/i-plugin-factory.d.ts +4 -5
- package/out/interface/common/i-plugin-factory/i-plugin-factory.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/platform/provider/platform-provider-base.d.ts.map +1 -1
- package/out/platform/provider/platform-provider-base.js +1 -0
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +7 -3
- package/out/ui-logic/ui-logic-context.d.ts +10 -1
- package/out/ui-logic/ui-logic-context.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-context.js +11 -0
- package/out/ui-logic/ui-logic-node/index.d.ts +1 -0
- package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/index.js +1 -0
- package/out/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.d.ts +8 -0
- package/out/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.js +13 -0
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +4 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +22 -16
- package/out/utils/theme-util/theme-util.d.ts +46 -0
- package/out/utils/theme-util/theme-util.d.ts.map +1 -0
- package/out/utils/theme-util/theme-util.js +61 -0
- package/package.json +4 -4
- package/src/controller/common/control/md-control.controller.ts +5 -1
- package/src/controller/control/chart/generator/chart-options-generator.ts +4 -1
- package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +18 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.ts +8 -3
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts +6 -2
- package/src/controller/control/grid/grid/grid.controller.ts +17 -0
- package/src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts +6 -0
- package/src/controller/control/tree/tree.controller.ts +45 -0
- package/src/controller/control/tree/tree.service.ts +1 -1
- package/src/global/global-util/global-util.ts +9 -0
- package/src/interface/common/i-plugin-factory/i-plugin-factory.ts +4 -5
- package/src/interface/controller/state/control/i-tree.state.ts +16 -0
- package/src/platform/provider/platform-provider-base.ts +1 -0
- package/src/ui-action/provider/front-ui-action-provider.ts +7 -3
- package/src/ui-logic/ui-logic-context.ts +13 -1
- package/src/ui-logic/ui-logic-node/index.ts +1 -0
- package/src/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.ts +22 -0
- package/src/ui-logic/ui-logic.ts +4 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/script/script-function.ts +22 -16
- package/src/utils/theme-util/theme-util.ts +64 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScriptFactory } from '../../../utils';
|
|
2
|
+
import { UILogicNode } from '../ui-logic-node';
|
|
3
|
+
export class RawJSCodeNode extends UILogicNode {
|
|
4
|
+
async exec(ctx) {
|
|
5
|
+
console.log(ctx);
|
|
6
|
+
ScriptFactory.execScriptFn({
|
|
7
|
+
view: ctx.view,
|
|
8
|
+
context: ctx.context,
|
|
9
|
+
params: ctx.viewParam,
|
|
10
|
+
uiLogic: ctx.params,
|
|
11
|
+
}, this.model.code || '', { isAsync: false });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"ui-logic.d.ts","sourceRoot":"","sources":["../../src/ui-logic/ui-logic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAmBL,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;GAOG;AACH,qBAAa,OAAO;IA2BN,SAAS,CAAC,KAAK,EAAE,UAAU;IA1BvC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAExD;;;;;OAKG;gBACmB,KAAK,EAAE,UAAU;IAuFvC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IASpD;;;;;;;;;OASG;IACG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBxD;;;;;;;;;;;;;OAaG;cACa,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
|
package/out/ui-logic/ui-logic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
2
|
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
3
3
|
import { UILogicContext } from './ui-logic-context';
|
|
4
|
-
import { AppendParamNode, BindParamNode, CopyParamNode, DataSetNode, DEActionNode, DebugParamNode, DEUIActionNode, EndNode, ExecuteDELogicNode, MsgBoxNode, PFPluginNode, PrepareJSParamNode, RenewParamNode, ResetParamNode, SortParamNode, StartNode, ThrowExceptionNode, ViewCtrlFireEventNode, ViewCtrlInvokeNode, } from './ui-logic-node';
|
|
4
|
+
import { AppendParamNode, BindParamNode, CopyParamNode, DataSetNode, DEActionNode, DebugParamNode, DEUIActionNode, EndNode, ExecuteDELogicNode, MsgBoxNode, PFPluginNode, PrepareJSParamNode, RawJSCodeNode, RenewParamNode, ResetParamNode, SortParamNode, StartNode, ThrowExceptionNode, ViewCtrlFireEventNode, ViewCtrlInvokeNode, } from './ui-logic-node';
|
|
5
5
|
import { UILogicParam } from './ui-logic-param/ui-logic-param';
|
|
6
6
|
/**
|
|
7
7
|
* 界面逻辑
|
|
@@ -103,6 +103,9 @@ export class UILogic {
|
|
|
103
103
|
case 'PFPLUGIN': // 前端插件调用
|
|
104
104
|
logicNode = new PFPluginNode(node);
|
|
105
105
|
break;
|
|
106
|
+
case 'RAWJSCODE':
|
|
107
|
+
logicNode = new RawJSCodeNode(node);
|
|
108
|
+
break;
|
|
106
109
|
default:
|
|
107
110
|
throw new ModelError(node, `未支持的逻辑节点类型: ${logicNodeType}`);
|
|
108
111
|
}
|
package/out/utils/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './modal/modal';
|
|
|
9
9
|
export * from './value-rule/value-rule';
|
|
10
10
|
export * from './script/index';
|
|
11
11
|
export { TextUtil } from './text-util/text-util';
|
|
12
|
+
export { ThemeUtil } from './theme-util/theme-util';
|
|
12
13
|
export { RawValueUtil } from './raw-value-util/raw-value-util';
|
|
13
14
|
export { handleAllSettled } from './promise/promise';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -9,5 +9,6 @@ export * from './modal/modal';
|
|
|
9
9
|
export * from './value-rule/value-rule';
|
|
10
10
|
export * from './script/index';
|
|
11
11
|
export { TextUtil } from './text-util/text-util';
|
|
12
|
+
export { ThemeUtil } from './theme-util/theme-util';
|
|
12
13
|
export { RawValueUtil } from './raw-value-util/raw-value-util';
|
|
13
14
|
export { handleAllSettled } from './promise/promise';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-function.d.ts","sourceRoot":"","sources":["../../../src/utils/script/script-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,iBAAiB,CAAC;AASvE,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE7B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAM;IAEjC,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBAGrC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAoC;IAgB/C;;;;;;;;OAQG;IACH,SAAS,CAAC,UAAU,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,mBAAmB,GAC3B,MAAM;IAWT;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI;IA4B5E;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE;IAuB7C;;;;;;;OAOG;IACH,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"script-function.d.ts","sourceRoot":"","sources":["../../../src/utils/script/script-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,iBAAiB,CAAC;AASvE,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE7B,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAM;IAEjC,SAAS,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBAGrC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAoC;IAgB/C;;;;;;;;OAQG;IACH,SAAS,CAAC,UAAU,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,mBAAmB,GAC3B,MAAM;IAWT;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI;IA4B5E;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE;IAuB7C;;;;;;;OAOG;IACH,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAkD9D;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CAI/B"}
|
|
@@ -115,7 +115,6 @@ export class ScriptFunction {
|
|
|
115
115
|
* @param {IParams} param
|
|
116
116
|
*/
|
|
117
117
|
fillDefaultParams(key, param) {
|
|
118
|
-
const view = param.view;
|
|
119
118
|
switch (key) {
|
|
120
119
|
case 'util': // 工具类
|
|
121
120
|
param.util = {
|
|
@@ -135,27 +134,34 @@ export class ScriptFunction {
|
|
|
135
134
|
case 'app': // 应用级的控制器
|
|
136
135
|
param.app = ibiz.hub.controller;
|
|
137
136
|
break;
|
|
138
|
-
case 'parent': // 父容器控制器
|
|
139
|
-
param.parent = view === null || view === void 0 ? void 0 : view.parentView;
|
|
140
|
-
break;
|
|
141
|
-
case 'topView': // 顶级视图控制器
|
|
142
|
-
param.topView = view === null || view === void 0 ? void 0 : view.getTopView();
|
|
143
|
-
break;
|
|
144
|
-
case 'parentView': // 父级视图控制器
|
|
145
|
-
param.parentView = view === null || view === void 0 ? void 0 : view.parentView;
|
|
146
|
-
break;
|
|
147
|
-
case 'topViewSession': // 顶级视图共享数据对象
|
|
148
|
-
param.topViewSession = view === null || view === void 0 ? void 0 : view.getTopView().session;
|
|
149
|
-
break;
|
|
150
|
-
case 'viewSession': // 当前视图共享数据对象
|
|
151
|
-
param.viewSession = view === null || view === void 0 ? void 0 : view.session;
|
|
152
|
-
break;
|
|
153
137
|
case 'appSession': // 全局共享数据对象
|
|
154
138
|
param.appSession = ibiz.hub.controller.session;
|
|
155
139
|
break;
|
|
156
140
|
default:
|
|
157
141
|
break;
|
|
158
142
|
}
|
|
143
|
+
const view = param.view;
|
|
144
|
+
if (view) {
|
|
145
|
+
switch (key) {
|
|
146
|
+
case 'parent': // 父容器控制器
|
|
147
|
+
param.parent = view.parentView;
|
|
148
|
+
break;
|
|
149
|
+
case 'topView': // 顶级视图控制器
|
|
150
|
+
param.topView = view.getTopView();
|
|
151
|
+
break;
|
|
152
|
+
case 'parentView': // 父级视图控制器
|
|
153
|
+
param.parentView = view.parentView;
|
|
154
|
+
break;
|
|
155
|
+
case 'topViewSession': // 顶级视图共享数据对象
|
|
156
|
+
param.topViewSession = view.getTopView().session;
|
|
157
|
+
break;
|
|
158
|
+
case 'viewSession': // 当前视图共享数据对象
|
|
159
|
+
param.viewSession = view.session;
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
159
165
|
}
|
|
160
166
|
/**
|
|
161
167
|
* 执行脚本代码
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IAppUITheme } from '@ibiz/model-core';
|
|
2
|
+
/**
|
|
3
|
+
* 主题工具类
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-12-02 23:12:15
|
|
7
|
+
* @export
|
|
8
|
+
* @class ThemeUtil
|
|
9
|
+
*/
|
|
10
|
+
export declare class ThemeUtil {
|
|
11
|
+
/**
|
|
12
|
+
* 主题设置元素 html
|
|
13
|
+
*
|
|
14
|
+
* @author chitanda
|
|
15
|
+
* @date 2023-12-02 23:12:26
|
|
16
|
+
* @protected
|
|
17
|
+
* @type {HTMLElement}
|
|
18
|
+
*/
|
|
19
|
+
protected html: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* 加载主题插件
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2023-12-03 01:12:44
|
|
25
|
+
* @param {IAppUITheme} theme
|
|
26
|
+
* @return {*} {Promise<void>}
|
|
27
|
+
*/
|
|
28
|
+
loadTheme(theme: IAppUITheme): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* 设置主题
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2023-12-02 23:12:37
|
|
34
|
+
* @param {string} tag
|
|
35
|
+
*/
|
|
36
|
+
setTheme(tag: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取当前主题
|
|
39
|
+
*
|
|
40
|
+
* @author chitanda
|
|
41
|
+
* @date 2023-12-02 23:12:10
|
|
42
|
+
* @return {*} {string}
|
|
43
|
+
*/
|
|
44
|
+
getTheme(): string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=theme-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-util.d.ts","sourceRoot":"","sources":["../../../src/utils/theme-util/theme-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,WAAW,CAA4C;IAEvE;;;;;;;OAOG;IACG,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAO3B;;;;;;OAMG;IACH,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 主题工具类
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2023-12-02 23:12:15
|
|
6
|
+
* @export
|
|
7
|
+
* @class ThemeUtil
|
|
8
|
+
*/
|
|
9
|
+
export class ThemeUtil {
|
|
10
|
+
constructor() {
|
|
11
|
+
/**
|
|
12
|
+
* 主题设置元素 html
|
|
13
|
+
*
|
|
14
|
+
* @author chitanda
|
|
15
|
+
* @date 2023-12-02 23:12:26
|
|
16
|
+
* @protected
|
|
17
|
+
* @type {HTMLElement}
|
|
18
|
+
*/
|
|
19
|
+
this.html = document.getElementsByTagName('html')[0];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 加载主题插件
|
|
23
|
+
*
|
|
24
|
+
* @author chitanda
|
|
25
|
+
* @date 2023-12-03 01:12:44
|
|
26
|
+
* @param {IAppUITheme} theme
|
|
27
|
+
* @return {*} {Promise<void>}
|
|
28
|
+
*/
|
|
29
|
+
async loadTheme(theme) {
|
|
30
|
+
const data = theme.themeParams || {};
|
|
31
|
+
await ibiz.plugin.loadPlugin({
|
|
32
|
+
runtimeObject: true,
|
|
33
|
+
rtobjectName: theme.name,
|
|
34
|
+
rtobjectRepo: data['theme-package-path'],
|
|
35
|
+
});
|
|
36
|
+
this.setTheme(theme.themeTag);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 设置主题
|
|
40
|
+
*
|
|
41
|
+
* @author chitanda
|
|
42
|
+
* @date 2023-12-02 23:12:37
|
|
43
|
+
* @param {string} tag
|
|
44
|
+
*/
|
|
45
|
+
setTheme(tag) {
|
|
46
|
+
const theme = this.getTheme();
|
|
47
|
+
this.html.classList.remove(theme);
|
|
48
|
+
this.html.setAttribute('theme', tag);
|
|
49
|
+
this.html.classList.add(tag);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 获取当前主题
|
|
53
|
+
*
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2023-12-02 23:12:10
|
|
56
|
+
* @return {*} {string}
|
|
57
|
+
*/
|
|
58
|
+
getTheme() {
|
|
59
|
+
return this.html.getAttribute('theme');
|
|
60
|
+
}
|
|
61
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@ibiz-template/core": "^0.4.0",
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
33
|
+
"@ibiz/model-core": "^0.0.23",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.10",
|
|
36
36
|
"@types/systemjs": "^6.13.5",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.4.0",
|
|
50
|
-
"@ibiz/model-core": "^0.0.
|
|
50
|
+
"@ibiz/model-core": "^0.0.23",
|
|
51
51
|
"async-validator": "^4.2.5",
|
|
52
52
|
"dayjs": "^1.11.7",
|
|
53
53
|
"echarts": "^5.4.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"qx-util": "^0.4.8",
|
|
60
60
|
"ramda": "^0.29.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "283c09417c873f27c58087f33a93466940c1b002"
|
|
63
63
|
}
|
|
@@ -436,8 +436,12 @@ export class MDControlController<
|
|
|
436
436
|
if (!dataImport) {
|
|
437
437
|
throw new RuntimeError('无导入模型!');
|
|
438
438
|
}
|
|
439
|
+
let importName = 'DataImport';
|
|
440
|
+
if (dataImport.enableCustomized) {
|
|
441
|
+
importName = 'DataImport2';
|
|
442
|
+
}
|
|
439
443
|
const modal = ibiz.overlay.createModal(
|
|
440
|
-
|
|
444
|
+
importName,
|
|
441
445
|
{
|
|
442
446
|
dismiss: () => modal.dismiss(),
|
|
443
447
|
appDataEntity,
|
|
@@ -240,7 +240,10 @@ export class ChartOptionsGenerator {
|
|
|
240
240
|
min: chartAxis.minValue,
|
|
241
241
|
position,
|
|
242
242
|
axisLabel: {
|
|
243
|
-
formatter: (value: string): string => {
|
|
243
|
+
formatter: (value: string | number): string => {
|
|
244
|
+
if (typeof value === 'number') {
|
|
245
|
+
value = value.toString();
|
|
246
|
+
}
|
|
244
247
|
if (dataShowMode === 1) {
|
|
245
248
|
if (value.length > 4) {
|
|
246
249
|
return `${value.slice(0, 4).split('').join('\n')}\n...`;
|
|
@@ -196,4 +196,22 @@ export class TreeExpBarController
|
|
|
196
196
|
}
|
|
197
197
|
await super.onRouterChange(info);
|
|
198
198
|
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 是否显示部件头部
|
|
202
|
+
* @author lxm
|
|
203
|
+
* @date 2023-08-02 07:54:18
|
|
204
|
+
* @protected
|
|
205
|
+
* @return {*} {boolean}
|
|
206
|
+
*/
|
|
207
|
+
protected calcControlHeaderVisible(): boolean {
|
|
208
|
+
const hasToolbar = !!this.toolbarController;
|
|
209
|
+
if (!hasToolbar && this.layoutPanel) {
|
|
210
|
+
const controller = this.layoutPanel.panelItems.control_toolbar;
|
|
211
|
+
if (controller) {
|
|
212
|
+
controller.state.visible = false;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return hasToolbar || !!(this.model.showTitleBar && this.model.title);
|
|
216
|
+
}
|
|
199
217
|
}
|
|
@@ -187,17 +187,22 @@ export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
|
187
187
|
* @author lxm
|
|
188
188
|
* @date 2023-11-11 08:01:49
|
|
189
189
|
*/
|
|
190
|
-
create(): void {
|
|
190
|
+
create(index?: number): void {
|
|
191
191
|
const context = this.context.clone();
|
|
192
192
|
const params = { ...this.params };
|
|
193
193
|
if (!this.state.items) {
|
|
194
194
|
this.state.items = [];
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
const item = {
|
|
197
197
|
id: createUUID(),
|
|
198
198
|
context,
|
|
199
199
|
params,
|
|
200
|
-
}
|
|
200
|
+
};
|
|
201
|
+
if (index !== undefined) {
|
|
202
|
+
this.state.items!.splice(index, 0, item);
|
|
203
|
+
} else {
|
|
204
|
+
this.state.items!.push(item);
|
|
205
|
+
}
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
refresh(): void {
|
package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
CHANGED
|
@@ -140,14 +140,18 @@ export class FormMDCtrlRepeaterController extends FormMDCtrlController {
|
|
|
140
140
|
* @author lxm
|
|
141
141
|
* @date 2023-11-22 04:50:19
|
|
142
142
|
*/
|
|
143
|
-
create(): void {
|
|
143
|
+
create(index?: number): void {
|
|
144
144
|
if (this.isSingleData) {
|
|
145
145
|
this.setValue({});
|
|
146
146
|
} else {
|
|
147
147
|
// 多数据,拷贝数组再添加新对象
|
|
148
148
|
let tempValue = this.value as IData[] | null;
|
|
149
149
|
tempValue = tempValue ? [...tempValue] : [];
|
|
150
|
-
|
|
150
|
+
if (index !== undefined) {
|
|
151
|
+
tempValue.splice(index, 0, {});
|
|
152
|
+
} else {
|
|
153
|
+
tempValue.push({});
|
|
154
|
+
}
|
|
151
155
|
this.setValue(tempValue);
|
|
152
156
|
}
|
|
153
157
|
}
|
|
@@ -1144,4 +1144,21 @@ export class GridController
|
|
|
1144
1144
|
const index = this.findRowStateIndex(data);
|
|
1145
1145
|
return index !== -1 ? this.state.rows[index] : undefined;
|
|
1146
1146
|
}
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* 行单击事件
|
|
1150
|
+
*
|
|
1151
|
+
* @author lxm
|
|
1152
|
+
* @date 2022-08-18 22:08:16
|
|
1153
|
+
* @param {IData} data 选中的单条数据
|
|
1154
|
+
*/
|
|
1155
|
+
async onRowClick(data: IData): Promise<void> {
|
|
1156
|
+
// 表格行单击时,只选中点击行
|
|
1157
|
+
this.setSelection([data]);
|
|
1158
|
+
|
|
1159
|
+
// 激活事件
|
|
1160
|
+
if (this.state.mdctrlActiveMode === 1) {
|
|
1161
|
+
await this.setActive(data);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1147
1164
|
}
|
|
@@ -207,6 +207,12 @@ export class GridFieldEditColumnController
|
|
|
207
207
|
* @param {string[]} names 变更属性名称
|
|
208
208
|
*/
|
|
209
209
|
async dataChangeNotify(row: GridRowState, names: string[]): Promise<void> {
|
|
210
|
+
// 重置项,变更时自己的值置空
|
|
211
|
+
const { resetItemName } = this.editItem;
|
|
212
|
+
if (resetItemName && names.includes(resetItemName)) {
|
|
213
|
+
this.setRowValue(row, null);
|
|
214
|
+
}
|
|
215
|
+
|
|
210
216
|
// 计算禁用状态
|
|
211
217
|
this.calcColumnDisabled(row);
|
|
212
218
|
|
|
@@ -36,6 +36,14 @@ export class TreeController
|
|
|
36
36
|
*/
|
|
37
37
|
contextMenus: { [p: string]: ContextMenuController } = {};
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* 是否启用快速搜索
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2023-12-04 03:33:32
|
|
43
|
+
* @type {boolean}
|
|
44
|
+
*/
|
|
45
|
+
enableQuickSearch: boolean = false;
|
|
46
|
+
|
|
39
47
|
protected initState(): void {
|
|
40
48
|
super.initState();
|
|
41
49
|
// 根节点初始化
|
|
@@ -43,6 +51,7 @@ export class TreeController
|
|
|
43
51
|
this.state.expandedKeys = [];
|
|
44
52
|
this.state.navigational = false;
|
|
45
53
|
this.state.size = 0;
|
|
54
|
+
this.state.query = '';
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
protected async onCreated(): Promise<void> {
|
|
@@ -50,6 +59,34 @@ export class TreeController
|
|
|
50
59
|
|
|
51
60
|
this.state.expandedKeys = [...this.state.defaultExpandedKeys];
|
|
52
61
|
|
|
62
|
+
// 快速搜索
|
|
63
|
+
if (this.model.detreeNodes?.[0].enableQuickSearch) {
|
|
64
|
+
this.enableQuickSearch = true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 计算快速搜索占位符
|
|
68
|
+
if (this.dataEntity) {
|
|
69
|
+
const searchFields = this.dataEntity.appDEFields?.filter(field => {
|
|
70
|
+
return field.enableQuickSearch;
|
|
71
|
+
});
|
|
72
|
+
const placeHolders: string[] = [];
|
|
73
|
+
searchFields?.forEach(searchField => {
|
|
74
|
+
if (searchField?.lnlanguageRes && searchField.lnlanguageRes.lanResTag) {
|
|
75
|
+
placeHolders.push(
|
|
76
|
+
ibiz.i18n.t(
|
|
77
|
+
searchField.lnlanguageRes.lanResTag,
|
|
78
|
+
searchField.logicName,
|
|
79
|
+
),
|
|
80
|
+
);
|
|
81
|
+
} else if (searchField?.logicName) {
|
|
82
|
+
placeHolders.push(searchField.logicName);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
if (placeHolders.length > 0) {
|
|
86
|
+
this.state.placeHolder = placeHolders.join('、');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
53
90
|
this.service = new TreeService(this.model);
|
|
54
91
|
await this.service.init(this.context);
|
|
55
92
|
|
|
@@ -99,6 +136,14 @@ export class TreeController
|
|
|
99
136
|
return nodes;
|
|
100
137
|
}
|
|
101
138
|
|
|
139
|
+
async getFetchParams(extraParams?: IParams): Promise<IParams> {
|
|
140
|
+
const params = await super.getFetchParams(extraParams);
|
|
141
|
+
if (this.state.query) {
|
|
142
|
+
params.query = this.state.query;
|
|
143
|
+
}
|
|
144
|
+
return params;
|
|
145
|
+
}
|
|
146
|
+
|
|
102
147
|
/**
|
|
103
148
|
* 加载子节点数据
|
|
104
149
|
*
|
|
@@ -301,7 +301,7 @@ export class TreeService extends MDControlService<IDETree> {
|
|
|
301
301
|
const { resultContext, resultParams } = calcNavParams(
|
|
302
302
|
{
|
|
303
303
|
deName,
|
|
304
|
-
navFilter: navFilter ? `n_${navFilter}_eq` : undefined,
|
|
304
|
+
navFilter: navFilter ? `n_${navFilter.toLowerCase()}_eq` : undefined,
|
|
305
305
|
pickupDEFName,
|
|
306
306
|
navParams,
|
|
307
307
|
navContexts,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
LayoutPanelUtil,
|
|
6
6
|
HandlebarsUtil,
|
|
7
7
|
RawValueUtil,
|
|
8
|
+
ThemeUtil,
|
|
8
9
|
} from '../../utils';
|
|
9
10
|
import {
|
|
10
11
|
DefaultErrorHandler,
|
|
@@ -28,6 +29,14 @@ export class GlobalUtil {
|
|
|
28
29
|
*/
|
|
29
30
|
readonly layoutPanel = new LayoutPanelUtil();
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 主题设置工具
|
|
34
|
+
*
|
|
35
|
+
* @author chitanda
|
|
36
|
+
* @date 2023-12-02 23:12:27
|
|
37
|
+
*/
|
|
38
|
+
readonly theme = new ThemeUtil();
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* 文本工具
|
|
33
42
|
*
|
|
@@ -11,14 +11,13 @@ import { IPluginItem } from '../i-plugin-item/i-plugin-item';
|
|
|
11
11
|
*/
|
|
12
12
|
export interface IPluginFactory {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 设置本地开发忽略远程加载插件
|
|
15
15
|
*
|
|
16
16
|
* @author chitanda
|
|
17
|
-
* @date
|
|
18
|
-
* @param {string}
|
|
19
|
-
* @param {() => Promise<unknown>} fn
|
|
17
|
+
* @date 2023-12-04 17:12:40
|
|
18
|
+
* @param {(string | RegExp)} rule
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
setDevIgnore(rule: string | RegExp): void;
|
|
22
21
|
/**
|
|
23
22
|
* 加载插件
|
|
24
23
|
*
|
|
@@ -45,6 +45,22 @@ export interface ITreeState extends IMDControlState {
|
|
|
45
45
|
* @type {boolean}
|
|
46
46
|
*/
|
|
47
47
|
navigational: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 查询条件
|
|
51
|
+
* @author lxm
|
|
52
|
+
* @date 2023-08-02 07:38:49
|
|
53
|
+
* @type {string}
|
|
54
|
+
*/
|
|
55
|
+
query: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 快速搜索占位符
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof IExpBarControlState
|
|
62
|
+
*/
|
|
63
|
+
placeHolder: string;
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
/**
|
|
@@ -101,10 +101,10 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
101
101
|
args: IUILogicParams,
|
|
102
102
|
): IUIActionResult {
|
|
103
103
|
const { scriptCode } = action as IUIAction;
|
|
104
|
-
const { context, params, data, event } = args;
|
|
104
|
+
const { context, params, data, event, view } = args;
|
|
105
105
|
if (scriptCode) {
|
|
106
106
|
const result = ScriptFactory.execScriptFn(
|
|
107
|
-
{ context, params, data, el: event?.target },
|
|
107
|
+
{ context, params, data, el: event?.target, view },
|
|
108
108
|
scriptCode,
|
|
109
109
|
) as IUIActionResult | undefined;
|
|
110
110
|
return result || {};
|
|
@@ -203,9 +203,13 @@ export class FrontUIActionProvider extends UIActionProviderBase {
|
|
|
203
203
|
const appDEDataImport = appDataEntity.appDEDataImports?.find(
|
|
204
204
|
dataImport => dataImport.id === action.appDEDataImportId,
|
|
205
205
|
);
|
|
206
|
+
let importName = 'DataImport';
|
|
207
|
+
if (appDEDataImport && appDEDataImport.enableCustomized) {
|
|
208
|
+
importName = 'DataImport2';
|
|
209
|
+
}
|
|
206
210
|
if (appDEDataImport) {
|
|
207
211
|
const modal = ibiz.overlay.createModal(
|
|
208
|
-
|
|
212
|
+
importName,
|
|
209
213
|
{
|
|
210
214
|
dismiss: () => modal.dismiss(),
|
|
211
215
|
appDataEntity,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUILogicContext, IUILogicParams } from '../interface';
|
|
1
|
+
import { IUILogicContext, IUILogicParams, IViewController } from '../interface';
|
|
2
2
|
import { UILogicParam } from './ui-logic-param/ui-logic-param';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -18,6 +18,18 @@ export class UILogicContext implements IUILogicContext {
|
|
|
18
18
|
*/
|
|
19
19
|
lastReturn: unknown;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* 视图控制器
|
|
23
|
+
*
|
|
24
|
+
* @author chitanda
|
|
25
|
+
* @date 2023-12-01 11:12:48
|
|
26
|
+
* @readonly
|
|
27
|
+
* @type {IViewController}
|
|
28
|
+
*/
|
|
29
|
+
get view(): IViewController {
|
|
30
|
+
return this.parameters.view;
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
/**
|
|
22
34
|
* 上下文
|
|
23
35
|
*/
|
|
@@ -18,3 +18,4 @@ export { DataSetNode } from './data-set-node/data-set-node';
|
|
|
18
18
|
export { ThrowExceptionNode } from './throw-exception-node/throw-exception-node';
|
|
19
19
|
export { ViewCtrlFireEventNode } from './view-ctrl-fire-event-node/view-ctrl-fire-event-node';
|
|
20
20
|
export { ExecuteDELogicNode } from './execute-de-logic-node/execute-de-logic-node';
|
|
21
|
+
export { RawJSCodeNode } from './raw-js-code-node/raw-js-code-node';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IDEUIRawCodeLogic } from '@ibiz/model-core';
|
|
2
|
+
import { ScriptFactory } from '../../../utils';
|
|
3
|
+
import { UILogicContext } from '../../ui-logic-context';
|
|
4
|
+
import { UILogicNode } from '../ui-logic-node';
|
|
5
|
+
|
|
6
|
+
export class RawJSCodeNode extends UILogicNode {
|
|
7
|
+
declare model: IDEUIRawCodeLogic;
|
|
8
|
+
|
|
9
|
+
async exec(ctx: UILogicContext): Promise<void> {
|
|
10
|
+
console.log(ctx);
|
|
11
|
+
ScriptFactory.execScriptFn(
|
|
12
|
+
{
|
|
13
|
+
view: ctx.view,
|
|
14
|
+
context: ctx.context,
|
|
15
|
+
params: ctx.viewParam,
|
|
16
|
+
uiLogic: ctx.params,
|
|
17
|
+
},
|
|
18
|
+
this.model.code || '',
|
|
19
|
+
{ isAsync: false },
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}
|