@ibiz-template/runtime 0.4.3 → 0.4.5
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 +269 -70
- package/dist/index.system.min.js +2 -3
- 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 +13 -0
- package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
- package/out/controller/control/toolbar/toolbar.controllerr.js +3 -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/model/utils/util.d.ts +4 -2
- package/out/model/utils/util.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/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +6 -1
- package/out/ui-action/provider/front-ui-action-provider.js +2 -2
- package/out/ui-action/provider/index.d.ts +2 -1
- package/out/ui-action/provider/index.d.ts.map +1 -1
- package/out/ui-action/provider/index.js +2 -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/theme-util/theme-util.d.ts +57 -0
- package/out/utils/theme-util/theme-util.d.ts.map +1 -0
- package/out/utils/theme-util/theme-util.js +95 -0
- package/package.json +5 -5
- 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 +14 -0
- package/src/controller/control/toolbar/toolbar.controllerr.ts +3 -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/model/utils/util.ts +4 -1
- package/src/platform/provider/platform-provider-base.ts +1 -0
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +9 -3
- package/src/ui-action/provider/front-ui-action-provider.ts +2 -2
- package/src/ui-action/provider/index.ts +2 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/theme-util/theme-util.ts +102 -0
- package/dist/index.system.min.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
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-05 11:12:00
|
|
34
|
+
* @protected
|
|
35
|
+
* @param {IAppUITheme} theme
|
|
36
|
+
* @param {Record<string, string>} params
|
|
37
|
+
* @return {*} {void}
|
|
38
|
+
*/
|
|
39
|
+
protected setThemeParams(theme: IAppUITheme, params: Record<string, string>): void;
|
|
40
|
+
/**
|
|
41
|
+
* 设置主题
|
|
42
|
+
*
|
|
43
|
+
* @author chitanda
|
|
44
|
+
* @date 2023-12-02 23:12:37
|
|
45
|
+
* @param {string} tag
|
|
46
|
+
*/
|
|
47
|
+
setTheme(tag: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* 获取当前主题
|
|
50
|
+
*
|
|
51
|
+
* @author chitanda
|
|
52
|
+
* @date 2023-12-02 23:12:10
|
|
53
|
+
* @return {*} {string}
|
|
54
|
+
*/
|
|
55
|
+
getTheme(): string;
|
|
56
|
+
}
|
|
57
|
+
//# 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;AAG7D;;;;;;;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;IAclD;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CACtB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,IAAI;IAoBP;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAO3B;;;;;;OAMG;IACH,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { clone } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* 主题工具类
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2023-12-02 23:12:15
|
|
7
|
+
* @export
|
|
8
|
+
* @class ThemeUtil
|
|
9
|
+
*/
|
|
10
|
+
export class ThemeUtil {
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* 主题设置元素 html
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2023-12-02 23:12:26
|
|
17
|
+
* @protected
|
|
18
|
+
* @type {HTMLElement}
|
|
19
|
+
*/
|
|
20
|
+
this.html = document.getElementsByTagName('html')[0];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 加载主题插件
|
|
24
|
+
*
|
|
25
|
+
* @author chitanda
|
|
26
|
+
* @date 2023-12-03 01:12:44
|
|
27
|
+
* @param {IAppUITheme} theme
|
|
28
|
+
* @return {*} {Promise<void>}
|
|
29
|
+
*/
|
|
30
|
+
async loadTheme(theme) {
|
|
31
|
+
const data = clone(theme.themeParams || {});
|
|
32
|
+
const path = data['theme-package-path'];
|
|
33
|
+
delete data.appId;
|
|
34
|
+
delete data['theme-package-path'];
|
|
35
|
+
await ibiz.plugin.loadPlugin({
|
|
36
|
+
runtimeObject: true,
|
|
37
|
+
rtobjectName: theme.name,
|
|
38
|
+
rtobjectRepo: path,
|
|
39
|
+
});
|
|
40
|
+
this.setThemeParams(theme, data);
|
|
41
|
+
this.setTheme(theme.themeTag);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 设置额外修改的主题参数
|
|
45
|
+
*
|
|
46
|
+
* @author chitanda
|
|
47
|
+
* @date 2023-12-05 11:12:00
|
|
48
|
+
* @protected
|
|
49
|
+
* @param {IAppUITheme} theme
|
|
50
|
+
* @param {Record<string, string>} params
|
|
51
|
+
* @return {*} {void}
|
|
52
|
+
*/
|
|
53
|
+
setThemeParams(theme, params) {
|
|
54
|
+
const themeStyle = document.getElementById(theme.themeTag);
|
|
55
|
+
if (themeStyle) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let content = `:root.${theme.themeTag}{`;
|
|
59
|
+
for (const key in params) {
|
|
60
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
61
|
+
const val = params[key];
|
|
62
|
+
content += `${key}: ${val}${val.endsWith(';') ? '' : ';'}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
content += '}';
|
|
66
|
+
const script = document.createElement('style');
|
|
67
|
+
script.id = theme.themeTag;
|
|
68
|
+
script.type = 'text/css';
|
|
69
|
+
script.innerHTML = content;
|
|
70
|
+
document.head.appendChild(script);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 设置主题
|
|
74
|
+
*
|
|
75
|
+
* @author chitanda
|
|
76
|
+
* @date 2023-12-02 23:12:37
|
|
77
|
+
* @param {string} tag
|
|
78
|
+
*/
|
|
79
|
+
setTheme(tag) {
|
|
80
|
+
const theme = this.getTheme();
|
|
81
|
+
this.html.classList.remove(theme);
|
|
82
|
+
this.html.setAttribute('theme', tag);
|
|
83
|
+
this.html.classList.add(tag);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* 获取当前主题
|
|
87
|
+
*
|
|
88
|
+
* @author chitanda
|
|
89
|
+
* @date 2023-12-02 23:12:10
|
|
90
|
+
* @return {*} {string}
|
|
91
|
+
*/
|
|
92
|
+
getTheme() {
|
|
93
|
+
return this.html.getAttribute('theme');
|
|
94
|
+
}
|
|
95
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.4.
|
|
33
|
-
"@ibiz/model-core": "^0.0.
|
|
32
|
+
"@ibiz-template/core": "^0.4.5",
|
|
33
|
+
"@ibiz/model-core": "^0.0.24",
|
|
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.24",
|
|
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": "28b2af793771fa7be9fac2e1c8396081f4002230"
|
|
63
63
|
}
|
|
@@ -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,20 @@ export class GridFieldEditColumnController
|
|
|
207
207
|
* @param {string[]} names 变更属性名称
|
|
208
208
|
*/
|
|
209
209
|
async dataChangeNotify(row: GridRowState, names: string[]): Promise<void> {
|
|
210
|
+
// 重置项,变更时自己的值置空
|
|
211
|
+
const { resetItemNames } = this.editItem;
|
|
212
|
+
let isReset = false;
|
|
213
|
+
if (resetItemNames && resetItemNames.length > 0) {
|
|
214
|
+
resetItemNames.forEach((resetItemName: string) => {
|
|
215
|
+
if (names.includes(resetItemName)) {
|
|
216
|
+
isReset = true;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (isReset) {
|
|
221
|
+
this.setRowValue(row, null);
|
|
222
|
+
}
|
|
223
|
+
|
|
210
224
|
// 计算禁用状态
|
|
211
225
|
this.calcColumnDisabled(row);
|
|
212
226
|
|
|
@@ -174,6 +174,9 @@ export class ToolbarController<
|
|
|
174
174
|
this.model,
|
|
175
175
|
(item: IDEToolbarItem) => {
|
|
176
176
|
const itemState = this.state.buttonsState[item.id!] as IButtonState;
|
|
177
|
+
if (!itemState) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
177
180
|
// 计算项显示逻辑
|
|
178
181
|
if (itemState.visible) {
|
|
179
182
|
const dynaVisible = this.scheduler!.triggerItemVisible(
|
|
@@ -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
|
/**
|
package/src/model/utils/util.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
IAppView,
|
|
4
4
|
IAppViewRef,
|
|
5
5
|
IControl,
|
|
6
|
+
IControlRender,
|
|
6
7
|
IModelObject,
|
|
7
8
|
IPanel,
|
|
8
9
|
ISysPFPlugin,
|
|
@@ -151,7 +152,9 @@ export function getPFPlugin(id: string, appId?: string): ISysPFPlugin {
|
|
|
151
152
|
* @param {IControl} control
|
|
152
153
|
* @return {*} {(IPanel | undefined)}
|
|
153
154
|
*/
|
|
154
|
-
export function getControlPanel(control:
|
|
155
|
+
export function getControlPanel(control: {
|
|
156
|
+
controlRenders?: IControlRender[];
|
|
157
|
+
}): IPanel | undefined {
|
|
155
158
|
let layoutPanel: IPanel | undefined;
|
|
156
159
|
if (control.controlRenders) {
|
|
157
160
|
const panelRender = control.controlRenders.find(
|
|
@@ -178,9 +178,15 @@ export class DynamicCodeListCache {
|
|
|
178
178
|
}
|
|
179
179
|
// 数据属性
|
|
180
180
|
if (dataAppDEFieldId && data[dataAppDEFieldId]) {
|
|
181
|
-
|
|
182
|
-
data
|
|
183
|
-
|
|
181
|
+
try {
|
|
182
|
+
result.data = ScriptFactory.execSingleLine(
|
|
183
|
+
data[dataAppDEFieldId],
|
|
184
|
+
) as IData;
|
|
185
|
+
} catch (error) {
|
|
186
|
+
ibiz.log.error(
|
|
187
|
+
'动态代码表数据属性返回值不为对象格式的字符串,无法转换!',
|
|
188
|
+
);
|
|
189
|
+
}
|
|
184
190
|
}
|
|
185
191
|
return result;
|
|
186
192
|
}
|
|
@@ -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 || {};
|
|
@@ -3,6 +3,7 @@ import { BackendUIActionProvider } from './backend-ui-action-provider';
|
|
|
3
3
|
import { SysUIActionProvider } from './sys-ui-action-provider';
|
|
4
4
|
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
5
5
|
import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
|
|
6
|
+
import { UIActionProviderBase } from './ui-action-provider-base';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 预置默认的界面行为适配器
|
|
@@ -36,4 +37,5 @@ export {
|
|
|
36
37
|
SysUIActionProvider,
|
|
37
38
|
BackendUIActionProvider,
|
|
38
39
|
WFWithdrawUIActionProvider,
|
|
40
|
+
UIActionProviderBase,
|
|
39
41
|
};
|
package/src/utils/index.ts
CHANGED
|
@@ -12,5 +12,6 @@ export * from './modal/modal';
|
|
|
12
12
|
export * from './value-rule/value-rule';
|
|
13
13
|
export * from './script/index';
|
|
14
14
|
export { TextUtil } from './text-util/text-util';
|
|
15
|
+
export { ThemeUtil } from './theme-util/theme-util';
|
|
15
16
|
export { RawValueUtil } from './raw-value-util/raw-value-util';
|
|
16
17
|
export { handleAllSettled } from './promise/promise';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { IAppUITheme, ISysPFPlugin } from '@ibiz/model-core';
|
|
2
|
+
import { clone } from 'ramda';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 主题工具类
|
|
6
|
+
*
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2023-12-02 23:12:15
|
|
9
|
+
* @export
|
|
10
|
+
* @class ThemeUtil
|
|
11
|
+
*/
|
|
12
|
+
export class ThemeUtil {
|
|
13
|
+
/**
|
|
14
|
+
* 主题设置元素 html
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2023-12-02 23:12:26
|
|
18
|
+
* @protected
|
|
19
|
+
* @type {HTMLElement}
|
|
20
|
+
*/
|
|
21
|
+
protected html: HTMLElement = document.getElementsByTagName('html')[0];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 加载主题插件
|
|
25
|
+
*
|
|
26
|
+
* @author chitanda
|
|
27
|
+
* @date 2023-12-03 01:12:44
|
|
28
|
+
* @param {IAppUITheme} theme
|
|
29
|
+
* @return {*} {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
async loadTheme(theme: IAppUITheme): Promise<void> {
|
|
32
|
+
const data = clone(theme.themeParams || {});
|
|
33
|
+
const path = data['theme-package-path'];
|
|
34
|
+
delete data.appId;
|
|
35
|
+
delete data['theme-package-path'];
|
|
36
|
+
await ibiz.plugin.loadPlugin({
|
|
37
|
+
runtimeObject: true,
|
|
38
|
+
rtobjectName: theme.name,
|
|
39
|
+
rtobjectRepo: path,
|
|
40
|
+
} as unknown as ISysPFPlugin);
|
|
41
|
+
this.setThemeParams(theme, data);
|
|
42
|
+
this.setTheme(theme.themeTag!);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 设置额外修改的主题参数
|
|
47
|
+
*
|
|
48
|
+
* @author chitanda
|
|
49
|
+
* @date 2023-12-05 11:12:00
|
|
50
|
+
* @protected
|
|
51
|
+
* @param {IAppUITheme} theme
|
|
52
|
+
* @param {Record<string, string>} params
|
|
53
|
+
* @return {*} {void}
|
|
54
|
+
*/
|
|
55
|
+
protected setThemeParams(
|
|
56
|
+
theme: IAppUITheme,
|
|
57
|
+
params: Record<string, string>,
|
|
58
|
+
): void {
|
|
59
|
+
const themeStyle = document.getElementById(theme.themeTag!);
|
|
60
|
+
if (themeStyle) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let content = `:root.${theme.themeTag!}{`;
|
|
64
|
+
for (const key in params) {
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
66
|
+
const val = params[key];
|
|
67
|
+
content += `${key}: ${val}${val.endsWith(';') ? '' : ';'}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
content += '}';
|
|
71
|
+
const script = document.createElement('style');
|
|
72
|
+
script.id = theme.themeTag!;
|
|
73
|
+
script.type = 'text/css';
|
|
74
|
+
script.innerHTML = content;
|
|
75
|
+
document.head.appendChild(script);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 设置主题
|
|
80
|
+
*
|
|
81
|
+
* @author chitanda
|
|
82
|
+
* @date 2023-12-02 23:12:37
|
|
83
|
+
* @param {string} tag
|
|
84
|
+
*/
|
|
85
|
+
setTheme(tag: string): void {
|
|
86
|
+
const theme = this.getTheme();
|
|
87
|
+
this.html.classList.remove(theme);
|
|
88
|
+
this.html.setAttribute('theme', tag);
|
|
89
|
+
this.html.classList.add(tag);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 获取当前主题
|
|
94
|
+
*
|
|
95
|
+
* @author chitanda
|
|
96
|
+
* @date 2023-12-02 23:12:10
|
|
97
|
+
* @return {*} {string}
|
|
98
|
+
*/
|
|
99
|
+
getTheme(): string {
|
|
100
|
+
return this.html.getAttribute('theme')!;
|
|
101
|
+
}
|
|
102
|
+
}
|