diff --git a/src/views/content/layoutItem/article/columns2.ts b/src/views/content/layoutItem/article/columns2.ts new file mode 100644 index 0000000..a8382f0 --- /dev/null +++ b/src/views/content/layoutItem/article/columns2.ts @@ -0,0 +1,59 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns2 = [ + { + label: '标题', + prop: 'title', + width: 300, + }, + { + label: '类型', + prop: 'type', + // render(record) { + // return h('span', record.row.type === 1 ? '通知' : '公告'); + // }, + render(record) { + return h( + ElTag, + { + type: record.row.type == 1 ? 'primary' : 'warning', + }, + { + default: () => (record.row.type == 1 ? '通知' : '公告'), + }, + ); + }, + }, + { + label: '状态', + prop: 'status', + // render(record) { + // return h('span', record.row.status === 1 ? '正常' : '关闭') + // }, + render(record) { + return h( + ElTag, + { + type: record.row.status ==1 ? 'success' : 'danger', + }, + { + default: () => (record.row.status ==1 ? '正常' : '禁用'), + }, + ); + }, + }, + { + label: '点击率', + prop: 'clickNum', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/layoutItem/article/index.vue b/src/views/content/layoutItem/article/index.vue index 819197c..fc7f2d5 100644 --- a/src/views/content/layoutItem/article/index.vue +++ b/src/views/content/layoutItem/article/index.vue @@ -4,13 +4,14 @@ title="选择文章" :close-on-click-modal="false" :before-close="dialogClose" + style="margin-top:20px;" >