@fecp/designer 5.4.35 → 5.4.37

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 (25) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/packages/formulaEditor/core/calculate.mjs +1 -0
  3. package/es/designer/src/packages/formulaEditor/core/customFunc.mjs +6 -0
  4. package/es/designer/src/packages/formulaEditor/core/functionCore.mjs +3 -1
  5. package/es/designer/src/packages/formulaEditor/function.mjs +14 -0
  6. package/es/designer.css +6 -6
  7. package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
  8. package/es/packages/vue/src/components/forms/date/Date.vue.mjs +5 -5
  9. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +7 -7
  10. package/es/packages/vue/src/utils/formulajs/calculate.mjs +9 -0
  11. package/es/packages/vue/src/utils/formulajs/customFunc.mjs +12 -0
  12. package/es/packages/vue/src/utils/formulajs/functionCore.mjs +3 -1
  13. package/lib/designer/package.json.js +1 -1
  14. package/lib/designer/src/packages/formulaEditor/core/calculate.js +1 -0
  15. package/lib/designer/src/packages/formulaEditor/core/customFunc.js +6 -0
  16. package/lib/designer/src/packages/formulaEditor/core/functionCore.js +3 -1
  17. package/lib/designer/src/packages/formulaEditor/function.js +14 -0
  18. package/lib/designer.css +6 -6
  19. package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
  20. package/lib/packages/vue/src/components/forms/date/Date.vue.js +5 -5
  21. package/lib/packages/vue/src/components/forms/form/Form.vue.js +7 -7
  22. package/lib/packages/vue/src/utils/formulajs/calculate.js +9 -0
  23. package/lib/packages/vue/src/utils/formulajs/customFunc.js +12 -0
  24. package/lib/packages/vue/src/utils/formulajs/functionCore.js +3 -1
  25. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const version = "5.4.35";
1
+ const version = "5.4.37";
2
2
  const packageJson = {
3
3
  version
4
4
  };
@@ -31,6 +31,7 @@ function calculate(params) {
31
31
  offset += data.toString().length - (endIndex - startIndex);
32
32
  }
33
33
  }
34
+ debugger;
34
35
  const result = functionCore.executeFunction(str);
35
36
  return result;
