generated from Leo_Ding/web-template
Compare commits
2 Commits
42d7c2d0e1
...
52beab311c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52beab311c | ||
|
|
0661196c60 |
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
//获取banner列表
|
||||
//获取产品优势列表
|
||||
export const getActiveList = (params) => request.basic.get('/api/v1/active', params)
|
||||
|
||||
//获取单个banner
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
//获取标签列表
|
||||
export const getTagList = (params) => request.basic.get('/api/v1/home-top-labels', params)
|
||||
|
||||
//获取算力卡列表
|
||||
export const getCardsList = (params) => request.basic.get('/api/v1/cards', params)
|
||||
|
||||
//获取算力中心列表
|
||||
export const getCentersList = (params) => request.basic.get('/api/v1/centers', params)
|
||||
|
||||
|
||||
//获取单个banner
|
||||
export const getBanner = (id) => request.basic.get(`/api/v1/banners/${id}`)
|
||||
//创建banner
|
||||
export const createBanner = (data) => request.basic.post('/api/v1/banners', data)
|
||||
//更新banner
|
||||
export const updateBanner = (id, data) => request.basic.put(`/api/v1/banners/${id}`, data)
|
||||
//删除banner
|
||||
export const deleteBanner = (id) => request.basic.delete(`/api/v1/banners/${id}`)
|
||||
@ -171,13 +171,17 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '活动ID', dataIndex: 'id' },
|
||||
{ title: '标题', dataIndex: 'title' },
|
||||
{ title: '描述', dataIndex: 'description' },
|
||||
{ title: '描述', dataIndex: 'description ' },
|
||||
{ title: '图片地址', dataIndex: 'imgUrl' },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'is_recommend',
|
||||
key: 'is_recommend',
|
||||
width: 150,
|
||||
customRender: ({ text }) => (text ? '推荐' : '不推荐'),
|
||||
},
|
||||
{ title: '页面地址', dataIndex: 'pageUrl' },
|
||||
{ title: '排序', dataIndex: 'order' },
|
||||
{ title: '是否启用', dataIndex: 'is_recommend' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, searchFormData, resetPagination } =
|
||||
|
||||
@ -108,25 +108,17 @@ defineOptions({
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '用户姓名', dataIndex: 'customerName', width: 200 },
|
||||
{ title: '用户联系方式', dataIndex: 'phone', width: 150 },
|
||||
{ title: '标题', dataIndex: 'title', width: 200 },
|
||||
{ title: '描述', dataIndex: 'description', width: 150 },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
title: '是否启用',
|
||||
dataIndex: 'is_recommend',
|
||||
key: 'is_recommend',
|
||||
width: 150,
|
||||
customRender: ({ text }) => disabledDict.getLabel(text) || text,
|
||||
customRender: ({ text }) => (text ? '启用' : '禁用'),
|
||||
},
|
||||
{
|
||||
title: '账号类型',
|
||||
key: 'accountType',
|
||||
dataIndex: 'accountType',
|
||||
width: 120,
|
||||
customRender: ({ text }) => authenticationTypeDict.getLabel(text) || text,
|
||||
},
|
||||
{ title: '拉黑时间', key: 'blackTime', dataIndex: 'blackTime', width: 160 },
|
||||
{ title: '解除时间', key: 'unblackTime', dataIndex: 'unblackTime', width: 160 },
|
||||
{ title: '拉黑原因', key: 'blacklistReason', dataIndex: 'blacklistReason', width: 220 },
|
||||
{ title: '图片地址', key: 'imgUrl', dataIndex: 'imgUrl', width: 160 },
|
||||
{ title: '页面地址', key: 'pageUrl', dataIndex: 'pageUrl', width: 160 },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
||||
]
|
||||
|
||||
@ -145,8 +137,8 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { data, total } = await apis.userControl
|
||||
.getBlackCustomersList({
|
||||
const { data, total } = await apis.activities
|
||||
.getActiveList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value,
|
||||
|
||||
@ -40,29 +40,17 @@
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
|
||||
:scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'banner_type' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag v-if="record.banner_type == 1" color="processing">
|
||||
首页轮播图
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag v-else color="processing">
|
||||
营销活动图
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'is_recommend' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag v-if="record.banner_type == true" color="processing">
|
||||
启用
|
||||
<a-tag v-if="record.is_recommend == true" color="processing">
|
||||
推荐
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag v-else color="processing">
|
||||
禁用
|
||||
不推荐
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="'createAt' === column.key">
|
||||
{{ formatUtcDateTime(record.created_at) }}
|
||||
</template>
|
||||
@ -108,25 +96,17 @@ defineOptions({
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '用户姓名', dataIndex: 'customerName', width: 200 },
|
||||
{ title: '用户联系方式', dataIndex: 'phone', width: 150 },
|
||||
{ title: '标题', dataIndex: 'title', width: 200 },
|
||||
{ title: '描述', dataIndex: 'description', width: 150 },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
width: 150,
|
||||
customRender: ({ text }) => disabledDict.getLabel(text) || text,
|
||||
},
|
||||
{
|
||||
title: '账号类型',
|
||||
key: 'accountType',
|
||||
dataIndex: 'accountType',
|
||||
title: '是否推荐',
|
||||
key: 'is_recommend',
|
||||
dataIndex: 'is_recommend',
|
||||
width: 120,
|
||||
customRender: ({ text }) => authenticationTypeDict.getLabel(text) || text,
|
||||
customRender: ({ text }) => (text ? '推荐' : '不推荐'),
|
||||
},
|
||||
{ title: '拉黑时间', key: 'blackTime', dataIndex: 'blackTime', width: 160 },
|
||||
{ title: '解除时间', key: 'unblackTime', dataIndex: 'unblackTime', width: 160 },
|
||||
{ title: '拉黑原因', key: 'blacklistReason', dataIndex: 'blacklistReason', width: 220 },
|
||||
{ title: '图片地址', key: 'image_url', dataIndex: 'image_url', width: 160 },
|
||||
{ title: '页面地址', key: 'link_url', dataIndex: 'link_url', width: 160 },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
||||
]
|
||||
|
||||
@ -145,8 +125,8 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { data, total } = await apis.userControl
|
||||
.getBlackCustomersList({
|
||||
const { data, total } = await apis.platform
|
||||
.getTagList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user