|
@@ -3,7 +3,7 @@
|
|
<div class="content">
|
|
<div class="content">
|
|
<sub-header />
|
|
<sub-header />
|
|
<div class="left">
|
|
<div class="left">
|
|
- <n-tabs type="line" pane-class="tab-content">
|
|
|
|
|
|
+ <n-tabs type="line" pane-class="tab-content" v-model:value="currentTab">
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<span class="meta-title">
|
|
<span class="meta-title">
|
|
<img src="@/assets/subtitle_3.png" />
|
|
<img src="@/assets/subtitle_3.png" />
|
|
@@ -18,15 +18,18 @@
|
|
<n-input-group round>
|
|
<n-input-group round>
|
|
<n-input
|
|
<n-input
|
|
round
|
|
round
|
|
|
|
+ clearable
|
|
v-model:value="inputValue"
|
|
v-model:value="inputValue"
|
|
placeholder="请输入要搜索的藏品"
|
|
placeholder="请输入要搜索的藏品"
|
|
|
|
+ @clear="collectStore.clearSearch"
|
|
/>
|
|
/>
|
|
- <n-button round type="primary"> 搜索 </n-button>
|
|
|
|
|
|
+ <n-button round type="primary" @click="handleSearch">
|
|
|
|
+ 搜索
|
|
|
|
+ </n-button>
|
|
</n-input-group>
|
|
</n-input-group>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
<n-tab-pane name="all" tab="全部">
|
|
<n-tab-pane name="all" tab="全部">
|
|
- <!-- {{ collectLists }} -->
|
|
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<template v-for="item in collectLists">
|
|
<template v-for="item in collectLists">
|
|
<n-gi>
|
|
<n-gi>
|
|
@@ -39,48 +42,52 @@
|
|
</n-gi>
|
|
</n-gi>
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
|
|
+ <empty :show="collectLists.length === 0" :height="500" />
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="one" tab="一级">
|
|
|
|
|
|
+ <n-tab-pane name="1" tab="一级">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
- <template v-for="(_, index) in 16">
|
|
|
|
|
|
+ <template v-for="item in collectLists">
|
|
<n-gi>
|
|
<n-gi>
|
|
<collect-box
|
|
<collect-box
|
|
- :id="index + 1"
|
|
|
|
- title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
|
|
|
|
- cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
|
|
|
|
- time="2023-01-02"
|
|
|
|
|
|
+ :id="item.id"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ :cover="domain + item.thumb"
|
|
|
|
+ :time="item.publishDate"
|
|
/>
|
|
/>
|
|
</n-gi>
|
|
</n-gi>
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
|
|
+ <empty :show="collectLists.length === 0" :height="500" />
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="two" tab="二级">
|
|
|
|
|
|
+ <n-tab-pane name="2" tab="二级">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
- <template v-for="(_, index) in 16">
|
|
|
|
|
|
+ <template v-for="item in collectLists">
|
|
<n-gi>
|
|
<n-gi>
|
|
<collect-box
|
|
<collect-box
|
|
- :id="index + 1"
|
|
|
|
- title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
|
|
|
|
- cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
|
|
|
|
- time="2023-01-02"
|
|
|
|
|
|
+ :id="item.id"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ :cover="domain + item.thumb"
|
|
|
|
+ :time="item.publishDate"
|
|
/>
|
|
/>
|
|
</n-gi>
|
|
</n-gi>
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
|
|
+ <empty :show="collectLists.length === 0" :height="500" />
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
- <n-tab-pane name="three" tab="三级">
|
|
|
|
|
|
+ <n-tab-pane name="3" tab="三级">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
<n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
|
|
- <template v-for="(_, index) in 16">
|
|
|
|
|
|
+ <template v-for="item in collectLists">
|
|
<n-gi>
|
|
<n-gi>
|
|
<collect-box
|
|
<collect-box
|
|
- :id="index + 1"
|
|
|
|
- title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
|
|
|
|
- cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
|
|
|
|
- time="2023-01-02"
|
|
|
|
|
|
+ :id="item.id"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ :cover="domain + item.thumb"
|
|
|
|
+ :time="item.publishDate"
|
|
/>
|
|
/>
|
|
</n-gi>
|
|
</n-gi>
|
|
</template>
|
|
</template>
|
|
</n-grid>
|
|
</n-grid>
|
|
|
|
+ <empty :show="collectLists.length === 0" :height="500" />
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
</n-tabs>
|
|
</n-tabs>
|
|
</div>
|
|
</div>
|
|
@@ -90,11 +97,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { computed, onMounted, ref } from "vue";
|
|
|
|
|
|
+import { computed, onMounted, ref, unref, watch, watchEffect } from "vue";
|
|
import { useFullscreen } from "@vueuse/core";
|
|
import { useFullscreen } from "@vueuse/core";
|
|
import collectBox from "../components/collectBox";
|
|
import collectBox from "../components/collectBox";
|
|
import subHeader from "../components/subHeader";
|
|
import subHeader from "../components/subHeader";
|
|
import sideMenu from "../components/sideMenu";
|
|
import sideMenu from "../components/sideMenu";
|
|
|
|
+import empty from "../components/empty.vue";
|
|
// import noticeBox from "../components/noticeBox";
|
|
// import noticeBox from "../components/noticeBox";
|
|
import { useCollectStore } from "../store/collect";
|
|
import { useCollectStore } from "../store/collect";
|
|
const collectStore = useCollectStore();
|
|
const collectStore = useCollectStore();
|
|
@@ -103,10 +111,29 @@ const collectLists = computed(() => collectStore.lists);
|
|
const XGap = ref(50);
|
|
const XGap = ref(50);
|
|
const YGap = ref(50);
|
|
const YGap = ref(50);
|
|
const inputValue = ref("");
|
|
const inputValue = ref("");
|
|
|
|
+const currentTab = ref("all");
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- collectStore.getCollectList();
|
|
|
|
-});
|
|
|
|
|
|
+watch(
|
|
|
|
+ currentTab,
|
|
|
|
+ (val) => {
|
|
|
|
+ const level = isNaN(Number(val)) ? 0 : Number(val);
|
|
|
|
+ collectStore.getCollectList(1, level);
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ immediate: true,
|
|
|
|
+ }
|
|
|
|
+);
|
|
|
|
+const handleSearch = () => {
|
|
|
|
+ if (unref(inputValue).length > 0) {
|
|
|
|
+ console.log("search");
|
|
|
|
+ const level = isNaN(Number(currentTab.value))
|
|
|
|
+ ? 0
|
|
|
|
+ : Number(currentTab.value);
|
|
|
|
+ collectStore.search(unref(inputValue), level);
|
|
|
|
+ } else {
|
|
|
|
+ collectStore.fetch();
|
|
|
|
+ }
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|