generated from Leo_Ding/web-template
轮播图修改
This commit is contained in:
parent
385efa8bf7
commit
78ea0032b8
@ -88,4 +88,6 @@ export default {
|
||||
newConfiguration: '带新配置',
|
||||
systemSettings: '短息、支付参数设置',
|
||||
allSetting: '短息、支付配置列表',
|
||||
bannerMgt: '图片轮播管理',
|
||||
bannerList: '图片轮播列表',
|
||||
}
|
||||
|
||||
30
src/router/routes/bannerMgt.js
Normal file
30
src/router/routes/bannerMgt.js
Normal 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: '*',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
]
|
||||
@ -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,
|
||||
]
|
||||
|
||||
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user