From 34d3099ed67e0d6e11323bfe68969e8db3783fad Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 22 Nov 2024 15:46:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/cms.js | 64 +++++++++ src/config/route.js | 9 ++ src/views/home/articles.vue | 266 ++++++++++++++++++++++++++++++++++++ 3 files changed, 339 insertions(+) create mode 100644 src/api/model/cms.js create mode 100644 src/views/home/articles.vue diff --git a/src/api/model/cms.js b/src/api/model/cms.js new file mode 100644 index 00000000..8cb76e4d --- /dev/null +++ b/src/api/model/cms.js @@ -0,0 +1,64 @@ +import config from "@/config" +import http from "@/utils/request" +/*公告视频接口*/ +export default { + article: { + list: { + name: "获取列表", + req: async function(data){ + return await http.get( + `${config.API_URL}/cms/article/`, + data + ); + } + }, + item: { + name: "获取详情", + req: async function(id){ + return await http.get( + `${config.API_URL}/cms/article/${id}/` + ); + } + }, + cquery: { + name: "复杂查询", + req: async function(data){ + return await http.post( + `${config.API_URL}/cms/article/cquery/`, + data); + } + }, + update: { + name: "编辑更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/cms/article/${id}/`, + data); + } + }, + create: { + name: "新增", + req: async function(data){ + return await http.post( + `${config.API_URL}/cms/article/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/cms/article/${id}/`); + } + }, + toggle_top: { + name: "文章置顶/取消", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/cms/article/${id}/toggle_top/`, + data); + } + }, + + }, +} diff --git a/src/config/route.js b/src/config/route.js index 18b17f45..6d9171e7 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -142,6 +142,15 @@ const routes = [ }, component: "home/event", }, + { + name: "articles", + path: "/articles", + meta: { + title: "公告视频", + perms: ["articles"], + }, + component: "home/articles", + }, ], }, //审批 diff --git a/src/views/home/articles.vue b/src/views/home/articles.vue new file mode 100644 index 00000000..e3c861ab --- /dev/null +++ b/src/views/home/articles.vue @@ -0,0 +1,266 @@ + + +