<template>
  <CommonListPage
    :title="'重要闽南记忆遗产'"
    :prevPage="{ title: '文化传承' }"
    :dropDownNames="[]"
    :showSearch="true"
    :pageSize="8"
    :load="loadData"
    :loadDetail="loadDetail"
  />
</template>

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

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

  const res = await LanguageContent.getContentList(new GetContentListParams()
    .setMainBodyColumnId(318)
    .setModelId(18)
    .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,
      };
    }),
  }
}
</script>

<style>
</style>

