This commit is contained in:
Leo_Ding 2026-01-22 14:50:08 +08:00
commit abee5ef4a4
6 changed files with 62 additions and 16 deletions

View File

@ -88,4 +88,6 @@ export default {
newConfiguration: '带新配置', newConfiguration: '带新配置',
systemSettings: '短息、支付参数设置', systemSettings: '短息、支付参数设置',
allSetting: '短息、支付配置列表', allSetting: '短息、支付配置列表',
bannerMgt: '图片轮播管理',
bannerList: '图片轮播列表',
} }

View File

@ -0,0 +1,30 @@
import { SettingOutlined } from '@ant-design/icons-vue'
export default [
{
path: 'bannerMgt',
name: 'bannerMgt',
component: 'RouteViewLayout',
meta: {
icon: 'icon-zhifudingjin',
title: '图片管理',
isMenu: true,
keepAlive: true,
permission: '*',
},
children: [
{
path: 'bannerList',
name: 'bannerList',
component: 'bannerMgt/bannerList/index.vue',
meta: {
title: '图片列表',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
],
}
]

View File

@ -30,6 +30,7 @@ import withdrawal from './withdrawal'
import invoice from './invoice' import invoice from './invoice'
import activities from './activities' import activities from './activities'
import systemSettings from './systemSettings' import systemSettings from './systemSettings'
import bannerMgt from './bannerMgt'
export default [ export default [
...home, ...home,
...form, ...form,
@ -63,4 +64,5 @@ export default [
...invoice, ...invoice,
...activities, ...activities,
...systemSettings, ...systemSettings,
...bannerMgt,
] ]

View File

@ -21,10 +21,10 @@ const options = {
interceptorRequestCatch: () => {}, interceptorRequestCatch: () => {},
interceptorResponse: (response) => { interceptorResponse: (response) => {
// 错误处理 // 错误处理
const { success, msg = 'Network Error' } = response.data || {} const { success } = response.data || {}
if (![true].includes(success)) { if (!success) {
message.error({ message.error({
content: msg, content: '请求失败',
key: MSG_ERROR_KEY, key: MSG_ERROR_KEY,
}) })
} }

View File

@ -35,17 +35,29 @@
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState" <a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
:scroll="{ x: 1000 }" @change="onTableChange"> :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'statusType' === column.key"> <template v-if="'banner_type' === column.key">
<!--状态--> <!--状态-->
<a-tag v-if="statusTypeEnum.is('enabled', record.status)" color="processing"> <a-tag v-if="record.banner_type == 1" color="processing">
{{ statusTypeEnum.getDesc(record.status) }} 首页轮播图
</a-tag> </a-tag>
<!--状态--> <!--状态-->
<a-tag v-if="statusTypeEnum.is('disabled', record.status)" color="processing"> <a-tag v-else color="processing">
{{ statusTypeEnum.getDesc(record.status) }} 营销活动图
</a-tag> </a-tag>
</template> </template>
<template v-if="'is_recommend' === column.key">
<!--状态-->
<a-tag v-if="record.banner_type == true" color="processing">
启用
</a-tag>
<!--状态-->
<a-tag v-else color="processing">
禁用
</a-tag>
</template>
<template v-if="'createAt' === column.key"> <template v-if="'createAt' === column.key">
{{ formatUtcDateTime(record.created_at) }} {{ formatUtcDateTime(record.created_at) }}
</template> </template>
@ -90,11 +102,11 @@ defineOptions({
}) })
const { t } = useI18n() // t const { t } = useI18n() // t
const columns = [ const columns = [
{ title: '缩略图', dataIndex: 'code', width: 240 }, { title: '缩略图', dataIndex: 'code', width: 200 },
{ title: '名称', dataIndex: 'name' }, { title: '名称', dataIndex: 'name', width: 150 },
{ title: t('pages.system.role.form.status'), dataIndex: 'status', key: 'statusType', width: 80 }, { title: '类型', dataIndex: 'banner_type', key: 'banner_type', width: 150 },
{ title: t('pages.system.role.form.sequence'), dataIndex: 'sequence', width: 100 },
{ title: t('pages.system.role.form.created_at'), key: 'createAt', fixed: 'right', width: 120 }, { title: t('pages.system.role.form.created_at'), key: 'createAt', fixed: 'right', width: 120 },
{ title: '是否启用', key: 'is_recommend', fixed: 'is_recommend', width: 120 },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 }, { title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
] ]
@ -113,8 +125,8 @@ async function getPageList() {
try { try {
showLoading() showLoading()
const { pageSize, current } = paginationState const { pageSize, current } = paginationState
const { success, data, total } = await apis.role const { data, total } = await apis.banner
.getRoleList({ .getBannerList({
pageSize, pageSize,
current: current, current: current,
...searchFormData.value, ...searchFormData.value,
@ -123,7 +135,7 @@ async function getPageList() {
throw new Error() throw new Error()
}) })
hideLoading() hideLoading()
if (config('http.code.success') === success) { if (data.length > 0) {
listData.value = data listData.value = data
paginationState.total = total paginationState.total = total
} }