From df27fda0542860ea23a80e96952d8da4d27d6dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Mon, 2 Dec 2024 10:08:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E3=80=81=E5=8F=8B=E9=93=BE?= =?UTF-8?q?=E3=80=81=E6=A0=87=E7=AD=BE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/content/category/columns.ts | 30 ++++ src/views/content/category/edit.vue | 185 +++++++++++++++++++++++ src/views/content/category/index.vue | 175 ++++++++++++++++++++++ src/views/content/link/columns.ts | 83 +++++++++++ src/views/content/link/edit.vue | 191 ++++++++++++++++++++++++ src/views/content/link/index.vue | 196 +++++++++++++++++++++++++ src/views/content/link/querySchemas.ts | 11 ++ src/views/content/tag/columns.ts | 36 +++++ src/views/content/tag/edit.vue | 124 ++++++++++++++++ src/views/content/tag/index.vue | 196 +++++++++++++++++++++++++ src/views/content/tag/querySchemas.ts | 11 ++ 11 files changed, 1238 insertions(+) create mode 100644 src/views/content/category/columns.ts create mode 100644 src/views/content/category/edit.vue create mode 100644 src/views/content/category/index.vue create mode 100644 src/views/content/link/columns.ts create mode 100644 src/views/content/link/edit.vue create mode 100644 src/views/content/link/index.vue create mode 100644 src/views/content/link/querySchemas.ts create mode 100644 src/views/content/tag/columns.ts create mode 100644 src/views/content/tag/edit.vue create mode 100644 src/views/content/tag/index.vue create mode 100644 src/views/content/tag/querySchemas.ts diff --git a/src/views/content/category/columns.ts b/src/views/content/category/columns.ts new file mode 100644 index 0000000..4765685 --- /dev/null +++ b/src/views/content/category/columns.ts @@ -0,0 +1,30 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + title: '分类名称', + key: 'name', + width: 200, + }, + { + title: '分类排序', + key: 'sort', + width: 100, + }, + { + title: '分类备注', + key: 'note', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/category/edit.vue b/src/views/content/category/edit.vue new file mode 100644 index 0000000..e345316 --- /dev/null +++ b/src/views/content/category/edit.vue @@ -0,0 +1,185 @@ + + diff --git a/src/views/content/category/index.vue b/src/views/content/category/index.vue new file mode 100644 index 0000000..3d8e980 --- /dev/null +++ b/src/views/content/category/index.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/content/link/columns.ts b/src/views/content/link/columns.ts new file mode 100644 index 0000000..bf3891d --- /dev/null +++ b/src/views/content/link/columns.ts @@ -0,0 +1,83 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '友链名称', + key: 'name', + width: 100, + }, + { + title: '友链类型', + key: 'type', + width: 100, + render(record) { + return h('span', record.type === 1 ? '友情链接' : '合作伙伴'); + }, + }, + { + title: '友链形式', + key: 'form', + width: 100, + render(record) { + return h('span', record.form === 1 ? '文字链接' : '图片链接'); + }, + }, + { + title: '友链地址', + key: 'url', + width: 200, + render(record) { + return h( + 'a', + { + href: record.url, + target: '_blank', + }, + record.url, + ); + }, + }, + { + title: '状态', + key: 'status', + width: 100, + render(record) { + return h( + NTag, + { + type: record.status == 1 ? 'success' : 'error', + }, + { + default: () => (record.status == 1 ? '正常' : '停用'), + }, + ); + }, + }, + { + title: '排序', + key: 'sort', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/link/edit.vue b/src/views/content/link/edit.vue new file mode 100644 index 0000000..3b4c3ef --- /dev/null +++ b/src/views/content/link/edit.vue @@ -0,0 +1,191 @@ + + diff --git a/src/views/content/link/index.vue b/src/views/content/link/index.vue new file mode 100644 index 0000000..0ddf52b --- /dev/null +++ b/src/views/content/link/index.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/src/views/content/link/querySchemas.ts b/src/views/content/link/querySchemas.ts new file mode 100644 index 0000000..0debe98 --- /dev/null +++ b/src/views/content/link/querySchemas.ts @@ -0,0 +1,11 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'NInput', + label: '友链名称', + componentProps: { + placeholder: '请输入友链名称', + }, + }, +]; diff --git a/src/views/content/tag/columns.ts b/src/views/content/tag/columns.ts new file mode 100644 index 0000000..efde4ca --- /dev/null +++ b/src/views/content/tag/columns.ts @@ -0,0 +1,36 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '标签名称', + key: 'name', + width: 100, + }, + { + title: '排序', + key: 'sort', + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/content/tag/edit.vue b/src/views/content/tag/edit.vue new file mode 100644 index 0000000..17ee0bf --- /dev/null +++ b/src/views/content/tag/edit.vue @@ -0,0 +1,124 @@ + + diff --git a/src/views/content/tag/index.vue b/src/views/content/tag/index.vue new file mode 100644 index 0000000..43ae627 --- /dev/null +++ b/src/views/content/tag/index.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/src/views/content/tag/querySchemas.ts b/src/views/content/tag/querySchemas.ts new file mode 100644 index 0000000..6e06842 --- /dev/null +++ b/src/views/content/tag/querySchemas.ts @@ -0,0 +1,11 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'NInput', + label: '标签名称', + componentProps: { + placeholder: '请输入标签名称', + }, + }, +];