优化广告位、广告模块
This commit is contained in:
parent
24634fe5f3
commit
da777e082f
@ -1,19 +1,21 @@
|
||||
import { h } from 'vue';
|
||||
import { ElAvatar } from 'element-plus';
|
||||
import { ElAvatar, ElTag } from 'element-plus';
|
||||
export const columns = [
|
||||
{
|
||||
type: 'selection',
|
||||
},
|
||||
{
|
||||
label: 'ID',
|
||||
prop: 'id'
|
||||
prop: 'id',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
label: '广告标题',
|
||||
prop: 'title',
|
||||
width: 250,
|
||||
render(record) {
|
||||
return h('a', {
|
||||
href: 'http://www.baidu.com',
|
||||
href: record.row.url,
|
||||
target:"_blank"
|
||||
}, record.row.title);
|
||||
},
|
||||
@ -23,7 +25,7 @@ export const columns = [
|
||||
prop: 'cover',
|
||||
render(record) {
|
||||
return h(ElAvatar, {
|
||||
size: 48,
|
||||
size: 35,
|
||||
src: record.row.cover,
|
||||
shape: 'square',
|
||||
fit: 'fill',
|
||||
@ -56,8 +58,38 @@ export const columns = [
|
||||
label: '广告状态',
|
||||
prop: 'status',
|
||||
render(record) {
|
||||
return h('span', record.row.status === 1 ? '在用' : '停用')
|
||||
return h(
|
||||
ElTag,
|
||||
{
|
||||
type: record.row.status ==1 ? 'success' : 'danger',
|
||||
},
|
||||
{
|
||||
default: () => (record.row.status ==1 ? '正常' : '停用'),
|
||||
},
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '广告尺寸',
|
||||
prop: 'size',
|
||||
render(record) {
|
||||
return record.row.width + 'x' + record.row.height;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '投放时间',
|
||||
prop: 'time',
|
||||
render(record) {
|
||||
return record.row.start_time + 'x' + record.row.end_time;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '点击量',
|
||||
prop: 'click',
|
||||
},
|
||||
{
|
||||
label: '排序',
|
||||
prop: 'sort',
|
||||
},
|
||||
{
|
||||
label: '创建人',
|
||||
@ -66,5 +98,6 @@ export const columns = [
|
||||
{
|
||||
label: '创建时间',
|
||||
prop: 'createTime',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
@ -22,7 +22,7 @@
|
||||
<PlusOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
添加广告
|
||||
添加
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:ad:batchDelete']">
|
||||
<template #icon>
|
||||
@ -69,7 +69,7 @@ const selectionData = ref([])
|
||||
adSortId:''
|
||||
});
|
||||
const actionColumn = reactive({
|
||||
width: 250,
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
|
@ -7,7 +7,8 @@ export const columns = [
|
||||
},
|
||||
{
|
||||
label: 'ID',
|
||||
prop: 'id'
|
||||
prop: 'id',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
label: '广告位名称',
|
||||
@ -49,5 +50,6 @@ export const columns = [
|
||||
{
|
||||
label: '创建时间',
|
||||
prop: 'createTime',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
@ -19,7 +19,7 @@
|
||||
<PlusOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
添加广告位
|
||||
添加
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:adSort:batchDelete']">
|
||||
<template #icon>
|
||||
@ -66,7 +66,7 @@ const selectionData = ref([])
|
||||
type:''
|
||||
});
|
||||
const actionColumn = reactive({
|
||||
width: 250,
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
|
Loading…
Reference in New Issue
Block a user