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: '带新配置',
systemSettings: '短息、支付参数设置',
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 activities from './activities'
import systemSettings from './systemSettings'
import bannerMgt from './bannerMgt'
export default [
...home,
...form,
@ -63,4 +64,5 @@ export default [
...invoice,
...activities,
...systemSettings,
...bannerMgt,
]

View File

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

View File

@ -1,7 +1,7 @@
<template>
<x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item :label="$t('pages.system.role.form.name')" name="name">
@ -35,17 +35,29 @@
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
:scroll="{ x: 1000 }" @change="onTableChange">
<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">
{{ statusTypeEnum.getDesc(record.status) }}
<a-tag v-if="record.banner_type == 1" color="processing">
首页轮播图
</a-tag>
<!--状态-->
<a-tag v-if="statusTypeEnum.is('disabled', record.status)" color="processing">
{{ statusTypeEnum.getDesc(record.status) }}
<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>
<!--状态-->
<a-tag v-else color="processing">
禁用
</a-tag>
</template>
<template v-if="'createAt' === column.key">
{{ formatUtcDateTime(record.created_at) }}
</template>
@ -90,11 +102,11 @@ defineOptions({
})
const { t } = useI18n() // t
const columns = [
{ title: '缩略图', dataIndex: 'code', width: 240 },
{ title: '名称', dataIndex: 'name' },
{ title: t('pages.system.role.form.status'), dataIndex: 'status', key: 'statusType', width: 80 },
{ title: t('pages.system.role.form.sequence'), dataIndex: 'sequence', width: 100 },
{ title: '缩略图', dataIndex: 'code', width: 200 },
{ title: '名称', dataIndex: 'name', width: 150 },
{ title: '类型', dataIndex: 'banner_type', key: 'banner_type', width: 150 },
{ 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 },
]
@ -113,8 +125,8 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.role
.getRoleList({
const { data, total } = await apis.banner
.getBannerList({
pageSize,
current: current,
...searchFormData.value,
@ -123,7 +135,7 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
if (data.length > 0) {
listData.value = data
paginationState.total = total
}