|
@@ -36,7 +36,7 @@
|
|
|
>
|
|
>
|
|
|
<template v-for="(drop, k) in dropDownNames" :key="k" >
|
|
<template v-for="(drop, k) in dropDownNames" :key="k" >
|
|
|
<SimpleDropDownPicker
|
|
<SimpleDropDownPicker
|
|
|
- v-if="!drop.activeTab || drop.activeTab.includes(tabCurrentIndex)"
|
|
|
|
|
|
|
+ v-if="!drop.activeTab || drop.activeTab.includes(tabCurrentId)"
|
|
|
:modelValue="dropDownValues[k]"
|
|
:modelValue="dropDownValues[k]"
|
|
|
:columns="drop.options"
|
|
:columns="drop.options"
|
|
|
:style="{maxWidth: `${100/dropDownNames.length}%`}"
|
|
:style="{maxWidth: `${100/dropDownNames.length}%`}"
|
|
@@ -45,7 +45,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<view
|
|
<view
|
|
|
v-if="(showTotal && dropDownVisibleCount < 3 && dropDownVisibleCount != 0)"
|
|
v-if="(showTotal && dropDownVisibleCount < 3 && dropDownVisibleCount != 0)"
|
|
|
- class="d-flex flex-row align-center mt-3 size-s color-primary text-bold"
|
|
|
|
|
|
|
+ class="d-flex flex-row align-center pt-3 pb-3 size-s color-primary text-bold"
|
|
|
>
|
|
>
|
|
|
<text>总共有 {{ listLoader.total }} 个</text>
|
|
<text>总共有 {{ listLoader.total }} 个</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -154,8 +154,17 @@ function getItemClass(index: number) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export interface DropDownNames {
|
|
export interface DropDownNames {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 下拉框选项
|
|
|
|
|
+ */
|
|
|
options: SimpleDropDownPickerItem[],
|
|
options: SimpleDropDownPickerItem[],
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 默认选中值
|
|
|
|
|
+ */
|
|
|
defaultSelectedValue: number|string,
|
|
defaultSelectedValue: number|string,
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 显示Tab的ID
|
|
|
|
|
+ */
|
|
|
activeTab?: number[],
|
|
activeTab?: number[],
|
|
|
}
|
|
}
|
|
|
export interface CommonListItem extends Record<string, any> {
|
|
export interface CommonListItem extends Record<string, any> {
|
|
@@ -281,7 +290,7 @@ const emit = defineEmits([ 'goCustomDetails' ])
|
|
|
const dropDownVisibleCount = computed(() => {
|
|
const dropDownVisibleCount = computed(() => {
|
|
|
let c = 0;
|
|
let c = 0;
|
|
|
for (const element of props.dropDownNames) {
|
|
for (const element of props.dropDownNames) {
|
|
|
- if (!element.activeTab || element.activeTab.includes(tabCurrentIndex.value))
|
|
|
|
|
|
|
+ if (!element.activeTab || element.activeTab.includes(tabCurrentId.value))
|
|
|
c++;
|
|
c++;
|
|
|
}
|
|
}
|
|
|
return c;
|
|
return c;
|
|
@@ -297,6 +306,7 @@ const listLoader = useSimplePageListLoader(props.pageSize, async (page, pageSize
|
|
|
)
|
|
)
|
|
|
});
|
|
});
|
|
|
const tabCurrentIndex = ref(0)
|
|
const tabCurrentIndex = ref(0)
|
|
|
|
|
+const tabCurrentId = computed(() => props.tabs?.[tabCurrentIndex.value]?.id ?? -1)
|
|
|
|
|
|
|
|
function handleChangeDropDownValue(index: number, value: number) {
|
|
function handleChangeDropDownValue(index: number, value: number) {
|
|
|
dropDownValues.value[index] = value;
|
|
dropDownValues.value[index] = value;
|