@ticatec/uniface-flexi-module 0.0.10 → 0.0.11
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.
|
@@ -79,6 +79,7 @@ export interface FlexiDataTableSchema {
|
|
|
79
79
|
indicatorColumn: IndicatorColumnSchema;
|
|
80
80
|
actionsColumn?: ActionsColumnSchema;
|
|
81
81
|
columns: Array<FlexiDataTableColumnSchema>;
|
|
82
|
+
dicts?: Array<string>;
|
|
82
83
|
}
|
|
83
84
|
export default class FlexiDataTable {
|
|
84
85
|
#private;
|
|
@@ -86,8 +87,20 @@ export default class FlexiDataTable {
|
|
|
86
87
|
readonly indicatorColumn: IndicatorColumn;
|
|
87
88
|
constructor(schema: FlexiDataTableSchema);
|
|
88
89
|
initialize(): Promise<void>;
|
|
90
|
+
protected set actionsColumn(value: ActionsColumn);
|
|
89
91
|
get actionsColumn(): ActionsColumn | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* 设置数据列
|
|
94
|
+
* @param value
|
|
95
|
+
* @protected
|
|
96
|
+
*/
|
|
97
|
+
protected set columns(value: Array<DataColumn>);
|
|
90
98
|
get columns(): Array<DataColumn>;
|
|
99
|
+
/**
|
|
100
|
+
* 获取字典数据项
|
|
101
|
+
* @param key
|
|
102
|
+
*/
|
|
103
|
+
protected getDictionary(key: string): Array<any>;
|
|
91
104
|
/**
|
|
92
105
|
* 获取数据字典值
|
|
93
106
|
* @param dict
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import utils from "../flexi-form/lib/utils";
|
|
2
|
+
import FlexiContext from "..";
|
|
2
3
|
export default class FlexiDataTable {
|
|
3
4
|
#columns = [];
|
|
4
5
|
round;
|
|
5
6
|
indicatorColumn;
|
|
6
7
|
#actionsColumn;
|
|
7
8
|
#schema;
|
|
9
|
+
#dictionaries;
|
|
8
10
|
constructor(schema) {
|
|
9
11
|
this.#schema = schema;
|
|
10
12
|
this.round = schema.round;
|
|
11
13
|
this.indicatorColumn = { displayNo: true, ...schema.indicatorColumn };
|
|
12
14
|
}
|
|
13
15
|
async initialize() {
|
|
16
|
+
if (this.#schema.dicts && this.#schema.dicts.length > 0) {
|
|
17
|
+
this.#dictionaries = FlexiContext.getInstance().loadDictionaries(this.#schema.dicts);
|
|
18
|
+
}
|
|
14
19
|
if (this.#schema.actionsColumn) {
|
|
15
20
|
const getActions = this[this.#schema.actionsColumn.getActions];
|
|
16
21
|
if (getActions) {
|
|
@@ -28,7 +33,6 @@ export default class FlexiDataTable {
|
|
|
28
33
|
const hint = schema.hint ? this[schema.hint] : null;
|
|
29
34
|
const render = schema.render ? this[schema.render] : null;
|
|
30
35
|
const compareFunction = schema.compareFunction ? this[schema.compareFunction] : null;
|
|
31
|
-
console.log(formatter, href, hint, render, compareFunction);
|
|
32
36
|
const column = {
|
|
33
37
|
text: schema.text,
|
|
34
38
|
field: schema.field,
|
|
@@ -49,12 +53,30 @@ export default class FlexiDataTable {
|
|
|
49
53
|
this.#columns.push(column);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
56
|
+
set actionsColumn(value) {
|
|
57
|
+
this.#actionsColumn = value;
|
|
58
|
+
}
|
|
52
59
|
get actionsColumn() {
|
|
53
60
|
return this.#actionsColumn;
|
|
54
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 设置数据列
|
|
64
|
+
* @param value
|
|
65
|
+
* @protected
|
|
66
|
+
*/
|
|
67
|
+
set columns(value) {
|
|
68
|
+
this.#columns = value;
|
|
69
|
+
}
|
|
55
70
|
get columns() {
|
|
56
71
|
return this.#columns;
|
|
57
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* 获取字典数据项
|
|
75
|
+
* @param key
|
|
76
|
+
*/
|
|
77
|
+
getDictionary(key) {
|
|
78
|
+
return this.#dictionaries[key];
|
|
79
|
+
}
|
|
58
80
|
/**
|
|
59
81
|
* 获取数据字典值
|
|
60
82
|
* @param dict
|
package/package.json
CHANGED