@fecp/designer 5.3.22 → 5.4.2
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/es/designer/package.json.mjs +1 -1
- package/es/designer/src/components/ParamsConfig.vue2.mjs +1 -1
- package/es/designer/src/components/ValueSelector.vue.mjs +191 -0
- package/es/designer/src/layout/aside/HiddenFieldDialog.vue.mjs +1 -1
- package/es/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +1 -1
- package/es/designer/src/packages/dataLinkage/index.vue.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/index.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/approvalHistory.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/subForm.vue.mjs +1 -1
- package/es/designer/src/packages/prod/index.vue.mjs +1 -1
- package/es/designer/src/packages/table/aside/index.mjs +2 -1
- package/es/designer/src/packages/table/default.mjs +51 -53
- package/es/designer/src/packages/table/headerBtn.vue.mjs +1 -1
- package/es/designer/src/packages/table/index.vue.mjs +3 -1
- package/es/designer/src/packages/table/tableSummary.vue.mjs +112 -0
- package/es/designer.css +101 -78
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +2 -2
- package/es/packages/vue/src/components/table/Table.vue.mjs +130 -10
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +1 -1
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/components/ParamsConfig.vue2.js +1 -1
- package/lib/designer/src/components/ValueSelector.vue.js +191 -0
- package/lib/designer/src/layout/aside/HiddenFieldDialog.vue.js +1 -1
- package/lib/designer/src/packages/advancedFilter/ValueInput.vue2.js +1 -1
- package/lib/designer/src/packages/dataLinkage/index.vue.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/index.vue.js +1 -1
- package/lib/designer/src/packages/form/property/approvalHistory.vue.js +1 -1
- package/lib/designer/src/packages/form/property/subForm.vue.js +1 -1
- package/lib/designer/src/packages/prod/index.vue.js +1 -1
- package/lib/designer/src/packages/table/aside/index.js +2 -1
- package/lib/designer/src/packages/table/default.js +51 -53
- package/lib/designer/src/packages/table/headerBtn.vue.js +1 -1
- package/lib/designer/src/packages/table/index.vue.js +3 -1
- package/lib/designer/src/packages/table/tableSummary.vue.js +112 -0
- package/lib/designer.css +101 -78
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +2 -2
- package/lib/packages/vue/src/components/table/Table.vue.js +130 -10
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import "../../../node_modules/element-plus/es/index.mjs";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { computed, createElementBlock, openBlock, createBlock, unref, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createVNode } from "vue";
|
|
6
6
|
import { Plus as plus_default, Delete as delete_default } from "../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
7
|
-
import ValueSelector from "./ValueSelector.
|
|
7
|
+
import ValueSelector from "./ValueSelector.vue.mjs";
|
|
8
8
|
/* empty css */
|
|
9
9
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
10
10
|
import { ElButton } from "../../../node_modules/element-plus/es/components/button/index.mjs";
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { computed, createBlock, openBlock, resolveDynamicComponent, withCtx, createVNode } from "vue";
|
|
2
|
+
import "../../../node_modules/element-plus/es/index.mjs";
|
|
3
|
+
import ValueSelectorPopover from "./ValueSelectorPopover.vue2.mjs";
|
|
4
|
+
import { getEditConfigData, getEditConfigDataFields } from "../packages/utils/common.mjs";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
7
|
+
import { ElInputTag } from "../../../node_modules/element-plus/es/components/input-tag/index.mjs";
|
|
8
|
+
import { ElInput } from "../../../node_modules/element-plus/es/components/input/index.mjs";
|
|
9
|
+
const _sfc_main = {
|
|
10
|
+
__name: "ValueSelector",
|
|
11
|
+
props: {
|
|
12
|
+
// modelValue 的格式:
|
|
13
|
+
// 单选:{ type: 'field', value: '字段ID' }
|
|
14
|
+
// 多选:[{ type: 'field', value: '字段ID1' }, { type: 'field', value: '字段ID2' }]
|
|
15
|
+
modelValue: {
|
|
16
|
+
default: () => null
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "请输入或选择值"
|
|
21
|
+
},
|
|
22
|
+
readOnly: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "small"
|
|
37
|
+
}
|
|
38
|
+
// // 可选的字段列表(从父组件传入)
|
|
39
|
+
// availableFields: {
|
|
40
|
+
// type: Array,
|
|
41
|
+
// default: () => [],
|
|
42
|
+
// validator: (value) => Array.isArray(value),
|
|
43
|
+
// },
|
|
44
|
+
},
|
|
45
|
+
emits: ["update:modelValue"],
|
|
46
|
+
setup(__props, { emit: __emit }) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const emit = __emit;
|
|
49
|
+
const inputComponent = computed(() => {
|
|
50
|
+
return props.multiple ? ElInputTag : ElInput;
|
|
51
|
+
});
|
|
52
|
+
const hiddenFieldsData = computed(() => {
|
|
53
|
+
const editConfigData = getEditConfigData();
|
|
54
|
+
return (editConfigData == null ? void 0 : editConfigData.hiddenFields) || [];
|
|
55
|
+
});
|
|
56
|
+
const availableFields = computed(() => {
|
|
57
|
+
const fields = getEditConfigDataFields() || [];
|
|
58
|
+
return fields.map((item) => ({
|
|
59
|
+
id: item.id,
|
|
60
|
+
label: item.label,
|
|
61
|
+
fieldName: item.fieldName,
|
|
62
|
+
fieldType: item.fieldType
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
const displayText = computed(() => {
|
|
66
|
+
if (!props.modelValue) return "";
|
|
67
|
+
if (!props.multiple && typeof props.modelValue === "object" && !Array.isArray(props.modelValue)) {
|
|
68
|
+
const val = props.modelValue;
|
|
69
|
+
if (val.label) return val.label;
|
|
70
|
+
const field = availableFields.value.find((f) => f.id === val.value);
|
|
71
|
+
return (field == null ? void 0 : field.label) || (field == null ? void 0 : field.fieldName) || val.value;
|
|
72
|
+
} else if (!props.multiple && typeof props.modelValue === "string") {
|
|
73
|
+
return props.modelValue;
|
|
74
|
+
}
|
|
75
|
+
return "";
|
|
76
|
+
});
|
|
77
|
+
const tags = computed({
|
|
78
|
+
get() {
|
|
79
|
+
if (!props.multiple || !Array.isArray(props.modelValue)) {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
return props.modelValue.map((item) => {
|
|
83
|
+
if (item.label) return item.label;
|
|
84
|
+
const field = availableFields.value.find((f) => f.id === item.value);
|
|
85
|
+
return (field == null ? void 0 : field.label) || (field == null ? void 0 : field.fieldName) || item.value;
|
|
86
|
+
}).filter(Boolean);
|
|
87
|
+
},
|
|
88
|
+
set(val) {
|
|
89
|
+
if (Array.isArray(props.modelValue)) {
|
|
90
|
+
const newModelValue = props.modelValue.filter((item) => {
|
|
91
|
+
const itemLabel = item.label || (() => {
|
|
92
|
+
const field = [
|
|
93
|
+
...availableFields.value,
|
|
94
|
+
...hiddenFieldsData.value
|
|
95
|
+
].find((f) => f.id === item.value);
|
|
96
|
+
return (field == null ? void 0 : field.label) || (field == null ? void 0 : field.fieldName) || item.value;
|
|
97
|
+
})();
|
|
98
|
+
return val.includes(itemLabel);
|
|
99
|
+
});
|
|
100
|
+
emit("update:modelValue", newModelValue);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const unifiedInputValue = computed({
|
|
105
|
+
get() {
|
|
106
|
+
return props.multiple ? tags.value : displayText.value;
|
|
107
|
+
},
|
|
108
|
+
set(val) {
|
|
109
|
+
if (props.multiple && Array.isArray(val)) {
|
|
110
|
+
tags.value = val;
|
|
111
|
+
} else if (!props.multiple && typeof val === "string") {
|
|
112
|
+
emit("update:modelValue", val);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const handleConfirm = (selected) => {
|
|
117
|
+
let result = null;
|
|
118
|
+
if (selected.type === "field") {
|
|
119
|
+
const field = [...availableFields.value, ...hiddenFieldsData.value].find(
|
|
120
|
+
(f) => f.id === selected.value
|
|
121
|
+
);
|
|
122
|
+
result = {
|
|
123
|
+
label: `\${${(field == null ? void 0 : field.label) || (field == null ? void 0 : field.fieldName) || selected.value}}`,
|
|
124
|
+
type: "field",
|
|
125
|
+
value: selected.value
|
|
126
|
+
};
|
|
127
|
+
} else if (selected.type === "userInfo") {
|
|
128
|
+
result = {
|
|
129
|
+
label: `\${用户信息: ${getUserInfoLabel(selected.value)}}`,
|
|
130
|
+
type: "userInfo",
|
|
131
|
+
value: selected.value
|
|
132
|
+
};
|
|
133
|
+
} else if (selected.type === "urlParam") {
|
|
134
|
+
result = {
|
|
135
|
+
label: `\${路由参数: ${selected.value}}`,
|
|
136
|
+
type: "urlParam",
|
|
137
|
+
value: selected.value
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (!result) return;
|
|
141
|
+
if (props.multiple) {
|
|
142
|
+
const currentValue = Array.isArray(props.modelValue) ? props.modelValue : [];
|
|
143
|
+
const exists = currentValue.some((item) => item.value === result.value);
|
|
144
|
+
if (!exists) {
|
|
145
|
+
emit("update:modelValue", [...currentValue, result]);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
emit("update:modelValue", result);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const getUserInfoLabel = (key) => {
|
|
152
|
+
const labels = {
|
|
153
|
+
userCode: "用户编号",
|
|
154
|
+
userName: "用户名称",
|
|
155
|
+
roleCode: "角色编号",
|
|
156
|
+
roleName: "角色名称",
|
|
157
|
+
orgCode: "机构编号",
|
|
158
|
+
orgName: "机构名称"
|
|
159
|
+
};
|
|
160
|
+
return labels[key] || key;
|
|
161
|
+
};
|
|
162
|
+
return (_ctx, _cache) => {
|
|
163
|
+
return openBlock(), createBlock(resolveDynamicComponent(inputComponent.value), {
|
|
164
|
+
modelValue: unifiedInputValue.value,
|
|
165
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unifiedInputValue.value = $event),
|
|
166
|
+
placeholder: __props.placeholder,
|
|
167
|
+
disabled: __props.disabled,
|
|
168
|
+
readonly: __props.readOnly,
|
|
169
|
+
trigger: __props.multiple ? "Space" : void 0,
|
|
170
|
+
"collapse-tags": "",
|
|
171
|
+
"collapse-tags-tooltip": "",
|
|
172
|
+
"max-collapse-tags": 1,
|
|
173
|
+
class: "value-selector-input",
|
|
174
|
+
size: __props.size
|
|
175
|
+
}, {
|
|
176
|
+
suffix: withCtx(() => [
|
|
177
|
+
createVNode(ValueSelectorPopover, {
|
|
178
|
+
"available-fields": availableFields.value,
|
|
179
|
+
disabled: __props.disabled,
|
|
180
|
+
onConfirm: handleConfirm
|
|
181
|
+
}, null, 8, ["available-fields", "disabled"])
|
|
182
|
+
]),
|
|
183
|
+
_: 1
|
|
184
|
+
}, 8, ["modelValue", "placeholder", "disabled", "readonly", "trigger", "size"]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const ValueSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e5b87efa"]]);
|
|
189
|
+
export {
|
|
190
|
+
ValueSelector as default
|
|
191
|
+
};
|
|
@@ -16,7 +16,7 @@ import { Plus as plus_default, RefreshRight as refresh_right_default, Delete as
|
|
|
16
16
|
import { getEditConfigData, getEditingType, cloneDeep, getEditConfigDataFields } from "../../packages/utils/common.mjs";
|
|
17
17
|
import { defaultProperty } from "../../packages/form/aside/index.mjs";
|
|
18
18
|
import { defaultProperty as defaultProperty$1 } from "../../packages/table/aside/index.mjs";
|
|
19
|
-
import ValueSelector from "../../components/ValueSelector.
|
|
19
|
+
import ValueSelector from "../../components/ValueSelector.vue.mjs";
|
|
20
20
|
/* empty css */
|
|
21
21
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
22
22
|
import { ElDialog } from "../../../../node_modules/element-plus/es/components/dialog/index.mjs";
|
|
@@ -14,7 +14,7 @@ import "../../../../node_modules/element-plus/theme-chalk/el-tooltip.css.mjs";
|
|
|
14
14
|
import "../../../../node_modules/element-plus/theme-chalk/el-date-picker.css.mjs";
|
|
15
15
|
import { computed, watch, ref, createElementBlock, unref, openBlock, createBlock, isRef, createVNode, createElementVNode, withCtx, Fragment, renderList } from "vue";
|
|
16
16
|
import { useVModel } from "../../../../node_modules/@vueuse/core/dist/index.mjs";
|
|
17
|
-
import ValueSelector from "../../components/ValueSelector.
|
|
17
|
+
import ValueSelector from "../../components/ValueSelector.vue.mjs";
|
|
18
18
|
import api from "../../api/index.mjs";
|
|
19
19
|
import { getEditConfigDataSources } from "../utils/common.mjs";
|
|
20
20
|
import { createDataSource } from "../utils/datasource.mjs";
|
|
@@ -30,7 +30,7 @@ import "../../../../node_modules/element-plus/theme-chalk/el-date-picker.css.mjs
|
|
|
30
30
|
/* empty css */
|
|
31
31
|
/* empty css */
|
|
32
32
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
33
|
-
/* empty css
|
|
33
|
+
/* empty css */
|
|
34
34
|
import "../../axios/config.mjs";
|
|
35
35
|
import "../../../../_virtual/FileSaver.min.mjs";
|
|
36
36
|
import "../../../../_virtual/index.mjs";
|
|
@@ -79,7 +79,7 @@ import "../../../../node_modules/element-plus/theme-chalk/el-date-picker.css.mjs
|
|
|
79
79
|
import "../../../../node_modules/element-plus/theme-chalk/el-tab-pane.css.mjs";
|
|
80
80
|
/* empty css */
|
|
81
81
|
/* empty css */
|
|
82
|
-
/* empty css
|
|
82
|
+
/* empty css */
|
|
83
83
|
import "../../axios/config.mjs";
|
|
84
84
|
/* empty css */
|
|
85
85
|
/* empty css */
|
|
@@ -11,7 +11,7 @@ import "../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
11
11
|
import { computed, ref, watch, createBlock, openBlock, unref, isRef, withCtx, createVNode, createElementBlock, createCommentVNode, createTextVNode, Fragment } from "vue";
|
|
12
12
|
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
|
|
13
13
|
import emitter from "../../utils/eventBus.mjs";
|
|
14
|
-
import ValueSelector from "../../../components/ValueSelector.
|
|
14
|
+
import ValueSelector from "../../../components/ValueSelector.vue.mjs";
|
|
15
15
|
import { ElCollapse, ElCollapseItem } from "../../../../../node_modules/element-plus/es/components/collapse/index.mjs";
|
|
16
16
|
import { ElForm, ElFormItem } from "../../../../../node_modules/element-plus/es/components/form/index.mjs";
|
|
17
17
|
import { ElInput } from "../../../../../node_modules/element-plus/es/components/input/index.mjs";
|
|
@@ -13,7 +13,7 @@ import { computed, ref, createBlock, openBlock, unref, isRef, withCtx, createVNo
|
|
|
13
13
|
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
|
|
14
14
|
import TemplateSelector from "../../../components/TemplateSelector.vue.mjs";
|
|
15
15
|
import emitter from "../../utils/eventBus.mjs";
|
|
16
|
-
import ValueSelector from "../../../components/ValueSelector.
|
|
16
|
+
import ValueSelector from "../../../components/ValueSelector.vue.mjs";
|
|
17
17
|
import { ElCollapse, ElCollapseItem } from "../../../../../node_modules/element-plus/es/components/collapse/index.mjs";
|
|
18
18
|
import { ElForm, ElFormItem } from "../../../../../node_modules/element-plus/es/components/form/index.mjs";
|
|
19
19
|
import { ElInput } from "../../../../../node_modules/element-plus/es/components/input/index.mjs";
|
|
@@ -14,7 +14,7 @@ import "../../../../node_modules/element-plus/es/index.mjs";
|
|
|
14
14
|
import { useModel, ref, watch, computed, createBlock, openBlock, withCtx, createVNode, createElementVNode, createElementBlock, Fragment, renderList, createTextVNode, unref } from "vue";
|
|
15
15
|
import { Plus as plus_default } from "../../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
16
16
|
import { getEditConfigData, getEditConfigDataFields, setEditConfigData } from "../utils/common.mjs";
|
|
17
|
-
import ValueSelector from "../../components/ValueSelector.
|
|
17
|
+
import ValueSelector from "../../components/ValueSelector.vue.mjs";
|
|
18
18
|
import api from "../../api/index.mjs";
|
|
19
19
|
/* empty css */
|
|
20
20
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
const defaultTableConfig = {
|
|
2
|
-
|
|
2
|
+
fieldsData: [
|
|
3
3
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
47
|
+
right: []
|
|
48
48
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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-
|
|
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
|
+
};
|