<template>
   <CommonListPage
    :title="'闽南文化历史地理背景'"
    :prevPage="{ title: '文化常识' }"
    :dropDownNames="[]"
    :showSearch="true"
    :tagsData="tagsData"
    :pageSize="8"
    :defaultSelectTag="233"
    :loadDetail="loadDetail"
    :load="loadData"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { GetContentListParams } from '@/api/CommonContent';
import HistoryContent from '@/api/introduction/HistoryContent';

async function loadDetail(id: number, item: any) {
  return await HistoryContent.getContentDetail(id);
}
async function loadData(
  page: number, 
  pageSize: number,
  selectedTag: number,
  searchText: string,
  dropDownValues: number[]
) {

  const res = await HistoryContent.getContentList(new GetContentListParams()
    .setMainBodyColumnId([ 233, 250, 251 ])
    .setKeywords(searchText)
  , page, pageSize);

  return { 
    page: page,
    total: res.total,
    data: res.list.map((item, index) => {
      return {
        id: item.id,
        title: item.title,
        desc: item.desc,
        image: item.thumbnail || item.image,
      };
    }),
  }
}

//子分类
const tagsData = ref([
]);
</script>

<style>
</style>


