123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <CommonListPage
- title="非遗传承人"
- itemType="article-character"
- detailsPage="/pages/inhert/inheritor/details"
- showTotal
- :dropDownNames="dropdownNames"
- :load="loadData"
- />
- </template>
- <script setup lang="ts">
- import CommonContent, { GetContentListParams } from '@/api/CommonContent';
- import InheritorContent from '@/api/inheritor/InheritorContent';
- import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
- import { onLoad } from '@dcloudio/uni-app';
- import { onMounted, ref } from 'vue';
- const dropdownNames = ref<DropDownNames[]>([]);
- async function loadData(
- page: number,
- pageSize: number,
- searchText: string,
- dropDownValues: number[]
- ) {
- const res = (await InheritorContent.getContentList(new GetContentListParams().setSelfValues({
- ichType: dropDownValues[0] == 0 ? undefined: dropDownValues[0],
- level: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
- region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
- keywords: searchText,
- }), page, pageSize));
- res.list.forEach((p) => {
- p.desc = p.ichName as string;
- p.bottomTags = [
- p.levelText,
- p.nation,
- ];
- })
- return res;
- }
- onLoad(async (querys) => {
- dropdownNames.value.push({
- options: [{
- id: 0,
- name: '全部类别'
- }].concat((await CommonContent.getCategoryList(4)).map((item) => ({
- id: item.id,
- name: item.title,
- }))),
- defaultSelectedValue: 0,
- });
- const levels = await CommonContent.getCategoryList(2);
- dropdownNames.value.push({
- options: [{
- id: 0,
- name: '全部级别'
- }].concat(levels.map((item) => ({
- id: item.id,
- name: item.title,
- }))),
- activeTab: [0],
- defaultSelectedValue: querys?.level ? (levels.find(p => p.title == querys.level)?.id ?? 0) : 0,
- });
- dropdownNames.value.push({
- options: [{
- id: 0,
- name: '全部区域'
- }].concat((await CommonContent.getCategoryList(1)).map((item) => ({
- id: item.id,
- name: item.title,
- }))),
- defaultSelectedValue: 0,
- });
- })
- </script>
|