@ibiz-template/runtime 0.5.7-alpha.5 → 0.5.7-alpha.7
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 +212 -89
- package/dist/index.system.min.js +1 -1
- package/out/controller/control/calendar/calendar.service.d.ts.map +1 -1
- package/out/controller/control/calendar/calendar.service.js +7 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +1 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +6 -0
- package/out/controller/notification/internal-message.controller.d.ts +7 -0
- package/out/controller/notification/internal-message.controller.d.ts.map +1 -1
- package/out/controller/notification/internal-message.controller.js +17 -0
- package/out/engine/md-view.engine.d.ts +28 -0
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +53 -11
- package/out/engine/view-base.engine.d.ts +38 -0
- package/out/engine/view-base.engine.d.ts.map +1 -1
- package/out/engine/view-base.engine.js +100 -52
- package/out/interface/common/i-drawer-options/i-drawer-options.d.ts +2 -2
- package/out/interface/common/i-modal-options/i-modal-options.d.ts +2 -2
- package/out/interface/common/i-popover-options/i-popover-options.d.ts +10 -10
- package/out/interface/common/i-popover-options/i-popover-options.d.ts.map +1 -1
- package/out/interface/util/i-notification-util/i-notification-util.d.ts +7 -0
- package/out/interface/util/i-notification-util/i-notification-util.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/controller/control/calendar/calendar.service.ts +8 -2
- package/src/controller/control/grid/grid/grid.controller.ts +7 -0
- package/src/controller/notification/internal-message.controller.ts +20 -1
- package/src/engine/md-view.engine.ts +59 -11
- package/src/engine/view-base.engine.ts +109 -49
- package/src/interface/common/i-drawer-options/i-drawer-options.ts +2 -2
- package/src/interface/common/i-modal-options/i-modal-options.ts +2 -2
- package/src/interface/common/i-popover-options/i-popover-options.ts +10 -10
- package/src/interface/util/i-notification-util/i-notification-util.ts +8 -0
package/dist/index.esm.js
CHANGED
|
@@ -3247,8 +3247,8 @@ var baseStyle = {
|
|
|
3247
3247
|
position: "fixed",
|
|
3248
3248
|
zIndex: "10000"
|
|
3249
3249
|
};
|
|
3250
|
-
function cloneElement(
|
|
3251
|
-
const element = getAnimationElement(
|
|
3250
|
+
function cloneElement(clone33, teleport = document.body, isRemoveChild = true) {
|
|
3251
|
+
const element = getAnimationElement(clone33);
|
|
3252
3252
|
if (element == null) {
|
|
3253
3253
|
throw new Error("Cannot clone a null or undefined element.");
|
|
3254
3254
|
}
|
|
@@ -3667,11 +3667,11 @@ function arrayContains(arr, val) {
|
|
|
3667
3667
|
});
|
|
3668
3668
|
}
|
|
3669
3669
|
function cloneObject(o) {
|
|
3670
|
-
var
|
|
3670
|
+
var clone33 = {};
|
|
3671
3671
|
for (var p in o) {
|
|
3672
|
-
|
|
3672
|
+
clone33[p] = o[p];
|
|
3673
3673
|
}
|
|
3674
|
-
return
|
|
3674
|
+
return clone33;
|
|
3675
3675
|
}
|
|
3676
3676
|
function replaceObjectProps(o1, o2) {
|
|
3677
3677
|
var o = cloneObject(o1);
|
|
@@ -16095,6 +16095,7 @@ import dayjs3 from "dayjs";
|
|
|
16095
16095
|
|
|
16096
16096
|
// src/controller/control/calendar/calendar.service.ts
|
|
16097
16097
|
import { RuntimeError as RuntimeError38 } from "@ibiz-template/core";
|
|
16098
|
+
import { clone as clone19 } from "ramda";
|
|
16098
16099
|
var CalendarService = class extends MDControlService {
|
|
16099
16100
|
/**
|
|
16100
16101
|
* 执行查询多条数据的方法
|
|
@@ -16114,10 +16115,15 @@ var CalendarService = class extends MDControlService {
|
|
|
16114
16115
|
const promises = sysCalendarItems.map(
|
|
16115
16116
|
async (item) => {
|
|
16116
16117
|
const fetchAction = item.appDEDataSetId || "fetchdefault";
|
|
16118
|
+
const tempContext = context.clone();
|
|
16119
|
+
const tempParams = clone19(params);
|
|
16120
|
+
if (item.maxSize) {
|
|
16121
|
+
tempParams.size = item.maxSize;
|
|
16122
|
+
}
|
|
16117
16123
|
return this.exec2(
|
|
16118
16124
|
fetchAction,
|
|
16119
|
-
|
|
16120
|
-
|
|
16125
|
+
tempContext,
|
|
16126
|
+
tempParams,
|
|
16121
16127
|
void 0,
|
|
16122
16128
|
item.appDataEntityId
|
|
16123
16129
|
);
|
|
@@ -16379,7 +16385,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
16379
16385
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
16380
16386
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
16381
16387
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
16382
|
-
import { clone as
|
|
16388
|
+
import { clone as clone20, isNil as isNil22, mergeDeepRight } from "ramda";
|
|
16383
16389
|
dayjs4.extend(minMax2);
|
|
16384
16390
|
dayjs4.extend(isSameOrBefore);
|
|
16385
16391
|
dayjs4.extend(quarterOfYear);
|
|
@@ -16654,7 +16660,7 @@ var BaseSeriesGenerator = class {
|
|
|
16654
16660
|
dataPreprocess(data) {
|
|
16655
16661
|
const tempData = [];
|
|
16656
16662
|
data.forEach((singleData) => {
|
|
16657
|
-
tempData.push(
|
|
16663
|
+
tempData.push(clone20(singleData));
|
|
16658
16664
|
});
|
|
16659
16665
|
const { groupMode } = this.model;
|
|
16660
16666
|
if (groupMode) {
|
|
@@ -17705,7 +17711,7 @@ import { ModelError as ModelError19, RuntimeModelError as RuntimeModelError32 }
|
|
|
17705
17711
|
|
|
17706
17712
|
// src/ui-logic/utils/handle-src-val.ts
|
|
17707
17713
|
import { ModelError as ModelError18 } from "@ibiz-template/core";
|
|
17708
|
-
import { clone as
|
|
17714
|
+
import { clone as clone21 } from "ramda";
|
|
17709
17715
|
function handleSrcVal2(ctx, srcValParams) {
|
|
17710
17716
|
const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
17711
17717
|
const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
|
|
@@ -17732,7 +17738,7 @@ function handleSrcVal2(ctx, srcValParams) {
|
|
|
17732
17738
|
value = ctx.parameters.context;
|
|
17733
17739
|
break;
|
|
17734
17740
|
case "ENVPARAM":
|
|
17735
|
-
value =
|
|
17741
|
+
value = clone21(ibiz.env);
|
|
17736
17742
|
break;
|
|
17737
17743
|
default:
|
|
17738
17744
|
throw new ModelError18(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
@@ -18091,7 +18097,7 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18091
18097
|
|
|
18092
18098
|
// src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
|
|
18093
18099
|
import { ModelError as ModelError22, RuntimeError as RuntimeError41 } from "@ibiz-template/core";
|
|
18094
|
-
import { clone as
|
|
18100
|
+
import { clone as clone22 } from "ramda";
|
|
18095
18101
|
var PrepareJSParamNode = class extends UILogicNode {
|
|
18096
18102
|
async exec(ctx) {
|
|
18097
18103
|
const nodeParams = this.model.deuilogicNodeParams;
|
|
@@ -18180,7 +18186,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
18180
18186
|
copyParam(nodeParam, ctx) {
|
|
18181
18187
|
const { dstDEUILogicParamId } = nodeParam;
|
|
18182
18188
|
const srcVal = handleSrcVal2(ctx, nodeParam);
|
|
18183
|
-
ctx.params[dstDEUILogicParamId] =
|
|
18189
|
+
ctx.params[dstDEUILogicParamId] = clone22(srcVal);
|
|
18184
18190
|
}
|
|
18185
18191
|
/**
|
|
18186
18192
|
* 绑定参数
|
|
@@ -18407,7 +18413,7 @@ var ResetParamNode2 = class extends UILogicNode {
|
|
|
18407
18413
|
|
|
18408
18414
|
// src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts
|
|
18409
18415
|
import { RuntimeModelError as RuntimeModelError41 } from "@ibiz-template/core";
|
|
18410
|
-
import { clone as
|
|
18416
|
+
import { clone as clone23 } from "ramda";
|
|
18411
18417
|
var CopyParamNode2 = class extends UILogicNode {
|
|
18412
18418
|
async exec(ctx) {
|
|
18413
18419
|
const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
|
|
@@ -18418,7 +18424,7 @@ var CopyParamNode2 = class extends UILogicNode {
|
|
|
18418
18424
|
);
|
|
18419
18425
|
}
|
|
18420
18426
|
const srcVal = handleSrcVal2(ctx, this.model);
|
|
18421
|
-
ctx.params[dstDEUILogicParamId] =
|
|
18427
|
+
ctx.params[dstDEUILogicParamId] = clone23(srcVal);
|
|
18422
18428
|
}
|
|
18423
18429
|
};
|
|
18424
18430
|
|
|
@@ -23576,7 +23582,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
|
|
|
23576
23582
|
|
|
23577
23583
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
|
|
23578
23584
|
import { ModelError as ModelError28 } from "@ibiz-template/core";
|
|
23579
|
-
import { clone as
|
|
23585
|
+
import { clone as clone24 } from "ramda";
|
|
23580
23586
|
var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
23581
23587
|
constructor() {
|
|
23582
23588
|
super(...arguments);
|
|
@@ -23660,7 +23666,7 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
|
|
|
23660
23666
|
copyFields.forEach((key) => {
|
|
23661
23667
|
tempForm[key] = this.form.model[key];
|
|
23662
23668
|
});
|
|
23663
|
-
this.repeatedForm =
|
|
23669
|
+
this.repeatedForm = clone24(tempForm);
|
|
23664
23670
|
}
|
|
23665
23671
|
/**
|
|
23666
23672
|
* 设置重复器数据(修改主表单里重复器对应属性)
|
|
@@ -23824,7 +23830,7 @@ import {
|
|
|
23824
23830
|
} from "@ibiz-template/core";
|
|
23825
23831
|
import { debounce as debounce2 } from "lodash-es";
|
|
23826
23832
|
import { createUUID as createUUID12 } from "qx-util";
|
|
23827
|
-
import { clone as
|
|
23833
|
+
import { clone as clone25 } from "ramda";
|
|
23828
23834
|
|
|
23829
23835
|
// src/controller/control/form/edit-form/edit-form.service.ts
|
|
23830
23836
|
import {
|
|
@@ -24189,8 +24195,8 @@ var EditFormController = class extends FormController {
|
|
|
24189
24195
|
* @return {*} {Promise<IData>}
|
|
24190
24196
|
*/
|
|
24191
24197
|
async copy() {
|
|
24192
|
-
const context =
|
|
24193
|
-
const queryParams =
|
|
24198
|
+
const context = clone25(this.context);
|
|
24199
|
+
const queryParams = clone25(this.params);
|
|
24194
24200
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
24195
24201
|
this.model.appDataEntityId,
|
|
24196
24202
|
this.model.appId
|
|
@@ -24247,7 +24253,7 @@ var EditFormController = class extends FormController {
|
|
|
24247
24253
|
return this.loadDraft();
|
|
24248
24254
|
}
|
|
24249
24255
|
const { context, params } = this.handlerAbilityParams(args);
|
|
24250
|
-
const queryParams =
|
|
24256
|
+
const queryParams = clone25(params);
|
|
24251
24257
|
let res;
|
|
24252
24258
|
try {
|
|
24253
24259
|
await this.startLoading();
|
|
@@ -24815,7 +24821,7 @@ import {
|
|
|
24815
24821
|
RuntimeError as RuntimeError55,
|
|
24816
24822
|
RuntimeModelError as RuntimeModelError61
|
|
24817
24823
|
} from "@ibiz-template/core";
|
|
24818
|
-
import { clone as
|
|
24824
|
+
import { clone as clone26 } from "ramda";
|
|
24819
24825
|
|
|
24820
24826
|
// src/controller/control/grid/grid/grid.service.ts
|
|
24821
24827
|
import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
|
|
@@ -25125,7 +25131,7 @@ var GridController = class extends MDControlController {
|
|
|
25125
25131
|
const result = await calcColumnModelBySchema(json, this);
|
|
25126
25132
|
if (result && result.degridColumns.length > 0) {
|
|
25127
25133
|
const { degridColumns, degridDataItems } = result;
|
|
25128
|
-
this.model =
|
|
25134
|
+
this.model = clone26(this.model);
|
|
25129
25135
|
this.model.degridColumns = [
|
|
25130
25136
|
...(this.model.degridColumns || []).filter((item) => {
|
|
25131
25137
|
return degridColumns.findIndex((x) => x.id === item.id) === -1;
|
|
@@ -25285,6 +25291,12 @@ var GridController = class extends MDControlController {
|
|
|
25285
25291
|
[this.state.remoteAggResult] = res.data;
|
|
25286
25292
|
}
|
|
25287
25293
|
}
|
|
25294
|
+
async getFetchParams(extraParams = {}) {
|
|
25295
|
+
if (this.model.enableItemPrivilege === true) {
|
|
25296
|
+
extraParams.srfdataaccessaction = true;
|
|
25297
|
+
}
|
|
25298
|
+
return super.getFetchParams(extraParams);
|
|
25299
|
+
}
|
|
25288
25300
|
/**
|
|
25289
25301
|
* 计算当前页的聚合数据
|
|
25290
25302
|
* @author lxm
|
|
@@ -25640,7 +25652,7 @@ var GridController = class extends MDControlController {
|
|
|
25640
25652
|
throw new RuntimeError55("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
25641
25653
|
}
|
|
25642
25654
|
if (row.data.srfuf === 1 /* UPDATE */) {
|
|
25643
|
-
row.cacheData =
|
|
25655
|
+
row.cacheData = clone26(row.data);
|
|
25644
25656
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
25645
25657
|
Object.assign(row.data, defaultVal);
|
|
25646
25658
|
}
|
|
@@ -25809,7 +25821,7 @@ var GridController = class extends MDControlController {
|
|
|
25809
25821
|
}
|
|
25810
25822
|
});
|
|
25811
25823
|
}
|
|
25812
|
-
const cloneData =
|
|
25824
|
+
const cloneData = clone26(
|
|
25813
25825
|
data2.map((item) => {
|
|
25814
25826
|
return item.getOrigin();
|
|
25815
25827
|
})
|
|
@@ -26047,7 +26059,7 @@ var GridController = class extends MDControlController {
|
|
|
26047
26059
|
import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
|
|
26048
26060
|
import dayjs5 from "dayjs";
|
|
26049
26061
|
import { debounce as debounce3 } from "lodash-es";
|
|
26050
|
-
import { clone as
|
|
26062
|
+
import { clone as clone27, isNil as isNil24 } from "ramda";
|
|
26051
26063
|
var GridFieldColumnController = class extends GridColumnController {
|
|
26052
26064
|
constructor() {
|
|
26053
26065
|
super(...arguments);
|
|
@@ -26185,7 +26197,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
26185
26197
|
srfkey: value,
|
|
26186
26198
|
...wfContext
|
|
26187
26199
|
});
|
|
26188
|
-
const tempParams =
|
|
26200
|
+
const tempParams = clone27(this.params);
|
|
26189
26201
|
const { context: newContext, params: newParams } = this.handlePublicParams(
|
|
26190
26202
|
row.data,
|
|
26191
26203
|
tempContext,
|
|
@@ -27572,7 +27584,7 @@ var PickupViewPanelController = class extends ControlController {
|
|
|
27572
27584
|
|
|
27573
27585
|
// src/controller/control/search-bar/search-bar.controller.ts
|
|
27574
27586
|
import { mergeInLeft as mergeInLeft3 } from "@ibiz-template/core";
|
|
27575
|
-
import { clone as
|
|
27587
|
+
import { clone as clone28 } from "ramda";
|
|
27576
27588
|
|
|
27577
27589
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
27578
27590
|
import { RuntimeModelError as RuntimeModelError63 } from "@ibiz-template/core";
|
|
@@ -28171,7 +28183,7 @@ var SearchBarController = class extends ControlController {
|
|
|
28171
28183
|
}
|
|
28172
28184
|
});
|
|
28173
28185
|
if (addSearchBarFilters.length > 0) {
|
|
28174
|
-
this.model =
|
|
28186
|
+
this.model = clone28(this.model);
|
|
28175
28187
|
this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
|
|
28176
28188
|
this.model.enableFilter = true;
|
|
28177
28189
|
}
|
|
@@ -30894,7 +30906,7 @@ import {
|
|
|
30894
30906
|
awaitTimeout as awaitTimeout3,
|
|
30895
30907
|
recursiveIterate as recursiveIterate11
|
|
30896
30908
|
} from "@ibiz-template/core";
|
|
30897
|
-
import { clone as
|
|
30909
|
+
import { clone as clone29 } from "ramda";
|
|
30898
30910
|
|
|
30899
30911
|
// src/controller/control/tree-grid-ex/tree-grid-ex.service.ts
|
|
30900
30912
|
var TreeGridExService = class extends TreeService {
|
|
@@ -31330,7 +31342,7 @@ var TreeGridExController = class extends TreeController {
|
|
|
31330
31342
|
throw new RuntimeError62("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
31331
31343
|
}
|
|
31332
31344
|
if (row.data._deData.srfuf === 1 /* UPDATE */) {
|
|
31333
|
-
row.cacheData =
|
|
31345
|
+
row.cacheData = clone29(row.data);
|
|
31334
31346
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
31335
31347
|
Object.assign(row.data, defaultVal);
|
|
31336
31348
|
}
|
|
@@ -31443,7 +31455,7 @@ import {
|
|
|
31443
31455
|
RuntimeError as RuntimeError63,
|
|
31444
31456
|
RuntimeModelError as RuntimeModelError68
|
|
31445
31457
|
} from "@ibiz-template/core";
|
|
31446
|
-
import { clone as
|
|
31458
|
+
import { clone as clone30 } from "ramda";
|
|
31447
31459
|
import dayjs6 from "dayjs";
|
|
31448
31460
|
var TreeGridExNodeColumnController = class {
|
|
31449
31461
|
/**
|
|
@@ -31652,7 +31664,7 @@ var TreeGridExNodeColumnController = class {
|
|
|
31652
31664
|
srfkey: value,
|
|
31653
31665
|
...wfContext
|
|
31654
31666
|
});
|
|
31655
|
-
const tempParams =
|
|
31667
|
+
const tempParams = clone30(this.params);
|
|
31656
31668
|
const { userParam } = this.nodeColumn;
|
|
31657
31669
|
if (userParam) {
|
|
31658
31670
|
const { navigateContexts, navigateParams } = parseUserParams(userParam);
|
|
@@ -33172,7 +33184,7 @@ var HubController = class {
|
|
|
33172
33184
|
|
|
33173
33185
|
// src/controller/notification/async-action.controller.ts
|
|
33174
33186
|
import { QXEvent as QXEvent7 } from "qx-util";
|
|
33175
|
-
import { clone as
|
|
33187
|
+
import { clone as clone31 } from "ramda";
|
|
33176
33188
|
import { isNil as isNil28, isNumber as isNumber2 } from "lodash-es";
|
|
33177
33189
|
import dayjs7 from "dayjs";
|
|
33178
33190
|
var AsyncActionController = class {
|
|
@@ -33280,7 +33292,7 @@ var AsyncActionController = class {
|
|
|
33280
33292
|
} else {
|
|
33281
33293
|
this.noticeResult(action);
|
|
33282
33294
|
}
|
|
33283
|
-
this.evt.emit("add",
|
|
33295
|
+
this.evt.emit("add", clone31(action));
|
|
33284
33296
|
this.evt.emit("dataChange");
|
|
33285
33297
|
}
|
|
33286
33298
|
/**
|
|
@@ -33302,7 +33314,7 @@ var AsyncActionController = class {
|
|
|
33302
33314
|
}
|
|
33303
33315
|
this.noticeResult(action);
|
|
33304
33316
|
}
|
|
33305
|
-
this.evt.emit("change",
|
|
33317
|
+
this.evt.emit("change", clone31(action));
|
|
33306
33318
|
this.evt.emit("dataChange");
|
|
33307
33319
|
}
|
|
33308
33320
|
noticeResult(action) {
|
|
@@ -33329,6 +33341,7 @@ var InternalMessageController = class {
|
|
|
33329
33341
|
}
|
|
33330
33342
|
async init() {
|
|
33331
33343
|
this.load();
|
|
33344
|
+
this.listenMqtt();
|
|
33332
33345
|
}
|
|
33333
33346
|
async load() {
|
|
33334
33347
|
await this.fetch(false);
|
|
@@ -33356,6 +33369,21 @@ var InternalMessageController = class {
|
|
|
33356
33369
|
}
|
|
33357
33370
|
this.evt.emit("dataChange");
|
|
33358
33371
|
}
|
|
33372
|
+
/**
|
|
33373
|
+
* 监听mqtt消息
|
|
33374
|
+
* @author lxm
|
|
33375
|
+
* @date 2024-01-30 01:53:44
|
|
33376
|
+
* @protected
|
|
33377
|
+
*/
|
|
33378
|
+
listenMqtt() {
|
|
33379
|
+
ibiz.mc.command.internalMessage.on(async (msg) => {
|
|
33380
|
+
ibiz.log.debug("mqtt internalMessage: ", msg);
|
|
33381
|
+
if (msg.subtype !== "INTERNALMESSAGE") {
|
|
33382
|
+
return;
|
|
33383
|
+
}
|
|
33384
|
+
ibiz.notification.info({ desc: msg.content, position: "bottom-right" });
|
|
33385
|
+
});
|
|
33386
|
+
}
|
|
33359
33387
|
};
|
|
33360
33388
|
|
|
33361
33389
|
// src/controller/notification/notice.controller.ts
|
|
@@ -33772,7 +33800,7 @@ var EngineFactory = class {
|
|
|
33772
33800
|
};
|
|
33773
33801
|
|
|
33774
33802
|
// src/engine/view-base.engine.ts
|
|
33775
|
-
import { RuntimeError as RuntimeError66 } from "@ibiz-template/core";
|
|
33803
|
+
import { RuntimeError as RuntimeError66, findRecursiveChild as findRecursiveChild3 } from "@ibiz-template/core";
|
|
33776
33804
|
var ViewEngineBase = class {
|
|
33777
33805
|
/**
|
|
33778
33806
|
* 构造函数在视图控制器的构造函数逻辑内部执行
|
|
@@ -33842,27 +33870,81 @@ var ViewEngineBase = class {
|
|
|
33842
33870
|
async onCreated() {
|
|
33843
33871
|
const { childNames } = this.view;
|
|
33844
33872
|
childNames.push("captionbar", "toolbar");
|
|
33873
|
+
this.calcDynamicLayout();
|
|
33845
33874
|
}
|
|
33846
|
-
|
|
33847
|
-
|
|
33848
|
-
|
|
33849
|
-
|
|
33850
|
-
|
|
33851
|
-
|
|
33852
|
-
|
|
33853
|
-
|
|
33854
|
-
|
|
33875
|
+
/**
|
|
33876
|
+
* 计算动态布局模型
|
|
33877
|
+
*
|
|
33878
|
+
* @author zk
|
|
33879
|
+
* @date 2024-01-29 02:01:47
|
|
33880
|
+
* @memberof ViewEngineBase
|
|
33881
|
+
*/
|
|
33882
|
+
calcDynamicLayout() {
|
|
33883
|
+
const names = this.calcRemoveLayoutModel();
|
|
33884
|
+
ibiz.log.debug("".concat(this.view.model.codeName, "\u5220\u9664\u6A21\u578B\uFF1A").concat(names.join(";")));
|
|
33885
|
+
this.removeLayoutModel(names);
|
|
33886
|
+
}
|
|
33887
|
+
/**
|
|
33888
|
+
* 计算移除的模型名称
|
|
33889
|
+
*
|
|
33890
|
+
* @author zk
|
|
33891
|
+
* @date 2024-01-29 02:01:21
|
|
33892
|
+
* @return {*} {string[]}
|
|
33893
|
+
* @memberof ViewEngineBase
|
|
33894
|
+
*/
|
|
33895
|
+
calcRemoveLayoutModel() {
|
|
33896
|
+
const { model } = this.view;
|
|
33897
|
+
const names = [];
|
|
33898
|
+
if (model.showCaptionBar === false) {
|
|
33899
|
+
names.push("view_captionbar");
|
|
33900
|
+
}
|
|
33901
|
+
if (!getControl(model, "toolbar")) {
|
|
33902
|
+
names.push("view_toolbar", "toolbar");
|
|
33903
|
+
}
|
|
33904
|
+
const toolBarList = ["lefttoolbar", "righttoolbar", "footertoolbar"];
|
|
33905
|
+
toolBarList.forEach((name) => {
|
|
33906
|
+
if (!getControl(model, name)) {
|
|
33907
|
+
names.push(name);
|
|
33855
33908
|
}
|
|
33909
|
+
});
|
|
33910
|
+
if (!this.calcViewHeaderVisible()) {
|
|
33911
|
+
names.push("view_header");
|
|
33856
33912
|
}
|
|
33857
33913
|
if (ibiz.env.isMob) {
|
|
33858
|
-
|
|
33859
|
-
|
|
33860
|
-
const controller = (_b = this.viewLayoutPanel) == null ? void 0 : _b.panelItems.view_footer;
|
|
33861
|
-
if (controller) {
|
|
33862
|
-
controller.state.visible = false;
|
|
33863
|
-
}
|
|
33914
|
+
if (!this.calcViewFooterVisible()) {
|
|
33915
|
+
names.push("view_footer");
|
|
33864
33916
|
}
|
|
33865
33917
|
}
|
|
33918
|
+
return names;
|
|
33919
|
+
}
|
|
33920
|
+
/**
|
|
33921
|
+
* 删除布局模型
|
|
33922
|
+
*
|
|
33923
|
+
* @author zk
|
|
33924
|
+
* @date 2024-01-29 02:01:29
|
|
33925
|
+
* @param {string[]} names
|
|
33926
|
+
* @param {(IPanelContainer | undefined)} [container=this.view.model.viewLayoutPanel]
|
|
33927
|
+
* @return {*} {void}
|
|
33928
|
+
* @memberof ViewEngineBase
|
|
33929
|
+
*/
|
|
33930
|
+
removeLayoutModel(names, container = this.view.model.viewLayoutPanel) {
|
|
33931
|
+
if (!container) {
|
|
33932
|
+
return;
|
|
33933
|
+
}
|
|
33934
|
+
const items = container.rootPanelItems || container.panelItems || [];
|
|
33935
|
+
const index = items.findIndex((item) => names.includes(item.id));
|
|
33936
|
+
if (index !== -1) {
|
|
33937
|
+
items.splice(index, 1);
|
|
33938
|
+
}
|
|
33939
|
+
items.forEach((item) => {
|
|
33940
|
+
if (item.itemType === "CONTAINER") {
|
|
33941
|
+
this.removeLayoutModel(names, item);
|
|
33942
|
+
}
|
|
33943
|
+
});
|
|
33944
|
+
}
|
|
33945
|
+
async onMounted() {
|
|
33946
|
+
const { model, childNames } = this.view;
|
|
33947
|
+
ibiz.log.debug("".concat(model.id, "\u7684\u5B50\u7EC4\u4EF6\uFF1A").concat(childNames.join(";"), "\u90FD\u5DF2mounted"));
|
|
33866
33948
|
}
|
|
33867
33949
|
async onDestroyed() {
|
|
33868
33950
|
}
|
|
@@ -33898,44 +33980,45 @@ var ViewEngineBase = class {
|
|
|
33898
33980
|
* @protected
|
|
33899
33981
|
*/
|
|
33900
33982
|
calcViewHeaderVisible() {
|
|
33901
|
-
var _a, _b, _c, _d;
|
|
33902
33983
|
let showHeader = false;
|
|
33903
33984
|
const { model } = this.view;
|
|
33904
|
-
if (model.showCaptionBar
|
|
33905
|
-
const controller = (_a = this.viewLayoutPanel) == null ? void 0 : _a.panelItems.view_captionbar;
|
|
33906
|
-
if (controller) {
|
|
33907
|
-
controller.state.visible = false;
|
|
33908
|
-
}
|
|
33909
|
-
} else {
|
|
33985
|
+
if (model.showCaptionBar) {
|
|
33910
33986
|
showHeader = true;
|
|
33911
33987
|
}
|
|
33912
33988
|
if (ibiz.env.isMob) {
|
|
33913
|
-
if (
|
|
33914
|
-
const controller = (_b = this.viewLayoutPanel) == null ? void 0 : _b.panelItems.lefttoolbar;
|
|
33915
|
-
if (controller) {
|
|
33916
|
-
controller.state.visible = false;
|
|
33917
|
-
}
|
|
33918
|
-
} else {
|
|
33989
|
+
if (this.isExistAndInLayout("lefttoolbar")) {
|
|
33919
33990
|
showHeader = true;
|
|
33920
33991
|
}
|
|
33921
|
-
if (
|
|
33922
|
-
const controller = (_c = this.viewLayoutPanel) == null ? void 0 : _c.panelItems.righttoolbar;
|
|
33923
|
-
if (controller) {
|
|
33924
|
-
controller.state.visible = false;
|
|
33925
|
-
}
|
|
33926
|
-
} else {
|
|
33992
|
+
if (this.isExistAndInLayout("righttoolbar")) {
|
|
33927
33993
|
showHeader = true;
|
|
33928
33994
|
}
|
|
33929
|
-
} else if (
|
|
33930
|
-
const controller = (_d = this.viewLayoutPanel) == null ? void 0 : _d.panelItems.view_toolbar;
|
|
33931
|
-
if (controller) {
|
|
33932
|
-
controller.state.visible = false;
|
|
33933
|
-
}
|
|
33934
|
-
} else {
|
|
33995
|
+
} else if (this.isExistAndInLayout("toolbar")) {
|
|
33935
33996
|
showHeader = true;
|
|
33936
33997
|
}
|
|
33937
33998
|
return showHeader;
|
|
33938
33999
|
}
|
|
34000
|
+
/**
|
|
34001
|
+
* 是否存在模型 并且 布局中有占位
|
|
34002
|
+
*
|
|
34003
|
+
* @author zk
|
|
34004
|
+
* @date 2024-01-30 11:01:33
|
|
34005
|
+
* @param {string} name
|
|
34006
|
+
* @return {*} {(IData | undefined)}
|
|
34007
|
+
* @memberof ViewEngineBase
|
|
34008
|
+
*/
|
|
34009
|
+
isExistAndInLayout(name) {
|
|
34010
|
+
const layout = this.view.model.viewLayoutPanel;
|
|
34011
|
+
if (!layout) {
|
|
34012
|
+
return false;
|
|
34013
|
+
}
|
|
34014
|
+
const ins = findRecursiveChild3(layout, name, {
|
|
34015
|
+
compareField: "id",
|
|
34016
|
+
childrenFields: ["panelItems", "rootPanelItems"]
|
|
34017
|
+
});
|
|
34018
|
+
const { model } = this.view;
|
|
34019
|
+
const has = getControl(model, name);
|
|
34020
|
+
return !!(ins && has);
|
|
34021
|
+
}
|
|
33939
34022
|
/**
|
|
33940
34023
|
* 计算底部的显示与否
|
|
33941
34024
|
* @author lxm
|
|
@@ -33945,7 +34028,7 @@ var ViewEngineBase = class {
|
|
|
33945
34028
|
*/
|
|
33946
34029
|
calcViewFooterVisible() {
|
|
33947
34030
|
let showFooter = false;
|
|
33948
|
-
if (this.
|
|
34031
|
+
if (this.isExistAndInLayout("footertoolbar")) {
|
|
33949
34032
|
showFooter = true;
|
|
33950
34033
|
}
|
|
33951
34034
|
return showFooter;
|
|
@@ -33982,7 +34065,7 @@ var ViewEngineBase = class {
|
|
|
33982
34065
|
|
|
33983
34066
|
// src/engine/md-view.engine.ts
|
|
33984
34067
|
import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
|
|
33985
|
-
import { clone as
|
|
34068
|
+
import { clone as clone32 } from "ramda";
|
|
33986
34069
|
var MDViewEngine = class extends ViewEngineBase {
|
|
33987
34070
|
/**
|
|
33988
34071
|
* 多数据部件名称
|
|
@@ -34194,7 +34277,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
34194
34277
|
if (!openAppViewLogic) {
|
|
34195
34278
|
throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
34196
34279
|
}
|
|
34197
|
-
const params =
|
|
34280
|
+
const params = clone32(this.view.params);
|
|
34198
34281
|
if (copyMode) {
|
|
34199
34282
|
params.srfcopymode = copyMode;
|
|
34200
34283
|
}
|
|
@@ -34295,17 +34378,38 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
34295
34378
|
async copy(args) {
|
|
34296
34379
|
this.newData(Object.assign(args, { copyMode: true }));
|
|
34297
34380
|
}
|
|
34381
|
+
/**
|
|
34382
|
+
* 计算头部显示
|
|
34383
|
+
*
|
|
34384
|
+
* @author zk
|
|
34385
|
+
* @date 2024-01-29 05:01:30
|
|
34386
|
+
* @protected
|
|
34387
|
+
* @return {*} {boolean}
|
|
34388
|
+
* @memberof MDViewEngine
|
|
34389
|
+
*/
|
|
34298
34390
|
calcViewHeaderVisible() {
|
|
34299
|
-
|
|
34300
|
-
|
|
34301
|
-
|
|
34302
|
-
|
|
34303
|
-
|
|
34304
|
-
|
|
34305
|
-
|
|
34306
|
-
|
|
34391
|
+
const showHeader = super.calcViewHeaderVisible();
|
|
34392
|
+
const visible = this.calcViewSearchBarVisible();
|
|
34393
|
+
return visible || showHeader;
|
|
34394
|
+
}
|
|
34395
|
+
/**
|
|
34396
|
+
* 计算搜索栏显示
|
|
34397
|
+
*
|
|
34398
|
+
* @author zk
|
|
34399
|
+
* @date 2024-01-29 05:01:36
|
|
34400
|
+
* @protected
|
|
34401
|
+
* @return {*} {boolean}
|
|
34402
|
+
* @memberof MDViewEngine
|
|
34403
|
+
*/
|
|
34404
|
+
calcViewSearchBarVisible() {
|
|
34405
|
+
const { model } = this.view;
|
|
34406
|
+
const has = this.isExistAndInLayout("searchbar");
|
|
34407
|
+
if (!has) {
|
|
34408
|
+
return has;
|
|
34307
34409
|
}
|
|
34308
|
-
|
|
34410
|
+
const searchBar = getControl(model, "searchbar");
|
|
34411
|
+
const visible = !!(searchBar.enableQuickSearch || searchBar.enableGroup || searchBar.enableFilter === true);
|
|
34412
|
+
return visible;
|
|
34309
34413
|
}
|
|
34310
34414
|
/**
|
|
34311
34415
|
* 切换搜索表单的显示与否
|
|
@@ -34321,6 +34425,25 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
34321
34425
|
}
|
|
34322
34426
|
}
|
|
34323
34427
|
}
|
|
34428
|
+
/**
|
|
34429
|
+
* 计算移除的模型名称
|
|
34430
|
+
*
|
|
34431
|
+
* @author zk
|
|
34432
|
+
* @date 2024-01-29 03:01:42
|
|
34433
|
+
* @return {*} {string[]}
|
|
34434
|
+
* @memberof MDViewEngine
|
|
34435
|
+
*/
|
|
34436
|
+
calcRemoveLayoutModel() {
|
|
34437
|
+
const { model } = this.view;
|
|
34438
|
+
const names = super.calcRemoveLayoutModel();
|
|
34439
|
+
if (!getControl(model, "searchform")) {
|
|
34440
|
+
names.push("searchform");
|
|
34441
|
+
}
|
|
34442
|
+
if (!this.calcViewSearchBarVisible()) {
|
|
34443
|
+
names.push("view_searchbar");
|
|
34444
|
+
}
|
|
34445
|
+
return names;
|
|
34446
|
+
}
|
|
34324
34447
|
};
|
|
34325
34448
|
|
|
34326
34449
|
// src/global/global-util/global-util.ts
|