@ibiz-template/runtime 0.7.31-alpha.1 → 0.7.34
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 +447 -63
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/chart/chart.controller.d.ts.map +1 -1
- package/out/controller/control/chart/chart.controller.js +25 -2
- package/out/controller/control/chart/generator/base-series-generator.d.ts.map +1 -1
- package/out/controller/control/chart/generator/base-series-generator.js +20 -13
- package/out/controller/control/chart/generator/chart-options-generator.d.ts +2 -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 +2 -1
- package/out/controller/control/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +0 -1
- package/out/controller/control/dashboard/portlet/chart-portlet/chart-portlet.controller.d.ts +5 -4
- package/out/controller/control/dashboard/portlet/chart-portlet/chart-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/chart-portlet/chart-portlet.controller.js +5 -4
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts +5 -4
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.js +5 -4
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts +5 -4
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.js +5 -4
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.d.ts +3 -2
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/report-portlet/report-portlet.controller.js +11 -3
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.d.ts +4 -4
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.js +4 -4
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +6 -8
- package/out/controller/control/search-bar/search-bar.controller.d.ts +16 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +31 -0
- 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/controller/controller/control/i-control.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-dashboard.controller.d.ts +10 -1
- package/out/interface/controller/controller/control/i-dashboard.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/portlet/i-portlet.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/portlet/i-portlet.controller.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-dashboard.event.d.ts +19 -0
- package/out/interface/controller/event/control/i-dashboard.event.d.ts.map +1 -1
- package/out/interface/util/i-jsonschema-util/i-jsonschema-util.d.ts +35 -0
- package/out/interface/util/i-jsonschema-util/i-jsonschema-util.d.ts.map +1 -0
- package/out/interface/util/i-jsonschema-util/i-jsonschema-util.js +1 -0
- package/out/interface/util/index.d.ts +1 -0
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/locale/en/index.d.ts +0 -1
- package/out/locale/en/index.d.ts.map +1 -1
- package/out/locale/en/index.js +0 -1
- package/out/locale/zh-CN/index.d.ts +0 -1
- package/out/locale/zh-CN/index.d.ts.map +1 -1
- package/out/locale/zh-CN/index.js +0 -1
- package/out/service/de-service-util.d.ts +19 -0
- package/out/service/de-service-util.d.ts.map +1 -1
- package/out/service/de-service-util.js +42 -10
- package/out/service/vo/chart-data/chart-data.d.ts +2 -1
- package/out/service/vo/chart-data/chart-data.d.ts.map +1 -1
- package/out/service/vo/chart-data/chart-data.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/jsonschema-util/jsonschema-util.d.ts +108 -0
- package/out/utils/jsonschema-util/jsonschema-util.d.ts.map +1 -0
- package/out/utils/jsonschema-util/jsonschema-util.js +305 -0
- package/package.json +4 -3
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { ValueOP } from '../../constant';
|
|
4
|
+
export var DataType;
|
|
5
|
+
(function (DataType) {
|
|
6
|
+
/**
|
|
7
|
+
* 字符串
|
|
8
|
+
*/
|
|
9
|
+
DataType["STRING"] = "STRING";
|
|
10
|
+
/**
|
|
11
|
+
* 数字
|
|
12
|
+
*/
|
|
13
|
+
DataType["NUMBER"] = "NUMBER";
|
|
14
|
+
/**
|
|
15
|
+
* 日期
|
|
16
|
+
*/
|
|
17
|
+
DataType["DATE"] = "DATE";
|
|
18
|
+
/**
|
|
19
|
+
* 代码表
|
|
20
|
+
*/
|
|
21
|
+
DataType["CODELIST"] = "CODELIST";
|
|
22
|
+
/**
|
|
23
|
+
* 外键值
|
|
24
|
+
*/
|
|
25
|
+
DataType["FOREIGNKEY"] = "FOREIGNKEY";
|
|
26
|
+
/**
|
|
27
|
+
* 子数据
|
|
28
|
+
*/
|
|
29
|
+
DataType["CHILD"] = "CHILD";
|
|
30
|
+
})(DataType || (DataType = {}));
|
|
31
|
+
/**
|
|
32
|
+
* JsonSchema工具类
|
|
33
|
+
*
|
|
34
|
+
* @author tony001
|
|
35
|
+
* @date 2024-07-25 00:07:22
|
|
36
|
+
* @export
|
|
37
|
+
* @class JsonSchemaUtil
|
|
38
|
+
*/
|
|
39
|
+
export class JsonSchemaUtil {
|
|
40
|
+
constructor() {
|
|
41
|
+
/**
|
|
42
|
+
* 值操作数组
|
|
43
|
+
*
|
|
44
|
+
* @author tony001
|
|
45
|
+
* @date 2024-07-25 00:07:57
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
this.valueOPArray = [
|
|
49
|
+
{ valueOP: ValueOP.EQ, label: '等于', sqlOP: '=' },
|
|
50
|
+
{ valueOP: ValueOP.NOT_EQ, label: '不等于', sqlOP: '<>' },
|
|
51
|
+
{ valueOP: ValueOP.GT, label: '大于', sqlOP: '>' },
|
|
52
|
+
{ valueOP: ValueOP.GT_AND_EQ, label: '大于等于', sqlOP: '>=' },
|
|
53
|
+
{ valueOP: ValueOP.LT, label: '小于', sqlOP: '<' },
|
|
54
|
+
{ valueOP: ValueOP.LT_AND_EQ, label: '小于等于', sqlOP: '<=' },
|
|
55
|
+
{ valueOP: ValueOP.IS_NULL, label: '为空', sqlOP: 'IS NULL' },
|
|
56
|
+
{ valueOP: ValueOP.IS_NOT_NULL, label: '非空', sqlOP: 'IS NOT NULL' },
|
|
57
|
+
{ valueOP: ValueOP.IN, label: '属于', sqlOP: 'IN' },
|
|
58
|
+
{ valueOP: ValueOP.NOT_IN, label: '不属于', sqlOP: 'NOT IN' },
|
|
59
|
+
{ valueOP: ValueOP.LIKE, label: '文本包含', sqlOP: 'LIKE' },
|
|
60
|
+
{ valueOP: ValueOP.LIFT_LIKE, label: '文本左包含', sqlOP: '' },
|
|
61
|
+
{ valueOP: ValueOP.RIGHT_LIKE, label: '文本右包含', sqlOP: '' },
|
|
62
|
+
{ valueOP: ValueOP.EXISTS, label: '存在', sqlOP: '' },
|
|
63
|
+
{ valueOP: ValueOP.NOT_EXISTS, label: '不存在', sqlOP: '' },
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* 数据类型映射操作符
|
|
67
|
+
*
|
|
68
|
+
* @author tony001
|
|
69
|
+
* @date 2024-07-25 00:07:31
|
|
70
|
+
* @private
|
|
71
|
+
* @type {{
|
|
72
|
+
* [p: string]: ValueOP[];
|
|
73
|
+
* }}
|
|
74
|
+
*/
|
|
75
|
+
this.DataTypeToOPs = {
|
|
76
|
+
[DataType.STRING]: [
|
|
77
|
+
ValueOP.EQ,
|
|
78
|
+
ValueOP.NOT_EQ,
|
|
79
|
+
ValueOP.IS_NULL,
|
|
80
|
+
ValueOP.IS_NOT_NULL,
|
|
81
|
+
ValueOP.USER_LIKE,
|
|
82
|
+
ValueOP.LIKE,
|
|
83
|
+
ValueOP.LIFT_LIKE,
|
|
84
|
+
ValueOP.RIGHT_LIKE,
|
|
85
|
+
],
|
|
86
|
+
[DataType.NUMBER]: [
|
|
87
|
+
ValueOP.EQ,
|
|
88
|
+
ValueOP.GT,
|
|
89
|
+
ValueOP.GT_AND_EQ,
|
|
90
|
+
ValueOP.LT,
|
|
91
|
+
ValueOP.LT_AND_EQ,
|
|
92
|
+
ValueOP.NOT_EQ,
|
|
93
|
+
ValueOP.IS_NULL,
|
|
94
|
+
ValueOP.IS_NOT_NULL,
|
|
95
|
+
ValueOP.IN,
|
|
96
|
+
ValueOP.NOT_IN,
|
|
97
|
+
],
|
|
98
|
+
[DataType.DATE]: [
|
|
99
|
+
ValueOP.EQ,
|
|
100
|
+
ValueOP.GT,
|
|
101
|
+
ValueOP.GT_AND_EQ,
|
|
102
|
+
ValueOP.LT,
|
|
103
|
+
ValueOP.LT_AND_EQ,
|
|
104
|
+
ValueOP.NOT_EQ,
|
|
105
|
+
ValueOP.IS_NULL,
|
|
106
|
+
ValueOP.IS_NOT_NULL,
|
|
107
|
+
ValueOP.IN,
|
|
108
|
+
ValueOP.NOT_IN,
|
|
109
|
+
],
|
|
110
|
+
[DataType.CODELIST]: [
|
|
111
|
+
ValueOP.EQ,
|
|
112
|
+
ValueOP.NOT_EQ,
|
|
113
|
+
ValueOP.IS_NULL,
|
|
114
|
+
ValueOP.IS_NOT_NULL,
|
|
115
|
+
ValueOP.IN,
|
|
116
|
+
ValueOP.NOT_IN,
|
|
117
|
+
],
|
|
118
|
+
[DataType.FOREIGNKEY]: [
|
|
119
|
+
ValueOP.EQ,
|
|
120
|
+
ValueOP.NOT_EQ,
|
|
121
|
+
ValueOP.IS_NULL,
|
|
122
|
+
ValueOP.IS_NOT_NULL,
|
|
123
|
+
ValueOP.IN,
|
|
124
|
+
ValueOP.NOT_IN,
|
|
125
|
+
],
|
|
126
|
+
[DataType.CHILD]: [ValueOP.EXISTS, ValueOP.NOT_EXISTS],
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* 排除操作符
|
|
130
|
+
*
|
|
131
|
+
* @author tony001
|
|
132
|
+
* @date 2024-07-25 17:07:51
|
|
133
|
+
* @private
|
|
134
|
+
* @type {string[]}
|
|
135
|
+
*/
|
|
136
|
+
this.excludeOPs = [
|
|
137
|
+
ValueOP.IS_NULL,
|
|
138
|
+
ValueOP.IS_NOT_NULL,
|
|
139
|
+
ValueOP.EXISTS,
|
|
140
|
+
ValueOP.NOT_EXISTS,
|
|
141
|
+
];
|
|
142
|
+
/**
|
|
143
|
+
* 数据类型映射编辑器
|
|
144
|
+
*
|
|
145
|
+
* @author tony001
|
|
146
|
+
* @date 2024-07-25 00:07:07
|
|
147
|
+
* @private
|
|
148
|
+
* @type {({
|
|
149
|
+
* [p: string]: IData| undefined;
|
|
150
|
+
* })}
|
|
151
|
+
*/
|
|
152
|
+
this.DataTypeToEditor = {
|
|
153
|
+
[DataType.STRING]: {
|
|
154
|
+
appId: '',
|
|
155
|
+
editorType: 'TEXTBOX',
|
|
156
|
+
},
|
|
157
|
+
[DataType.NUMBER]: {
|
|
158
|
+
appId: '',
|
|
159
|
+
editorType: 'NUMBER',
|
|
160
|
+
},
|
|
161
|
+
[DataType.DATE]: {
|
|
162
|
+
appId: '',
|
|
163
|
+
editorType: 'DATEPICKEREX',
|
|
164
|
+
dateTimeFormat: 'YYYY-MM-DD',
|
|
165
|
+
},
|
|
166
|
+
[DataType.CODELIST]: {
|
|
167
|
+
appId: '',
|
|
168
|
+
valueType: 'SIMPLE',
|
|
169
|
+
editorType: 'MDROPDOWNLIST',
|
|
170
|
+
appCodeListId: '',
|
|
171
|
+
editorParams: {
|
|
172
|
+
overflowMode: 'ellipsis',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
[DataType.FOREIGNKEY]: {
|
|
176
|
+
appId: '',
|
|
177
|
+
editorType: 'ADDRESSPICKUP',
|
|
178
|
+
appDEDataSetId: 'fetchdefault',
|
|
179
|
+
objectIdField: 'srfkey',
|
|
180
|
+
objectNameField: 'srfmajortext',
|
|
181
|
+
valueType: 'OBJECTS',
|
|
182
|
+
editorParams: {
|
|
183
|
+
overflowMode: 'ellipsis',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
[DataType.CHILD]: undefined,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 获取jsonschema属性数据
|
|
191
|
+
*
|
|
192
|
+
* @author tony001
|
|
193
|
+
* @date 2024-07-25 00:07:49
|
|
194
|
+
* @param {string} entityId
|
|
195
|
+
* @param {IContext} context
|
|
196
|
+
* @param {IParams} [params={}]
|
|
197
|
+
* @return {*} {Promise<IData[]>}
|
|
198
|
+
*/
|
|
199
|
+
async getEntitySchemaFields(entityId, context, params = {}) {
|
|
200
|
+
var _a;
|
|
201
|
+
const result = [];
|
|
202
|
+
const strParams = qs.stringify(params);
|
|
203
|
+
const app = ibiz.hub.getApp(context.srfappid);
|
|
204
|
+
const entity = await ibiz.hub.getAppDataEntity(entityId, context.srfappid);
|
|
205
|
+
let url = `/jsonschema/${entity.name}`;
|
|
206
|
+
if (entity.dynaSysMode === 0 && ibiz.appData) {
|
|
207
|
+
url += `?dynamodeltag=${ibiz.appData.dynamodeltag}${strParams ? `&${strParams}` : ''}`;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
url += `${strParams ? `?${strParams}` : ''}`;
|
|
211
|
+
}
|
|
212
|
+
const res = await app.net.get(url);
|
|
213
|
+
const { data } = res;
|
|
214
|
+
if (!data.properties) {
|
|
215
|
+
return result;
|
|
216
|
+
}
|
|
217
|
+
const { properties } = data;
|
|
218
|
+
if (!(Object.keys(properties).length > 0)) {
|
|
219
|
+
return result;
|
|
220
|
+
}
|
|
221
|
+
for (let i = 0; i < Object.keys(properties).length; i++) {
|
|
222
|
+
const key = Object.keys(properties)[i];
|
|
223
|
+
const item = properties[key];
|
|
224
|
+
let type = DataType.STRING;
|
|
225
|
+
const originalType = item.type;
|
|
226
|
+
// 子数据类型属性和扩展属性暂忽略
|
|
227
|
+
if (originalType === 'array' || item.extension) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
switch (originalType) {
|
|
231
|
+
case 'string':
|
|
232
|
+
if (item.$ref) {
|
|
233
|
+
type = DataType.FOREIGNKEY;
|
|
234
|
+
}
|
|
235
|
+
if (item.enumSource) {
|
|
236
|
+
type = DataType.CODELIST;
|
|
237
|
+
}
|
|
238
|
+
if (item.format === 'date-time') {
|
|
239
|
+
type = DataType.DATE;
|
|
240
|
+
}
|
|
241
|
+
break;
|
|
242
|
+
case 'integer':
|
|
243
|
+
case 'number':
|
|
244
|
+
type = DataType.NUMBER;
|
|
245
|
+
if (item.enumSource) {
|
|
246
|
+
type = DataType.CODELIST;
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
default:
|
|
250
|
+
if (item.$ref) {
|
|
251
|
+
type = DataType.FOREIGNKEY;
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
result.push({
|
|
256
|
+
type,
|
|
257
|
+
originalType,
|
|
258
|
+
appDEFieldId: key,
|
|
259
|
+
caption: item.description,
|
|
260
|
+
appCodeListId: item.enumSource,
|
|
261
|
+
appDataEntityId: (_a = item.$ref) === null || _a === void 0 ? void 0 : _a.split('.')[0],
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return result;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* 通过数据类型获取可使用操作标识集合
|
|
268
|
+
*
|
|
269
|
+
* @author tony001
|
|
270
|
+
* @date 2024-07-25 16:07:24
|
|
271
|
+
* @param {string} dataType
|
|
272
|
+
* @return {*} {IData[]}
|
|
273
|
+
*/
|
|
274
|
+
getValueOPsByDataType(dataType) {
|
|
275
|
+
let result = [];
|
|
276
|
+
result = this.valueOPArray.filter(mode => this.DataTypeToOPs[dataType].includes(mode.valueOP));
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* 获取仿真编辑器
|
|
281
|
+
*
|
|
282
|
+
* @author tony001
|
|
283
|
+
* @date 2024-07-25 17:07:11
|
|
284
|
+
* @param {IContext} context
|
|
285
|
+
* @param {IData} item
|
|
286
|
+
* @return {*} {Promise<IData>}
|
|
287
|
+
*/
|
|
288
|
+
getMockEditor(context, item, valueOP) {
|
|
289
|
+
// 排除类型操作符无编辑器
|
|
290
|
+
if (valueOP && this.excludeOPs.includes(valueOP))
|
|
291
|
+
return;
|
|
292
|
+
const baseMockEditor = this.DataTypeToEditor[item.type];
|
|
293
|
+
if (!baseMockEditor)
|
|
294
|
+
return;
|
|
295
|
+
baseMockEditor.appId = context.srfappid;
|
|
296
|
+
if (item.type === DataType.CODELIST) {
|
|
297
|
+
baseMockEditor.appCodeListId = item.appCodeListId;
|
|
298
|
+
}
|
|
299
|
+
if (item.type === DataType.FOREIGNKEY) {
|
|
300
|
+
baseMockEditor.appDataEntityId = item.appDataEntityId;
|
|
301
|
+
}
|
|
302
|
+
// 后续特殊处理放这儿
|
|
303
|
+
return baseMockEditor;
|
|
304
|
+
}
|
|
305
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.34",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
28
28
|
"publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
|
|
29
29
|
"publish:beta": "npm run build && npm publish --access public --tag=beta --registry=https://registry.npmjs.org/",
|
|
30
|
-
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
30
|
+
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/",
|
|
31
|
+
"publish:local": "npm run build && npm publish --access public --registry=http://172.16.240.221:8081/repository/local/"
|
|
31
32
|
},
|
|
32
33
|
"author": "chitanda",
|
|
33
34
|
"license": "MIT",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"animejs": "^3.2.2"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@ibiz-template/core": "^0.7.
|
|
39
|
+
"@ibiz-template/core": "^0.7.32",
|
|
39
40
|
"@ibiz/model-core": "^0.1.46",
|
|
40
41
|
"@types/animejs": "^3.1.12",
|
|
41
42
|
"@types/path-browserify": "^1.0.2",
|