@ibiz-template/runtime 0.5.1-dev.0 → 0.5.1
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 +191 -70
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +14 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +62 -10
- package/out/controller/control/search-bar/entity-schema.d.ts +1 -1
- package/out/controller/control/search-bar/entity-schema.d.ts.map +1 -1
- package/out/controller/control/search-bar/entity-schema.js +29 -13
- package/out/controller/control/search-bar/search-bar.controller.d.ts +8 -9
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +36 -21
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.d.ts +9 -0
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.js +20 -0
- package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.js +4 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts +6 -6
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +22 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts +6 -6
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-code-list-node-data.js +6 -6
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +6 -6
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +6 -6
- package/out/service/vo/gantt-node-data/gantt-node-data-util.js +1 -1
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts +6 -6
- package/out/service/vo/gantt-node-data/gantt-static-node-data.d.ts.map +1 -1
- package/out/service/vo/gantt-node-data/gantt-static-node-data.js +6 -6
- package/package.json +5 -5
- package/src/controller/control/grid/grid/grid.controller.ts +84 -14
- package/src/controller/control/search-bar/entity-schema.ts +43 -20
- package/src/controller/control/search-bar/search-bar.controller.ts +32 -21
- package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.ts +35 -2
- package/src/controller/control/tree-grid-ex/tree-grid-ex-row.state.ts +4 -1
- package/src/interface/controller/state/control/i-gantt.state.ts +6 -6
- package/src/interface/controller/state/control/i-grid.state.ts +24 -0
- package/src/service/vo/gantt-node-data/gantt-code-list-node-data.ts +12 -12
- package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +12 -12
- package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +1 -1
- package/src/service/vo/gantt-node-data/gantt-static-node-data.ts +15 -12
|
@@ -4,11 +4,11 @@ export class GanttDataSetNodeData extends TreeDataSetNodeData {
|
|
|
4
4
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
5
5
|
super(nodeModel, parentNodeData, opts);
|
|
6
6
|
const { data } = opts;
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
7
|
+
this._snDataItemValue = calcDataItemValue(model.sndataItemName, nodeModel, data);
|
|
8
|
+
this._beginDataItemValue = calcDataItemValue(model.beginDataItemName, nodeModel, data);
|
|
9
|
+
this._endDataItemValue = calcDataItemValue(model.endDataItemName, nodeModel, data);
|
|
10
|
+
this._prevDataItemValue = calcDataItemValue(model.prevDataItemName, nodeModel, data);
|
|
11
|
+
this._finishDataItemValue = calcDataItemValue(model.finishDataItemName, nodeModel, data);
|
|
12
|
+
this._totalDataItemValue = calcDataItemValue(model.totalDataItemName, nodeModel, data);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -10,7 +10,7 @@ export const calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
|
|
|
10
10
|
return result;
|
|
11
11
|
}
|
|
12
12
|
const targetTreeNodeDataItem = nodeModel.detreeNodeDataItems.find((nodeDataItem) => {
|
|
13
|
-
return nodeDataItem.
|
|
13
|
+
return nodeDataItem.detreeColumnId === fieldCodeName;
|
|
14
14
|
});
|
|
15
15
|
if (targetTreeNodeDataItem && targetTreeNodeDataItem.appDEFieldId) {
|
|
16
16
|
result = data[targetTreeNodeDataItem.appDEFieldId];
|
|
@@ -2,12 +2,12 @@ import { IDEGantt, IDETreeNode } from '@ibiz/model-core';
|
|
|
2
2
|
import { IGanttNodeData } from '../../../interface';
|
|
3
3
|
import { TreeStaticNodeData } from '../tree-node-data';
|
|
4
4
|
export declare class GanttStaticNodeData extends TreeStaticNodeData implements IGanttNodeData {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
_snDataItemValue: string;
|
|
6
|
+
_beginDataItemValue: string;
|
|
7
|
+
_endDataItemValue: string;
|
|
8
|
+
_prevDataItemValue: string | number;
|
|
9
|
+
_finishDataItemValue: string | number;
|
|
10
|
+
_totalDataItemValue: string | number;
|
|
11
11
|
_children?: IGanttNodeData[] | undefined;
|
|
12
12
|
_parent?: IGanttNodeData;
|
|
13
13
|
constructor(model: IDEGantt, nodeModel: IDETreeNode, parentNodeData: IGanttNodeData | undefined, opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gantt-static-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-static-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,qBAAa,mBACX,SAAQ,kBACR,YAAW,cAAc;IAEzB,
|
|
1
|
+
{"version":3,"file":"gantt-static-node-data.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-static-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,qBAAa,mBACX,SAAQ,kBACR,YAAW,cAAc;IAEzB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,mBAAmB,EAAE,MAAM,CAAC;IAE5B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;IAErC,SAAS,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAEzC,OAAO,CAAC,EAAE,cAAc,CAAC;gBAGvB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,WAAW,EACtB,cAAc,EAAE,cAAc,GAAG,SAAS,EAC1C,IAAI,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE;CAyBrD"}
|
|
@@ -3,11 +3,11 @@ import { calcDataItemValue } from './gantt-node-data-util';
|
|
|
3
3
|
export class GanttStaticNodeData extends TreeStaticNodeData {
|
|
4
4
|
constructor(model, nodeModel, parentNodeData, opts) {
|
|
5
5
|
super(nodeModel, parentNodeData, opts);
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
6
|
+
this._snDataItemValue = calcDataItemValue(model.sndataItemName, nodeModel);
|
|
7
|
+
this._beginDataItemValue = calcDataItemValue(model.beginDataItemName, nodeModel);
|
|
8
|
+
this._endDataItemValue = calcDataItemValue(model.endDataItemName, nodeModel);
|
|
9
|
+
this._prevDataItemValue = calcDataItemValue(model.prevDataItemName, nodeModel);
|
|
10
|
+
this._finishDataItemValue = calcDataItemValue(model.finishDataItemName, nodeModel);
|
|
11
|
+
this._totalDataItemValue = calcDataItemValue(model.totalDataItemName, nodeModel);
|
|
12
12
|
}
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.5.1
|
|
3
|
+
"version": "0.5.1",
|
|
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.5.1-
|
|
33
|
-
"@ibiz/model-core": "^0.1.
|
|
32
|
+
"@ibiz-template/core": "^0.5.1-next.0",
|
|
33
|
+
"@ibiz/model-core": "^0.1.2",
|
|
34
34
|
"@types/path-browserify": "^1.0.2",
|
|
35
35
|
"@types/qs": "^6.9.11",
|
|
36
36
|
"@types/systemjs": "^6.13.5",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
50
|
-
"@ibiz/model-core": "^0.1.
|
|
50
|
+
"@ibiz/model-core": "^0.1.2",
|
|
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": "f442a5daebbca26f24b167d8afa470d8fd2ff8b8"
|
|
63
63
|
}
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
IExportColumn,
|
|
35
35
|
IColumnState,
|
|
36
36
|
ISearchGroupData,
|
|
37
|
+
IStorageColumnStates,
|
|
37
38
|
} from '../../../../interface';
|
|
38
39
|
import { calcDeCodeNameById } from '../../../../model';
|
|
39
40
|
import { getGridColumnProvider } from '../../../../register';
|
|
@@ -697,20 +698,40 @@ export class GridController<
|
|
|
697
698
|
* @return {*} {Promise<void>}
|
|
698
699
|
*/
|
|
699
700
|
protected initColumnStates(): void {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
if (column.columnType !== 'GROUPGRIDCOLUMN') {
|
|
704
|
-
this.state.columnStates.push({
|
|
705
|
-
key: column.codeName!,
|
|
706
|
-
caption: column.caption!,
|
|
707
|
-
hidden: !!column.hideDefault,
|
|
708
|
-
uaColumn: column.columnType === 'UAGRIDCOLUMN',
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
{ childrenFields: ['degridColumns'] },
|
|
701
|
+
this.state.columnStates = [];
|
|
702
|
+
const storageColumnStatesStr = localStorage.getItem(
|
|
703
|
+
`${this.view.model.id}.${this.model.name}.columnStates`,
|
|
713
704
|
);
|
|
705
|
+
// 有本地缓存从缓存里拿,拿完如果还是空数组再走模型
|
|
706
|
+
if (storageColumnStatesStr) {
|
|
707
|
+
const storageColumnStates: IStorageColumnStates = JSON.parse(
|
|
708
|
+
storageColumnStatesStr,
|
|
709
|
+
);
|
|
710
|
+
if (this.addSchemaColumn && storageColumnStates.schemaColumnStates) {
|
|
711
|
+
this.state.columnStates = storageColumnStates.schemaColumnStates;
|
|
712
|
+
} else if (
|
|
713
|
+
!this.addSchemaColumn &&
|
|
714
|
+
storageColumnStates.defaultColumnStates
|
|
715
|
+
) {
|
|
716
|
+
this.state.columnStates = storageColumnStates.defaultColumnStates;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (this.state.columnStates.length === 0) {
|
|
720
|
+
recursiveIterate(
|
|
721
|
+
this.model,
|
|
722
|
+
(column: IDEGridColumn) => {
|
|
723
|
+
if (column.columnType !== 'GROUPGRIDCOLUMN') {
|
|
724
|
+
this.state.columnStates.push({
|
|
725
|
+
key: column.codeName!,
|
|
726
|
+
caption: column.caption!,
|
|
727
|
+
hidden: !!column.hideDefault,
|
|
728
|
+
uaColumn: column.columnType === 'UAGRIDCOLUMN',
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
{ childrenFields: ['degridColumns'] },
|
|
733
|
+
);
|
|
734
|
+
}
|
|
714
735
|
this.calcColumnFixed();
|
|
715
736
|
}
|
|
716
737
|
|
|
@@ -1281,6 +1302,7 @@ export class GridController<
|
|
|
1281
1302
|
*/
|
|
1282
1303
|
setColumnVisible(columnState: IColumnState): void {
|
|
1283
1304
|
columnState.hidden = !columnState.hidden;
|
|
1305
|
+
this.saveColumnStates();
|
|
1284
1306
|
}
|
|
1285
1307
|
|
|
1286
1308
|
/**
|
|
@@ -1299,8 +1321,56 @@ export class GridController<
|
|
|
1299
1321
|
if (data.columnstates) {
|
|
1300
1322
|
this.state.columnStates = data.columnstates;
|
|
1301
1323
|
} else {
|
|
1302
|
-
this.state.columnStates = [];
|
|
1303
1324
|
this.initColumnStates();
|
|
1304
1325
|
}
|
|
1305
1326
|
}
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* 改变列排序
|
|
1330
|
+
* @return {*}
|
|
1331
|
+
* @author: zhujiamin
|
|
1332
|
+
* @Date: 2024-01-05 11:21:07
|
|
1333
|
+
*/
|
|
1334
|
+
changeColumnStateSort(
|
|
1335
|
+
columnKey: string,
|
|
1336
|
+
newIndex: number,
|
|
1337
|
+
oldIndex: number,
|
|
1338
|
+
): void {
|
|
1339
|
+
const columnState = this.state.columnStates.find(
|
|
1340
|
+
item => item.key === columnKey,
|
|
1341
|
+
);
|
|
1342
|
+
if (columnState) {
|
|
1343
|
+
// 移除元素从旧位置,将元素插入到新位置
|
|
1344
|
+
this.state.columnStates.splice(oldIndex, 1);
|
|
1345
|
+
this.state.columnStates.splice(newIndex, 0, columnState);
|
|
1346
|
+
// 存本地缓存
|
|
1347
|
+
this.saveColumnStates();
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* 存储列状态到本地
|
|
1353
|
+
* @return {*}
|
|
1354
|
+
* @author: zhujiamin
|
|
1355
|
+
* @Date: 2024-01-05 13:45:36
|
|
1356
|
+
*/
|
|
1357
|
+
saveColumnStates(): void {
|
|
1358
|
+
let storageColumnStates: IStorageColumnStates = {};
|
|
1359
|
+
// 先判断是否缓存过,根据addSchemaColumn判断存到哪个属性上
|
|
1360
|
+
const storageColumnStatesStr = localStorage.getItem(
|
|
1361
|
+
`${this.view.model.id}.${this.model.name}.columnStates`,
|
|
1362
|
+
);
|
|
1363
|
+
if (storageColumnStatesStr) {
|
|
1364
|
+
storageColumnStates = JSON.parse(storageColumnStatesStr);
|
|
1365
|
+
}
|
|
1366
|
+
if (this.addSchemaColumn) {
|
|
1367
|
+
storageColumnStates.schemaColumnStates = this.state.columnStates;
|
|
1368
|
+
} else {
|
|
1369
|
+
storageColumnStates.defaultColumnStates = this.state.columnStates;
|
|
1370
|
+
}
|
|
1371
|
+
localStorage.setItem(
|
|
1372
|
+
`${this.view.model.id}.${this.model.name}.columnStates`,
|
|
1373
|
+
JSON.stringify(storageColumnStates),
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1306
1376
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { IEditor, ISearchBarFilter } from '@ibiz/model-core';
|
|
1
|
+
import { IDropDownList, IEditor, ISearchBarFilter } from '@ibiz/model-core';
|
|
2
2
|
import { ValueOP } from '../../../constant';
|
|
3
3
|
import { SearchBarController } from './search-bar.controller';
|
|
4
4
|
import { ExcludeOPs } from './search-bar-filter.controller';
|
|
5
5
|
|
|
6
|
+
type ISchemaField = {
|
|
7
|
+
type: string;
|
|
8
|
+
key: string;
|
|
9
|
+
description: string;
|
|
10
|
+
enumSource?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
6
13
|
const appId = '';
|
|
7
14
|
|
|
8
15
|
/** 数据类型映射操作符号 */
|
|
@@ -91,6 +98,21 @@ function initDefaultEditor(): void {
|
|
|
91
98
|
|
|
92
99
|
initDefaultEditor();
|
|
93
100
|
|
|
101
|
+
function getEditor(field: ISchemaField, op: string): IEditor {
|
|
102
|
+
if (field.enumSource) {
|
|
103
|
+
return {
|
|
104
|
+
appId,
|
|
105
|
+
editorType: 'DROPDOWNLIST',
|
|
106
|
+
singleSelect: true,
|
|
107
|
+
valueType: 'SIMPLE',
|
|
108
|
+
appCodeListId: field.enumSource,
|
|
109
|
+
id: `${field.key}_${op}`,
|
|
110
|
+
} as IDropDownList;
|
|
111
|
+
}
|
|
112
|
+
const editorModel = EditorsMap[`${field.type}_${op}`];
|
|
113
|
+
return editorModel;
|
|
114
|
+
}
|
|
115
|
+
|
|
94
116
|
/**
|
|
95
117
|
* 根据json模型计算出过滤项模型
|
|
96
118
|
* @author lxm
|
|
@@ -100,10 +122,10 @@ initDefaultEditor();
|
|
|
100
122
|
* @param {SearchBarController} c
|
|
101
123
|
* @return {*} {ISearchBarFilter[]}
|
|
102
124
|
*/
|
|
103
|
-
export function calcFilterModelBySchema(
|
|
125
|
+
export async function calcFilterModelBySchema(
|
|
104
126
|
json: IData,
|
|
105
127
|
c: SearchBarController,
|
|
106
|
-
): ISearchBarFilter[] {
|
|
128
|
+
): Promise<ISearchBarFilter[]> {
|
|
107
129
|
if (!json.properties) {
|
|
108
130
|
return [];
|
|
109
131
|
}
|
|
@@ -112,11 +134,7 @@ export function calcFilterModelBySchema(
|
|
|
112
134
|
return [];
|
|
113
135
|
}
|
|
114
136
|
|
|
115
|
-
const addFields:
|
|
116
|
-
key: string;
|
|
117
|
-
description: string;
|
|
118
|
-
type: string;
|
|
119
|
-
}[] = [];
|
|
137
|
+
const addFields: ISchemaField[] = [];
|
|
120
138
|
|
|
121
139
|
Object.keys(properties).forEach((key: string) => {
|
|
122
140
|
let type: string;
|
|
@@ -141,12 +159,17 @@ export function calcFilterModelBySchema(
|
|
|
141
159
|
key,
|
|
142
160
|
description: properties[key].description,
|
|
143
161
|
type,
|
|
162
|
+
enumSource: properties[key].enumSource,
|
|
144
163
|
});
|
|
145
164
|
});
|
|
146
165
|
|
|
147
166
|
// 属性codeName对应的属性id
|
|
148
167
|
const codeNameToId: { [p: string]: string } = {};
|
|
149
|
-
|
|
168
|
+
const dataEntity = await ibiz.hub.getAppDataEntity(
|
|
169
|
+
c.model.appDataEntityId!,
|
|
170
|
+
c.model.appId,
|
|
171
|
+
);
|
|
172
|
+
dataEntity.appDEFields?.forEach(field => {
|
|
150
173
|
codeNameToId[field.codeName!.toLowerCase()] = field.id!;
|
|
151
174
|
});
|
|
152
175
|
|
|
@@ -159,18 +182,18 @@ export function calcFilterModelBySchema(
|
|
|
159
182
|
return;
|
|
160
183
|
}
|
|
161
184
|
ops.forEach(op => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
appId,
|
|
165
|
-
appDEFieldId: codeNameToId[item.key],
|
|
166
|
-
id: item.key,
|
|
167
|
-
caption: item.description,
|
|
168
|
-
defsearchMode: {
|
|
185
|
+
if (item)
|
|
186
|
+
addSearchBarFilters.push({
|
|
169
187
|
appId,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
appDEFieldId: codeNameToId[item.key],
|
|
189
|
+
id: item.key,
|
|
190
|
+
caption: item.description,
|
|
191
|
+
defsearchMode: {
|
|
192
|
+
appId,
|
|
193
|
+
valueOP: op,
|
|
194
|
+
},
|
|
195
|
+
editor: getEditor(item, op),
|
|
196
|
+
});
|
|
174
197
|
});
|
|
175
198
|
});
|
|
176
199
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recursiveIterate,
|
|
5
5
|
} from '@ibiz-template/core';
|
|
6
6
|
import { IAppDataEntity, ISearchBar, ISearchBarFilter } from '@ibiz/model-core';
|
|
7
|
-
import { isNil } from 'ramda';
|
|
7
|
+
import { clone, isNil } from 'ramda';
|
|
8
8
|
import {
|
|
9
9
|
ISearchBarState,
|
|
10
10
|
ISearchBarEvent,
|
|
@@ -79,7 +79,9 @@ export class SearchBarController
|
|
|
79
79
|
* @date 2023-12-29 04:15:34
|
|
80
80
|
* @type {boolean}
|
|
81
81
|
*/
|
|
82
|
-
enableFilter: boolean
|
|
82
|
+
get enableFilter(): boolean {
|
|
83
|
+
return this.model.enableFilter === true;
|
|
84
|
+
}
|
|
83
85
|
|
|
84
86
|
/**
|
|
85
87
|
* 最终使用的searchBarFilters
|
|
@@ -87,7 +89,16 @@ export class SearchBarController
|
|
|
87
89
|
* @date 2023-12-29 06:55:13
|
|
88
90
|
* @type {ISearchBarFilter[]}
|
|
89
91
|
*/
|
|
90
|
-
searchBarFilters
|
|
92
|
+
get searchBarFilters(): ISearchBarFilter[] {
|
|
93
|
+
return this.model.searchBarFilters || [];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 是否启用根据实体的JSON Schema生成过滤项
|
|
98
|
+
* @author lxm
|
|
99
|
+
* @date 2024-01-05 10:10:37
|
|
100
|
+
*/
|
|
101
|
+
addSchemaFilters = false;
|
|
91
102
|
|
|
92
103
|
/**
|
|
93
104
|
* 表格控制器
|
|
@@ -113,16 +124,6 @@ export class SearchBarController
|
|
|
113
124
|
this.state.selectedGroupItem = null;
|
|
114
125
|
this.state.searchBarGroups = [];
|
|
115
126
|
this.state.selectedSearchGroupItem = null;
|
|
116
|
-
this.initFilterState();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 初始化Filter相关的属性
|
|
121
|
-
* @author lxm
|
|
122
|
-
* @date 2023-12-29 04:18:02
|
|
123
|
-
* @protected
|
|
124
|
-
*/
|
|
125
|
-
protected initFilterState(): void {
|
|
126
127
|
this.resetFilter();
|
|
127
128
|
this.state.visible = !!(
|
|
128
129
|
this.model.enableQuickSearch ||
|
|
@@ -132,6 +133,8 @@ export class SearchBarController
|
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
protected async onCreated(): Promise<void> {
|
|
136
|
+
await this.initByEntitySchema();
|
|
137
|
+
|
|
135
138
|
await super.onCreated();
|
|
136
139
|
|
|
137
140
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
@@ -149,7 +152,6 @@ export class SearchBarController
|
|
|
149
152
|
await this.service.init(this.context);
|
|
150
153
|
}
|
|
151
154
|
|
|
152
|
-
await this.initByEntitySchema();
|
|
153
155
|
await this.initSearchBarFilters();
|
|
154
156
|
await this.initSearBarGroups();
|
|
155
157
|
}
|
|
@@ -161,12 +163,17 @@ export class SearchBarController
|
|
|
161
163
|
* @return {*} {Promise<void>}
|
|
162
164
|
*/
|
|
163
165
|
async initByEntitySchema(): Promise<void> {
|
|
164
|
-
this.
|
|
165
|
-
|
|
166
|
+
if (!this.addSchemaFilters) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const json = await getEntitySchema(
|
|
170
|
+
this.model.appDataEntityId!,
|
|
171
|
+
this.context,
|
|
172
|
+
);
|
|
166
173
|
if (!json) {
|
|
167
174
|
return;
|
|
168
175
|
}
|
|
169
|
-
const addSearchBarFilters = calcFilterModelBySchema(json, this);
|
|
176
|
+
const addSearchBarFilters = await calcFilterModelBySchema(json, this);
|
|
170
177
|
|
|
171
178
|
const mergeFilters: ISearchBarFilter[] = [];
|
|
172
179
|
this.model.searchBarFilters?.forEach(filter => {
|
|
@@ -182,9 +189,13 @@ export class SearchBarController
|
|
|
182
189
|
}
|
|
183
190
|
});
|
|
184
191
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
192
|
+
// 如果有根据json计算出的过滤项,则要重置相关state参数
|
|
193
|
+
if (addSearchBarFilters.length > 0) {
|
|
194
|
+
// 修改模型之前拷贝一份,避免污染原始数据
|
|
195
|
+
(this as IData).model = clone(this.model);
|
|
196
|
+
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
197
|
+
this.model.enableFilter = true;
|
|
198
|
+
}
|
|
188
199
|
}
|
|
189
200
|
|
|
190
201
|
/**
|
|
@@ -311,7 +322,7 @@ export class SearchBarController
|
|
|
311
322
|
* @return {*} {IData}
|
|
312
323
|
*/
|
|
313
324
|
calcFilters(): IData[] | undefined {
|
|
314
|
-
if (!this.
|
|
325
|
+
if (!this.enableFilter) {
|
|
315
326
|
return;
|
|
316
327
|
}
|
|
317
328
|
let hasFilter = false; // 是否有过滤项
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IDETreeDEFColumn,
|
|
4
|
+
IDETreeNode,
|
|
5
|
+
IDETreeNodeDataItem,
|
|
6
|
+
} from '@ibiz/model-core';
|
|
3
7
|
import { TreeGridExColumnController } from '../tree-grid-ex-column/tree-grid-ex-column.controller';
|
|
8
|
+
import { ITreeGridExRowState } from '../../../../../interface';
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* 树表格(增强)属性列控制器
|
|
@@ -10,4 +15,32 @@ import { TreeGridExColumnController } from '../tree-grid-ex-column/tree-grid-ex-
|
|
|
10
15
|
* @class TreeGridExFieldColumnController
|
|
11
16
|
* @extends {TreeGridExColumnController<IDETreeDEFColumn>}
|
|
12
17
|
*/
|
|
13
|
-
export class TreeGridExFieldColumnController extends TreeGridExColumnController<IDETreeDEFColumn> {
|
|
18
|
+
export class TreeGridExFieldColumnController extends TreeGridExColumnController<IDETreeDEFColumn> {
|
|
19
|
+
/**
|
|
20
|
+
* 给rowController初始化属性列的状态
|
|
21
|
+
*
|
|
22
|
+
* @author zpc
|
|
23
|
+
* @date 2024-01-07 21:09:43
|
|
24
|
+
* @param {ITreeGridExRowState} row
|
|
25
|
+
*/
|
|
26
|
+
initColumnStates(row: ITreeGridExRowState): void {
|
|
27
|
+
const { data } = row;
|
|
28
|
+
if (!this.model.id || !data._deData) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { detreeNodeDataItems } = this.treeGrid.getNodeModel(
|
|
33
|
+
data._nodeId,
|
|
34
|
+
) as IDETreeNode;
|
|
35
|
+
const targetTreeNodeDataItem = detreeNodeDataItems?.find(
|
|
36
|
+
(treeNodeDataItem: IDETreeNodeDataItem) => {
|
|
37
|
+
return treeNodeDataItem.detreeColumnId === this.model.id;
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
if (targetTreeNodeDataItem && targetTreeNodeDataItem.appDEFieldId) {
|
|
41
|
+
(data as IData)[this.model.id.toLowerCase()] = (data._deData as IData)[
|
|
42
|
+
targetTreeNodeDataItem.appDEFieldId.toLowerCase()
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -28,7 +28,10 @@ export class TreeGridExRowState implements ITreeGridExRowState {
|
|
|
28
28
|
|
|
29
29
|
constructor(data: ITreeNodeData, treeGrid: TreeGridExController) {
|
|
30
30
|
this.data = data;
|
|
31
|
-
|
|
31
|
+
// 初始化属性列数据状态
|
|
32
|
+
Object.values(treeGrid.fieldColumns).forEach(column => {
|
|
33
|
+
column.initColumnStates(this);
|
|
34
|
+
});
|
|
32
35
|
// 初始化操作列状态
|
|
33
36
|
Object.values(treeGrid.uaColumns).forEach(column => {
|
|
34
37
|
column.initActionStates(this);
|
|
@@ -54,7 +54,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
54
54
|
* @date 2023-12-11 17:12:39
|
|
55
55
|
* @type {string}
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
_snDataItemValue: string;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* 开始时间
|
|
@@ -63,7 +63,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
63
63
|
* @date 2023-12-11 17:12:12
|
|
64
64
|
* @type {string}
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
_beginDataItemValue: string;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* 结束时间
|
|
@@ -72,7 +72,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
72
72
|
* @date 2023-12-11 17:12:52
|
|
73
73
|
* @type {string}
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
_endDataItemValue: string;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* 前置数据
|
|
@@ -81,7 +81,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
81
81
|
* @date 2023-12-11 17:12:13
|
|
82
82
|
* @type {(string | number)}
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
_prevDataItemValue: string | number;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* 完成量数据
|
|
@@ -90,7 +90,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
90
90
|
* @date 2023-12-11 17:12:26
|
|
91
91
|
* @type {(string | number)}
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
_finishDataItemValue: string | number;
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* 总量数据项
|
|
@@ -99,7 +99,7 @@ export interface IGanttNodeData extends ITreeNodeData {
|
|
|
99
99
|
* @date 2023-12-11 17:12:43
|
|
100
100
|
* @type {(string | number)}
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
_totalDataItemValue: string | number;
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* 子数据
|
|
@@ -183,3 +183,27 @@ export interface IColumnState {
|
|
|
183
183
|
*/
|
|
184
184
|
fixed?: 'left' | 'right';
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 本地存储表格列状态对象
|
|
189
|
+
* @return {*}
|
|
190
|
+
* @author: zhujiamin
|
|
191
|
+
* @Date: 2024-01-05 11:38:38
|
|
192
|
+
*/
|
|
193
|
+
export interface IStorageColumnStates {
|
|
194
|
+
/**
|
|
195
|
+
* 开启jsonschema下的表格列状态
|
|
196
|
+
* @return {*}
|
|
197
|
+
* @author: zhujiamin
|
|
198
|
+
* @Date: 2024-01-05 11:39:22
|
|
199
|
+
*/
|
|
200
|
+
schemaColumnStates?: IColumnState[];
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 默认表格列状态
|
|
204
|
+
* @return {*}
|
|
205
|
+
* @author: zhujiamin
|
|
206
|
+
* @Date: 2024-01-05 11:39:22
|
|
207
|
+
*/
|
|
208
|
+
defaultColumnStates?: IColumnState[];
|
|
209
|
+
}
|
|
@@ -7,17 +7,17 @@ export class GanttCodeListNodeData
|
|
|
7
7
|
extends TreeCodeListNodeData
|
|
8
8
|
implements IGanttNodeData
|
|
9
9
|
{
|
|
10
|
-
|
|
10
|
+
_snDataItemValue: string;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
_beginDataItemValue: string;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
_endDataItemValue: string;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
_prevDataItemValue: string | number;
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
_finishDataItemValue: string | number;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
_totalDataItemValue: string | number;
|
|
21
21
|
|
|
22
22
|
_children?: IGanttNodeData[] | undefined;
|
|
23
23
|
|
|
@@ -36,32 +36,32 @@ export class GanttCodeListNodeData
|
|
|
36
36
|
) {
|
|
37
37
|
super(nodeModel, parentNodeData, opts);
|
|
38
38
|
const { data } = opts;
|
|
39
|
-
this.
|
|
39
|
+
this._snDataItemValue = calcDataItemValue(
|
|
40
40
|
model.sndataItemName,
|
|
41
41
|
nodeModel,
|
|
42
42
|
data,
|
|
43
43
|
);
|
|
44
|
-
this.
|
|
44
|
+
this._beginDataItemValue = calcDataItemValue(
|
|
45
45
|
model.beginDataItemName,
|
|
46
46
|
nodeModel,
|
|
47
47
|
data,
|
|
48
48
|
);
|
|
49
|
-
this.
|
|
49
|
+
this._endDataItemValue = calcDataItemValue(
|
|
50
50
|
model.endDataItemName,
|
|
51
51
|
nodeModel,
|
|
52
52
|
data,
|
|
53
53
|
);
|
|
54
|
-
this.
|
|
54
|
+
this._prevDataItemValue = calcDataItemValue(
|
|
55
55
|
model.prevDataItemName,
|
|
56
56
|
nodeModel,
|
|
57
57
|
data,
|
|
58
58
|
);
|
|
59
|
-
this.
|
|
59
|
+
this._finishDataItemValue = calcDataItemValue(
|
|
60
60
|
model.finishDataItemName,
|
|
61
61
|
nodeModel,
|
|
62
62
|
data,
|
|
63
63
|
);
|
|
64
|
-
this.
|
|
64
|
+
this._totalDataItemValue = calcDataItemValue(
|
|
65
65
|
model.totalDataItemName,
|
|
66
66
|
nodeModel,
|
|
67
67
|
data,
|