36
37
  } catch (e) {
@@ -0,0 +1,6 @@
1
+ const DATEDELTA = (dataStr, offset) => {
2
+ return /* @__PURE__ */ new Date();
3
+ };
4
+ export {
5
+ DATEDELTA
6
+ };
@@ -1,7 +1,9 @@
1
1
  import * as index from "../../../../../node_modules/@formulajs/formulajs/lib/esm/index.mjs";
2
+ import * as customFunc from "./customFunc.mjs";
3
+ const Formula = { ...index, ...customFunc };
2
4
  class FunctionCore {
3
5
  constructor() {
4
- Object.assign(FunctionCore.prototype, index);
6
+ Object.assign(FunctionCore.prototype, Formula);
5
7
  }
6
8
  executeFunction(str) {
7
9
  const fn = new Function(
@@ -343,6 +343,20 @@ const functionList = [
343
343
  example: 'DAY("2025/1/15") = 15',
344
344
  usage: "DAY(日期)"
345
345
  },
346
+ {
347
+ name: "DATEDELTA",
348
+ enCode: "DATEDELTA",
349
+ tip: "加减日期天数",
350
+ example: 'DATEDELTA("2025/1/15",2) = 2025/1/17',
351
+ usage: "DATEDELTA(指定日期,需要加减的天数)"
352
+ },
353
+ {
354
+ name: "EDATE",
355
+ enCode: "EDATE",
356
+ tip: "加减日期月份",
357
+ example: 'EDATE("2025/1/15",2) = 2025/3/15',
358
+ usage: "EDATE(指定日期,需要加减的月份数)"
359
+ },
346
360
  {
347
361
  name: "DAYS",
348
362
  enCode: "DAYS",
package/es/designer.css CHANGED
@@ -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-d272bf0a] {
5907
+ .fec-form[data-v-d28cc224] {
5908
5908
  height: 100%;
5909
5909
  }
5910
- [data-v-d272bf0a] .vgl-item {
5910
+ [data-v-d28cc224] .vgl-item {
5911
5911
  transition: none;
5912
5912
  }
5913
- [data-v-d272bf0a] .vgl-item > .el-form-item {
5913
+ [data-v-d28cc224] .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-d272bf0a] .vgl-item > .el-form-item.el-form-item--label-top {
5919
+ [data-v-d28cc224] .vgl-item > .el-form-item.el-form-item--label-top {
5920
5920
  flex-direction: column;
5921
5921
  }
5922
- [data-v-d272bf0a] .vgl-item > .el-form-item .el-form-item__label {
5922
+ [data-v-d28cc224] .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-d272bf0a] .vgl-item > .el-container {
5927
+ [data-v-d28cc224] .vgl-item > .el-container {
5928
5928
  height: auto !important;
5929
5929
  }.cell-content .cell-text[data-v-3e5372d4] {
5930
5930
  display: inline-block;
@@ -6,13 +6,13 @@
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  import { createBlock, openBlock, withCtx, createVNode, renderSlot } from "vue";
9
- /* empty css */
10
- import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
11
9
  /* empty css */
12
10
  /* empty css */
13
11
  /* empty css */
14
12
  /* empty css */
15
13
  /* empty css */
14
+ /* empty css */
15
+ import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
16
16
  import { SwipeCell } from "../../../../../../node_modules/vant/es/swipe-cell/index.mjs";
17
17
  import { showConfirmDialog } from "../../../../../../node_modules/vant/es/dialog/function-call.mjs";
18
18
  import "../../../../../../node_modules/vant/es/dialog/index.mjs";
@@ -72,13 +72,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
72
72
  });
73
73
  const computedValueFormat = computed(() => {
74
74
  const valueFormatMap = {
75
- date: "YYYY-MM-DD",
76
- week: "YYYY-MM-DD",
77
- month: "YYYY-MM",
75
+ date: "YYYY/MM/DD",
76
+ week: "YYYY/MM/DD",
77
+ month: "YYYY/MM",
78
78
  year: "YYYY",
79
- datetime: "YYYY-MM-DD HH:mm:ss"
79
+ datetime: "YYYY/MM/DD HH:mm:ss"
80
80
  };
81
- return valueFormatMap[props.dateType] || "YYYY-MM-DD";
81
+ return valueFormatMap[props.dateType] || "YYYY/MM/DD";
82
82
  });
83
83
  const inputValue = computed({
84
84
  get: () => props.modelValue,
@@ -636,11 +636,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
636
636
  datetime: "YYYYMMDDHHmmss"
637
637
  };
638
638
  const formValueFormatMap = {
639
- date: "YYYY-MM-DD",
640
- week: "YYYY-MM-DD",
641
- month: "YYYY-MM",
639
+ date: "YYYY/MM/DD",
640
+ week: "YYYY/MM/DD",
641
+ month: "YYYY/MM",
642
642
  year: "YYYY",
643
- datetime: "YYYY-MM-DD HH:mm:ss"
643
+ datetime: "YYYY/MM/DD HH:mm:ss"
644
644
  };
645
645
  const getFormData = () => {
646
646
  const result = { ...formData.value };
@@ -659,7 +659,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
659
659
  } else if (fieldName && fieldType === "date" && value) {
660
660
  const dateValueType = field.dateValueType;
661
661
  const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
662
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
662
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
663
663
  switch (dateValueType) {
664
664
  case "date":
665
665
  result[fieldName] = hooks(value, formValueFormat).toDate();
@@ -717,7 +717,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
717
717
  });
718
718
  } else if (fieldName && fieldType === "date" && value) {
719
719
  const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
720
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
720
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
721
721
  processedData[fieldName] = hooks(value, valueFormat).format(
722
722
  formValueFormat
723
723
  );
@@ -1064,7 +1064,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1064
1064
  };
1065
1065
  }
1066
1066
  });
1067
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d272bf0a"]]);
1067
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d28cc224"]]);
1068
1068
  export {
1069
1069
  _Form as default
1070
1070
  };
@@ -58,6 +58,15 @@ function calculate(params) {
58
58
  offset += data.toString().length - (endIndex - startIndex);
59
59
  }
60
60
  const result = functionCore.executeFunction(str);
61
+ if (result instanceof Date) {
62
+ const year = result.getFullYear();
63
+ const month = String(result.getMonth() + 1).padStart(2, "0");
64
+ const day = String(result.getDate()).padStart(2, "0");
65
+ const hh = String(result.getHours()).padStart(2, "0");
66
+ const mm = String(result.getMinutes()).padStart(2, "0");
67
+ const ss = String(result.getSeconds()).padStart(2, "0");
68
+ return `${year}/${month}/${day} ${hh}:${mm}:${ss}`;
69
+ }
61
70
  return result;
62
71
  } catch (e) {
63
72
  const errorTypes = {
@@ -0,0 +1,12 @@
1
+ const DATEDELTA = (dateStr, offset) => {
2
+ const date = new Date(dateStr);
3
+ if (isNaN(date.getTime())) {
4
+ return null;
5
+ }
6
+ const result = new Date(date);
7
+ result.setDate(result.getDate() + Number(offset));
8
+ return result;
9
+ };
10
+ export {
11
+ DATEDELTA
12
+ };
@@ -1,7 +1,9 @@
1
1
  import * as index from "../../../../../node_modules/@formulajs/formulajs/lib/esm/index.mjs";
2
+ import * as customFunc from "./customFunc.mjs";
3
+ const Formula = { ...index, ...customFunc };
2
4
  class FunctionCore {
3
5
  constructor() {
4
- Object.assign(FunctionCore.prototype, index);
6
+ Object.assign(FunctionCore.prototype, Formula);
5
7
  }
6
8
  executeFunction(str) {
7
9
  const fn = new Function(
@@ -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.35";
3
+ const version = "5.4.37";
4
4
  const packageJson = {
5
5
  version
6
6
  };
@@ -33,6 +33,7 @@ function calculate(params) {
33
33
  offset += data.toString().length - (endIndex - startIndex);
34
34
  }
35
35
  }
36
+ debugger;
36
37
  const result = functionCore.default.executeFunction(str);
37
38
  return result;
38
39
  } catch (e) {
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const DATEDELTA = (dataStr, offset) => {
4
+ return /* @__PURE__ */ new Date();
5
+ };
6
+ exports.DATEDELTA = DATEDELTA;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const index = require("../../../../../node_modules/@formulajs/formulajs/lib/esm/index.js");
4
+ const customFunc = require("./customFunc.js");
5
+ const Formula = { ...index, ...customFunc };
4
6
  class FunctionCore {
5
7
  constructor() {
6
- Object.assign(FunctionCore.prototype, index);
8
+ Object.assign(FunctionCore.prototype, Formula);
7
9
  }
8
10
  executeFunction(str) {
9
11
  const fn = new Function(
@@ -345,6 +345,20 @@ const functionList = [
345
345
  example: 'DAY("2025/1/15") = 15',
346
346
  usage: "DAY(日期)"
347
347
  },
348
+ {
349
+ name: "DATEDELTA",
350
+ enCode: "DATEDELTA",
351
+ tip: "加减日期天数",
352
+ example: 'DATEDELTA("2025/1/15",2) = 2025/1/17',
353
+ usage: "DATEDELTA(指定日期,需要加减的天数)"
354
+ },
355
+ {
356
+ name: "EDATE",
357
+ enCode: "EDATE",
358
+ tip: "加减日期月份",
359
+ example: 'EDATE("2025/1/15",2) = 2025/3/15',
360
+ usage: "EDATE(指定日期,需要加减的月份数)"
361
+ },
348
362
  {
349
363
  name: "DAYS",
350
364
  enCode: "DAYS",
package/lib/designer.css CHANGED
@@ -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-d272bf0a] {
5907
+ .fec-form[data-v-d28cc224] {
5908
5908
  height: 100%;
5909
5909
  }
5910
- [data-v-d272bf0a] .vgl-item {
5910
+ [data-v-d28cc224] .vgl-item {
5911
5911
  transition: none;
5912
5912
  }
5913
- [data-v-d272bf0a] .vgl-item > .el-form-item {
5913
+ [data-v-d28cc224] .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-d272bf0a] .vgl-item > .el-form-item.el-form-item--label-top {
5919
+ [data-v-d28cc224] .vgl-item > .el-form-item.el-form-item--label-top {
5920
5920
  flex-direction: column;
5921
5921
  }
5922
- [data-v-d272bf0a] .vgl-item > .el-form-item .el-form-item__label {
5922
+ [data-v-d28cc224] .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-d272bf0a] .vgl-item > .el-container {
5927
+ [data-v-d28cc224] .vgl-item > .el-container {
5928
5928
  height: auto !important;
5929
5929
  }.cell-content .cell-text[data-v-3e5372d4] {
5930
5930
  display: inline-block;
@@ -8,13 +8,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8
8
  ;/* empty css */
9
9
  ;/* empty css */
10
10
  const vue = require("vue");
11
- ;/* empty css */
12
- const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
13
11
  ;/* empty css */
14
12
  ;/* empty css */
15
13
  ;/* empty css */
16
14
  ;/* empty css */
17
15
  ;/* empty css */
16
+ ;/* empty css */
17
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
18
18
  const index$1 = require("../../../../../../node_modules/vant/es/swipe-cell/index.js");
19
19
  const functionCall = require("../../../../../../node_modules/vant/es/dialog/function-call.js");
20
20
  require("../../../../../../node_modules/vant/es/dialog/index.js");
@@ -74,13 +74,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
74
74
  });
75
75
  const computedValueFormat = vue.computed(() => {
76
76
  const valueFormatMap = {
77
- date: "YYYY-MM-DD",
78
- week: "YYYY-MM-DD",
79
- month: "YYYY-MM",
77
+ date: "YYYY/MM/DD",
78
+ week: "YYYY/MM/DD",
79
+ month: "YYYY/MM",
80
80
  year: "YYYY",
81
- datetime: "YYYY-MM-DD HH:mm:ss"
81
+ datetime: "YYYY/MM/DD HH:mm:ss"
82
82
  };
83
- return valueFormatMap[props.dateType] || "YYYY-MM-DD";
83
+ return valueFormatMap[props.dateType] || "YYYY/MM/DD";
84
84
  });
85
85
  const inputValue = vue.computed({
86
86
  get: () => props.modelValue,
@@ -638,11 +638,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
638
638
  datetime: "YYYYMMDDHHmmss"
639
639
  };
640
640
  const formValueFormatMap = {
641
- date: "YYYY-MM-DD",
642
- week: "YYYY-MM-DD",
643
- month: "YYYY-MM",
641
+ date: "YYYY/MM/DD",
642
+ week: "YYYY/MM/DD",
643
+ month: "YYYY/MM",
644
644
  year: "YYYY",
645
- datetime: "YYYY-MM-DD HH:mm:ss"
645
+ datetime: "YYYY/MM/DD HH:mm:ss"
646
646
  };
647
647
  const getFormData = () => {
648
648
  const result = { ...formData.value };
@@ -661,7 +661,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
661
661
  } else if (fieldName && fieldType === "date" && value) {
662
662
  const dateValueType = field.dateValueType;
663
663
  const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
664
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
664
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
665
665
  switch (dateValueType) {
666
666
  case "date":
667
667
  result[fieldName] = moment.default(value, formValueFormat).toDate();
@@ -719,7 +719,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
719
719
  });
720
720
  } else if (fieldName && fieldType === "date" && value) {
721
721
  const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
722
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
722
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
723
723
  processedData[fieldName] = moment.default(value, valueFormat).format(
724
724
  formValueFormat
725
725
  );
@@ -1066,5 +1066,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1066
1066
  };
1067
1067
  }
1068
1068
  });
1069
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-d272bf0a"]]);
1069
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-d28cc224"]]);
1070
1070
  exports.default = _Form;
@@ -60,6 +60,15 @@ function calculate(params) {
60
60
  offset += data.toString().length - (endIndex - startIndex);
61
61
  }
62
62
  const result = functionCore.default.executeFunction(str);
63
+ if (result instanceof Date) {
64
+ const year = result.getFullYear();
65
+ const month = String(result.getMonth() + 1).padStart(2, "0");
66
+ const day = String(result.getDate()).padStart(2, "0");
67
+ const hh = String(result.getHours()).padStart(2, "0");
68
+ const mm = String(result.getMinutes()).padStart(2, "0");
69
+ const ss = String(result.getSeconds()).padStart(2, "0");
70
+ return `${year}/${month}/${day} ${hh}:${mm}:${ss}`;
71
+ }
63
72
  return result;
64
73
  } catch (e) {
65
74
  const errorTypes = {
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const DATEDELTA = (dateStr, offset) => {
4
+ const date = new Date(dateStr);
5
+ if (isNaN(date.getTime())) {
6
+ return null;
7
+ }
8
+ const result = new Date(date);
9
+ result.setDate(result.getDate() + Number(offset));
10
+ return result;
11
+ };
12
+ exports.DATEDELTA = DATEDELTA;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const index = require("../../../../../node_modules/@formulajs/formulajs/lib/esm/index.js");
4
+ const customFunc = require("./customFunc.js");
5
+ const Formula = { ...index, ...customFunc };
4
6
  class FunctionCore {
5
7
  constructor() {
6
- Object.assign(FunctionCore.prototype, index);
8
+ Object.assign(FunctionCore.prototype, Formula);
7
9
  }
8
10
  executeFunction(str) {
9
11
  const fn = new Function(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.4.35",
3
+ "version": "5.4.37",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [