@ibiz-template/runtime 0.6.4 → 0.6.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 +58 -7
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +3 -0
- package/out/controller/utils/data-file-util/data-file-util.d.ts +2 -2
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +13 -4
- package/out/service/service/authority/de-authority.service.d.ts.map +1 -1
- package/out/service/service/authority/de-authority.service.js +7 -2
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +1 -1
- package/out/service/utils/app-counter/app-counter.d.ts +10 -0
- package/out/service/utils/app-counter/app-counter.d.ts.map +1 -1
- package/out/service/utils/app-counter/app-counter.js +23 -0
- package/out/service/utils/util/util.d.ts +8 -0
- package/out/service/utils/util/util.d.ts.map +1 -1
- package/out/service/utils/util/util.js +19 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -6101,6 +6101,7 @@ var AppCounter = class {
|
|
|
6101
6101
|
* @type {IData}
|
|
6102
6102
|
*/
|
|
6103
6103
|
this.data = {};
|
|
6104
|
+
this.countChange = this.countChange.bind(this);
|
|
6104
6105
|
}
|
|
6105
6106
|
/**
|
|
6106
6107
|
* 计数器是否已经销毁
|
|
@@ -6125,6 +6126,26 @@ var AppCounter = class {
|
|
|
6125
6126
|
this.setParams(context, params);
|
|
6126
6127
|
this.interval();
|
|
6127
6128
|
await this.load();
|
|
6129
|
+
if (this.model.appDataEntityId) {
|
|
6130
|
+
ibiz.mc.command.change.on(this.countChange);
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
/**
|
|
6134
|
+
* 接受计数器实体数据变更,刷新计数器
|
|
6135
|
+
*
|
|
6136
|
+
* @author chitanda
|
|
6137
|
+
* @date 2024-03-07 14:03:00
|
|
6138
|
+
* @protected
|
|
6139
|
+
* @param {IPortalMessage} msg
|
|
6140
|
+
*/
|
|
6141
|
+
countChange(msg) {
|
|
6142
|
+
const data = msg.data;
|
|
6143
|
+
if (this.model.appDataEntityId) {
|
|
6144
|
+
const codeName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
6145
|
+
if (data && data.srfdecodename === codeName) {
|
|
6146
|
+
this.refresh();
|
|
6147
|
+
}
|
|
6148
|
+
}
|
|
6128
6149
|
}
|
|
6129
6150
|
/**
|
|
6130
6151
|
* 设置上下文以及查询参数
|
|
@@ -6241,6 +6262,7 @@ var AppCounter = class {
|
|
|
6241
6262
|
this.context.destroy();
|
|
6242
6263
|
this.destroyInterval();
|
|
6243
6264
|
this.evt.reset();
|
|
6265
|
+
ibiz.mc.command.change.on(this.countChange);
|
|
6244
6266
|
}
|
|
6245
6267
|
};
|
|
6246
6268
|
|
|
@@ -7273,6 +7295,20 @@ function fieldValueToBoolean(value) {
|
|
|
7273
7295
|
return !!value;
|
|
7274
7296
|
}
|
|
7275
7297
|
}
|
|
7298
|
+
function convertToObject(input) {
|
|
7299
|
+
const result = {};
|
|
7300
|
+
if (!input) {
|
|
7301
|
+
return result;
|
|
7302
|
+
}
|
|
7303
|
+
const pairs = input.split(",");
|
|
7304
|
+
if (pairs && pairs.length > 0) {
|
|
7305
|
+
pairs.forEach((pair) => {
|
|
7306
|
+
const [key, value] = pair.split(":");
|
|
7307
|
+
result[key] = parseInt(value, 10);
|
|
7308
|
+
});
|
|
7309
|
+
}
|
|
7310
|
+
return result;
|
|
7311
|
+
}
|
|
7276
7312
|
|
|
7277
7313
|
// src/service/utils/dyna-sys-params/dyna-sys-params.ts
|
|
7278
7314
|
async function calcDynaSysParams(appDataEntityId, context, opts = {}) {
|
|
@@ -9136,8 +9172,11 @@ var DeAuthorityService = class {
|
|
|
9136
9172
|
* @return {*} {Promise<boolean>}
|
|
9137
9173
|
*/
|
|
9138
9174
|
async calcByDataAccessAction(dataAccessAction, data) {
|
|
9139
|
-
if (data.
|
|
9140
|
-
|
|
9175
|
+
if (data.srfdataaccaction) {
|
|
9176
|
+
const dataAccactions = convertToObject(data.srfdataaccaction);
|
|
9177
|
+
if (!dataAccactions[dataAccessAction]) {
|
|
9178
|
+
return false;
|
|
9179
|
+
}
|
|
9141
9180
|
}
|
|
9142
9181
|
const mainStateResult = await this.calcByDeMainState(
|
|
9143
9182
|
dataAccessAction,
|
|
@@ -9669,6 +9708,7 @@ var Method = class {
|
|
|
9669
9708
|
res = await this.app.net.post(
|
|
9670
9709
|
this.mergeRequestPath(path2, methodName),
|
|
9671
9710
|
data || params || {},
|
|
9711
|
+
{},
|
|
9672
9712
|
header
|
|
9673
9713
|
);
|
|
9674
9714
|
break;
|
|
@@ -14340,13 +14380,17 @@ function listenAsyncAction(id) {
|
|
|
14340
14380
|
ibiz.mc.command.asyncAction.on(callBack);
|
|
14341
14381
|
});
|
|
14342
14382
|
}
|
|
14343
|
-
async function asyncImportData(file, appDataEntity, dataImport) {
|
|
14383
|
+
async function asyncImportData(file, appDataEntity, dataImport, context) {
|
|
14344
14384
|
const data = new FormData();
|
|
14345
14385
|
data.append("file", file);
|
|
14346
|
-
let url = "".concat(appDataEntity.codeName2.toLowerCase(), "/").concat(asyncImportUrl);
|
|
14386
|
+
let url = "/".concat(appDataEntity.codeName2.toLowerCase(), "/").concat(asyncImportUrl);
|
|
14347
14387
|
if (dataImport == null ? void 0 : dataImport.codeName) {
|
|
14348
14388
|
url += "?srfimporttag=".concat(dataImport.codeName);
|
|
14349
14389
|
}
|
|
14390
|
+
if (context) {
|
|
14391
|
+
const resPath = calcResPath(context, appDataEntity);
|
|
14392
|
+
url = resPath + url;
|
|
14393
|
+
}
|
|
14350
14394
|
const res = await ibiz.net.request(url, {
|
|
14351
14395
|
method: "post",
|
|
14352
14396
|
data,
|
|
@@ -14358,13 +14402,17 @@ async function asyncImportData(file, appDataEntity, dataImport) {
|
|
|
14358
14402
|
"OBJECTCREATED"
|
|
14359
14403
|
);
|
|
14360
14404
|
}
|
|
14361
|
-
async function importData(file, appDataEntity, dataImport) {
|
|
14405
|
+
async function importData(file, appDataEntity, dataImport, context) {
|
|
14362
14406
|
const data = new FormData();
|
|
14363
14407
|
data.append("file", file);
|
|
14364
|
-
let url = "".concat(appDataEntity.codeName2.toLowerCase(), "/").concat(importUrl);
|
|
14408
|
+
let url = "/".concat(appDataEntity.codeName2.toLowerCase(), "/").concat(importUrl);
|
|
14365
14409
|
if (dataImport == null ? void 0 : dataImport.codeName) {
|
|
14366
14410
|
url += "?srfimporttag=".concat(dataImport.codeName);
|
|
14367
14411
|
}
|
|
14412
|
+
if (context) {
|
|
14413
|
+
const resPath = calcResPath(context, appDataEntity);
|
|
14414
|
+
url = resPath + url;
|
|
14415
|
+
}
|
|
14368
14416
|
const res = await ibiz.net.request(url, {
|
|
14369
14417
|
method: "post",
|
|
14370
14418
|
data,
|
|
@@ -16272,7 +16320,10 @@ var MDControlController = class extends ControlController {
|
|
|
16272
16320
|
importName,
|
|
16273
16321
|
{
|
|
16274
16322
|
dismiss: () => modal.dismiss(),
|
|
16275
|
-
|
|
16323
|
+
dataImport,
|
|
16324
|
+
appDataEntity,
|
|
16325
|
+
context: this.context,
|
|
16326
|
+
params: this.params
|
|
16276
16327
|
},
|
|
16277
16328
|
{
|
|
16278
16329
|
width: "auto",
|