优化友链管理模块

This commit is contained in:
zjl 2024-08-30 14:48:51 +08:00
parent 148e0f7679
commit 8f3a35e496
6 changed files with 42 additions and 14 deletions

View File

@ -7,7 +7,8 @@ export const columns = [
}, },
{ {
label: 'ID', label: 'ID',
prop: 'id' prop: 'id',
width: 100,
}, },
{ {
label: '位置编号', label: '位置编号',
@ -28,5 +29,6 @@ export const columns = [
{ {
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime',
width: 180,
}, },
]; ];

View File

@ -19,7 +19,7 @@
<PlusOutlined /> <PlusOutlined />
</el-icon> </el-icon>
</template> </template>
添加页面布局 添加
</el-button> </el-button>
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:layout:batchDelete']"> <el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:layout:batchDelete']">
<template #icon> <template #icon>
@ -64,7 +64,7 @@ const selectionData = ref([])
description:'' description:''
}); });
const actionColumn = reactive({ const actionColumn = reactive({
width: 250, width: 200,
label: '操作', label: '操作',
prop: 'action', prop: 'action',
fixed: 'right', fixed: 'right',

View File

@ -7,7 +7,8 @@ export const columns = [
}, },
{ {
label: 'ID', label: 'ID',
prop: 'id' prop: 'id',
width: 100,
}, },
{ {
label: '位置编号', label: '位置编号',
@ -28,5 +29,6 @@ export const columns = [
{ {
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime',
width: 180,
}, },
]; ];

View File

@ -19,7 +19,7 @@
<PlusOutlined /> <PlusOutlined />
</el-icon> </el-icon>
</template> </template>
添加页面推荐 添加
</el-button> </el-button>
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:layoutItem:batchDelete']"> <el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:layoutItem:batchDelete']">
<template #icon> <template #icon>
@ -66,7 +66,7 @@ const selectionData = ref([])
type:'' type:''
}); });
const actionColumn = reactive({ const actionColumn = reactive({
width: 250, width: 200,
label: '操作', label: '操作',
prop: 'action', prop: 'action',
fixed: 'right', fixed: 'right',

View File

@ -7,35 +7,58 @@ export const columns = [
}, },
{ {
label: 'ID', label: 'ID',
prop: 'id' prop: 'id',
width: 100,
}, },
{ {
label: '名称', label: '友链名称',
prop: 'name', prop: 'name',
}, },
{ {
label: '类型', label: '友链类型',
prop: 'type', prop: 'type',
render(record) { render(record) {
return h('span', record.row.type === 1 ? '友情链接' : '合作伙伴') return h('span', record.row.type === 1 ? '友情链接' : '合作伙伴')
}, },
}, },
{ {
label: '类型', label: '友链形式',
prop: 'form', prop: 'form',
render(record) { render(record) {
return h('span', record.row.form === 1 ? '文字链接' : '图片链接') return h('span', record.row.form === 1 ? '文字链接' : '图片链接')
}, },
}, },
{ {
label: 'URL', label: '友链地址',
prop: 'url', prop: 'url',
width: 200,
render(record) {
return h('a', {
href: record.row.url,
target:"_blank"
}, record.row.url);
},
}, },
// {
// label: '状态',
// prop: 'status',
// render(record) {
// return h('span', record.row.status === 1 ? '在用' : '停用')
// },
// },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
render(record) { render(record) {
return h('span', record.row.status === 1 ? '在用' : '停用') return h(
ElTag,
{
type: record.row.status ==1 ? 'success' : 'danger',
},
{
default: () => (record.row.status ==1 ? '正常' : '停用'),
},
);
}, },
}, },
{ {
@ -49,5 +72,6 @@ export const columns = [
{ {
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime',
width: 180,
}, },
]; ];

View File

@ -19,7 +19,7 @@
<PlusOutlined /> <PlusOutlined />
</el-icon> </el-icon>
</template> </template>
添加友情链接 添加
</el-button> </el-button>
<el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:link:batchDelete']"> <el-button type="danger" @click="handleDelete()" :disabled="!selectionData.length" v-perm="['sys:link:batchDelete']">
<template #icon> <template #icon>
@ -64,7 +64,7 @@ const selectionData = ref([])
name:'' name:''
}); });
const actionColumn = reactive({ const actionColumn = reactive({
width: 250, width: 200,
label: '操作', label: '操作',
prop: 'action', prop: 'action',
fixed: 'right', fixed: 'right',