From 853e171f542c4d135ed0d7d8750b2f8eaeaf900a 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, 15 Jul 2024 15:10:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8B=E6=83=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/content/link.ts | 60 ++++++++++ src/views/content/link/columns.ts | 49 ++++++++ src/views/content/link/edit.vue | 147 +++++++++++++++++++++++ src/views/content/link/index.vue | 156 +++++++++++++++++++++++++ src/views/content/link/querySchemas.ts | 11 ++ 5 files changed, 423 insertions(+) create mode 100644 src/api/content/link.ts 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 diff --git a/src/api/content/link.ts b/src/api/content/link.ts new file mode 100644 index 0000000..6603532 --- /dev/null +++ b/src/api/content/link.ts @@ -0,0 +1,60 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 列表 + */ +export function getLinkList(params?) { + return http.request({ + url: '/link/page', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getLinkDetail(linkId) { + return http.request({ + url: '/link/detail/'+linkId, + method: 'get', + }); +} +/** + * @description: 添加 + */ +export function linkAdd(data:any) { + return http.request({ + url: '/link/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新 + */ +export function linkUpdate(data:any) { + return http.request({ + url: '/link/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除 + */ +export function linkDelete(linkId) { + return http.request({ + url: '/link/delete/'+linkId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除 + */ +export function linkBatchDelete(data:any) { + return http.request({ + url: '/link/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/views/content/link/columns.ts b/src/views/content/link/columns.ts new file mode 100644 index 0000000..3fc32d5 --- /dev/null +++ b/src/views/content/link/columns.ts @@ -0,0 +1,49 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '名称', + prop: 'name', + }, + { + label: '类型', + prop: 'type', + render(record) { + return h('span', record.row.type === 1 ? '友情链接' : '合作伙伴') + }, + }, + { + label: '类型', + prop: 'form', + render(record) { + return h('span', record.row.form === 1 ? '文字链接' : '图片链接') + }, + }, + { + label: 'URL', + prop: 'url', + }, + { + label: '状态', + prop: 'status', + render(record) { + return h('span', record.row.status === 1 ? '在用' : '停用') + }, + }, + { + label: '排序', + prop: 'sort', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/content/link/edit.vue b/src/views/content/link/edit.vue new file mode 100644 index 0000000..b7bcc71 --- /dev/null +++ b/src/views/content/link/edit.vue @@ -0,0 +1,147 @@ + + diff --git a/src/views/content/link/index.vue b/src/views/content/link/index.vue new file mode 100644 index 0000000..9d77cb4 --- /dev/null +++ b/src/views/content/link/index.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/src/views/content/link/querySchemas.ts b/src/views/content/link/querySchemas.ts new file mode 100644 index 0000000..2a83569 --- /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: 'Input', + label: '标签名称', + componentProps: { + placeholder: '请输入标签名称', + }, + } +];