订阅列表接口对接

This commit is contained in:
付民康
2025-03-19 12:34:08 +08:00
parent 17c0df7379
commit 847cfdcb4c
3 changed files with 78 additions and 11 deletions

View File

@@ -193,3 +193,25 @@ export const getgroupNoticeList = (data): Promise<any> => {
})
);
}
// 个人中心-获取订阅列表
export const getSubscribeList = (data): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/alert/subscribe/list`,
method: 'POST',
data,
})
);
}
// 个人中心-获取组织级订阅列表
export const getGroupSubscribeList = (data): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/alert/group/subscribe/list`,
method: 'POST',
data,
})
);
}

View File

@@ -2,11 +2,11 @@
<Card simple class="jyh-card mt-3">
<div class="card-title">组织订阅列表</div>
<div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column>
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="订阅时间"></d-column>
<d-column field="name" header="软件名称"></d-column>
<d-column field="detail" header="版本号"></d-column>
<d-column field="owner" header="订阅人"></d-column>
<d-column field="releaseId" header="版本号"></d-column>
<d-column field="username" header="订阅人"></d-column>
<d-column header="操作" width="100">
<template #default="scope">
<d-popover>
@@ -24,17 +24,39 @@
</template>
</d-column>
</d-table>
<NoData v-else :small="false"></NoData>
</div>
</Card>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const tableData = ref([{ code: '05822156', name: 'MIT License', detail: 'integer', owner: 'admin' }]);
import { onMounted, ref } from 'vue';
import { getgroupNoticeList, getGroupSubscribeList, getSubscribeList } from '@/api/jyh';
import NoData from "@/components/NoData/NoData.vue";
const tableData = ref([]);
const hidden = () => {
// 模拟body点击操作
document.querySelector('body')?.click();
};
const pager = ref({
total: 0,
pageIndex: 1,
pageSize: 10
});
const getList = async() => {
const { data, error } = await getGroupSubscribeList({ current: 1,size: pager.value.pageSize });
if (!error && data) {
tableData.value = data.data.data.records;
pager.value.total = data.data.data.total;
}
};
onMounted(async() => {
getList();
});
</script>
<style scoped lang="scss">

View File

@@ -2,10 +2,11 @@
<Card simple class="jyh-card mt-3">
<div class="card-title">个人订阅列表</div>
<div class="mb-3">
<d-table class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="code" header="订阅时间"></d-column>
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="订阅时间"></d-column>
<d-column field="name" header="软件名称"></d-column>
<d-column field="detail" header="版本号"></d-column>
<d-column field="releaseId" header="版本号"></d-column>
<d-column field="username" header="订阅人"></d-column>
<d-column header="操作" width="100">
<template #default="scope">
<d-popover>
@@ -23,17 +24,39 @@
</template>
</d-column>
</d-table>
<NoData v-else :small="false"></NoData>
</div>
</Card>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const tableData = ref([{ code: '05822156', name: 'MIT License', detail: 'integer' }]);
import { onMounted, ref } from 'vue';
import { getgroupNoticeList, getGroupSubscribeList, getSubscribeList } from '@/api/jyh';
import NoData from "@/components/NoData/NoData.vue";
const tableData = ref([]);
const hidden = () => {
// 模拟body点击操作
document.querySelector('body')?.click();
};
const pager = ref({
total: 0,
pageIndex: 1,
pageSize: 10
});
const getList = async() => {
const { data, error } = await getSubscribeList({ current: 1,size: pager.value.pageSize });
if (!error && data) {
tableData.value = data.data.data.records;
pager.value.total = data.data.data.total;
}
};
onMounted(async() => {
getList();
});
</script>
<style scoped lang="scss">