diff --git a/src/views/content/ad/columns.ts b/src/views/content/ad/columns.ts new file mode 100644 index 0000000..c576843 --- /dev/null +++ b/src/views/content/ad/columns.ts @@ -0,0 +1,118 @@ +import { h } from 'vue'; +import { NTag, NImage } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '广告标题', + key: 'title', + width: 250, + render(record) { + return h( + 'a', + { + href: record.url, + target: '_blank', + }, + record.title, + ); + }, + }, + { + title: '广告封面', + key: 'cover', + width: 100, + render(record) { + return h(NImage, { + width: 35, + src: record.cover, + shape: 'square', + fit: 'fill', + }); + }, + }, + { + title: '广告类型', + key: 'type', + width: 100, + render(record) { + let typeText = ''; + switch (record.type) { + case 1: + typeText = '图片'; + break; + case 2: + typeText = '文字'; + break; + case 3: + typeText = '视频'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '广告状态', + key: 'status', + width: 100, + render(record) { + return h( + NTag, + { + type: record.status == 1 ? 'success' : 'error', + }, + { + default: () => (record.status == 1 ? '正常' : '停用'), + }, + ); + }, + }, + { + title: '广告尺寸', + key: 'size', + width: 100, + render(record) { + return record.width + 'x' + record.height; + }, + }, + { + title: '投放时间', + key: 'time', + width: 180, + render(record) { + return record.startTime + '-' + record.endTime; + }, + }, + { + title: '点击量', + key: 'click', + width: 100, + }, + { + title: '排序', + key: 'sort', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/ad/edit.vue b/src/views/content/ad/edit.vue new file mode 100644 index 0000000..9c80dd2 --- /dev/null +++ b/src/views/content/ad/edit.vue @@ -0,0 +1,271 @@ + + diff --git a/src/views/content/ad/index.vue b/src/views/content/ad/index.vue new file mode 100644 index 0000000..b4cb44b --- /dev/null +++ b/src/views/content/ad/index.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/content/ad/querySchemas.ts b/src/views/content/ad/querySchemas.ts new file mode 100644 index 0000000..201ca86 --- /dev/null +++ b/src/views/content/ad/querySchemas.ts @@ -0,0 +1,53 @@ +import { FormSchema } from '@/components/Form/index'; +import { getAdSortAllList } from '@/api/content/adSort'; +export const loadSelectData = async (res) => { + //这里可以进行数据转换处理 + return (await getAdSortAllList({ ...res })).map((item, index) => { + return { + ...item, + label: item.name, + value: item.id, + index, + }; + }); +}; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '广告标题', + componentProps: { + placeholder: '请输广告标题', + }, + }, + { + field: 'status', + component: 'NSelect', + label: '广告状态', + componentProps: { + placeholder: '请选择广告状态', + clearable: true, + options: [ + { + label: '在用', + value: '1', + }, + { + label: '停用', + value: '2', + }, + ], + }, + }, + { + field: 'adSortId', + component: 'BasicSelect', + label: '广告位', + componentProps: { + placeholder: '请选择广告位', + clearable: true, + block: true, + request: loadSelectData, + }, + }, +]; diff --git a/src/views/content/adSort/columns.ts b/src/views/content/adSort/columns.ts new file mode 100644 index 0000000..8e03643 --- /dev/null +++ b/src/views/content/adSort/columns.ts @@ -0,0 +1,62 @@ +import { h } from 'vue'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '广告位名称', + key: 'name', + width: 200, + }, + { + title: '广告位编号', + key: 'location', + width: 100, + }, + { + title: '广告位类型', + key: 'type', + width: 100, + render(record) { + let typeText = ''; + switch (record.type) { + case 1: + typeText = '网站'; + break; + case 2: + typeText = '手机站'; + break; + case 3: + typeText = '移动端'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '排序', + key: 'sort', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/adSort/edit.vue b/src/views/content/adSort/edit.vue new file mode 100644 index 0000000..fdbbc2f --- /dev/null +++ b/src/views/content/adSort/edit.vue @@ -0,0 +1,156 @@ + + diff --git a/src/views/content/adSort/index.vue b/src/views/content/adSort/index.vue new file mode 100644 index 0000000..e2ee6a2 --- /dev/null +++ b/src/views/content/adSort/index.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/content/adSort/querySchemas.ts b/src/views/content/adSort/querySchemas.ts new file mode 100644 index 0000000..ab38c25 --- /dev/null +++ b/src/views/content/adSort/querySchemas.ts @@ -0,0 +1,34 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'NInput', + label: '名称', + componentProps: { + placeholder: '请输入广告位名称', + }, + }, + { + field: 'type', + component: 'NSelect', + label: '类型', + componentProps: { + placeholder: '请选择广告位类型', + clearable: true, + options: [ + { + label: '网站', + value: '1', + }, + { + label: '手机站', + value: '2', + }, + { + label: '移动端', + value: '3', + }, + ], + }, + }, +]; diff --git a/src/views/content/article/columns.ts b/src/views/content/article/columns.ts new file mode 100644 index 0000000..688b118 --- /dev/null +++ b/src/views/content/article/columns.ts @@ -0,0 +1,90 @@ +import { h } from 'vue'; +import { NImage, NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '文章标题', + key: 'title', + width: 200, + render(record) { + return h( + 'a', + { + href: 'http://www.baidu.com', + target: '_blank', + }, + record.title, + ); + }, + }, + { + title: '文章封面', + key: 'cover', + width: 100, + render(record) { + return h(NImage, { + width: 48, + src: record.cover, + shape: 'square', + fit: 'fill', + }); + }, + }, + { + title: '文章分类', + key: 'categoryName', + width: 100, + }, + { + title: '文章作者', + key: 'author', + width: 100, + }, + { + title: '文章状态', + key: 'status', + width: 100, + render(record) { + return h( + NTag, + { + type: record.status == 1 ? 'error' : 'success', + }, + { + default: () => (record.status == 1 ? '下架' : '正常'), + }, + ); + }, + }, + { + title: '点击率', + key: 'click', + width: 100, + }, + { + title: '文章排序', + key: 'sort', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/article/edit.vue b/src/views/content/article/edit.vue new file mode 100644 index 0000000..1fcd3e2 --- /dev/null +++ b/src/views/content/article/edit.vue @@ -0,0 +1,258 @@ + + diff --git a/src/views/content/article/index.vue b/src/views/content/article/index.vue new file mode 100644 index 0000000..8bb0483 --- /dev/null +++ b/src/views/content/article/index.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/content/article/querySchemas.ts b/src/views/content/article/querySchemas.ts new file mode 100644 index 0000000..8bfb15f --- /dev/null +++ b/src/views/content/article/querySchemas.ts @@ -0,0 +1,30 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '文章标题', + componentProps: { + placeholder: '请输入文章标题', + }, + }, + { + field: 'status', + component: 'NSelect', + label: '文章状态', + componentProps: { + placeholder: '请选择文章状态', + clearable: true, + options: [ + { + label: '下架', + value: '1', + }, + { + label: '正常', + value: '0', + }, + ], + }, + }, +]; diff --git a/src/views/monitor/job/columns.ts b/src/views/monitor/job/columns.ts index c23ed60..7b8bdc0 100644 --- a/src/views/monitor/job/columns.ts +++ b/src/views/monitor/job/columns.ts @@ -62,7 +62,6 @@ export const columns = [ { title: '状态', key: 'status', - key: 'status', width: 100, }, {