vue2-client 1.19.49 → 1.19.51
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/package.json
CHANGED
|
@@ -172,6 +172,16 @@ const isCustomPagination = computed(() => {
|
|
|
172
172
|
const isHiddenFunctionalArea = computed(() => {
|
|
173
173
|
return attrs.hiddenFunctionalArea === 'true' || attrs.hiddenFunctionalArea === true
|
|
174
174
|
})
|
|
175
|
+
|
|
176
|
+
// 从 attrs 中获取 pageMaxSize,如果存在则作为 defaultPageSize
|
|
177
|
+
const computedDefaultPageSize = computed(() => {
|
|
178
|
+
const pageMaxSize = attrs.pageMaxSize
|
|
179
|
+
// 将字符串转换为数字,如果无效则使用默认值
|
|
180
|
+
const numericPageSize = pageMaxSize ? Number(pageMaxSize) : null
|
|
181
|
+
const defaultSize = (numericPageSize && numericPageSize > 0) ? numericPageSize : 10
|
|
182
|
+
|
|
183
|
+
return defaultSize
|
|
184
|
+
})
|
|
175
185
|
</script>
|
|
176
186
|
|
|
177
187
|
<template>
|
|
@@ -185,6 +195,7 @@ const isHiddenFunctionalArea = computed(() => {
|
|
|
185
195
|
<x-form-table
|
|
186
196
|
ref="xFormTableRef"
|
|
187
197
|
v-bind="$attrs"
|
|
198
|
+
:defaultPageSize="computedDefaultPageSize"
|
|
188
199
|
:customPagination="isCustomPagination"
|
|
189
200
|
:hiddenFunctionalArea="isHiddenFunctionalArea"
|
|
190
201
|
@expand="onExpandLog"
|
|
@@ -156,10 +156,36 @@ const filterQueryParams = computed(() => {
|
|
|
156
156
|
})
|
|
157
157
|
const sideListConfig = computed(() => props.config?.sideList || chartConfig.value?.sideList || null)
|
|
158
158
|
const isCascadeMode = computed(() => sideListConfig.value?.mode === 'cascade')
|
|
159
|
-
const sideListOptions =
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
const sideListOptions = ref([])
|
|
160
|
+
|
|
161
|
+
// 异步获取sideList options
|
|
162
|
+
const loadSideListOptions = async () => {
|
|
163
|
+
const config = sideListConfig.value
|
|
164
|
+
if (!config) {
|
|
165
|
+
sideListOptions.value = []
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 如果配置了sideListLogic,则通过runLogic获取options
|
|
170
|
+
if (config.sideListLogic) {
|
|
171
|
+
try {
|
|
172
|
+
const result = await runLogic(config.sideListLogic, {
|
|
173
|
+
config,
|
|
174
|
+
chartConfig: chartConfig.value,
|
|
175
|
+
props
|
|
176
|
+
})
|
|
177
|
+
sideListOptions.value = Array.isArray(result) ? result : []
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.error('获取sideList options失败:', error)
|
|
180
|
+
sideListOptions.value = []
|
|
181
|
+
emit('error', error)
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
// 使用静态options
|
|
185
|
+
const options = config.options
|
|
186
|
+
sideListOptions.value = Array.isArray(options) ? options : []
|
|
187
|
+
}
|
|
188
|
+
}
|
|
163
189
|
const sideListLabel = computed(() => sideListConfig.value?.label || sideListConfig.value?.title || '')
|
|
164
190
|
const cascadeLevels = computed(() => {
|
|
165
191
|
if (!isCascadeMode.value) return []
|
|
@@ -418,6 +444,11 @@ const ensureCascadeSelections = () => {
|
|
|
418
444
|
}
|
|
419
445
|
}
|
|
420
446
|
|
|
447
|
+
// 监听sideList配置变化,重新加载options
|
|
448
|
+
watch(sideListConfig, () => {
|
|
449
|
+
loadSideListOptions()
|
|
450
|
+
}, { immediate: true, deep: true })
|
|
451
|
+
|
|
421
452
|
watch([radioFilterOptions, () => radioFilterConfig.value?.defaultValue], () => {
|
|
422
453
|
ensureFilterSelection()
|
|
423
454
|
}, { immediate: true })
|
|
@@ -1381,6 +1412,9 @@ onBeforeUnmount(() => {
|
|
|
1381
1412
|
display: flex;
|
|
1382
1413
|
flex-direction: column;
|
|
1383
1414
|
gap: 6px;
|
|
1415
|
+
max-height: 280px;
|
|
1416
|
+
overflow-y: auto;
|
|
1417
|
+
padding-right: 4px;
|
|
1384
1418
|
}
|
|
1385
1419
|
|
|
1386
1420
|
.side-list-item {
|