@ibiz-template/runtime 0.5.7-alpha.4 → 0.5.7-alpha.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.
Files changed (52) hide show
  1. package/dist/index.esm.js +317 -194
  2. package/dist/index.system.min.js +1 -1
  3. package/out/controller/control/calendar/calendar.service.d.ts.map +1 -1
  4. package/out/controller/control/calendar/calendar.service.js +7 -1
  5. package/out/controller/control/search-bar/entity-schema.d.ts +1 -2
  6. package/out/controller/control/search-bar/entity-schema.d.ts.map +1 -1
  7. package/out/controller/control/search-bar/entity-schema.js +2 -2
  8. package/out/controller/control/search-bar/index.d.ts +2 -0
  9. package/out/controller/control/search-bar/index.d.ts.map +1 -1
  10. package/out/controller/control/search-bar/index.js +2 -0
  11. package/out/controller/control/search-bar/search-bar-filter.controller.d.ts +5 -6
  12. package/out/controller/control/search-bar/search-bar-filter.controller.d.ts.map +1 -1
  13. package/out/controller/control/search-bar/search-bar-filter.controller.js +6 -9
  14. package/out/controller/control/search-bar/search-bar.controller.d.ts +1 -24
  15. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  16. package/out/controller/control/search-bar/search-bar.controller.js +11 -88
  17. package/out/controller/control/search-bar/use-searchcond.d.ts +33 -0
  18. package/out/controller/control/search-bar/use-searchcond.d.ts.map +1 -0
  19. package/out/controller/control/search-bar/use-searchcond.js +91 -0
  20. package/out/controller/notification/internal-message.controller.d.ts +7 -0
  21. package/out/controller/notification/internal-message.controller.d.ts.map +1 -1
  22. package/out/controller/notification/internal-message.controller.js +17 -0
  23. package/out/engine/md-view.engine.d.ts +28 -0
  24. package/out/engine/md-view.engine.d.ts.map +1 -1
  25. package/out/engine/md-view.engine.js +53 -11
  26. package/out/engine/view-base.engine.d.ts +38 -0
  27. package/out/engine/view-base.engine.d.ts.map +1 -1
  28. package/out/engine/view-base.engine.js +99 -53
  29. package/out/interface/common/i-drawer-options/i-drawer-options.d.ts +2 -2
  30. package/out/interface/common/i-modal-options/i-modal-options.d.ts +2 -2
  31. package/out/interface/common/i-popover-options/i-popover-options.d.ts +10 -10
  32. package/out/interface/common/i-popover-options/i-popover-options.d.ts.map +1 -1
  33. package/out/interface/util/i-notification-util/i-notification-util.d.ts +7 -0
  34. package/out/interface/util/i-notification-util/i-notification-util.d.ts.map +1 -1
  35. package/out/service/service/auth/v7-auth.service.d.ts +8 -0
  36. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  37. package/out/service/service/auth/v7-auth.service.js +15 -0
  38. package/package.json +5 -5
  39. package/src/controller/control/calendar/calendar.service.ts +8 -2
  40. package/src/controller/control/search-bar/entity-schema.ts +4 -4
  41. package/src/controller/control/search-bar/index.ts +2 -0
  42. package/src/controller/control/search-bar/search-bar-filter.controller.ts +15 -10
  43. package/src/controller/control/search-bar/search-bar.controller.ts +24 -98
  44. package/src/controller/control/search-bar/use-searchcond.ts +100 -0
  45. package/src/controller/notification/internal-message.controller.ts +20 -1
  46. package/src/engine/md-view.engine.ts +59 -11
  47. package/src/engine/view-base.engine.ts +108 -51
  48. package/src/interface/common/i-drawer-options/i-drawer-options.ts +2 -2
  49. package/src/interface/common/i-modal-options/i-modal-options.ts +2 -2
  50. package/src/interface/common/i-popover-options/i-popover-options.ts +10 -10
  51. package/src/interface/util/i-notification-util/i-notification-util.ts +8 -0
  52. package/src/service/service/auth/v7-auth.service.ts +16 -1
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(clone32, teleport = document.body, isRemoveChild = true) {
3251
- const element = getAnimationElement(clone32);
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 clone32 = {};
3670
+ var clone33 = {};
3671
3671
  for (var p in o) {
3672
- clone32[p] = o[p];
3672
+ clone33[p] = o[p];
3673
3673
  }
3674
- return clone32;
3674
+ return clone33;
3675
3675
  }
3676
3676
  function replaceObjectProps(o1, o2) {
3677
3677
  var o = cloneObject(o1);
@@ -9336,6 +9336,7 @@ var V7AuthService = class {
9336
9336
  true
9337
9337
  );
9338
9338
  }
9339
+ await this.loadAppData();
9339
9340
  ibiz.hub.getAllApps().forEach((app) => {
9340
9341
  app.initMqtt();
9341
9342
  });
@@ -9352,6 +9353,19 @@ var V7AuthService = class {
9352
9353
  isAnonymous
9353
9354
  } : void 0;
9354
9355
  }
9356
+ /**
9357
+ * 加载应用数据
9358
+ *
9359
+ * @author chitanda
9360
+ * @date 2022-07-20 20:07:50
9361
+ * @return {*} {Promise<void>}
9362
+ */
9363
+ async loadAppData() {
9364
+ const res = await ibiz.net.get("/appdata");
9365
+ if (res.ok) {
9366
+ ibiz.appData = res.data;
9367
+ }
9368
+ }
9355
9369
  };
9356
9370
 
9357
9371
  // src/service/service/async-action/async-action.service.ts
@@ -16081,6 +16095,7 @@ import dayjs3 from "dayjs";
16081
16095
 
16082
16096
  // src/controller/control/calendar/calendar.service.ts
16083
16097
  import { RuntimeError as RuntimeError38 } from "@ibiz-template/core";
