@fecp/designer 5.3.21 → 5.4.1

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.3.21";
1
+ const version = "5.4.1";
2
2
  const packageJson = {
3
3
  version
4
4
  };
@@ -10,7 +10,8 @@ const defaultProperty = {
10
10
  headerAlign: "center",
11
11
  align: "center",
12
12
  isOverflowWrap: true,
13
- isShow: true
13
+ isShow: true,
14
+ canSort: true
14
15
  };
15
16
  const components = [
16
17
  {
@@ -1,26 +1,26 @@
1
1
  const defaultTableConfig = {
2
- "fieldsData": [
2
+ fieldsData: [
3
3
  {
4
- "fieldType": "text",
5
- "label": "文本",
6
- "fieldName": "fieldName",
7
- "format": "number",
8
- "hasDecimalPlaces": true,
9
- "decimalPlaces": 2,
10
- "optionStyle": "default",
11
- "dateType": "date",
12
- "widthMode": "auto",
13
- "minWidth": 80,
14
- "headerAlign": "center",
15
- "align": "center",
16
- "isShow": true,
17
- "id": 1770347203793,
18
- "type": "widgets"
4
+ fieldType: "text",
5
+ label: "文本",
6
+ fieldName: "fieldName",
7
+ format: "number",
8
+ hasDecimalPlaces: true,
9
+ decimalPlaces: 2,
10
+ optionStyle: "default",
11
+ dateType: "date",
12
+ widthMode: "auto",
13
+ minWidth: 80,
14
+ headerAlign: "center",
15
+ align: "center",
16
+ isShow: true,
17
+ id: 1770347203793,
18
+ type: "widgets"
19
19
  }
20
20
  ],
21
- "showTitle": true,
22
- "isOptBtns": true,
23
- "optBtns": [
21
+ showTitle: true,
22
+ isOptBtns: true,
23
+ optBtns: [
24
24
  // {
25
25
  // "id": 1770347228880,
26
26
  // "label": "修改",
@@ -34,8 +34,8 @@ const defaultTableConfig = {
34
34
  // "btnStyle": "default"
35
35
  // }
36
36
  ],
37
- "customBtns": {
38
- "left": [
37
+ customBtns: {
38
+ left: [
39
39
  // {
40
40
  // "id": 1770347217788,
41
41
  // "label": "新增",
@@ -44,40 +44,38 @@ const defaultTableConfig = {
44
44
  // "btnStyle": "default"
45
45
  // }
46
46
  ],
47
- "right": []
47
+ right: []
48
48
  },
49
- "selectMode": "none",
50
- "showIndex": false,
51
- "heightMode": "auto",
52
- "height": 500,
53
- "editable": false,
54
- "events": {},
55
- "dataSourceId": "",
56
- "sortRules": [],
57
- "paginationConfig": {
58
- "enabled": true,
59
- "pageSize": 10,
60
- "pageSizes": [
61
- 10,
62
- 20,
63
- 50,
64
- 100,
65
- 200,
66
- 500
67
- ],
68
- "layout": "full",
69
- "background": true,
70
- "size": "small"
49
+ selectMode: "none",
50
+ showIndex: false,
51
+ heightMode: "auto",
52
+ height: 500,
53
+ editable: false,
54
+ events: {},
55
+ dataSourceId: "",
56
+ sortRules: [],
57
+ paginationConfig: {
58
+ enabled: true,
59
+ pageSize: 10,
60
+ pageSizes: [10, 20, 50, 100, 200, 500],
61
+ layout: "full",
62
+ background: true,
63
+ size: "small"
64
+ },
65
+ mode: [],
66
+ dataSources: [],
67
+ dialogs: [],
68
+ queryConfig: {
69
+ enabled: true,
70
+ mode: "fixed",
71
+ columnCount: 4,
72
+ collapseRows: 2,
73
+ filterFields: []
71
74
  },
72
- "mode": [],
73
- "dataSources": [],
74
- "dialogs": [],
75
- "queryConfig": {
76
- "enabled": true,
77
- "mode": "fixed",
78
- "columnCount": 4,
79
- "collapseRows": 2,
80
- "filterFields": []
75
+ summaryConfig: {
76
+ enabled: false,
77
+ mode: "current",
78
+ summaryFields: []
81
79
  }
82
80
  };
83
81
  const defaultCustomBtn = {
@@ -22,6 +22,7 @@ import { Setting as setting_default, Hide as hide_default, Delete as delete_defa
22
22
  import TableSetting from "./TableSetting.vue.mjs";
23
23
  import QueryModule from "./queryModule/index.vue.mjs";
24
24
  import TablePagination from "./tablePagination.vue.mjs";
25
+ import TableSummary from "./tableSummary.vue.mjs";
25
26
  import { getEditConfigData, setSelectedItem, setHoverItem, getCurrentClass } from "../utils/common.mjs";
26
27
  /* empty css */
27
28
  /* empty css */
@@ -465,12 +466,13 @@ const _sfc_main = {
465
466
  }, 8, ["modelValue"])
466
467
  ], 2)
467
468
  ]),
469
+ createVNode(TableSummary),
468
470
  createVNode(TablePagination)
469
471
  ], 64);
470
472
  };
471
473
  }
472
474
  };
473
- const tableWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f581ce52"]]);
475
+ const tableWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-271403ad"]]);
474
476
  export {
475
477
  tableWorkArea as default
476
478
  };
@@ -0,0 +1,112 @@
1
+ import "../../../../node_modules/element-plus/es/index.mjs";
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
+ /* empty css */
12
+ /* empty css */
13
+ /* empty css */
14
+ import { computed, reactive, watch, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, createBlock } from "vue";
15
+ import { getEditConfigData } from "../utils/common.mjs";
16
+ /* empty css */
17
+ import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
18
+ import { ElSwitch } from "../../../../node_modules/element-plus/es/components/switch/index.mjs";
19
+ import { ElDivider } from "../../../../node_modules/element-plus/es/components/divider/index.mjs";
20
+ import { ElSelect, ElOption } from "../../../../node_modules/element-plus/es/components/select/index.mjs";
21
+ import { ElRadioGroup, ElRadioButton } from "../../../../node_modules/element-plus/es/components/radio/index.mjs";
22
+ const _hoisted_1 = { class: "table-summary-config" };
23
+ const _hoisted_2 = { class: "config-row" };
24
+ const _sfc_main = {
25
+ __name: "tableSummary",
26
+ setup(__props) {
27
+ var _a;
28
+ const editConfigData = computed(() => getEditConfigData());
29
+ const availableFields = computed(() => {
30
+ var _a2;
31
+ const fields = ((_a2 = editConfigData.value) == null ? void 0 : _a2.fieldsData) || [];
32
+ return fields.filter((field) => field.isShow && field.fieldType === "number");
33
+ });
34
+ const summaryConfig = reactive({
35
+ enabled: false,
36
+ mode: "current",
37
+ summaryFields: [],
38
+ ...((_a = editConfigData.value) == null ? void 0 : _a.summaryConfig) || {}
39
+ });
40
+ watch(
41
+ summaryConfig,
42
+ (val) => {
43
+ editConfigData.value.summaryConfig = val;
44
+ },
45
+ { deep: true }
46
+ );
47
+ return (_ctx, _cache) => {
48
+ const _component_el_switch = ElSwitch;
49
+ const _component_el_divider = ElDivider;
50
+ const _component_el_option = ElOption;
51
+ const _component_el_select = ElSelect;
52
+ const _component_el_radio_button = ElRadioButton;
53
+ const _component_el_radio_group = ElRadioGroup;
54
+ return openBlock(), createElementBlock("div", _hoisted_1, [
55
+ createElementVNode("div", _hoisted_2, [
56
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "config-label" }, "开启合计:", -1)),
57
+ createVNode(_component_el_switch, {
58
+ modelValue: summaryConfig.enabled,
59
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => summaryConfig.enabled = $event),
60
+ size: "small"
61
+ }, null, 8, ["modelValue"]),
62
+ createVNode(_component_el_divider, { direction: "vertical" }),
63
+ _cache[4] || (_cache[4] = createElementVNode("span", { class: "config-label" }, "合计列:", -1)),
64
+ createVNode(_component_el_select, {
65
+ modelValue: summaryConfig.summaryFields,
66
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => summaryConfig.summaryFields = $event),
67
+ multiple: "",
68
+ size: "small",
69
+ style: { "width": "200px" },
70
+ "collapse-tags": "",
71
+ "collapse-tags-tooltip": "",
72
+ placeholder: "请选择要合计的列"
73
+ }, {
74
+ default: withCtx(() => [
75
+ (openBlock(true), createElementBlock(Fragment, null, renderList(availableFields.value, (field) => {
76
+ return openBlock(), createBlock(_component_el_option, {
77
+ key: field.fieldName,
78
+ label: field.label || field.fieldName,
79
+ value: field.fieldName
80
+ }, null, 8, ["label", "value"]);
81
+ }), 128))
82
+ ]),
83
+ _: 1
84
+ }, 8, ["modelValue"]),
85
+ createVNode(_component_el_divider, { direction: "vertical" }),
86
+ _cache[5] || (_cache[5] = createElementVNode("span", { class: "config-label" }, "合计模式:", -1)),
87
+ createVNode(_component_el_radio_group, {
88
+ modelValue: summaryConfig.mode,
89
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => summaryConfig.mode = $event),
90
+ size: "small"
91
+ }, {
92
+ default: withCtx(() => [
93
+ createVNode(_component_el_radio_button, {
94
+ label: "当前页数据",
95
+ value: "current"
96
+ }),
97
+ createVNode(_component_el_radio_button, {
98
+ label: "全部数据",
99
+ value: "all"
100
+ })
101
+ ]),
102
+ _: 1
103
+ }, 8, ["modelValue"])
104
+ ])
105
+ ]);
106
+ };
107
+ }
108
+ };
109
+ const TableSummary = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-95806c79"]]);
110
+ export {
111
+ TableSummary as default
112
+ };