|
@@ -17,7 +17,7 @@
|
|
}"
|
|
}"
|
|
:scrollable="tabs && tabs.length > 5"
|
|
:scrollable="tabs && tabs.length > 5"
|
|
class="top-tab"
|
|
class="top-tab"
|
|
- @click="(e: any) => tab = e.id"
|
|
|
|
|
|
+ @click="handleTabClick"
|
|
/>
|
|
/>
|
|
<!-- 搜索 -->
|
|
<!-- 搜索 -->
|
|
<view v-if="showSearch" class="d-flex flex-col p-2">
|
|
<view v-if="showSearch" class="d-flex flex-col p-2">
|
|
@@ -36,12 +36,14 @@
|
|
v-if="dropDownNames && dropDownNames.length > 0"
|
|
v-if="dropDownNames && dropDownNames.length > 0"
|
|
class="d-flex flex-row justify-around p-2 pt-0"
|
|
class="d-flex flex-row justify-around p-2 pt-0"
|
|
>
|
|
>
|
|
- <SimpleDropDownPicker
|
|
|
|
- v-for="(drop, k) in dropDownNames" :key="k"
|
|
|
|
- :modelValue="dropDownValues[k] || drop.defaultSelectedValue"
|
|
|
|
- :columns="drop.options"
|
|
|
|
- @update:modelValue="(v) => handleChangeDropDownValue(k, v)"
|
|
|
|
- />
|
|
|
|
|
|
+ <template v-for="(drop, k) in dropDownNames" :key="k" >
|
|
|
|
+ <SimpleDropDownPicker
|
|
|
|
+ v-if="drop.activeTab == undefined || drop.activeTab == tab"
|
|
|
|
+ :modelValue="dropDownValues[k] || drop.defaultSelectedValue"
|
|
|
|
+ :columns="drop.options"
|
|
|
|
+ @update:modelValue="(v) => handleChangeDropDownValue(k, v)"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<view class="d-flex flex-row flex-wrap justify-between p-3 pt-0">
|
|
<view class="d-flex flex-row flex-wrap justify-between p-3 pt-0">
|
|
@@ -100,6 +102,7 @@ import SimpleDropDownPicker, { type SimpleDropDownPickerItem } from '@/common/co
|
|
export interface DropDownNames {
|
|
export interface DropDownNames {
|
|
options: SimpleDropDownPickerItem[],
|
|
options: SimpleDropDownPickerItem[],
|
|
defaultSelectedValue: number|string,
|
|
defaultSelectedValue: number|string,
|
|
|
|
+ activeTab?: number,
|
|
}
|
|
}
|
|
export interface CommonListItem extends Record<string, any> {
|
|
export interface CommonListItem extends Record<string, any> {
|
|
id: number,
|
|
id: number,
|
|
@@ -119,7 +122,11 @@ const props = defineProps({
|
|
* 分组标签
|
|
* 分组标签
|
|
*/
|
|
*/
|
|
tabs: {
|
|
tabs: {
|
|
- type: Array as PropType<{ id: number, name: string }[]>,
|
|
|
|
|
|
+ type: Array as PropType<{
|
|
|
|
+ id: number,
|
|
|
|
+ name: string,
|
|
|
|
+ jump?: () => void,
|
|
|
|
+ }[]>,
|
|
default: null,
|
|
default: null,
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -207,6 +214,15 @@ function goDetails(id: number) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function handleTabClick(e: any) {
|
|
|
|
+ if (e.jump) {
|
|
|
|
+ e.jump();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ tab.value = e.id;
|
|
|
|
+ listLoader.loadData(undefined, true);
|
|
|
|
+}
|
|
|
|
+
|
|
watch(tab, () => {
|
|
watch(tab, () => {
|
|
listLoader.loadData(undefined, true);
|
|
listLoader.loadData(undefined, true);
|
|
});
|
|
});
|