@ibiz-template/runtime 0.7.5 → 0.7.6
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 +484 -57
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts +1 -9
- package/out/application.d.ts.map +1 -1
- package/out/application.js +1 -2
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +1 -1
- package/out/controller/control/dashboard/custom-dashboard.controller.d.ts +80 -6
- package/out/controller/control/dashboard/custom-dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/custom-dashboard.controller.js +109 -14
- package/out/controller/control/dashboard/dashboard.controller.d.ts +8 -0
- package/out/controller/control/dashboard/dashboard.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/dashboard.controller.js +17 -0
- package/out/controller/control/dashboard/portlet/chart-portlet/chart-portlet.controller.d.ts +7 -0
- 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 +11 -0
- package/out/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.d.ts +7 -0
- 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 +11 -0
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts +31 -2
- 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 +62 -15
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.state.d.ts +15 -0
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.state.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.d.ts +7 -0
- 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 +12 -0
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +2 -1
- 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 +34 -0
- package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
- package/out/controller/control/tree/tree.controller.js +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts +18 -0
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.js +70 -1
- package/out/interface/common/i-app-service/i-app-service.d.ts +1 -9
- package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
- package/out/interface/controller/controller/control/portlet/i-portlet.controller.d.ts +14 -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 +15 -1
- package/out/interface/controller/event/control/i-dashboard.event.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-wizard-panel.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-wizard-panel.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/portlet/i-portlet.state.d.ts +15 -0
- package/out/interface/controller/state/control/portlet/i-portlet.state.d.ts.map +1 -1
- package/out/service/service/util/util.service.d.ts +55 -5
- package/out/service/service/util/util.service.d.ts.map +1 -1
- package/out/service/service/util/util.service.js +108 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -12432,11 +12432,62 @@ var UtilService = class {
|
|
|
12432
12432
|
/**
|
|
12433
12433
|
* Creates an instance of UtilService.
|
|
12434
12434
|
* @author tony001
|
|
12435
|
-
* @date 2024-04-
|
|
12436
|
-
* @param {
|
|
12435
|
+
* @date 2024-04-24 14:04:41
|
|
12436
|
+
* @param {IAppUtil} appUtil
|
|
12437
12437
|
*/
|
|
12438
|
-
constructor(
|
|
12439
|
-
this.
|
|
12438
|
+
constructor(appUtil) {
|
|
12439
|
+
this.appUtil = appUtil;
|
|
12440
|
+
/**
|
|
12441
|
+
* 存储实体模型
|
|
12442
|
+
*
|
|
12443
|
+
* @author tony001
|
|
12444
|
+
* @date 2024-04-24 15:04:36
|
|
12445
|
+
* @type {(IAppDataEntity | null)}
|
|
12446
|
+
*/
|
|
12447
|
+
this.stoageAppDataEntity = null;
|
|
12448
|
+
/**
|
|
12449
|
+
* 存储服务
|
|
12450
|
+
*
|
|
12451
|
+
* @author tony001
|
|
12452
|
+
* @date 2024-04-24 14:04:36
|
|
12453
|
+
* @type {(IAppDEService | null)}
|
|
12454
|
+
*/
|
|
12455
|
+
this.appDEService = null;
|
|
12456
|
+
}
|
|
12457
|
+
/**
|
|
12458
|
+
* 获取存储服务
|
|
12459
|
+
*
|
|
12460
|
+
* @author tony001
|
|
12461
|
+
* @date 2024-04-24 14:04:21
|
|
12462
|
+
* @private
|
|
12463
|
+
* @param {IContext} context
|
|
12464
|
+
* @param {IParams} params
|
|
12465
|
+
* @return {*} {Promise<IAppDEService>}
|
|
12466
|
+
*/
|
|
12467
|
+
async getAppDEService(context) {
|
|
12468
|
+
if (this.appDEService) {
|
|
12469
|
+
return this.appDEService;
|
|
12470
|
+
}
|
|
12471
|
+
const { appId: appId2, name, stoageAppDataEntityId } = this.appUtil;
|
|
12472
|
+
if (appId2 && stoageAppDataEntityId) {
|
|
12473
|
+
const app = ibiz.hub.getApp(appId2);
|
|
12474
|
+
this.stoageAppDataEntity = await ibiz.hub.getAppDataEntity(
|
|
12475
|
+
stoageAppDataEntityId,
|
|
12476
|
+
appId2
|
|
12477
|
+
);
|
|
12478
|
+
const appDEService = await app.deService.getService(
|
|
12479
|
+
context,
|
|
12480
|
+
stoageAppDataEntityId
|
|
12481
|
+
);
|
|
12482
|
+
if (appDEService) {
|
|
12483
|
+
this.appDEService = appDEService;
|
|
12484
|
+
return appDEService;
|
|
12485
|
+
}
|
|
12486
|
+
throw new Error(
|
|
12487
|
+
"\u5E94\u7528\u529F\u80FD[".concat(name, "]\u672A\u627E\u5230\u5B58\u50A8\u5B9E\u4F53[").concat(stoageAppDataEntityId, "]")
|
|
12488
|
+
);
|
|
12489
|
+
}
|
|
12490
|
+
throw new Error("\u5E94\u7528\u529F\u80FD[".concat(name, "]\u4E0D\u5B58\u5728"));
|
|
12440
12491
|
}
|
|
12441
12492
|
/**
|
|
12442
12493
|
* 加载指定数据
|
|
@@ -12449,7 +12500,20 @@ var UtilService = class {
|
|
|
12449
12500
|
* @return {*} {Promise<IData>}
|
|
12450
12501
|
*/
|
|
12451
12502
|
async load(tag, context, params) {
|
|
12452
|
-
|
|
12503
|
+
const tempContext = context.clone();
|
|
12504
|
+
const dataService = await this.getAppDEService(tempContext);
|
|
12505
|
+
tempContext[this.stoageAppDataEntity.codeName.toLowerCase()] = tag;
|
|
12506
|
+
const { getAppDEActionId } = this.appUtil;
|
|
12507
|
+
try {
|
|
12508
|
+
const res = await dataService.exec(
|
|
12509
|
+
getAppDEActionId || "get",
|
|
12510
|
+
tempContext,
|
|
12511
|
+
params
|
|
12512
|
+
);
|
|
12513
|
+
return this.handleResponse(res);
|
|
12514
|
+
} catch (error) {
|
|
12515
|
+
return {};
|
|
12516
|
+
}
|
|
12453
12517
|
}
|
|
12454
12518
|
/**
|
|
12455
12519
|
* 保存指定数据
|
|
@@ -12463,7 +12527,63 @@ var UtilService = class {
|
|
|
12463
12527
|
* @return {*} {Promise<IData>}
|
|
12464
12528
|
*/
|
|
12465
12529
|
async save(tag, context, params, data) {
|
|
12466
|
-
|
|
12530
|
+
const dataService = await this.getAppDEService(context);
|
|
12531
|
+
const {
|
|
12532
|
+
context: tempContext,
|
|
12533
|
+
params: tempParams,
|
|
12534
|
+
data: tempData
|
|
12535
|
+
} = this.handleRequestData(tag, context, params, data);
|
|
12536
|
+
return dataService.exec("save", tempContext, tempData, tempParams);
|
|
12537
|
+
}
|
|
12538
|
+
/**
|
|
12539
|
+
* 处理请求数据
|
|
12540
|
+
*
|
|
12541
|
+
* @author tony001
|
|
12542
|
+
* @date 2024-04-24 15:04:02
|
|
12543
|
+
* @private
|
|
12544
|
+
* @param {IContext} context
|
|
12545
|
+
* @param {IParams} params
|
|
12546
|
+
* @param {IData} data
|
|
12547
|
+
* @return {*} {{ context: IContext; params: IParams; data: IData }}
|
|
12548
|
+
*/
|
|
12549
|
+
handleRequestData(tag, context, params, data) {
|
|
12550
|
+
const {
|
|
12551
|
+
modelIdAppDEFieldId,
|
|
12552
|
+
modelAppDEFieldId,
|
|
12553
|
+
appIdAppDEFieldId,
|
|
12554
|
+
userIdAppDEFieldId,
|
|
12555
|
+
stoageAppDataEntityId
|
|
12556
|
+
} = this.appUtil;
|
|
12557
|
+
if (!this.stoageAppDataEntity) {
|
|
12558
|
+
throw new Error("\u672A\u627E\u5230\u5B58\u50A8\u5B9E\u4F53[".concat(stoageAppDataEntityId, "]"));
|
|
12559
|
+
}
|
|
12560
|
+
const tempContext = context.clone();
|
|
12561
|
+
const tempData = {};
|
|
12562
|
+
tempContext[this.stoageAppDataEntity.codeName.toLowerCase()] = tag;
|
|
12563
|
+
const { keyAppDEFieldId } = this.stoageAppDataEntity;
|
|
12564
|
+
tempData[keyAppDEFieldId] = tag;
|
|
12565
|
+
tempData[modelIdAppDEFieldId] = params == null ? void 0 : params.modelId;
|
|
12566
|
+
tempData[modelAppDEFieldId] = JSON.stringify(data);
|
|
12567
|
+
tempData[appIdAppDEFieldId] = tempContext.srfappid;
|
|
12568
|
+
tempData[userIdAppDEFieldId] = tempContext.srfpersonid;
|
|
12569
|
+
tempData.type = params == null ? void 0 : params.type;
|
|
12570
|
+
tempData.owner_type = params == null ? void 0 : params.ownerType;
|
|
12571
|
+
tempData.owner_id = params == null ? void 0 : params.ownerId;
|
|
12572
|
+
return { context: tempContext, params, data: tempData };
|
|
12573
|
+
}
|
|
12574
|
+
/**
|
|
12575
|
+
* 处理响应数据
|
|
12576
|
+
*
|
|
12577
|
+
* @author tony001
|
|
12578
|
+
* @date 2024-04-24 16:04:45
|
|
12579
|
+
* @private
|
|
12580
|
+
* @param {IData} response
|
|
12581
|
+
* @return {*} {IData}
|
|
12582
|
+
*/
|
|
12583
|
+
handleResponse(response) {
|
|
12584
|
+
const { data } = response;
|
|
12585
|
+
const { modelAppDEFieldId } = this.appUtil;
|
|
12586
|
+
return JSON.parse(data[modelAppDEFieldId]);
|
|
12467
12587
|
}
|
|
12468
12588
|
};
|
|
12469
12589
|
|
|
@@ -13872,7 +13992,6 @@ var Application = class {
|
|
|
13872
13992
|
this.deService = new DEServiceUtil(model);
|
|
13873
13993
|
this.codeList = new CodeListService(model);
|
|
13874
13994
|
this.authority = new AuthorityService(model);
|
|
13875
|
-
this.utilservice = new UtilService(model);
|
|
13876
13995
|
}
|
|
13877
13996
|
/**
|
|
13878
13997
|
* 当前应用标识
|
|
@@ -16010,7 +16129,8 @@ var ViewController = class extends BaseController {
|
|
|
16010
16129
|
appCounterRefs.map(async (counterRef) => {
|
|
16011
16130
|
const counter = await CounterService.getCounterByRef(
|
|
16012
16131
|
counterRef,
|
|
16013
|
-
this.context
|
|
16132
|
+
this.context,
|
|
16133
|
+
{ ...this.params }
|
|
16014
16134
|
);
|
|
16015
16135
|
this.counters[counterRef.id] = counter;
|
|
16016
16136
|
})
|
|
@@ -22096,6 +22216,23 @@ var DashboardController = class extends ControlController {
|
|
|
22096
22216
|
})
|
|
22097
22217
|
);
|
|
22098
22218
|
}
|
|
22219
|
+
/**
|
|
22220
|
+
* 初始化
|
|
22221
|
+
*
|
|
22222
|
+
* @param {IData} [config={}]
|
|
22223
|
+
* @return {*} {Promise<void>}
|
|
22224
|
+
* @memberof DashboardController
|
|
22225
|
+
*/
|
|
22226
|
+
async initPortletsConfig(config = {}) {
|
|
22227
|
+
Object.keys(config).forEach((key) => {
|
|
22228
|
+
const portlet = this.portlets[key];
|
|
22229
|
+
if (portlet) {
|
|
22230
|
+
portlet.config = config[key];
|
|
22231
|
+
portlet.state.title = portlet.config.srftitle;
|
|
22232
|
+
Object.assign(portlet.params, portlet.config);
|
|
22233
|
+
}
|
|
22234
|
+
});
|
|
22235
|
+
}
|
|
22099
22236
|
/**
|
|
22100
22237
|
* 通知所有表单成员表单操作过程中的数据变更
|
|
22101
22238
|
*
|
|
@@ -22113,6 +22250,7 @@ var DashboardController = class extends ControlController {
|
|
|
22113
22250
|
};
|
|
22114
22251
|
|
|
22115
22252
|
// src/controller/control/dashboard/custom-dashboard.controller.ts
|
|
22253
|
+
import { merge } from "lodash-es";
|
|
22116
22254
|
var CustomDashboardController = class {
|
|
22117
22255
|
/**
|
|
22118
22256
|
* Creates an instance of BaseController.
|
|
@@ -22120,7 +22258,7 @@ var CustomDashboardController = class {
|
|
|
22120
22258
|
* @date 2023-04-26 06:46:21
|
|
22121
22259
|
* @param {CTX} ctx 跨组件上下文环境,内部机制不暴露
|
|
22122
22260
|
*/
|
|
22123
|
-
constructor(model) {
|
|
22261
|
+
constructor(model, dashboard) {
|
|
22124
22262
|
/**
|
|
22125
22263
|
* 自定义布局模型数据
|
|
22126
22264
|
*
|
|
@@ -22143,19 +22281,93 @@ var CustomDashboardController = class {
|
|
|
22143
22281
|
*/
|
|
22144
22282
|
this.layoutRowH = 80;
|
|
22145
22283
|
/**
|
|
22146
|
-
*
|
|
22284
|
+
* 门户配置
|
|
22147
22285
|
*
|
|
22148
|
-
* @
|
|
22149
|
-
* @
|
|
22286
|
+
* @type {IData}
|
|
22287
|
+
* @memberof CustomDashboardController
|
|
22150
22288
|
*/
|
|
22151
|
-
this.
|
|
22152
|
-
|
|
22289
|
+
this.portletConfig = {};
|
|
22290
|
+
/**
|
|
22291
|
+
* 自定义定制范围类型(public:公开,personal:个人,data:数据,默认是按照个人区分,配置了应用功能组件才生效)
|
|
22292
|
+
*
|
|
22293
|
+
* @author tony001
|
|
22294
|
+
* @date 2024-04-24 19:04:47
|
|
22295
|
+
* @type {('public' | 'personal' | 'data')}
|
|
22296
|
+
*/
|
|
22297
|
+
this.type = "personal";
|
|
22298
|
+
/**
|
|
22299
|
+
* 所属数据类型(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
22300
|
+
*
|
|
22301
|
+
* @author tony001
|
|
22302
|
+
* @date 2024-04-24 19:04:06
|
|
22303
|
+
* @type {string}
|
|
22304
|
+
*/
|
|
22305
|
+
this.ownerType = "";
|
|
22306
|
+
/**
|
|
22307
|
+
* 所属数据标识(仅限自定义定制为data类型时生效,配置了应用功能组件才生效)
|
|
22308
|
+
*
|
|
22309
|
+
* @author tony001
|
|
22310
|
+
* @date 2024-04-24 19:04:18
|
|
22311
|
+
* @type {string}
|
|
22312
|
+
*/
|
|
22313
|
+
this.ownerId = "";
|
|
22153
22314
|
this.model = model;
|
|
22154
|
-
this.
|
|
22155
|
-
|
|
22156
|
-
|
|
22157
|
-
|
|
22158
|
-
|
|
22315
|
+
this.context = dashboard.context;
|
|
22316
|
+
this.params = dashboard.params;
|
|
22317
|
+
this.init(dashboard.controlParams);
|
|
22318
|
+
}
|
|
22319
|
+
/**
|
|
22320
|
+
* 初始化
|
|
22321
|
+
*
|
|
22322
|
+
* @author tony001
|
|
22323
|
+
* @date 2024-04-24 20:04:14
|
|
22324
|
+
* @private
|
|
22325
|
+
*/
|
|
22326
|
+
init(controlParams) {
|
|
22327
|
+
var _a, _b;
|
|
22328
|
+
this.type = "personal";
|
|
22329
|
+
this.ownerId = this.context.srfpersonid;
|
|
22330
|
+
if (controlParams.type) {
|
|
22331
|
+
this.type = controlParams.type;
|
|
22332
|
+
}
|
|
22333
|
+
if (controlParams.owner_type) {
|
|
22334
|
+
this.ownerType = controlParams.owner_type;
|
|
22335
|
+
}
|
|
22336
|
+
if (controlParams.owner_id) {
|
|
22337
|
+
this.ownerId = this.context[controlParams.owner_id];
|
|
22338
|
+
}
|
|
22339
|
+
if (this.model.appDynaDashboardUtilId) {
|
|
22340
|
+
const app = ibiz.hub.getApp(this.context.srfappid);
|
|
22341
|
+
this.util = new UtilService(
|
|
22342
|
+
app.getAppUtil(this.model.appDynaDashboardUtilId)
|
|
22343
|
+
);
|
|
22344
|
+
} else {
|
|
22345
|
+
this.config = new ConfigService(
|
|
22346
|
+
this.model.appId,
|
|
22347
|
+
"dynadashboard",
|
|
22348
|
+
"dashboard_".concat(((_a = this.model.appDataEntityId) == null ? void 0 : _a.toLowerCase()) || "app", "_").concat((_b = this.model.codeName) == null ? void 0 : _b.toLowerCase())
|
|
22349
|
+
);
|
|
22350
|
+
}
|
|
22351
|
+
}
|
|
22352
|
+
/**
|
|
22353
|
+
* 获取资源标识
|
|
22354
|
+
*
|
|
22355
|
+
* @author tony001
|
|
22356
|
+
* @date 2024-04-24 14:04:55
|
|
22357
|
+
* @private
|
|
22358
|
+
* @return {*} {string}
|
|
22359
|
+
*/
|
|
22360
|
+
getResourceTag() {
|
|
22361
|
+
var _a, _b;
|
|
22362
|
+
const base = "".concat(this.context.srfappid, "_dashboard_").concat(((_a = this.model.appDataEntityId) == null ? void 0 : _a.toLowerCase()) || "app", "_").concat((_b = this.model.codeName) == null ? void 0 : _b.toLowerCase());
|
|
22363
|
+
switch (this.type) {
|
|
22364
|
+
case "personal":
|
|
22365
|
+
return "".concat(base, "_").concat(this.context.srfpersonid);
|
|
22366
|
+
case "data":
|
|
22367
|
+
return "".concat(base, "_").concat(this.ownerType, "_").concat(this.ownerId);
|
|
22368
|
+
default:
|
|
22369
|
+
return base;
|
|
22370
|
+
}
|
|
22159
22371
|
}
|
|
22160
22372
|
/**
|
|
22161
22373
|
* 加载自定义布局模型数据
|
|
@@ -22164,7 +22376,16 @@ var CustomDashboardController = class {
|
|
|
22164
22376
|
* @Date: 2023-09-20 16:22:49
|
|
22165
22377
|
*/
|
|
22166
22378
|
async loadCustomModelData() {
|
|
22167
|
-
|
|
22379
|
+
let res;
|
|
22380
|
+
if (this.model.appDynaDashboardUtilId) {
|
|
22381
|
+
res = await this.util.load(
|
|
22382
|
+
this.getResourceTag(),
|
|
22383
|
+
this.context,
|
|
22384
|
+
this.params
|
|
22385
|
+
);
|
|
22386
|
+
} else {
|
|
22387
|
+
res = await this.config.load();
|
|
22388
|
+
}
|
|
22168
22389
|
if (res.model) {
|
|
22169
22390
|
this.customModelData = res.model;
|
|
22170
22391
|
}
|
|
@@ -22174,7 +22395,10 @@ var CustomDashboardController = class {
|
|
|
22174
22395
|
if (res.rowH) {
|
|
22175
22396
|
this.layoutRowH = res.rowH;
|
|
22176
22397
|
}
|
|
22177
|
-
|
|
22398
|
+
if (res.config) {
|
|
22399
|
+
this.portletConfig = res.config;
|
|
22400
|
+
}
|
|
22401
|
+
return { model: this.customModelData, config: this.portletConfig };
|
|
22178
22402
|
}
|
|
22179
22403
|
/**
|
|
22180
22404
|
* 保存自定义布局模型数据
|
|
@@ -22182,19 +22406,42 @@ var CustomDashboardController = class {
|
|
|
22182
22406
|
* @author: zhujiamin
|
|
22183
22407
|
* @Date: 2023-09-20 16:22:49
|
|
22184
22408
|
*/
|
|
22185
|
-
async saveCustomModelData(model) {
|
|
22186
|
-
|
|
22409
|
+
async saveCustomModelData(model, config = {}) {
|
|
22410
|
+
merge(this.portletConfig, config);
|
|
22411
|
+
let res;
|
|
22412
|
+
const data = {
|
|
22187
22413
|
model,
|
|
22188
22414
|
colNum: this.layoutColNum,
|
|
22189
|
-
rowH: this.layoutRowH
|
|
22190
|
-
|
|
22415
|
+
rowH: this.layoutRowH,
|
|
22416
|
+
config: this.portletConfig
|
|
22417
|
+
};
|
|
22418
|
+
if (this.model.appDynaDashboardUtilId) {
|
|
22419
|
+
res = await this.util.save(
|
|
22420
|
+
this.getResourceTag(),
|
|
22421
|
+
this.context,
|
|
22422
|
+
{
|
|
22423
|
+
...this.params,
|
|
22424
|
+
type: this.type,
|
|
22425
|
+
ownerType: this.ownerType,
|
|
22426
|
+
ownerId: this.ownerId,
|
|
22427
|
+
modelId: this.model.id
|
|
22428
|
+
},
|
|
22429
|
+
data
|
|
22430
|
+
);
|
|
22431
|
+
} else {
|
|
22432
|
+
res = await this.config.save(data);
|
|
22433
|
+
}
|
|
22191
22434
|
if (res) {
|
|
22192
22435
|
this.customModelData = model;
|
|
22193
22436
|
}
|
|
22194
|
-
return model;
|
|
22437
|
+
return { model, config: this.portletConfig };
|
|
22195
22438
|
}
|
|
22196
22439
|
};
|
|
22197
22440
|
|
|
22441
|
+
// src/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.ts
|
|
22442
|
+
import { merge as merge2 } from "lodash-es";
|
|
22443
|
+
import { IBizContext as IBizContext5, IBizParams as IBizParams2 } from "@ibiz-template/core";
|
|
22444
|
+
|
|
22198
22445
|
// src/controller/control/dashboard/portlet/portlet-part/portlet-part.state.ts
|
|
22199
22446
|
var PortletPartState = class {
|
|
22200
22447
|
constructor() {
|
|
@@ -22224,26 +22471,38 @@ var PortletPartState = class {
|
|
|
22224
22471
|
// src/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.ts
|
|
22225
22472
|
var PortletPartController = class {
|
|
22226
22473
|
/**
|
|
22227
|
-
*
|
|
22228
|
-
*
|
|
22474
|
+
* Creates an instance of PortletPartController.
|
|
22229
22475
|
* @author lxm
|
|
22230
|
-
* @date 2022-10-
|
|
22231
|
-
* @
|
|
22232
|
-
* @
|
|
22476
|
+
* @date 2022-10-21 10:10:44
|
|
22477
|
+
* @param {T} model
|
|
22478
|
+
* @param {DashboardController} dashboard 数据看板控制器
|
|
22479
|
+
* @param {IPortletContainerController} [parent] 父容器控制器,最上级不存在
|
|
22233
22480
|
*/
|
|
22234
|
-
|
|
22235
|
-
|
|
22481
|
+
constructor(model, dashboard, parent) {
|
|
22482
|
+
/**
|
|
22483
|
+
* 门户配置
|
|
22484
|
+
*
|
|
22485
|
+
* @type {IData}
|
|
22486
|
+
* @memberof PortletPartController
|
|
22487
|
+
*/
|
|
22488
|
+
this.config = {};
|
|
22489
|
+
this.model = model;
|
|
22490
|
+
this.dashboard = dashboard;
|
|
22491
|
+
this.parent = parent;
|
|
22492
|
+
this.state = this.createState();
|
|
22493
|
+
this.state.context = IBizContext5.create({}, this.dashboard.context);
|
|
22494
|
+
this.params = new IBizParams2({}, this.dashboard.params);
|
|
22236
22495
|
}
|
|
22237
22496
|
/**
|
|
22238
|
-
*
|
|
22497
|
+
* 门户部件的上下文参数
|
|
22239
22498
|
*
|
|
22240
22499
|
* @author lxm
|
|
22241
|
-
* @date 2022-10-23 16:10:
|
|
22500
|
+
* @date 2022-10-23 16:10:50
|
|
22242
22501
|
* @readonly
|
|
22243
|
-
* @type {
|
|
22502
|
+
* @type {IContext}
|
|
22244
22503
|
*/
|
|
22245
|
-
get
|
|
22246
|
-
return this.
|
|
22504
|
+
get context() {
|
|
22505
|
+
return this.state.context;
|
|
22247
22506
|
}
|
|
22248
22507
|
/**
|
|
22249
22508
|
* 获取容器类名集合
|
|
@@ -22256,18 +22515,17 @@ var PortletPartController = class {
|
|
|
22256
22515
|
return [...this.state.class.container, ...this.state.class.containerDyna];
|
|
22257
22516
|
}
|
|
22258
22517
|
/**
|
|
22259
|
-
*
|
|
22260
|
-
* @author
|
|
22261
|
-
* @
|
|
22262
|
-
* @
|
|
22263
|
-
* @
|
|
22264
|
-
* @param {IPortletContainerController} [parent] 父容器控制器,最上级不存在
|
|
22518
|
+
* 内容控制器
|
|
22519
|
+
* @author zzq
|
|
22520
|
+
* @readonly
|
|
22521
|
+
* @type {IController | undefined}
|
|
22522
|
+
* @memberof PortletPartController
|
|
22265
22523
|
*/
|
|
22266
|
-
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22524
|
+
get contentController() {
|
|
22525
|
+
const { contentControlId } = this.model;
|
|
22526
|
+
if (contentControlId) {
|
|
22527
|
+
return this.dashboard.getController(contentControlId);
|
|
22528
|
+
}
|
|
22271
22529
|
}
|
|
22272
22530
|
/**
|
|
22273
22531
|
* 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
|
|
@@ -22281,7 +22539,7 @@ var PortletPartController = class {
|
|
|
22281
22539
|
}
|
|
22282
22540
|
async onInit() {
|
|
22283
22541
|
this.onDataChange = this.onDataChange.bind(this);
|
|
22284
|
-
const { layoutPos, sysCss } = this.model;
|
|
22542
|
+
const { layoutPos, sysCss, title, titleLanguageRes } = this.model;
|
|
22285
22543
|
if (layoutPos) {
|
|
22286
22544
|
const { width, height } = calcLayoutHeightWidth(this.model);
|
|
22287
22545
|
this.state.layout.width = "".concat(width);
|
|
@@ -22290,6 +22548,12 @@ var PortletPartController = class {
|
|
|
22290
22548
|
if (sysCss == null ? void 0 : sysCss.cssName) {
|
|
22291
22549
|
this.state.class.container.push(sysCss.cssName);
|
|
22292
22550
|
}
|
|
22551
|
+
if (titleLanguageRes) {
|
|
22552
|
+
this.state.title = ibiz.i18n.t(titleLanguageRes.lanResTag, title);
|
|
22553
|
+
} else {
|
|
22554
|
+
this.state.title = title;
|
|
22555
|
+
}
|
|
22556
|
+
this.config = { srftitle: this.state.title };
|
|
22293
22557
|
await this.initActionStates();
|
|
22294
22558
|
}
|
|
22295
22559
|
/**
|
|
@@ -22302,6 +22566,30 @@ var PortletPartController = class {
|
|
|
22302
22566
|
createState() {
|
|
22303
22567
|
return new PortletPartState();
|
|
22304
22568
|
}
|
|
22569
|
+
/**
|
|
22570
|
+
* 刷新门户部件
|
|
22571
|
+
*
|
|
22572
|
+
* @author zzq
|
|
22573
|
+
* @date 2024-04-25 10:03:33
|
|
22574
|
+
*/
|
|
22575
|
+
refresh() {
|
|
22576
|
+
}
|
|
22577
|
+
/**
|
|
22578
|
+
* 设置配置数据
|
|
22579
|
+
*
|
|
22580
|
+
* @param {IData} config
|
|
22581
|
+
* @memberof PortletPartController
|
|
22582
|
+
*/
|
|
22583
|
+
async setConfig(config) {
|
|
22584
|
+
merge2(this.config, config);
|
|
22585
|
+
this.state.title = this.config.srftitle;
|
|
22586
|
+
delete config.srftitle;
|
|
22587
|
+
merge2(this.params, config);
|
|
22588
|
+
this.dashboard.evt.emit("onConfigChange", {
|
|
22589
|
+
name: this.model.id,
|
|
22590
|
+
config: this.config
|
|
22591
|
+
});
|
|
22592
|
+
}
|
|
22305
22593
|
/**
|
|
22306
22594
|
* 数据改变方法
|
|
22307
22595
|
* @param {DataChangeEvent} event
|
|
@@ -22367,10 +22655,11 @@ var PortletPartController = class {
|
|
|
22367
22655
|
await UIActionUtil.execAndResolved(
|
|
22368
22656
|
actionId,
|
|
22369
22657
|
{
|
|
22370
|
-
context: this.
|
|
22371
|
-
params: this.
|
|
22658
|
+
context: this.context,
|
|
22659
|
+
params: this.params,
|
|
22372
22660
|
data,
|
|
22373
22661
|
view: this.dashboard.view,
|
|
22662
|
+
ctrl: this,
|
|
22374
22663
|
event
|
|
22375
22664
|
},
|
|
22376
22665
|
detail.appId
|
|
@@ -22421,6 +22710,19 @@ var ContainerPortletController = class extends PortletPartController {
|
|
|
22421
22710
|
|
|
22422
22711
|
// src/controller/control/dashboard/portlet/view-portlet/view-portlet.controller.ts
|
|
22423
22712
|
var ViewPortletController = class extends PortletPartController {
|
|
22713
|
+
/**
|
|
22714
|
+
* 刷新门户部件
|
|
22715
|
+
*
|
|
22716
|
+
* @author zzq
|
|
22717
|
+
* @date 2024-04-25 10:03:33
|
|
22718
|
+
*/
|
|
22719
|
+
refresh() {
|
|
22720
|
+
if (this.contentController) {
|
|
22721
|
+
this.contentController.callUIAction(
|
|
22722
|
+
"Refresh" /* REFRESH */
|
|
22723
|
+
);
|
|
22724
|
+
}
|
|
22725
|
+
}
|
|
22424
22726
|
};
|
|
22425
22727
|
|
|
22426
22728
|
// src/controller/control/dashboard/portlet/menu-portlet/menu-portlet.controller.ts
|
|
@@ -22429,6 +22731,17 @@ var MenuPortletController = class extends PortletPartController {
|
|
|
22429
22731
|
|
|
22430
22732
|
// src/controller/control/dashboard/portlet/chart-portlet/chart-portlet.controller.ts
|
|
22431
22733
|
var ChartPortletController = class extends PortletPartController {
|
|
22734
|
+
/**
|
|
22735
|
+
* 刷新门户部件
|
|
22736
|
+
*
|
|
22737
|
+
* @author zzq
|
|
22738
|
+
* @date 2024-04-25 10:03:33
|
|
22739
|
+
*/
|
|
22740
|
+
refresh() {
|
|
22741
|
+
if (this.contentController) {
|
|
22742
|
+
this.contentController.refresh();
|
|
22743
|
+
}
|
|
22744
|
+
}
|
|
22432
22745
|
};
|
|
22433
22746
|
|
|
22434
22747
|
// src/controller/control/dashboard/portlet/actionbar-portlet/actionbar-portlet.controller.ts
|
|
@@ -22441,6 +22754,17 @@ var HtmlPortletController = class extends PortletPartController {
|
|
|
22441
22754
|
|
|
22442
22755
|
// src/controller/control/dashboard/portlet/list-portlet/list-portlet.controller.ts
|
|
22443
22756
|
var ListPortletController = class extends PortletPartController {
|
|
22757
|
+
/**
|
|
22758
|
+
* 刷新门户部件
|
|
22759
|
+
*
|
|
22760
|
+
* @author zzq
|
|
22761
|
+
* @date 2024-04-25 10:03:33
|
|
22762
|
+
*/
|
|
22763
|
+
refresh() {
|
|
22764
|
+
if (this.contentController) {
|
|
22765
|
+
this.contentController.refresh();
|
|
22766
|
+
}
|
|
22767
|
+
}
|
|
22444
22768
|
};
|
|
22445
22769
|
|
|
22446
22770
|
// src/controller/control/dashboard/portlet/rawitem-portlet/rawitem-portlet.controller.ts
|
|
@@ -23950,7 +24274,7 @@ var FormController = class extends ControlController {
|
|
|
23950
24274
|
const counter = await CounterService.getCounterByRef(
|
|
23951
24275
|
counterRef,
|
|
23952
24276
|
this.context,
|
|
23953
|
-
dataKey ? { customId: dataKey } :
|
|
24277
|
+
dataKey ? { customId: dataKey, ...this.params } : { ...this.params }
|
|
23954
24278
|
);
|
|
23955
24279
|
this.counters[counterRef.id] = counter;
|
|
23956
24280
|
})
|
|
@@ -26221,7 +26545,7 @@ var FormTabPanelController = class extends FormDetailController {
|
|
|
26221
26545
|
// src/controller/control/form/edit-form/edit-form.controller.ts
|
|
26222
26546
|
import {
|
|
26223
26547
|
awaitTimeout,
|
|
26224
|
-
IBizContext as
|
|
26548
|
+
IBizContext as IBizContext6,
|
|
26225
26549
|
isElementSame as isElementSame2,
|
|
26226
26550
|
mergeInLeft as mergeInLeft2,
|
|
26227
26551
|
RuntimeError as RuntimeError55
|
|
@@ -26936,7 +27260,7 @@ var EditFormController = class extends FormController {
|
|
|
26936
27260
|
switch (autoSaveMode) {
|
|
26937
27261
|
case 3:
|
|
26938
27262
|
saveParam.data = this.getDiffData();
|
|
26939
|
-
saveParam.context =
|
|
27263
|
+
saveParam.context = IBizContext6.create({ srfsimple: true });
|
|
26940
27264
|
break;
|
|
26941
27265
|
default:
|
|
26942
27266
|
}
|
|
@@ -27707,6 +28031,36 @@ var GridController = class extends MDControlController {
|
|
|
27707
28031
|
this.dataExportParam.header = degridColumns.map((item) => item.caption);
|
|
27708
28032
|
}
|
|
27709
28033
|
}
|
|
28034
|
+
/**
|
|
28035
|
+
* 填充导出代码表
|
|
28036
|
+
* @author zzq
|
|
28037
|
+
* @date 2024-04-23 16:10:17
|
|
28038
|
+
* @protected
|
|
28039
|
+
* @return {*} {Promise<void>}
|
|
28040
|
+
*/
|
|
28041
|
+
async fillExportCodelistMap() {
|
|
28042
|
+
if (this.model.dedataExportId) {
|
|
28043
|
+
return;
|
|
28044
|
+
}
|
|
28045
|
+
const fillCodeList = async (key, fieldColumnC) => {
|
|
28046
|
+
const dataItems = await fieldColumnC.loadCodeList();
|
|
28047
|
+
this.allExportCodelistMap.set(key, dataItems);
|
|
28048
|
+
};
|
|
28049
|
+
const exportColumnsPromises = [];
|
|
28050
|
+
for (const [key, codeListItems] of this.allExportCodelistMap) {
|
|
28051
|
+
if (!codeListItems) {
|
|
28052
|
+
const fieldColumn = this.fieldColumns[key];
|
|
28053
|
+
if (fieldColumn.codeListItems) {
|
|
28054
|
+
this.allExportCodelistMap.set(key, fieldColumn.codeListItems);
|
|
28055
|
+
} else {
|
|
28056
|
+
exportColumnsPromises.push(fillCodeList(key, fieldColumn));
|
|
28057
|
+
}
|
|
28058
|
+
}
|
|
28059
|
+
}
|
|
28060
|
+
if (exportColumnsPromises.length > 0) {
|
|
28061
|
+
await Promise.all(exportColumnsPromises);
|
|
28062
|
+
}
|
|
28063
|
+
}
|
|
27710
28064
|
/**
|
|
27711
28065
|
* 初始化表格分组
|
|
27712
28066
|
* @author lxm
|
|
@@ -28475,6 +28829,7 @@ var GridController = class extends MDControlController {
|
|
|
28475
28829
|
if (!header) {
|
|
28476
28830
|
throw new RuntimeError56("\u65E0\u8868\u683C\u5217");
|
|
28477
28831
|
}
|
|
28832
|
+
await this.fillExportCodelistMap();
|
|
28478
28833
|
const data = await this.getExportData(args.params);
|
|
28479
28834
|
const formatData = this.formatExcelData(data);
|
|
28480
28835
|
const table = formatData.map((v) => Object.values(v));
|
|
@@ -32399,7 +32754,8 @@ var TreeController = class extends MDControlController {
|
|
|
32399
32754
|
if (appCounterRef) {
|
|
32400
32755
|
this.counter = await CounterService.getCounterByRef(
|
|
32401
32756
|
appCounterRef,
|
|
32402
|
-
this.context
|
|
32757
|
+
this.context,
|
|
32758
|
+
{ ...this.params }
|
|
32403
32759
|
);
|
|
32404
32760
|
}
|
|
32405
32761
|
}
|
|
@@ -33145,14 +33501,22 @@ var WizardPanelController = class extends ControlController {
|
|
|
33145
33501
|
*/
|
|
33146
33502
|
this.formData = {};
|
|
33147
33503
|
}
|
|
33504
|
+
/**
|
|
33505
|
+
* 获取向导面板数据
|
|
33506
|
+
* @returns
|
|
33507
|
+
*/
|
|
33508
|
+
getData() {
|
|
33509
|
+
return [this.formData];
|
|
33510
|
+
}
|
|
33148
33511
|
initState() {
|
|
33149
33512
|
super.initState();
|
|
33513
|
+
this.state.buttonsState = new ButtonContainerState();
|
|
33150
33514
|
}
|
|
33151
33515
|
async onCreated() {
|
|
33152
33516
|
var _a, _b;
|
|
33153
33517
|
await super.onCreated();
|
|
33154
33518
|
this.model.dewizard.dewizardForms.forEach((wizardForm) => {
|
|
33155
|
-
var _a2, _b2, _c;
|
|
33519
|
+
var _a2, _b2, _c, _d;
|
|
33156
33520
|
if (wizardForm.firstForm) {
|
|
33157
33521
|
this.firstForm = wizardForm;
|
|
33158
33522
|
}
|
|
@@ -33162,7 +33526,17 @@ var WizardPanelController = class extends ControlController {
|
|
|
33162
33526
|
});
|
|
33163
33527
|
const stepTag = wizardStep == null ? void 0 : wizardStep.stepTag;
|
|
33164
33528
|
this.stepTags[formName] = stepTag;
|
|
33529
|
+
(_d = wizardForm.stepActions) == null ? void 0 : _d.forEach((step) => {
|
|
33530
|
+
const name = "".concat(wizardForm.formTag, "@").concat(step);
|
|
33531
|
+
const buttonState = new UIActionButtonState(
|
|
33532
|
+
name,
|
|
33533
|
+
this.context.srfappid
|
|
33534
|
+
);
|
|
33535
|
+
buttonState.visible = !this.getStepScriptCode(wizardForm, step);
|
|
33536
|
+
this.state.buttonsState.addState(name, buttonState);
|
|
33537
|
+
});
|
|
33165
33538
|
});
|
|
33539
|
+
this.state.buttonsState.init();
|
|
33166
33540
|
(_b = (_a = this.model.dewizard) == null ? void 0 : _a.dewizardSteps) == null ? void 0 : _b.forEach((step) => {
|
|
33167
33541
|
this.steps.push(step.stepTag);
|
|
33168
33542
|
});
|
|
@@ -33229,7 +33603,11 @@ var WizardPanelController = class extends ControlController {
|
|
|
33229
33603
|
async onFormMounted(activeFormTag, event) {
|
|
33230
33604
|
const formController = event.ctrl;
|
|
33231
33605
|
this.formControllers.set(activeFormTag, formController);
|
|
33606
|
+
formController.evt.on("onFormDataChange", (evt) => {
|
|
33607
|
+
this.calcButtonState(evt.data[0]);
|
|
33608
|
+
});
|
|
33232
33609
|
const data = await formController.load();
|
|
33610
|
+
this.calcButtonState(formController.data);
|
|
33233
33611
|
Object.assign(this.formData, data);
|
|
33234
33612
|
}
|
|
33235
33613
|
/**
|
|
@@ -33398,6 +33776,55 @@ var WizardPanelController = class extends ControlController {
|
|
|
33398
33776
|
await this.activeFormController.save();
|
|
33399
33777
|
await this.finish();
|
|
33400
33778
|
}
|
|
33779
|
+
/**
|
|
33780
|
+
* 获取向导表单步骤脚本代码
|
|
33781
|
+
* @param wizardForm
|
|
33782
|
+
* @param step
|
|
33783
|
+
*/
|
|
33784
|
+
getStepScriptCode(wizardForm, step) {
|
|
33785
|
+
switch (step) {
|
|
33786
|
+
case "PREV":
|
|
33787
|
+
return wizardForm.goPrevEnableScriptCode;
|
|
33788
|
+
case "NEXT":
|
|
33789
|
+
return wizardForm.goNextEnableScriptCode;
|
|
33790
|
+
case "FINISH":
|
|
33791
|
+
return wizardForm.goFinishEnableScriptCode;
|
|
33792
|
+
default:
|
|
33793
|
+
}
|
|
33794
|
+
}
|
|
33795
|
+
/**
|
|
33796
|
+
* 计算按钮状态
|
|
33797
|
+
*
|
|
33798
|
+
* @param item 数据
|
|
33799
|
+
* @memberof WizardPanelController
|
|
33800
|
+
*/
|
|
33801
|
+
async calcButtonState(item) {
|
|
33802
|
+
var _a;
|
|
33803
|
+
const { activeWizardForm } = this;
|
|
33804
|
+
if (activeWizardForm) {
|
|
33805
|
+
let data = item;
|
|
33806
|
+
if (data && data instanceof ControlVO) {
|
|
33807
|
+
data = data.getOrigin();
|
|
33808
|
+
}
|
|
33809
|
+
(_a = activeWizardForm.stepActions) == null ? void 0 : _a.forEach((step) => {
|
|
33810
|
+
const buttonState = this.state.buttonsState["".concat(activeWizardForm.formTag, "@").concat(step)];
|
|
33811
|
+
const scriptCode = this.getStepScriptCode(activeWizardForm, step);
|
|
33812
|
+
if (buttonState && scriptCode) {
|
|
33813
|
+
buttonState.visible = !!ScriptFactory.execScriptFn(
|
|
33814
|
+
{
|
|
33815
|
+
view: this.view,
|
|
33816
|
+
context: this.context,
|
|
33817
|
+
params: this.params,
|
|
33818
|
+
data,
|
|
33819
|
+
env: ibiz.env
|
|
33820
|
+
},
|
|
33821
|
+
scriptCode,
|
|
33822
|
+
{ isAsync: false, singleRowReturn: true }
|
|
33823
|
+
);
|
|
33824
|
+
}
|
|
33825
|
+
});
|
|
33826
|
+
}
|
|
33827
|
+
}
|
|
33401
33828
|
};
|
|
33402
33829
|
|
|
33403
33830
|
// src/controller/control/md-ctrl/md-ctrl.controller.ts
|