@fecp/designer 5.4.26 → 5.4.27

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.
@@ -1,4 +1,4 @@
1
- const version = "5.4.26";
1
+ const version = "5.4.27";
2
2
  const packageJson = {
3
3
  version
4
4
  };
package/es/designer.css CHANGED
@@ -5708,18 +5708,18 @@ body,
5708
5708
  :root,:host{--van-overlay-z-index: 1;--van-overlay-background: rgba(0, 0, 0, .7)}.van-overlay{position:fixed;top:0;left:0;z-index:var(--van-overlay-z-index);width:100%;height:100%;background:var(--van-overlay-background)}
5709
5709
  :root,:host{--van-popup-background: var(--van-background-2);--van-popup-transition: transform var(--van-duration-base);--van-popup-round-radius: 16px;--van-popup-close-icon-size: 22px;--van-popup-close-icon-color: var(--van-gray-5);--van-popup-close-icon-margin: 16px;--van-popup-close-icon-z-index: 1}.van-overflow-hidden{overflow:hidden!important}.van-popup{position:fixed;max-height:100%;overflow-y:auto;box-sizing:border-box;background:var(--van-popup-background);transition:var(--van-popup-transition);-webkit-overflow-scrolling:touch}.van-popup--center{top:50%;left:0;right:0;width:-webkit-fit-content;width:fit-content;max-width:calc(100vw - var(--van-padding-md) * 2);margin:0 auto;transform:translateY(-50%)}.van-popup--center.van-popup--round{border-radius:var(--van-popup-round-radius)}.van-popup--top{top:0;left:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--van-popup-round-radius) var(--van-popup-round-radius)}.van-popup--right{top:50%;right:0;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--van-popup-round-radius) 0 0 var(--van-popup-round-radius)}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--van-popup-round-radius) var(--van-popup-round-radius) 0 0}.van-popup--left{top:50%;left:0;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--van-popup-round-radius) var(--van-popup-round-radius) 0}.van-popup-slide-top-enter-active,.van-popup-slide-left-enter-active,.van-popup-slide-right-enter-active,.van-popup-slide-bottom-enter-active{transition-timing-function:var(--van-ease-out)}.van-popup-slide-top-leave-active,.van-popup-slide-left-leave-active,.van-popup-slide-right-leave-active,.van-popup-slide-bottom-leave-active{transition-timing-function:var(--van-ease-in)}.van-popup-slide-top-enter-from,.van-popup-slide-top-leave-active{transform:translate3d(0,-100%,0)}.van-popup-slide-right-enter-from,.van-popup-slide-right-leave-active{transform:translate3d(100%,-50%,0)}.van-popup-slide-bottom-enter-from,.van-popup-slide-bottom-leave-active{transform:translate3d(0,100%,0)}.van-popup-slide-left-enter-from,.van-popup-slide-left-leave-active{transform:translate3d(-100%,-50%,0)}.van-popup__close-icon{position:absolute;z-index:var(--van-popup-close-icon-z-index);color:var(--van-popup-close-icon-color);font-size:var(--van-popup-close-icon-size)}.van-popup__close-icon--top-left{top:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--top-right{top:var(--van-popup-close-icon-margin);right:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-left{bottom:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-right{right:var(--van-popup-close-icon-margin);bottom:var(--van-popup-close-icon-margin)}
5710
5710
  :root,:host{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-duration-base);--van-dialog-radius: 16px;--van-dialog-background: var(--van-background-2);--van-dialog-header-font-weight: var(--van-font-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-primary-color)}.van-dialog{top:45%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background);border-radius:var(--van-dialog-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{color:var(--van-text-color);padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{color:var(--van-text-color);flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0;border-radius:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog--round-button .van-action-bar-button--first{border-top-left-radius:var(--van-radius-max);border-bottom-left-radius:var(--van-radius-max)}.van-dialog--round-button .van-action-bar-button--last{border-top-right-radius:var(--van-radius-max);border-bottom-right-radius:var(--van-radius-max)}.van-dialog-bounce-enter-from{transform:translate3d(0,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(0,-50%,0) scale(.9);opacity:0}
5711
- .dialog-header-content[data-v-3d101d10] {
5711
+ .dialog-header-content[data-v-9cd09319] {
5712
5712
  font-size: 16px;
5713
5713
  font-weight: 600;
5714
5714
  color: #303133;
5715
5715
  }
5716
- .dialog-content-wrapper[data-v-3d101d10] {
5716
+ .dialog-content-wrapper[data-v-9cd09319] {
5717
5717
  min-height: 500px;
5718
5718
  flex-grow: 1;
5719
5719
  display: flex;
5720
5720
  flex-direction: column;
5721
5721
  }
5722
- .empty-content[data-v-3d101d10] {
5722
+ .empty-content[data-v-9cd09319] {
5723
5723
  display: flex;
5724
5724
  align-items: center;
5725
5725
  justify-content: center;
@@ -5727,13 +5727,13 @@ body,
5727
5727
  color: #909399;
5728
5728
  font-size: 14px;
5729
5729
  }
5730
- .component-error[data-v-3d101d10] {
5730
+ .component-error[data-v-9cd09319] {
5731
5731
  padding: 40px 20px;
5732
5732
  text-align: center;
5733
5733
  color: #f56c6c;
5734
5734
  font-size: 14px;
5735
5735
  }
5736
- .fec-dialog-table[data-v-3d101d10] .table-pagination {
5736
+ .fec-dialog-table[data-v-9cd09319] .table-pagination {
5737
5737
  padding: 8px 0 0 0;
5738
5738
  }.text-field-wrapper[data-v-185ddd14] {
5739
5739
  width: 100%;
@@ -5904,27 +5904,27 @@ body,
5904
5904
  width: 80px;
5905
5905
  font-size: var(--el-font-size-extra-small);
5906
5906
  }
5907
- .fec-form[data-v-eb63b66b] {
5907
+ .fec-form[data-v-5d68b9c4] {
5908
5908
  height: 100%;
5909
5909
  }
5910
- [data-v-eb63b66b] .vgl-item {
5910
+ [data-v-5d68b9c4] .vgl-item {
5911
5911
  transition: none;
5912
5912
  }
5913
- [data-v-eb63b66b] .vgl-item > .el-form-item {
5913
+ [data-v-5d68b9c4] .vgl-item > .el-form-item {
5914
5914
  width: 100%;
5915
5915
  padding: 12px 8px 0 8px;
5916
5916
  height: calc(100% - 15px);
5917
5917
  display: flex;
5918
5918
  }
5919
- [data-v-eb63b66b] .vgl-item > .el-form-item.el-form-item--label-top {
5919
+ [data-v-5d68b9c4] .vgl-item > .el-form-item.el-form-item--label-top {
5920
5920
  flex-direction: column;
5921
5921
  }
5922
- [data-v-eb63b66b] .vgl-item > .el-form-item .el-form-item__label {
5922
+ [data-v-5d68b9c4] .vgl-item > .el-form-item .el-form-item__label {
5923
5923
  line-height: 20px;
5924
5924
  display: flex;
5925
5925
  align-items: center;
5926
5926
  }
5927
- [data-v-eb63b66b] .vgl-item > .el-container {
5927
+ [data-v-5d68b9c4] .vgl-item > .el-container {
5928
5928
  height: auto !important;
5929
5929
  }.cell-content .cell-text[data-v-3e5372d4] {
5930
5930
  display: inline-block;
@@ -180,7 +180,8 @@ const _sfc_main = {
180
180
  const calcResult = calculate({
181
181
  text: displayFormat == null ? void 0 : displayFormat.text,
182
182
  marks: [],
183
- value: row
183
+ value: row,
184
+ fieldsList: props.fieldsList
184
185
  });
185
186
  return calcResult;
186
187
  });
@@ -445,7 +446,7 @@ const _sfc_main = {
445
446
  };
446
447
  }
447
448
  };
448
- const DialogRenderer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3d101d10"]]);
449
+ const DialogRenderer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9cd09319"]]);
449
450
  export {
450
451
  DialogRenderer as default
451
452
  };
@@ -822,7 +822,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
822
822
  const calcResult = calculate({
823
823
  text: formulaText,
824
824
  marks: [],
825
- value: formData.value
825
+ value: formData.value,
826
+ fieldsList: fields
826
827
  });
827
828
  formData.value[field.fieldName] = calcResult;
828
829
  }
@@ -1064,7 +1065,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1064
1065
  };
1065
1066
  }
1066
1067
  });
1067
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-eb63b66b"]]);
1068
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5d68b9c4"]]);
1068
1069
  export {
1069
1070
  _Form as default
1070
1071
  };
@@ -1,7 +1,7 @@
1
1
  import functionCore from "./functionCore.mjs";
2
2
  import "vue";
3
3
  function calculate(params) {
4
- const { text, marks = [], value = {} } = params;
4
+ const { text, marks = [], value = {}, fieldsList = [] } = params;
5
5
  if (!text) return new Error("非法公式");
6
6
  try {
7
7
  let str = text;
@@ -23,15 +23,30 @@ function calculate(params) {
23
23
  const [key, subKey] = enCode.split(".");
24
24
  if (value[key]) data = value[key].map((o) => o[subKey]);
25
25
  }
26
- if (data !== void 0) {
27
- if (typeof data != "string") {
28
- data = JSON.stringify(data);
26
+ if (!data) {
27
+ const fieldItem = fieldsList.find((item2) => item2.fieldName == enCode);
28
+ if (fieldItem) {
29
+ switch (fieldItem.fieldType) {
30
+ case "number":
31
+ data = 0;
32
+ break;
33
+ case "switch":
34
+ data = false;
35
+ break;
36
+ default:
37
+ data = "";
38
+ }
39
+ } else {
40
+ throw new Error("字段:" + item.fieldName + " 未定义");
29
41
  }
30
- const actualStart = startIndex + offset;
31
- const actualEnd = endIndex + offset;
32
- str = str.slice(0, actualStart) + data.toString() + str.slice(actualEnd);
33
- offset += data.toString().length - (endIndex - startIndex);
34
42
  }
43
+ if (typeof data != "string") {
44
+ data = JSON.stringify(data);
45
+ }
46
+ const actualStart = startIndex + offset;
47
+ const actualEnd = endIndex + offset;
48
+ str = str.slice(0, actualStart) + data.toString() + str.slice(actualEnd);
49
+ offset += data.toString().length - (endIndex - startIndex);
35
50
  }
36
51
  const result = functionCore.executeFunction(str);
37
52
  return result;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const version = "5.4.26";
3
+ const version = "5.4.27";
4
4
  const packageJson = {
5
5
  version
6
6
  };
package/lib/designer.css CHANGED
@@ -5708,18 +5708,18 @@ body,
5708
5708
  :root,:host{--van-overlay-z-index: 1;--van-overlay-background: rgba(0, 0, 0, .7)}.van-overlay{position:fixed;top:0;left:0;z-index:var(--van-overlay-z-index);width:100%;height:100%;background:var(--van-overlay-background)}
5709
5709
  :root,:host{--van-popup-background: var(--van-background-2);--van-popup-transition: transform var(--van-duration-base);--van-popup-round-radius: 16px;--van-popup-close-icon-size: 22px;--van-popup-close-icon-color: var(--van-gray-5);--van-popup-close-icon-margin: 16px;--van-popup-close-icon-z-index: 1}.van-overflow-hidden{overflow:hidden!important}.van-popup{position:fixed;max-height:100%;overflow-y:auto;box-sizing:border-box;background:var(--van-popup-background);transition:var(--van-popup-transition);-webkit-overflow-scrolling:touch}.van-popup--center{top:50%;left:0;right:0;width:-webkit-fit-content;width:fit-content;max-width:calc(100vw - var(--van-padding-md) * 2);margin:0 auto;transform:translateY(-50%)}.van-popup--center.van-popup--round{border-radius:var(--van-popup-round-radius)}.van-popup--top{top:0;left:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--van-popup-round-radius) var(--van-popup-round-radius)}.van-popup--right{top:50%;right:0;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--van-popup-round-radius) 0 0 var(--van-popup-round-radius)}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--van-popup-round-radius) var(--van-popup-round-radius) 0 0}.van-popup--left{top:50%;left:0;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--van-popup-round-radius) var(--van-popup-round-radius) 0}.van-popup-slide-top-enter-active,.van-popup-slide-left-enter-active,.van-popup-slide-right-enter-active,.van-popup-slide-bottom-enter-active{transition-timing-function:var(--van-ease-out)}.van-popup-slide-top-leave-active,.van-popup-slide-left-leave-active,.van-popup-slide-right-leave-active,.van-popup-slide-bottom-leave-active{transition-timing-function:var(--van-ease-in)}.van-popup-slide-top-enter-from,.van-popup-slide-top-leave-active{transform:translate3d(0,-100%,0)}.van-popup-slide-right-enter-from,.van-popup-slide-right-leave-active{transform:translate3d(100%,-50%,0)}.van-popup-slide-bottom-enter-from,.van-popup-slide-bottom-leave-active{transform:translate3d(0,100%,0)}.van-popup-slide-left-enter-from,.van-popup-slide-left-leave-active{transform:translate3d(-100%,-50%,0)}.van-popup__close-icon{position:absolute;z-index:var(--van-popup-close-icon-z-index);color:var(--van-popup-close-icon-color);font-size:var(--van-popup-close-icon-size)}.van-popup__close-icon--top-left{top:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--top-right{top:var(--van-popup-close-icon-margin);right:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-left{bottom:var(--van-popup-close-icon-margin);left:var(--van-popup-close-icon-margin)}.van-popup__close-icon--bottom-right{right:var(--van-popup-close-icon-margin);bottom:var(--van-popup-close-icon-margin)}
5710
5710
  :root,:host{--van-dialog-width: 320px;--van-dialog-small-screen-width: 90%;--van-dialog-font-size: var(--van-font-size-lg);--van-dialog-transition: var(--van-duration-base);--van-dialog-radius: 16px;--van-dialog-background: var(--van-background-2);--van-dialog-header-font-weight: var(--van-font-bold);--van-dialog-header-line-height: 24px;--van-dialog-header-padding-top: 26px;--van-dialog-header-isolated-padding: var(--van-padding-lg) 0;--van-dialog-message-padding: var(--van-padding-lg);--van-dialog-message-font-size: var(--van-font-size-md);--van-dialog-message-line-height: var(--van-line-height-md);--van-dialog-message-max-height: 60vh;--van-dialog-has-title-message-text-color: var(--van-gray-7);--van-dialog-has-title-message-padding-top: var(--van-padding-xs);--van-dialog-button-height: 48px;--van-dialog-round-button-height: 36px;--van-dialog-confirm-button-text-color: var(--van-primary-color)}.van-dialog{top:45%;width:var(--van-dialog-width);overflow:hidden;font-size:var(--van-dialog-font-size);background:var(--van-dialog-background);border-radius:var(--van-dialog-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--van-dialog-transition);transition-property:transform,opacity}@media (max-width: 321px){.van-dialog{width:var(--van-dialog-small-screen-width)}}.van-dialog__header{color:var(--van-text-color);padding-top:var(--van-dialog-header-padding-top);font-weight:var(--van-dialog-header-font-weight);line-height:var(--van-dialog-header-line-height);text-align:center}.van-dialog__header--isolated{padding:var(--van-dialog-header-isolated-padding)}.van-dialog__content--isolated{display:flex;align-items:center;min-height:104px}.van-dialog__message{color:var(--van-text-color);flex:1;max-height:var(--van-dialog-message-max-height);padding:26px var(--van-dialog-message-padding);overflow-y:auto;font-size:var(--van-dialog-message-font-size);line-height:var(--van-dialog-message-line-height);white-space:pre-wrap;text-align:center;word-wrap:break-word;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:var(--van-dialog-has-title-message-padding-top);color:var(--van-dialog-has-title-message-text-color)}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__confirm,.van-dialog__cancel{flex:1;height:var(--van-dialog-button-height);margin:0;border:0;border-radius:0}.van-dialog__confirm,.van-dialog__confirm:active{color:var(--van-dialog-confirm-button-text-color)}.van-dialog--round-button .van-dialog__footer{position:relative;height:auto;padding:var(--van-padding-xs) var(--van-padding-lg) var(--van-padding-md)}.van-dialog--round-button .van-dialog__message{padding-bottom:var(--van-padding-md);color:var(--van-text-color)}.van-dialog--round-button .van-dialog__confirm,.van-dialog--round-button .van-dialog__cancel{height:var(--van-dialog-round-button-height)}.van-dialog--round-button .van-dialog__confirm{color:var(--van-white)}.van-dialog--round-button .van-action-bar-button--first{border-top-left-radius:var(--van-radius-max);border-bottom-left-radius:var(--van-radius-max)}.van-dialog--round-button .van-action-bar-button--last{border-top-right-radius:var(--van-radius-max);border-bottom-right-radius:var(--van-radius-max)}.van-dialog-bounce-enter-from{transform:translate3d(0,-50%,0) scale(.7);opacity:0}.van-dialog-bounce-leave-active{transform:translate3d(0,-50%,0) scale(.9);opacity:0}
5711
- .dialog-header-content[data-v-3d101d10] {
5711
+ .dialog-header-content[data-v-9cd09319] {
5712
5712
  font-size: 16px;
5713
5713
  font-weight: 600;
5714
5714
  color: #303133;
5715
5715
  }
5716
- .dialog-content-wrapper[data-v-3d101d10] {
5716
+ .dialog-content-wrapper[data-v-9cd09319] {
5717
5717
  min-height: 500px;
5718
5718
  flex-grow: 1;
5719
5719
  display: flex;
5720
5720
  flex-direction: column;
5721
5721
  }
5722
- .empty-content[data-v-3d101d10] {
5722
+ .empty-content[data-v-9cd09319] {
5723
5723
  display: flex;
5724
5724
  align-items: center;
5725
5725
  justify-content: center;
@@ -5727,13 +5727,13 @@ body,
5727
5727
  color: #909399;
5728
5728
  font-size: 14px;
5729
5729
  }
5730
- .component-error[data-v-3d101d10] {
5730
+ .component-error[data-v-9cd09319] {
5731
5731
  padding: 40px 20px;
5732
5732
  text-align: center;
5733
5733
  color: #f56c6c;
5734
5734
  font-size: 14px;
5735
5735
  }
5736
- .fec-dialog-table[data-v-3d101d10] .table-pagination {
5736
+ .fec-dialog-table[data-v-9cd09319] .table-pagination {
5737
5737
  padding: 8px 0 0 0;
5738
5738
  }.text-field-wrapper[data-v-185ddd14] {
5739
5739
  width: 100%;
@@ -5904,27 +5904,27 @@ body,
5904
5904
  width: 80px;
5905
5905
  font-size: var(--el-font-size-extra-small);
5906
5906
  }
5907
- .fec-form[data-v-eb63b66b] {
5907
+ .fec-form[data-v-5d68b9c4] {
5908
5908
  height: 100%;
5909
5909
  }
5910
- [data-v-eb63b66b] .vgl-item {
5910
+ [data-v-5d68b9c4] .vgl-item {
5911
5911
  transition: none;
5912
5912
  }
5913
- [data-v-eb63b66b] .vgl-item > .el-form-item {
5913
+ [data-v-5d68b9c4] .vgl-item > .el-form-item {
5914
5914
  width: 100%;
5915
5915
  padding: 12px 8px 0 8px;
5916
5916
  height: calc(100% - 15px);
5917
5917
  display: flex;
5918
5918
  }
5919
- [data-v-eb63b66b] .vgl-item > .el-form-item.el-form-item--label-top {
5919
+ [data-v-5d68b9c4] .vgl-item > .el-form-item.el-form-item--label-top {
5920
5920
  flex-direction: column;
5921
5921
  }
5922
- [data-v-eb63b66b] .vgl-item > .el-form-item .el-form-item__label {
5922
+ [data-v-5d68b9c4] .vgl-item > .el-form-item .el-form-item__label {
5923
5923
  line-height: 20px;
5924
5924
  display: flex;
5925
5925
  align-items: center;
5926
5926
  }
5927
- [data-v-eb63b66b] .vgl-item > .el-container {
5927
+ [data-v-5d68b9c4] .vgl-item > .el-container {
5928
5928
  height: auto !important;
5929
5929
  }.cell-content .cell-text[data-v-3e5372d4] {
5930
5930
  display: inline-block;
@@ -182,7 +182,8 @@ const _sfc_main = {
182
182
  const calcResult = calculate.calculate({
183
183
  text: displayFormat == null ? void 0 : displayFormat.text,
184
184
  marks: [],
185
- value: row
185
+ value: row,
186
+ fieldsList: props.fieldsList
186
187
  });
187
188
  return calcResult;
188
189
  });
@@ -447,5 +448,5 @@ const _sfc_main = {
447
448
  };
448
449
  }
449
450
  };
450
- const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-3d101d10"]]);
451
+ const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-9cd09319"]]);
451
452
  exports.default = DialogRenderer;
@@ -824,7 +824,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
824
824
  const calcResult = calculate.calculate({
825
825
  text: formulaText,
826
826
  marks: [],
827
- value: formData.value
827
+ value: formData.value,
828
+ fieldsList: fields
828
829
  });
829
830
  formData.value[field.fieldName] = calcResult;
830
831
  }
@@ -1066,5 +1067,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1066
1067
  };
1067
1068
  }
1068
1069
  });
1069
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-eb63b66b"]]);
1070
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-5d68b9c4"]]);
1070
1071
  exports.default = _Form;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const functionCore = require("./functionCore.js");
4
4
  require("vue");
5
5
  function calculate(params) {
6
- const { text, marks = [], value = {} } = params;
6
+ const { text, marks = [], value = {}, fieldsList = [] } = params;
7
7
  if (!text) return new Error("非法公式");
8
8
  try {
9
9
  let str = text;
@@ -25,15 +25,30 @@ function calculate(params) {
25
25
  const [key, subKey] = enCode.split(".");
26
26
  if (value[key]) data = value[key].map((o) => o[subKey]);
27
27
  }
28
- if (data !== void 0) {
29
- if (typeof data != "string") {
30
- data = JSON.stringify(data);
28
+ if (!data) {
29
+ const fieldItem = fieldsList.find((item2) => item2.fieldName == enCode);
30
+ if (fieldItem) {
31
+ switch (fieldItem.fieldType) {
32
+ case "number":
33
+ data = 0;
34
+ break;
35
+ case "switch":
36
+ data = false;
37
+ break;
38
+ default:
39
+ data = "";
40
+ }
41
+ } else {
42
+ throw new Error("字段:" + item.fieldName + " 未定义");
31
43
  }
32
- const actualStart = startIndex + offset;
33
- const actualEnd = endIndex + offset;
34
- str = str.slice(0, actualStart) + data.toString() + str.slice(actualEnd);
35
- offset += data.toString().length - (endIndex - startIndex);
36
44
  }
45
+ if (typeof data != "string") {
46
+ data = JSON.stringify(data);
47
+ }
48
+ const actualStart = startIndex + offset;
49
+ const actualEnd = endIndex + offset;
50
+ str = str.slice(0, actualStart) + data.toString() + str.slice(actualEnd);
51
+ offset += data.toString().length - (endIndex - startIndex);
37
52
  }
38
53
  const result = functionCore.default.executeFunction(str);
39
54
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.4.26",
3
+ "version": "5.4.27",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [