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: '请输入标签名称', + }, + } +];