@fecp/designer 5.5.1 → 5.5.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/DocumentParam.vue.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/eventFlow/dialog/action/RiskSch.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/approvalHistory.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/contract.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/default.mjs +2 -2
- package/es/designer/src/packages/table/headerBtn.vue.mjs +1 -1
- package/es/designer/src/packages/table/tablePagination.vue.mjs +23 -82
- package/es/designer.css +47 -47
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/Pagination.vue.mjs +6 -6
- package/es/packages/vue/src/components/table/Table.vue.mjs +4 -4
- package/es/packages/vue/src/utils/parseFilterConfig.mjs +7 -7
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/components/DocumentParam.vue.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/eventFlow/dialog/action/RiskSch.vue.js +1 -1
- package/lib/designer/src/packages/form/property/approvalHistory.vue.js +1 -1
- package/lib/designer/src/packages/form/property/contract.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/default.js +2 -2
- package/lib/designer/src/packages/table/headerBtn.vue.js +1 -1
- package/lib/designer/src/packages/table/tablePagination.vue.js +27 -86
- package/lib/designer.css +47 -47
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +2 -1
- package/lib/packages/vue/src/components/table/Pagination.vue.js +6 -6
- package/lib/packages/vue/src/components/table/Table.vue.js +4 -4
- package/lib/packages/vue/src/utils/parseFilterConfig.js +7 -7
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import "../../../node_modules/element-plus/es/index.mjs";
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { computed, ref, createElementBlock, openBlock, createBlock, unref, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createVNode } from "vue";
|
|
11
11
|
import { Plus as plus_default, Delete as delete_default } from "../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
12
|
-
import ValueSelector from "./ValueSelector.
|
|
12
|
+
import ValueSelector from "./ValueSelector.vue.mjs";
|
|
13
13
|
import api from "../api/index.mjs";
|
|
14
14
|
/* empty css */
|
|
15
15
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
@@ -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";
|
|
@@ -84,7 +84,7 @@ import widgets from "../table/property/widgets.vue.mjs";
|
|
|
84
84
|
import "../../../../node_modules/element-plus/theme-chalk/el-tab-pane.css.mjs";
|
|
85
85
|
/* empty css */
|
|
86
86
|
/* empty css */
|
|
87
|
-
/* empty css
|
|
87
|
+
/* empty css */
|
|
88
88
|
/* empty css */
|
|
89
89
|
/* empty css */
|
|
90
90
|
/* empty css */
|
|
@@ -4,7 +4,7 @@ import "../../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { createElementBlock, openBlock, Fragment, createVNode, withCtx } from "vue";
|
|
6
6
|
import RiskSchemeSelector from "../../../../components/RiskSchemeSelector.vue2.mjs";
|
|
7
|
-
import ValueSelector from "../../../../components/ValueSelector.
|
|
7
|
+
import ValueSelector from "../../../../components/ValueSelector.vue.mjs";
|
|
8
8
|
import ParamsConfig from "../../../../components/ParamsConfig.vue2.mjs";
|
|
9
9
|
import { ElFormItem } from "../../../../../../node_modules/element-plus/es/components/form/index.mjs";
|
|
10
10
|
import { ElSwitch } from "../../../../../../node_modules/element-plus/es/components/switch/index.mjs";
|
|
@@ -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";
|
|
@@ -17,7 +17,7 @@ import "../../../../../node_modules/element-plus/es/index.mjs";
|
|
|
17
17
|
import { computed, ref, createBlock, openBlock, withCtx, createVNode, createTextVNode, createElementBlock, Fragment, renderList } from "vue";
|
|
18
18
|
import { getCurrentItem } from "../../utils/common.mjs";
|
|
19
19
|
import "../../utils/eventBus.mjs";
|
|
20
|
-
import ValueSelector from "../../../components/ValueSelector.
|
|
20
|
+
import ValueSelector from "../../../components/ValueSelector.vue.mjs";
|
|
21
21
|
import api from "../../../api/index.mjs";
|
|
22
22
|
import ParamsConfig from "../../../components/ParamsConfig.vue2.mjs";
|
|
23
23
|
/* empty css */
|
|
@@ -12,7 +12,7 @@ import { computed, ref, createBlock, openBlock, unref, isRef, withCtx, createVNo
|
|
|
12
12
|
import { getCurrentItem, getEditConfigData } from "../../utils/common.mjs";
|
|
13
13
|
import TemplateSelector from "../../../components/TemplateSelector.vue2.mjs";
|
|
14
14
|
import emitter from "../../utils/eventBus.mjs";
|
|
15
|
-
import ValueSelector from "../../../components/ValueSelector.
|
|
15
|
+
import ValueSelector from "../../../components/ValueSelector.vue.mjs";
|
|
16
16
|
import ParamsConfig from "../../../components/ParamsConfig.vue2.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";
|
|
@@ -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";
|
|
@@ -56,8 +56,8 @@ const defaultTableConfig = {
|
|
|
56
56
|
sortRules: [],
|
|
57
57
|
paginationConfig: {
|
|
58
58
|
enabled: true,
|
|
59
|
-
pageSize:
|
|
60
|
-
pageSizes: [
|
|
59
|
+
pageSize: 15,
|
|
60
|
+
pageSizes: [15, 20, 50, 100, 200, 500],
|
|
61
61
|
layout: "full",
|
|
62
62
|
background: true,
|
|
63
63
|
size: "small"
|
|
@@ -8,21 +8,15 @@ import "../../../../node_modules/element-plus/es/index.mjs";
|
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
|
-
/* empty css */
|
|
12
|
-
/* empty css */
|
|
13
|
-
/* empty css */
|
|
14
|
-
/* empty css */
|
|
15
11
|
/* empty css */
|
|
16
12
|
/* empty css */
|
|
17
|
-
import { computed, reactive, watch, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, normalizeClass, createCommentVNode, toDisplayString } from "vue";
|
|
13
|
+
import { computed, reactive, watch, ref, createElementBlock, openBlock, createElementVNode, createVNode, withCtx, normalizeClass, createBlock, createCommentVNode, unref, toDisplayString, nextTick } from "vue";
|
|
18
14
|
import { getEditConfigData } from "../utils/common.mjs";
|
|
19
15
|
/* empty css */
|
|
20
16
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
21
17
|
import { ElSwitch } from "../../../../node_modules/element-plus/es/components/switch/index.mjs";
|
|
22
18
|
import { ElDivider } from "../../../../node_modules/element-plus/es/components/divider/index.mjs";
|
|
23
|
-
import { ElInputNumber } from "../../../../node_modules/element-plus/es/components/input-number/index.mjs";
|
|
24
19
|
import { ElSelect, ElOption } from "../../../../node_modules/element-plus/es/components/select/index.mjs";
|
|
25
|
-
import { ElRadioGroup, ElRadioButton } from "../../../../node_modules/element-plus/es/components/radio/index.mjs";
|
|
26
20
|
import { ElPagination } from "../../../../node_modules/element-plus/es/components/pagination/index.mjs";
|
|
27
21
|
const _hoisted_1 = { class: "table-pagination-config" };
|
|
28
22
|
const _hoisted_2 = { class: "config-row" };
|
|
@@ -37,8 +31,8 @@ const _sfc_main = {
|
|
|
37
31
|
const editConfigData = computed(() => getEditConfigData());
|
|
38
32
|
const paginationConfig = reactive({
|
|
39
33
|
enabled: true,
|
|
40
|
-
pageSize:
|
|
41
|
-
pageSizes: [
|
|
34
|
+
pageSize: 15,
|
|
35
|
+
pageSizes: [15, 20, 50, 100, 200, 500],
|
|
42
36
|
layout: "full",
|
|
43
37
|
background: true,
|
|
44
38
|
size: "small",
|
|
@@ -59,49 +53,40 @@ const _sfc_main = {
|
|
|
59
53
|
function getLayout(layout) {
|
|
60
54
|
return layoutMap[layout] || layoutMap.full;
|
|
61
55
|
}
|
|
56
|
+
const showPagination = ref(true);
|
|
57
|
+
function pageSizeChange() {
|
|
58
|
+
showPagination.value = false;
|
|
59
|
+
nextTick(() => {
|
|
60
|
+
showPagination.value = true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
62
63
|
return (_ctx, _cache) => {
|
|
63
64
|
const _component_el_switch = ElSwitch;
|
|
64
65
|
const _component_el_divider = ElDivider;
|
|
65
|
-
const _component_el_input_number = ElInputNumber;
|
|
66
66
|
const _component_el_option = ElOption;
|
|
67
67
|
const _component_el_select = ElSelect;
|
|
68
|
-
const _component_el_radio_button = ElRadioButton;
|
|
69
|
-
const _component_el_radio_group = ElRadioGroup;
|
|
70
68
|
const _component_el_pagination = ElPagination;
|
|
71
69
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
72
70
|
createElementVNode("div", _hoisted_2, [
|
|
73
|
-
_cache[
|
|
71
|
+
_cache[2] || (_cache[2] = createElementVNode("span", { class: "config-label" }, "开启分页:", -1)),
|
|
74
72
|
createVNode(_component_el_switch, {
|
|
75
73
|
modelValue: paginationConfig.enabled,
|
|
76
74
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => paginationConfig.enabled = $event),
|
|
77
75
|
size: "small"
|
|
78
76
|
}, null, 8, ["modelValue"]),
|
|
79
77
|
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
80
|
-
_cache[
|
|
81
|
-
createVNode(
|
|
78
|
+
_cache[3] || (_cache[3] = createElementVNode("span", { class: "config-label" }, "每页条数:", -1)),
|
|
79
|
+
createVNode(_component_el_select, {
|
|
82
80
|
modelValue: paginationConfig.pageSize,
|
|
83
81
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => paginationConfig.pageSize = $event),
|
|
84
|
-
min: 1,
|
|
85
|
-
max: 500,
|
|
86
|
-
size: "small",
|
|
87
|
-
"controls-position": "right",
|
|
88
|
-
style: { "width": "100px" }
|
|
89
|
-
}, null, 8, ["modelValue"]),
|
|
90
|
-
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
91
|
-
_cache[7] || (_cache[7] = createElementVNode("span", { class: "config-label" }, "可选条数:", -1)),
|
|
92
|
-
createVNode(_component_el_select, {
|
|
93
|
-
modelValue: paginationConfig.pageSizes,
|
|
94
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => paginationConfig.pageSizes = $event),
|
|
95
|
-
multiple: "",
|
|
96
82
|
size: "small",
|
|
97
|
-
style: { "width": "
|
|
98
|
-
|
|
99
|
-
"collapse-tags-tooltip": ""
|
|
83
|
+
style: { "width": "100px" },
|
|
84
|
+
onChange: pageSizeChange
|
|
100
85
|
}, {
|
|
101
86
|
default: withCtx(() => [
|
|
102
87
|
createVNode(_component_el_option, {
|
|
103
|
-
label: "
|
|
104
|
-
value:
|
|
88
|
+
label: "15",
|
|
89
|
+
value: 15
|
|
105
90
|
}),
|
|
106
91
|
createVNode(_component_el_option, {
|
|
107
92
|
label: "20",
|
|
@@ -125,60 +110,16 @@ const _sfc_main = {
|
|
|
125
110
|
})
|
|
126
111
|
]),
|
|
127
112
|
_: 1
|
|
128
|
-
}, 8, ["modelValue"]),
|
|
129
|
-
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
130
|
-
_cache[8] || (_cache[8] = createElementVNode("span", { class: "config-label" }, "分页样式:", -1)),
|
|
131
|
-
createVNode(_component_el_select, {
|
|
132
|
-
modelValue: paginationConfig.layout,
|
|
133
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => paginationConfig.layout = $event),
|
|
134
|
-
size: "small",
|
|
135
|
-
style: { "width": "140px" }
|
|
136
|
-
}, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(_component_el_option, {
|
|
139
|
-
label: "简单",
|
|
140
|
-
value: "simple"
|
|
141
|
-
}),
|
|
142
|
-
createVNode(_component_el_option, {
|
|
143
|
-
label: "标准",
|
|
144
|
-
value: "standard"
|
|
145
|
-
}),
|
|
146
|
-
createVNode(_component_el_option, {
|
|
147
|
-
label: "完整",
|
|
148
|
-
value: "full"
|
|
149
|
-
})
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
}, 8, ["modelValue"]),
|
|
153
|
-
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
154
|
-
createVNode(_component_el_radio_group, {
|
|
155
|
-
modelValue: paginationConfig.size,
|
|
156
|
-
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => paginationConfig.size = $event),
|
|
157
|
-
size: "small"
|
|
158
|
-
}, {
|
|
159
|
-
default: withCtx(() => [
|
|
160
|
-
createVNode(_component_el_radio_button, {
|
|
161
|
-
label: "紧凑",
|
|
162
|
-
value: "small"
|
|
163
|
-
}),
|
|
164
|
-
createVNode(_component_el_radio_button, {
|
|
165
|
-
label: "标准",
|
|
166
|
-
value: "default"
|
|
167
|
-
}),
|
|
168
|
-
createVNode(_component_el_radio_button, {
|
|
169
|
-
label: "大号",
|
|
170
|
-
value: "large"
|
|
171
|
-
})
|
|
172
|
-
]),
|
|
173
|
-
_: 1
|
|
174
113
|
}, 8, ["modelValue"])
|
|
175
114
|
]),
|
|
176
115
|
createElementVNode("div", {
|
|
177
116
|
class: normalizeClass(["preview-section", { disabled: !paginationConfig.enabled }])
|
|
178
117
|
}, [
|
|
179
|
-
|
|
118
|
+
unref(showPagination) ? (openBlock(), createBlock(_component_el_pagination, {
|
|
119
|
+
key: 0,
|
|
180
120
|
style: { "width": "100%" },
|
|
181
|
-
"page-sizes":
|
|
121
|
+
"page-sizes": [15, 20, 50, 100, 200, 500],
|
|
122
|
+
"default-page-size": paginationConfig.pageSize,
|
|
182
123
|
layout: getLayout(paginationConfig.layout),
|
|
183
124
|
total: 100,
|
|
184
125
|
background: paginationConfig.background,
|
|
@@ -189,13 +130,13 @@ const _sfc_main = {
|
|
|
189
130
|
getLayout(paginationConfig.layout).includes("slot") ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(1) + "/" + toDisplayString(Math.ceil(100 / paginationConfig.pageSize)) + "页 ", 1)) : createCommentVNode("", true)
|
|
190
131
|
]),
|
|
191
132
|
_: 1
|
|
192
|
-
}, 8, ["page-
|
|
133
|
+
}, 8, ["default-page-size", "layout", "background", "size", "disabled"])) : createCommentVNode("", true)
|
|
193
134
|
], 2)
|
|
194
135
|
]);
|
|
195
136
|
};
|
|
196
137
|
}
|
|
197
138
|
};
|
|
198
|
-
const TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
139
|
+
const TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-12c51ab8"]]);
|
|
199
140
|
export {
|
|
200
141
|
TablePagination as default
|
|
201
142
|
};
|