16098
+ import { clone as clone19 } from "ramda";
16084
16099
  var CalendarService = class extends MDControlService {
16085
16100
  /**
16086
16101
  * 执行查询多条数据的方法
@@ -16100,10 +16115,15 @@ var CalendarService = class extends MDControlService {
16100
16115
  const promises = sysCalendarItems.map(
16101
16116
  async (item) => {
16102
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
+ }
16103
16123
  return this.exec2(
16104
16124
  fetchAction,
16105
- context,
16106
- params,
16125
+ tempContext,
16126
+ tempParams,
16107
16127
  void 0,
16108
16128
  item.appDataEntityId
16109
16129
  );
@@ -16365,7 +16385,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
16365
16385
  import quarterOfYear from "dayjs/plugin/quarterOfYear";
16366
16386
  import weekOfYear from "dayjs/plugin/weekOfYear";
16367
16387
  import isoWeek from "dayjs/plugin/isoWeek";
16368
- import { clone as clone19, isNil as isNil22, mergeDeepRight } from "ramda";
16388
+ import { clone as clone20, isNil as isNil22, mergeDeepRight } from "ramda";
16369
16389
  dayjs4.extend(minMax2);
16370
16390
  dayjs4.extend(isSameOrBefore);
16371
16391
  dayjs4.extend(quarterOfYear);
@@ -16640,7 +16660,7 @@ var BaseSeriesGenerator = class {
16640
16660
  dataPreprocess(data) {
16641
16661
  const tempData = [];
16642
16662
  data.forEach((singleData) => {
16643
- tempData.push(clone19(singleData));
16663
+ tempData.push(clone20(singleData));
16644
16664
  });
16645
16665
  const { groupMode } = this.model;
16646
16666
  if (groupMode) {
@@ -17691,7 +17711,7 @@ import { ModelError as ModelError19, RuntimeModelError as RuntimeModelError32 }
17691
17711
 
17692
17712
  // src/ui-logic/utils/handle-src-val.ts
17693
17713
  import { ModelError as ModelError18 } from "@ibiz-template/core";
17694
- import { clone as clone20 } from "ramda";
17714
+ import { clone as clone21 } from "ramda";
17695
17715
  function handleSrcVal2(ctx, srcValParams) {
17696
17716
  const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
17697
17717
  const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
@@ -17718,7 +17738,7 @@ function handleSrcVal2(ctx, srcValParams) {
17718
17738
  value = ctx.parameters.context;
17719
17739
  break;
17720
17740
  case "ENVPARAM":
17721
- value = clone20(ibiz.env);
17741
+ value = clone21(ibiz.env);
17722
17742
  break;
17723
17743
  default:
17724
17744
  throw new ModelError18(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
@@ -18077,7 +18097,7 @@ var EndNode2 = class extends UILogicNode {
18077
18097
 
18078
18098
  // src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
18079
18099
  import { ModelError as ModelError22, RuntimeError as RuntimeError41 } from "@ibiz-template/core";
18080
- import { clone as clone21 } from "ramda";
18100
+ import { clone as clone22 } from "ramda";
18081
18101
  var PrepareJSParamNode = class extends UILogicNode {
18082
18102
  async exec(ctx) {
18083
18103
  const nodeParams = this.model.deuilogicNodeParams;
@@ -18166,7 +18186,7 @@ var PrepareJSParamNode = class extends UILogicNode {
18166
18186
  copyParam(nodeParam, ctx) {
18167
18187
  const { dstDEUILogicParamId } = nodeParam;
18168
18188
  const srcVal = handleSrcVal2(ctx, nodeParam);
18169
- ctx.params[dstDEUILogicParamId] = clone21(srcVal);
18189
+ ctx.params[dstDEUILogicParamId] = clone22(srcVal);
18170
18190
  }
18171
18191
  /**
18172
18192
  * 绑定参数
@@ -18393,7 +18413,7 @@ var ResetParamNode2 = class extends UILogicNode {
18393
18413
 
18394
18414
  // src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts
18395
18415
  import { RuntimeModelError as RuntimeModelError41 } from "@ibiz-template/core";
18396
- import { clone as clone22 } from "ramda";
18416
+ import { clone as clone23 } from "ramda";
18397
18417
  var CopyParamNode2 = class extends UILogicNode {
18398
18418
  async exec(ctx) {
18399
18419
  const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
@@ -18404,7 +18424,7 @@ var CopyParamNode2 = class extends UILogicNode {
18404
18424
  );
18405
18425
  }
18406
18426
  const srcVal = handleSrcVal2(ctx, this.model);
18407
- ctx.params[dstDEUILogicParamId] = clone22(srcVal);
18427
+ ctx.params[dstDEUILogicParamId] = clone23(srcVal);
18408
18428
  }
18409
18429
  };
18410
18430
 
@@ -23562,7 +23582,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
23562
23582
 
23563
23583
  // src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
23564
23584
  import { ModelError as ModelError28 } from "@ibiz-template/core";
23565
- import { clone as clone23 } from "ramda";
23585
+ import { clone as clone24 } from "ramda";
23566
23586
  var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
23567
23587
  constructor() {
23568
23588
  super(...arguments);
@@ -23646,7 +23666,7 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
23646
23666
  copyFields.forEach((key) => {
23647
23667
  tempForm[key] = this.form.model[key];
23648
23668
  });
23649
- this.repeatedForm = clone23(tempForm);
23669
+ this.repeatedForm = clone24(tempForm);
23650
23670
  }
23651
23671
  /**
23652
23672
  * 设置重复器数据(修改主表单里重复器对应属性)
@@ -23810,7 +23830,7 @@ import {
23810
23830
  } from "@ibiz-template/core";
23811
23831
  import { debounce as debounce2 } from "lodash-es";
23812
23832
  import { createUUID as createUUID12 } from "qx-util";
23813
- import { clone as clone24 } from "ramda";
23833
+ import { clone as clone25 } from "ramda";
23814
23834
 
23815
23835
  // src/controller/control/form/edit-form/edit-form.service.ts
23816
23836
  import {
@@ -24175,8 +24195,8 @@ var EditFormController = class extends FormController {
24175
24195
  * @return {*} {Promise<IData>}
24176
24196
  */
24177
24197
  async copy() {
24178
- const context = clone24(this.context);
24179
- const queryParams = clone24(this.params);
24198
+ const context = clone25(this.context);
24199
+ const queryParams = clone25(this.params);
24180
24200
  const appDataEntity = await ibiz.hub.getAppDataEntity(
24181
24201
  this.model.appDataEntityId,
24182
24202
  this.model.appId
@@ -24233,7 +24253,7 @@ var EditFormController = class extends FormController {
24233
24253
  return this.loadDraft();
24234
24254
  }
24235
24255
  const { context, params } = this.handlerAbilityParams(args);
24236
- const queryParams = clone24(params);
24256
+ const queryParams = clone25(params);
24237
24257
  let res;
24238
24258
  try {
24239
24259
  await this.startLoading();
@@ -24801,7 +24821,7 @@ import {
24801
24821
  RuntimeError as RuntimeError55,
24802
24822
  RuntimeModelError as RuntimeModelError61
24803
24823
  } from "@ibiz-template/core";
24804
- import { clone as clone25 } from "ramda";
24824
+ import { clone as clone26 } from "ramda";
24805
24825
 
24806
24826
  // src/controller/control/grid/grid/grid.service.ts
24807
24827
  import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
@@ -25111,7 +25131,7 @@ var GridController = class extends MDControlController {
25111
25131
  const result = await calcColumnModelBySchema(json, this);
25112
25132
  if (result && result.degridColumns.length > 0) {
25113
25133
  const { degridColumns, degridDataItems } = result;
25114
- this.model = clone25(this.model);
25134
+ this.model = clone26(this.model);
25115
25135
  this.model.degridColumns = [
25116
25136
  ...(this.model.degridColumns || []).filter((item) => {
25117
25137
  return degridColumns.findIndex((x) => x.id === item.id) === -1;
@@ -25626,7 +25646,7 @@ var GridController = class extends MDControlController {
25626
25646
  throw new RuntimeError55("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
25627
25647
  }
25628
25648
  if (row.data.srfuf === 1 /* UPDATE */) {
25629
- row.cacheData = clone25(row.data);
25649
+ row.cacheData = clone26(row.data);
25630
25650
  const defaultVal = this.calcDefaultValue(row.data, false);
25631
25651
  Object.assign(row.data, defaultVal);
25632
25652
  }
@@ -25795,7 +25815,7 @@ var GridController = class extends MDControlController {
25795
25815
  }
25796
25816
  });
25797
25817
  }
25798
- const cloneData = clone25(
25818
+ const cloneData = clone26(
25799
25819
  data2.map((item) => {
25800
25820
  return item.getOrigin();
25801
25821
  })
@@ -26033,7 +26053,7 @@ var GridController = class extends MDControlController {
26033
26053
  import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
26034
26054
  import dayjs5 from "dayjs";
26035
26055
  import { debounce as debounce3 } from "lodash-es";
26036
- import { clone as clone26, isNil as isNil24 } from "ramda";
26056
+ import { clone as clone27, isNil as isNil24 } from "ramda";
26037
26057
  var GridFieldColumnController = class extends GridColumnController {
26038
26058
  constructor() {
26039
26059
  super(...arguments);
@@ -26171,7 +26191,7 @@ var GridFieldColumnController = class extends GridColumnController {
26171
26191
  srfkey: value,
26172
26192
  ...wfContext
26173
26193
  });
26174
- const tempParams = clone26(this.params);
26194
+ const tempParams = clone27(this.params);
26175
26195
  const { context: newContext, params: newParams } = this.handlePublicParams(
26176
26196
  row.data,
26177
26197
  tempContext,
@@ -27557,12 +27577,8 @@ var PickupViewPanelController = class extends ControlController {
27557
27577
  };
27558
27578
 
27559
27579
  // src/controller/control/search-bar/search-bar.controller.ts
27560
- import {
27561
- RuntimeError as RuntimeError58,
27562
- mergeInLeft as mergeInLeft3,
27563
- recursiveIterate as recursiveIterate9
27564
- } from "@ibiz-template/core";
27565
- import { clone as clone27, isNil as isNil25 } from "ramda";
27580
+ import { mergeInLeft as mergeInLeft3 } from "@ibiz-template/core";
27581
+ import { clone as clone28 } from "ramda";
27566
27582
 
27567
27583
  // src/controller/control/search-bar/search-bar-filter.controller.ts
27568
27584
  import { RuntimeModelError as RuntimeModelError63 } from "@ibiz-template/core";
@@ -27571,9 +27587,9 @@ var ExcludeOPs = [
27571
27587
  "ISNOTNULL" /* IS_NOT_NULL */
27572
27588
  ];
27573
27589
  var SearchBarFilterController = class {
27574
- constructor(model, searchBar) {
27590
+ constructor(model, appDataEntity, context, params) {
27575
27591
  this.model = model;
27576
- this.searchBar = searchBar;
27592
+ this.appDataEntity = appDataEntity;
27577
27593
  /**
27578
27594
  * 不需要编辑器
27579
27595
  * @author lxm
@@ -27582,21 +27598,17 @@ var SearchBarFilterController = class {
27582
27598
  */
27583
27599
  this.noEditor = false;
27584
27600
  var _a;
27601
+ this.context = context;
27602
+ this.params = params;
27585
27603
  let field;
27586
27604
  if (model.appDEFieldId) {
27587
- field = findFieldById(searchBar.appDataEntity, model.appDEFieldId);
27605
+ field = findFieldById(appDataEntity, model.appDEFieldId);
27588
27606
  }
27589
27607
  this.fieldName = field ? field.codeName.toLowerCase() : model.id;
27590
27608
  this.label = model.caption || (field == null ? void 0 : field.logicName) || model.id;
27591
27609
  this.valueOP = (_a = model.defsearchMode) == null ? void 0 : _a.valueOP;
27592
27610
  this.noEditor = this.valueOP ? ExcludeOPs.includes(this.valueOP) : !this.model.editor;
27593
27611
  }
27594
- get context() {
27595
- return this.searchBar.context;
27596
- }
27597
- get params() {
27598
- return this.searchBar.params;
27599
- }
27600
27612
  /**
27601
27613
  * 初始化
27602
27614
  * @author lxm
@@ -27893,7 +27905,7 @@ function getEditor(field, op) {
27893
27905
  const editorModel = EditorsMap["".concat(field.type, "_").concat(op)];
27894
27906
  return editorModel;
27895
27907
  }
27896
- async function calcFilterModelBySchema(json, c) {
27908
+ async function calcFilterModelBySchema(json, appDataEntityId, modelAppId) {
27897
27909
  var _a;
27898
27910
  if (!json.properties) {
27899
27911
  return [];
@@ -27929,8 +27941,8 @@ async function calcFilterModelBySchema(json, c) {
27929
27941
  });
27930
27942
  const codeNameToId = {};
27931
27943
  const dataEntity = await ibiz.hub.getAppDataEntity(
27932
- c.model.appDataEntityId,
27933
- c.model.appId
27944
+ appDataEntityId,
27945
+ modelAppId
27934
27946
  );
27935
27947
  (_a = dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
27936
27948
  codeNameToId[field.codeName.toLowerCase()] = field.id;
@@ -27960,6 +27972,72 @@ async function calcFilterModelBySchema(json, c) {
27960
27972
  return addSearchBarFilters;
27961
27973
  }
27962
27974
 
27975
+ // src/controller/control/search-bar/use-searchcond.ts
27976
+ import { RuntimeError as RuntimeError58, recursiveIterate as recursiveIterate9 } from "@ibiz-template/core";
27977
+ import { isNil as isNil25 } from "ramda";
27978
+ function getOriginFilterNodes() {
27979
+ return [
27980
+ {
27981
+ leaf: false,
27982
+ logicType: "AND",
27983
+ children: [{ leaf: true, field: null, valueOP: null, value: null }]
27984
+ }
27985
+ ];
27986
+ }
27987
+ function formatFilters(node) {
27988
+ if (!node.leaf) {
27989
+ return {
27990
+ condtype: "GROUP",
27991
+ condop: node.logicType,
27992
+ bnotmode: false,
27993
+ searchconds: node.children.map((item) => formatFilters(item))
27994
+ };
27995
+ }
27996
+ return {
27997
+ condtype: "DEFIELD",
27998
+ fieldname: node.field,
27999
+ condop: node.valueOP,
28000
+ value: node.value
28001
+ };
28002
+ }
28003
+ function parseFilters(data) {
28004
+ if (data.condtype === "GROUP") {
28005
+ return {
28006
+ leaf: false,
28007
+ logicType: data.condop === "AND" ? "AND" : "OR",
28008
+ children: (data.searchconds || []).map(
28009
+ (item) => parseFilters(item)
28010
+ )
28011
+ };
28012
+ }
28013
+ if (data.condtype === "DEFIELD") {
28014
+ return {
28015
+ leaf: true,
28016
+ field: data.fieldname || null,
28017
+ valueOP: data.condop || null,
28018
+ value: data.value || null
28019
+ };
28020
+ }
28021
+ throw new RuntimeError58("\u65E0\u6548\u7684condtype:".concat(data.condtype));
28022
+ }
28023
+ function calcSearchConds(filterNodes) {
28024
+ let hasFilter = false;
28025
+ let hasError = false;
28026
+ recursiveIterate9(filterNodes[0], (node) => {
28027
+ if (node.leaf) {
28028
+ if (node.field && node.valueOP && !isNil25(node.value)) {
28029
+ hasFilter = true;
28030
+ } else {
28031
+ hasError = true;
28032
+ }
28033
+ }
28034
+ });
28035
+ if (hasFilter && !hasError) {
28036
+ const filter = [formatFilters(filterNodes[0])];
28037
+ return filter;
28038
+ }
28039
+ }
28040
+
27963
28041
  // src/controller/control/search-bar/search-bar.controller.ts
27964
28042
  var SearchBarController = class extends ControlController {
27965
28043
  constructor() {
@@ -28004,7 +28082,7 @@ var SearchBarController = class extends ControlController {
28004
28082
  * @author lxm
28005
28083
  * @date 2024-01-05 10:10:37
28006
28084
  */
28007
- this.addSchemaFilters = false;
28085
+ this.addSchemaFilters = true;
28008
28086
  }
28009
28087
  /**
28010
28088
  * 启用自定义过滤项
@@ -28081,7 +28159,11 @@ var SearchBarController = class extends ControlController {
28081
28159
  if (!json) {
28082
28160
  return;
28083
28161
  }
28084
- const addSearchBarFilters = await calcFilterModelBySchema(json, this);
28162
+ const addSearchBarFilters = await calcFilterModelBySchema(
28163
+ json,
28164
+ this.model.appDataEntityId,
28165
+ this.model.appId
28166
+ );
28085
28167
  const mergeFilters = [];
28086
28168
  (_a = this.model.searchBarFilters) == null ? void 0 : _a.forEach((filter) => {
28087
28169
  const findindex = addSearchBarFilters.findIndex(
@@ -28095,7 +28177,7 @@ var SearchBarController = class extends ControlController {
28095
28177
  }
28096
28178
  });
28097
28179
  if (addSearchBarFilters.length > 0) {
28098
- this.model = clone27(this.model);
28180
+ this.model = clone28(this.model);
28099
28181
  this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
28100
28182
  this.model.enableFilter = true;
28101
28183
  }
@@ -28183,7 +28265,7 @@ var SearchBarController = class extends ControlController {
28183
28265
  * @date 2023-10-16 03:52:44
28184
28266
  */
28185
28267
  resetFilter() {
28186
- this.state.filterNodes = this.getOriginFilterNodes();
28268
+ this.state.filterNodes = getOriginFilterNodes();
28187
28269
  this.evt.emit("onSearch", void 0);
28188
28270
  }
28189
28271
  /**
@@ -28197,7 +28279,12 @@ var SearchBarController = class extends ControlController {
28197
28279
  var _a;
28198
28280
  if ((_a = this.searchBarFilters) == null ? void 0 : _a.length) {
28199
28281
  this.searchBarFilters.forEach((item) => {
28200
- const filterController = new SearchBarFilterController(item, this);
28282
+ const filterController = new SearchBarFilterController(
28283
+ item,
28284
+ this.appDataEntity,
28285
+ this.context,
28286
+ this.params
28287
+ );
28201
28288
  this.filterControllers.push(filterController);
28202
28289
  });
28203
28290
  await Promise.all(
@@ -28215,86 +28302,8 @@ var SearchBarController = class extends ControlController {
28215
28302
  if (!this.enableFilter) {
28216
28303
  return;
28217
28304
  }
28218
- let hasFilter = false;
28219
- let hasError = false;
28220
- recursiveIterate9(this.state.filterNodes[0], (node) => {
28221
- if (node.leaf) {
28222
- if (node.field && node.valueOP && !isNil25(node.value)) {
28223
- hasFilter = true;
28224
- } else {
28225
- hasError = true;
28226
- }
28227
- }
28228
- });
28229
- if (hasFilter && !hasError) {
28230
- const filter = [this.formatFilters(this.state.filterNodes[0])];
28231
- return filter;
28232
- }
28233
- }
28234
- /**
28235
- * 格式化过滤项 (后续如果修改这里的逻辑记得把下方的反推函数parseFilters也跟着修改!)
28236
- * @author lxm
28237
- * @date 2023-10-16 03:45:41
28238
- * @param {IFilterNode} node
28239
- * @return {*} {IData}
28240
- */
28241
- formatFilters(node) {
28242
- if (!node.leaf) {
28243
- return {
28244
- condtype: "GROUP",
28245
- condop: node.logicType,
28246
- bnotmode: false,
28247
- searchconds: node.children.map((item) => this.formatFilters(item))
28248
- };
28249
- }
28250
- return {
28251
- condtype: "DEFIELD",
28252
- fieldname: node.field,
28253
- condop: node.valueOP,
28254
- value: node.value
28255
- };
28256
- }
28257
- /**
28258
- * 根据格式化后的过滤项反推出过滤项树节点数据集合
28259
- * @param {IData} data
28260
- * @return {*}
28261
- * @author: zhujiamin
28262
- * @Date: 2023-12-28 09:47:45
28263
- */
28264
- parseFilters(data) {
28265
- if (data.condtype === "GROUP") {
28266
- return {
28267
- leaf: false,
28268
- logicType: data.condop === "AND" ? "AND" : "OR",
28269
- children: (data.searchconds || []).map(
28270
- (item) => this.parseFilters(item)
28271
- )
28272
- };
28273
- }
28274
- if (data.condtype === "DEFIELD") {
28275
- return {
28276
- leaf: true,
28277
- field: data.fieldname || null,
28278
- valueOP: data.condop || null,
28279
- value: data.value || null
28280
- };
28281
- }
28282
- throw new RuntimeError58("\u65E0\u6548\u7684condtype:".concat(data.condtype));
28283
- }
28284
- /**
28285
- * 获取初始过滤项树节点数据集合
28286
- * @return {*}
28287
- * @author: zhujiamin
28288
- * @Date: 2023-12-21 17:29:47
28289
- */
28290
- getOriginFilterNodes() {
28291
- return [
28292
- {
28293
- leaf: false,
28294
- logicType: "AND",
28295
- children: [{ leaf: true, field: null, valueOP: null, value: null }]
28296
- }
28297
- ];
28305
+ const searchconds = calcSearchConds(this.state.filterNodes);
28306
+ return searchconds;
28298
28307
  }
28299
28308
  /**
28300
28309
  * 初始化搜索栏分组项(获取后台分组清单并合并模型)
@@ -28457,11 +28466,11 @@ var SearchBarController = class extends ControlController {
28457
28466
  }
28458
28467
  if (groupItem.searchGroupData && groupItem.searchGroupData.searchconds && groupItem.searchGroupData.searchconds.length > 0) {
28459
28468
  const filterNodes = groupItem.searchGroupData.searchconds.map(
28460
- (item) => this.parseFilters(item)
28469
+ (item) => parseFilters(item)
28461
28470
  );
28462
28471
  this.state.filterNodes = filterNodes;
28463
28472
  } else {
28464
- this.state.filterNodes = this.getOriginFilterNodes();
28473
+ this.state.filterNodes = getOriginFilterNodes();
28465
28474
  }
28466
28475
  if (this.grid && groupItem && groupItem.searchGroupData) {
28467
28476
  this.grid.setGroupParams(groupItem.searchGroupData);
@@ -30891,7 +30900,7 @@ import {
30891
30900
  awaitTimeout as awaitTimeout3,
30892
30901
  recursiveIterate as recursiveIterate11
30893
30902
  } from "@ibiz-template/core";
30894
- import { clone as clone28 } from "ramda";
30903
+ import { clone as clone29 } from "ramda";
30895
30904
 
30896
30905
  // src/controller/control/tree-grid-ex/tree-grid-ex.service.ts
30897
30906
  var TreeGridExService = class extends TreeService {
@@ -31327,7 +31336,7 @@ var TreeGridExController = class extends TreeController {
31327
31336
  throw new RuntimeError62("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
31328
31337
  }
31329
31338
  if (row.data._deData.srfuf === 1 /* UPDATE */) {
31330
- row.cacheData = clone28(row.data);
31339
+ row.cacheData = clone29(row.data);
31331
31340
  const defaultVal = this.calcDefaultValue(row.data, false);
31332
31341
  Object.assign(row.data, defaultVal);
31333
31342
  }
@@ -31440,7 +31449,7 @@ import {
31440
31449
  RuntimeError as RuntimeError63,
31441
31450
  RuntimeModelError as RuntimeModelError68
31442
31451
  } from "@ibiz-template/core";
31443
- import { clone as clone29 } from "ramda";
31452
+ import { clone as clone30 } from "ramda";
31444
31453
  import dayjs6 from "dayjs";
31445
31454
  var TreeGridExNodeColumnController = class {
31446
31455
  /**
@@ -31649,7 +31658,7 @@ var TreeGridExNodeColumnController = class {
31649
31658
  srfkey: value,
31650
31659
  ...wfContext
31651
31660
  });
31652
- const tempParams = clone29(this.params);
31661
+ const tempParams = clone30(this.params);
31653
31662
  const { userParam } = this.nodeColumn;
31654
31663
  if (userParam) {
31655
31664
  const { navigateContexts, navigateParams } = parseUserParams(userParam);
@@ -33169,7 +33178,7 @@ var HubController = class {
33169
33178
 
33170
33179
  // src/controller/notification/async-action.controller.ts
33171
33180
  import { QXEvent as QXEvent7 } from "qx-util";
33172
- import { clone as clone30 } from "ramda";
33181
+ import { clone as clone31 } from "ramda";
33173
33182
  import { isNil as isNil28, isNumber as isNumber2 } from "lodash-es";
33174
33183
  import dayjs7 from "dayjs";
33175
33184
  var AsyncActionController = class {
@@ -33277,7 +33286,7 @@ var AsyncActionController = class {
33277
33286
  } else {
33278
33287
  this.noticeResult(action);
33279
33288
  }
33280
- this.evt.emit("add", clone30(action));
33289
+ this.evt.emit("add", clone31(action));
33281
33290
  this.evt.emit("dataChange");
33282
33291
  }
33283
33292
  /**
@@ -33299,7 +33308,7 @@ var AsyncActionController = class {
33299
33308
  }
33300
33309
  this.noticeResult(action);
33301
33310
  }
33302
- this.evt.emit("change", clone30(action));
33311
+ this.evt.emit("change", clone31(action));
33303
33312
  this.evt.emit("dataChange");
33304
33313
  }
33305
33314
  noticeResult(action) {
@@ -33326,6 +33335,7 @@ var InternalMessageController = class {
33326
33335
  }
33327
33336
  async init() {
33328
33337
  this.load();
33338
+ this.listenMqtt();
33329
33339
  }
33330
33340
  async load() {
33331
33341
  await this.fetch(false);
@@ -33353,6 +33363,21 @@ var InternalMessageController = class {
33353
33363
  }
33354
33364
  this.evt.emit("dataChange");
33355
33365
  }
33366
+ /**
33367
+ * 监听mqtt消息
33368
+ * @author lxm
33369
+ * @date 2024-01-30 01:53:44
33370
+ * @protected
33371
+ */
33372
+ listenMqtt() {
33373
+ ibiz.mc.command.internalMessage.on(async (msg) => {
33374
+ ibiz.log.debug("mqtt internalMessage: ", msg);
33375
+ if (msg.subtype !== "INTERNALMESSAGE") {
33376
+ return;
33377
+ }
33378
+ ibiz.notification.info({ desc: msg.content, position: "bottom-right" });
33379
+ });
33380
+ }
33356
33381
  };
33357
33382
 
33358
33383
  // src/controller/notification/notice.controller.ts
@@ -33769,7 +33794,7 @@ var EngineFactory = class {
33769
33794
  };
33770
33795
 
33771
33796
  // src/engine/view-base.engine.ts
33772
- import { RuntimeError as RuntimeError66 } from "@ibiz-template/core";
33797
+ import { RuntimeError as RuntimeError66, findRecursiveChild as findRecursiveChild3 } from "@ibiz-template/core";
33773
33798
  var ViewEngineBase = class {
33774
33799
  /**
33775
33800
  * 构造函数在视图控制器的构造函数逻辑内部执行
@@ -33839,27 +33864,79 @@ var ViewEngineBase = class {
33839
33864
  async onCreated() {
33840
33865
  const { childNames } = this.view;
33841
33866
  childNames.push("captionbar", "toolbar");
33867
+ this.calcDynamicLayout();
33842
33868
  }
33843
- async onMounted() {
33844
- var _a, _b;
33845
- const { model, childNames } = this.view;
33846
- ibiz.log.debug("".concat(model.id, "\u7684\u5B50\u7EC4\u4EF6\uFF1A").concat(childNames.join(";"), "\u90FD\u5DF2mounted"));
33847
- const showHeader = this.calcViewHeaderVisible();
33848
- if (!showHeader) {
33849
- const controller = (_a = this.viewLayoutPanel) == null ? void 0 : _a.panelItems.view_header;
33850
- if (controller) {
33851
- controller.state.visible = false;
33852
- }
33869
+ /**
33870
+ * 计算动态布局模型
33871
+ *
33872
+ * @author zk
33873
+ * @date 2024-01-29 02:01:47
33874
+ * @memberof ViewEngineBase
33875
+ */
33876
+ calcDynamicLayout() {
33877
+ const names = this.calcRemoveLayoutModel();
33878
+ ibiz.log.debug("".concat(this.view.model.codeName, "\u5220\u9664\u6A21\u578B\uFF1A").concat(names.join(";")));
33879
+ this.removeLayoutModel(names);
33880
+ }
33881
+ /**
33882
+ * 计算移除的模型名称
33883
+ *
33884
+ * @author zk
33885
+ * @date 2024-01-29 02:01:21
33886
+ * @return {*} {string[]}
33887
+ * @memberof ViewEngineBase
33888
+ */
33889
+ calcRemoveLayoutModel() {
33890
+ const { model } = this.view;
33891
+ const names = [];
33892
+ if (model.showCaptionBar === false) {
33893
+ names.push("view_captionbar");
33853
33894
  }
33854
- if (ibiz.env.isMob) {
33855
- const showFooter = this.calcViewFooterVisible();
33856
- if (!showFooter) {
33857
- const controller = (_b = this.viewLayoutPanel) == null ? void 0 : _b.panelItems.view_footer;
33858
- if (controller) {
33859
- controller.state.visible = false;
33860
- }
33895
+ if (!getControl(model, "toolbar")) {
33896
+ names.push("view_toolbar", "toolbar");
33897
+ }
33898
+ const toolBarList = ["lefttoolbar", "righttoolbar", "footertoolbar"];
33899
+ toolBarList.forEach((name) => {
33900
+ if (!getControl(model, name)) {
33901
+ names.push(name);
33861
33902
  }
33903
+ });
33904
+ if (!this.calcViewHeaderVisible()) {
33905
+ names.push("view_header");
33862
33906
  }
33907
+ if (!this.calcViewFooterVisible()) {
33908
+ names.push("view_footer");
33909
+ }
33910
+ return names;
33911
+ }
33912
+ /**
33913
+ * 删除布局模型
33914
+ *
33915
+ * @author zk
33916
+ * @date 2024-01-29 02:01:29
33917
+ * @param {string[]} names
33918
+ * @param {(IPanelContainer | undefined)} [container=this.view.model.viewLayoutPanel]
33919
+ * @return {*} {void}
33920
+ * @memberof ViewEngineBase
33921
+ */
33922
+ removeLayoutModel(names, container = this.view.model.viewLayoutPanel) {
33923
+ if (!container) {
33924
+ return;
33925
+ }
33926
+ const items = container.rootPanelItems || container.panelItems || [];
33927
+ const index = items.findIndex((item) => names.includes(item.id));
33928
+ if (index !== -1) {
33929
+ items.splice(index, 1);
33930
+ }
33931
+ items.forEach((item) => {
33932
+ if (item.itemType === "CONTAINER") {
33933
+ this.removeLayoutModel(names, item);
33934
+ }
33935
+ });
33936
+ }
33937
+ async onMounted() {
33938
+ const { model, childNames } = this.view;
33939
+ ibiz.log.debug("".concat(model.id, "\u7684\u5B50\u7EC4\u4EF6\uFF1A").concat(childNames.join(";"), "\u90FD\u5DF2mounted"));
33863
33940
  }
33864
33941
  async onDestroyed() {
33865
33942
  }
@@ -33895,44 +33972,45 @@ var ViewEngineBase = class {
33895
33972
  * @protected
33896
33973
  */
33897
33974
  calcViewHeaderVisible() {
33898
- var _a, _b, _c, _d;
33899
33975
  let showHeader = false;
33900
33976
  const { model } = this.view;
33901
- if (model.showCaptionBar === false) {
33902
- const controller = (_a = this.viewLayoutPanel) == null ? void 0 : _a.panelItems.view_captionbar;
33903
- if (controller) {
33904
- controller.state.visible = false;
33905
- }
33906
- } else {
33977
+ if (model.showCaptionBar) {
33907
33978
  showHeader = true;
33908
33979
  }
33909
33980
  if (ibiz.env.isMob) {
33910
- if (!this.leftToolbar) {
33911
- const controller = (_b = this.viewLayoutPanel) == null ? void 0 : _b.panelItems.lefttoolbar;
33912
- if (controller) {
33913
- controller.state.visible = false;
33914
- }
33915
- } else {
33981
+ if (this.isExistAndInLayout("lefttoolbar")) {
33916
33982
  showHeader = true;
33917
33983
  }
33918
- if (!this.rightToolbar) {
33919
- const controller = (_c = this.viewLayoutPanel) == null ? void 0 : _c.panelItems.righttoolbar;
33920
- if (controller) {
33921
- controller.state.visible = false;
33922
- }
33923
- } else {
33984
+ if (this.isExistAndInLayout("righttoolbar")) {
33924
33985
  showHeader = true;
33925
33986
  }
33926
- } else if (!this.toolbar) {
33927
- const controller = (_d = this.viewLayoutPanel) == null ? void 0 : _d.panelItems.view_toolbar;
33928
- if (controller) {
33929
- controller.state.visible = false;
33930
- }
33931
- } else {
33987
+ } else if (this.isExistAndInLayout("toolbar")) {
33932
33988
  showHeader = true;
33933
33989
  }
33934
33990
  return showHeader;
33935
33991
  }
33992
+ /**
33993
+ * 是否存在模型 并且 布局中有占位
33994
+ *
33995
+ * @author zk
33996
+ * @date 2024-01-30 11:01:33
33997
+ * @param {string} name
33998
+ * @return {*} {(IData | undefined)}
33999
+ * @memberof ViewEngineBase
34000
+ */
34001
+ isExistAndInLayout(name) {
34002
+ const layout = this.view.model.viewLayoutPanel;
34003
+ if (!layout) {
34004
+ return false;
34005
+ }
34006
+ const ins = findRecursiveChild3(layout, name, {
34007
+ compareField: "id",
34008
+ childrenFields: ["panelItems", "rootPanelItems"]
34009
+ });
34010
+ const { model } = this.view;
34011
+ const has = getControl(model, name);
34012
+ return !!(ins && has);
34013
+ }
33936
34014
  /**
33937
34015
  * 计算底部的显示与否
33938
34016
  * @author lxm
@@ -33942,7 +34020,7 @@ var ViewEngineBase = class {
33942
34020
  */
33943
34021
  calcViewFooterVisible() {
33944
34022
  let showFooter = false;
33945
- if (this.footerToolbar) {
34023
+ if (this.isExistAndInLayout("footertoolbar")) {
33946
34024
  showFooter = true;
33947
34025
  }
33948
34026
  return showFooter;
@@ -33979,7 +34057,7 @@ var ViewEngineBase = class {
33979
34057
 
33980
34058
  // src/engine/md-view.engine.ts
33981
34059
  import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
33982
- import { clone as clone31 } from "ramda";
34060
+ import { clone as clone32 } from "ramda";
33983
34061
  var MDViewEngine = class extends ViewEngineBase {
33984
34062
  /**
33985
34063
  * 多数据部件名称
@@ -34191,7 +34269,7 @@ var MDViewEngine = class extends ViewEngineBase {
34191
34269
  if (!openAppViewLogic) {
34192
34270
  throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
34193
34271
  }
34194
- const params = clone31(this.view.params);
34272
+ const params = clone32(this.view.params);
34195
34273
  if (copyMode) {
34196
34274
  params.srfcopymode = copyMode;
34197
34275
  }
@@ -34292,17 +34370,38 @@ var MDViewEngine = class extends ViewEngineBase {
34292
34370
  async copy(args) {
34293
34371
  this.newData(Object.assign(args, { copyMode: true }));
34294
34372
  }
34373
+ /**
34374
+ * 计算头部显示
34375
+ *
34376
+ * @author zk
34377
+ * @date 2024-01-29 05:01:30
34378
+ * @protected
34379
+ * @return {*} {boolean}
34380
+ * @memberof MDViewEngine
34381
+ */
34295
34382
  calcViewHeaderVisible() {
34296
- let showHeader = super.calcViewHeaderVisible();
34297
- if (!this.searchBar || !this.searchBar.state.visible) {
34298
- const controller = this.viewLayoutPanel.panelItems.view_searchbar;
34299
- if (controller) {
34300
- controller.state.visible = false;
34301
- }
34302
- } else {
34303
- showHeader = true;
34383
+ const showHeader = super.calcViewHeaderVisible();
34384
+ const visible = this.calcViewSearchBarVisible();
34385
+ return visible || showHeader;
34386
+ }
34387
+ /**
34388
+ * 计算搜索栏显示
34389
+ *
34390
+ * @author zk
34391
+ * @date 2024-01-29 05:01:36
34392
+ * @protected
34393
+ * @return {*} {boolean}
34394
+ * @memberof MDViewEngine
34395
+ */
34396
+ calcViewSearchBarVisible() {
34397
+ const { model } = this.view;
34398
+ const has = this.isExistAndInLayout("searchbar");
34399
+ if (!has) {
34400
+ return has;
34304
34401
  }
34305
- return showHeader;
34402
+ const searchBar = getControl(model, "searchbar");
34403
+ const visible = !!(searchBar.enableQuickSearch || searchBar.enableGroup || searchBar.enableFilter === true);
34404
+ return visible;
34306
34405
  }
34307
34406
  /**
34308
34407
  * 切换搜索表单的显示与否
@@ -34318,6 +34417,25 @@ var MDViewEngine = class extends ViewEngineBase {
34318
34417
  }
34319
34418
  }
34320
34419
  }
34420
+ /**
34421
+ * 计算移除的模型名称
34422
+ *
34423
+ * @author zk
34424
+ * @date 2024-01-29 03:01:42
34425
+ * @return {*} {string[]}
34426
+ * @memberof MDViewEngine
34427
+ */
34428
+ calcRemoveLayoutModel() {
34429
+ const { model } = this.view;
34430
+ const names = super.calcRemoveLayoutModel();
34431
+ if (!getControl(model, "searchform")) {
34432
+ names.push("searchform");
34433
+ }
34434
+ if (!this.calcViewSearchBarVisible()) {
34435
+ names.push("view_searchbar");
34436
+ }
34437
+ return names;
34438
+ }
34321
34439
  };
34322
34440
 
34323
34441
  // src/global/global-util/global-util.ts
@@ -35796,11 +35914,13 @@ export {
35796
35914
  calcDeCodeNameById,
35797
35915
  calcDynaClass,
35798
35916
  calcDynaSysParams,
35917
+ calcFilterModelBySchema,
35799
35918
  calcGridLayoutPos,
35800
35919
  calcLayoutHeightWidth,
35801
35920
  calcMainStateOPPrivsStrs,
35802
35921
  calcNavParams,
35803
35922
  calcResPath,
35923
+ calcSearchConds,
35804
35924
  compare,
35805
35925
  compareNumber,
35806
35926
  contains,
@@ -35821,6 +35941,7 @@ export {
35821
35941
  findEditItem,
35822
35942
  findFieldById,
35823
35943
  findModelChild,
35944
+ formatFilters,
35824
35945
  formatMultiData,
35825
35946
  generateEditorRules,
35826
35947
  generateRules,
@@ -35845,6 +35966,7 @@ export {
35845
35966
  getInternalMessageProvider,
35846
35967
  getMatchResPath,
35847
35968
  getOriginData,
35969
+ getOriginFilterNodes,
35848
35970
  getPFPlugin,
35849
35971
  getPanelItemProvider,
35850
35972
  getPlatformProvider,
@@ -35873,6 +35995,7 @@ export {
35873
35995
  isValueChange,
35874
35996
  matchMainState,
35875
35997
  openRedirectView,
35998
+ parseFilters,
35876
35999
  parseUserParams,
35877
36000
  presetAppCounterProvider,
35878
36001
  presetDEMethodProvider,