@ibiz-template/runtime 0.1.2 → 0.1.3

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 CHANGED
@@ -711,7 +711,9 @@ function calcLayoutHeightWidth(layoutPos) {
711
711
  if (widthMode === "FULL") {
712
712
  result.width = "100%";
713
713
  } else if (width && width > 0) {
714
- if (widthMode === "PERCENTAGE") {
714
+ if (width > 0 && width <= 1) {
715
+ result.width = "".concat(width * 100, "%");
716
+ } else if (widthMode === "PERCENTAGE") {
715
717
  result.width = "".concat(width, "%");
716
718
  } else {
717
719
  result.width = "".concat(width, "px");
@@ -720,7 +722,9 @@ function calcLayoutHeightWidth(layoutPos) {
720
722
  if (heightMode === "FULL") {
721
723
  result.height = "100%";
722
724
  } else if (height && height > 0) {
723
- if (heightMode === "PERCENTAGE") {
725
+ if (height > 0 && height <= 1) {
726
+ result.height = "".concat(height * 100, "%");
727
+ } else if (heightMode === "PERCENTAGE") {
724
728
  result.height = "".concat(height, "%");
725
729
  } else {
726
730
  result.height = "".concat(height, "px");
@@ -1085,21 +1089,13 @@ async function openDERedirectView(appView, context, params = {}, data = []) {
1085
1089
  );
1086
1090
  throw new RuntimeModelError(
1087
1091
  appView,
1088
- "\u672A\u627E\u5230\u91CD\u5B9A\u5411\u6807\u8BC6[".concat(rdTag, "]\u6216[").concat(deRdTag, "]\u6216[").concat(wfRdTag, "]\u5BF9\u5E94\u89C6\u56FE")
1092
+ "\u672A\u627E\u5230\u91CD\u5B9A\u5411\u6807\u8BC6[".concat(rdTag, "]\u6216[").concat(deRdTag, "]\u6216\u5DE5\u4F5C\u6D41[").concat(wfRdTag, "]\u5BF9\u5E94\u89C6\u56FE")
1089
1093
  );
1090
1094
  }
1091
1095
  return { ok: true, data: [] };
1092
1096
  }
1093
1097
  async function calcDERdTag(entity, rdView, params, data) {
1094
1098
  let rdTag = "";
1095
- const typeFieldId = rdView.typeAppDEFieldId;
1096
- if (typeFieldId) {
1097
- const { codeName } = findFieldById(entity, typeFieldId);
1098
- const value = data[codeName.toLowerCase()];
1099
- if (notNilEmpty2(value)) {
1100
- return value;
1101
- }
1102
- }
1103
1099
  const defView = "".concat(ibiz.env.isMob ? "MOB" : "", "EDITVIEW");
1104
1100
  const srfWf = params.srfwf;
1105
1101
  if (notNilEmpty2(srfWf)) {
@@ -1109,9 +1105,19 @@ async function calcDERdTag(entity, rdView, params, data) {
1109
1105
  return "".concat(defView, ":").concat(srfWf.toUpperCase());
1110
1106
  }
1111
1107
  let typeValue = "";
1112
- if (entity.indexTypeAppDEFieldId) {
1113
- const { codeName } = findFieldById(entity, entity.indexTypeAppDEFieldId);
1114
- typeValue = data[codeName.toLowerCase()];
1108
+ const typeFieldId = rdView.typeAppDEFieldId;
1109
+ if (typeFieldId) {
1110
+ const { codeName } = findFieldById(entity, typeFieldId);
1111
+ const value = data[codeName.toLowerCase()];
1112
+ if (notNilEmpty2(value)) {
1113
+ typeValue = value;
1114
+ }
1115
+ }
1116
+ if (isNilOrEmpty2(typeValue)) {
1117
+ if (entity.indexTypeAppDEFieldId) {
1118
+ const { codeName } = findFieldById(entity, entity.indexTypeAppDEFieldId);
1119
+ typeValue = data[codeName.toLowerCase()];
1120
+ }
1115
1121
  }
1116
1122
  if (isNilOrEmpty2(typeValue)) {
1117
1123
  if (entity.formTypeAppDEFieldId) {
@@ -1120,7 +1126,7 @@ async function calcDERdTag(entity, rdView, params, data) {
1120
1126
  }
1121
1127
  }
1122
1128
  if (notNilEmpty2(typeValue)) {
1123
- rdTag = "".concat(defView, ":").concat(typeValue);
1129
+ rdTag = "".concat(defView, ":").concat(typeValue.toUpperCase());
1124
1130
  } else {
1125
1131
  rdTag = "".concat(defView);
1126
1132
  }
@@ -8182,7 +8188,7 @@ var MDViewEngine = class extends ViewEngineBase {
8182
8188
  view: this.view
8183
8189
  }));
8184
8190
  if (result === -1) {
8185
- throw new RuntimeModelError20(this.view.model, "\u7F3A\u5C11opendata\u7684\u89C6\u56FE\u903B\u8F91");
8191
+ ibiz.log.warn("\u89C6\u56FE[".concat(this.view.model.codeName, "]\uFF0C\u672A\u914D\u7F6E\u7F16\u8F91\u6253\u5F00\u89C6\u56FE"));
8186
8192
  }
8187
8193
  }
8188
8194
  /**
@@ -12122,6 +12128,7 @@ var MDControlController = class extends ControlController {
12122
12128
  this.state.isLoaded = false;
12123
12129
  this.state.singleSelect = true;
12124
12130
  this.state.mdctrlActiveMode = 0;
12131
+ this.state.groups = [];
12125
12132
  }
12126
12133
  /**
12127
12134
  * 设置排序
@@ -12169,35 +12176,34 @@ var MDControlController = class extends ControlController {
12169
12176
  * @date 2022-08-19 14:08:50
12170
12177
  */
12171
12178
  async load(args = {}) {
12172
- const isInitialLoad = args.isInitialLoad === true;
12173
- const isLoadMore = args.isLoadMore === true;
12174
- if (isInitialLoad) {
12175
- this.state.curPage = 1;
12176
- } else if (isLoadMore) {
12177
- this.state.curPage += 1;
12178
- }
12179
- const { context } = this.handlerAbilityParams(args);
12180
- const params = await this.getFetchParams(args == null ? void 0 : args.params);
12181
12179
  await this.startLoading();
12182
- let res;
12183
12180
  try {
12184
- res = await this.service.fetch(context, params);
12181
+ const isInitialLoad = args.isInitialLoad === true;
12182
+ const isLoadMore = args.isLoadMore === true;
12183
+ if (isInitialLoad) {
12184
+ this.state.curPage = 1;
12185
+ } else if (isLoadMore) {
12186
+ this.state.curPage += 1;
12187
+ }
12188
+ const { context } = this.handlerAbilityParams(args);
12189
+ const params = await this.getFetchParams(args == null ? void 0 : args.params);
12190
+ const res = await this.service.fetch(context, params);
12185
12191
  if (typeof res.total === "number") {
12186
12192
  this.state.total = res.total;
12187
12193
  }
12194
+ if (isLoadMore) {
12195
+ this.state.items.push(...res.data);
12196
+ } else {
12197
+ this.state.items = res.data;
12198
+ }
12199
+ await this.afterLoad(args, res.data);
12200
+ this.state.isLoaded = true;
12201
+ await this._evt.emit("onLoadSuccess", {
12202
+ isInitialLoad
12203
+ });
12188
12204
  } finally {
12189
12205
  await this.endLoading();
12190
12206
  }
12191
- if (isLoadMore) {
12192
- this.state.items.push(...res.data);
12193
- } else {
12194
- this.state.items = res.data;
12195
- }
12196
- await this.afterLoad(args, res.data);
12197
- this.state.isLoaded = true;
12198
- await this._evt.emit("onLoadSuccess", {
12199
- isInitialLoad
12200
- });
12201
12207
  return this.state.items;
12202
12208
  }
12203
12209
  /**