From 3e05422d7451eaaaf3db27773b4ddbcd0616652b Mon Sep 17 00:00:00 2001 From: chenke Date: Tue, 22 Feb 2022 16:11:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=93=E9=A2=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/subject.js | 69 +++++ src/router/routes.js | 110 ++++---- src/views/article/subject/article.vue | 323 ++++++++++++++++++++++ src/views/article/subject/index.vue | 372 ++++++++++++++++++++++++++ src/views/article/subject/layout.vue | 3 + 5 files changed, 831 insertions(+), 46 deletions(-) create mode 100644 src/api/subject.js create mode 100644 src/views/article/subject/article.vue create mode 100644 src/views/article/subject/index.vue create mode 100644 src/views/article/subject/layout.vue diff --git a/src/api/subject.js b/src/api/subject.js new file mode 100644 index 0000000..7c1dd47 --- /dev/null +++ b/src/api/subject.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +// 查询主题列表 +export function listSubject(query) { + return request({ + url: '/special/specialBackList', + method: 'get', + params: query + }) +} + + +// 新增主题 +export function addSubject(data) { + return request({ + url: '/special/addSpecial', + method: 'post', + data: data + }) +} + +// 修改主题 +export function updateSubject(data) { + return request({ + url: '/special/specialEdit', + method: 'post', + data: data + }) +} + +// 删除主题 +export function delSubject(data) { + return request({ + url: '/special/specialDel', + method: 'post', + data: data + }) +} + + + +// 查询主题文章列表 +export function listSubjectArticle(query) { + return request({ + url: '/special/specialBackListMore', + method: 'get', + params: query + }) +} + + +// 新增文章 +export function addSubjectArticle(data) { + return request({ + url: '/special/specialBind', + method: 'post', + data: data + }) +} + +// 删除主题 +export function delSubjectArticle(data) { + console.log(data) + return request({ + url: '/special/specialSolution', + method: 'post', + data: data + }) +} diff --git a/src/router/routes.js b/src/router/routes.js index c81da2b..814e48f 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -40,37 +40,55 @@ const routes = [ path: '/dashboard', component: () => import('@/views/dashboard'), }], - meta: { title: '欢迎页', icon: 'form', noCache: true} + meta: { title: '欢迎页', icon: 'form', noCache: true } }, { path: '/menuManage', component: Layout, children: [{ - path: 'index', - name: 'MenuManage', - component: () => import('@/views/menu'), - meta: { title: '菜单管理', icon: 'tree-table', noCache: true} + path: 'index', + name: 'MenuManage', + component: () => import('@/views/menu'), + meta: { title: '菜单管理', icon: 'tree-table', noCache: true } }] }, { path: '*', component: Notfound, hidden: true }, { - path: '/article', - component: Layout, - name: 'article', - meta: { title: '内容中心', icon: 'form' }, + path: '/article', + component: Layout, + name: 'article', + meta: { title: '内容中心', icon: 'form' }, + children: [{ + path: 'index', + name: 'articleIndex', + component: () => import('@/views/article/index'), + meta: { title: '文章列表', icon: 'form', noCache: true } + }, { + path: 'category', + name: 'articleCategory', + component: () => import('@/views/article/category'), + meta: { title: '文章类别', icon: 'form', noCache: true } + }, + { + path: 'subject', + component: () => import('@/views/article/subject/layout'), + name: 'subject', + meta: { title: '专题管理', icon: 'form' }, children: [{ - path: 'index', - name: 'articleIndex', - component: () => import('@/views/article/index'), - meta: { title: '文章列表', icon: 'form', noCache: true} - },{ - path: 'category', - name: 'articleCategory', - component: () => import('@/views/article/category'), - meta: { title: '文章类别', icon: 'form', noCache: true} + path: 'list', + name: 'subjectIndex', + component: () => import('@/views/article/subject/index'), + meta: { title: '专题列表', icon: 'form', noCache: true } + }, { + path: 'article', + name: 'subjectArticle', + component: () => import('@/views/article/subject/article'), + meta: { title: '专题文章', icon: 'form', noCache: true } }, ] + }, + ] }, { @@ -79,40 +97,40 @@ const routes = [ name: 'AD', meta: { title: '广告中心', icon: 'form' }, children: [{ - path: 'index', - name: 'adIndex', - component: () => import('@/views/ad/index'), - meta: { title: '首页管理', icon: 'form', noCache: true} - } + path: 'index', + name: 'adIndex', + component: () => import('@/views/ad/index'), + meta: { title: '首页管理', icon: 'form', noCache: true } + } ] -}, + }, -{ - path: '/admin', - component: Layout, - name: 'Admin', - meta: { title: '用户', icon: 'form' }, - children: [{ + { + path: '/admin', + component: Layout, + name: 'Admin', + meta: { title: '用户', icon: 'form' }, + children: [{ path: 'index', name: 'AdminIndex', component: () => import('@/views/admin/index'), - meta: { title: '管理员管理', icon: 'form', noCache: true} + meta: { title: '管理员管理', icon: 'form', noCache: true } } - ] -}, -{ - path: '/role', - component: Layout, - name: 'Role', - meta: { title: '角色', icon: 'form' }, - children: [{ + ] + }, + { + path: '/role', + component: Layout, + name: 'Role', + meta: { title: '角色', icon: 'form' }, + children: [{ path: 'index', name: 'RoleIndex', component: () => import('@/views/role/index'), - meta: { title: '角色管理', icon: 'form', noCache: true} + meta: { title: '角色管理', icon: 'form', noCache: true } } - ] -}, + ] + }, ...warning, @@ -121,10 +139,10 @@ const routes = [ path: '/updateVersion', component: Layout, children: [{ - path: 'index', - name: 'UpdateVersion', - component: () => import('@/views/updateVersion/updateVersion'), - meta: { title: '版本更新', icon: 'form', noCache: true} + path: 'index', + name: 'UpdateVersion', + component: () => import('@/views/updateVersion/updateVersion'), + meta: { title: '版本更新', icon: 'form', noCache: true } }] }, ...playground, diff --git a/src/views/article/subject/article.vue b/src/views/article/subject/article.vue new file mode 100644 index 0000000..6c6f264 --- /dev/null +++ b/src/views/article/subject/article.vue @@ -0,0 +1,323 @@ + + + + + \ No newline at end of file diff --git a/src/views/article/subject/index.vue b/src/views/article/subject/index.vue new file mode 100644 index 0000000..06d020d --- /dev/null +++ b/src/views/article/subject/index.vue @@ -0,0 +1,372 @@ + + + + diff --git a/src/views/article/subject/layout.vue b/src/views/article/subject/layout.vue new file mode 100644 index 0000000..5e1bb62 --- /dev/null +++ b/src/views/article/subject/layout.vue @@ -0,0 +1,3 @@ + From 3f276a7eb7b67dfca8d4167b384556d31a6aacfc Mon Sep 17 00:00:00 2001 From: chenke Date: Tue, 22 Feb 2022 16:13:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/get-img-width.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/get-img-width.js b/src/utils/get-img-width.js index 73ae9b0..ba0e647 100644 --- a/src/utils/get-img-width.js +++ b/src/utils/get-img-width.js @@ -31,6 +31,14 @@ export default function (file, id) { width = 722; height = 406; break; + case 'subjectCover': //专题封面 + width = 650; + height = 350; + break; + case 'subjectBanner': //专题封面 + width = 1585; + height = 224; + break; }; return new Promise(resolve => { let reader = new FileReader(); From 5fe4048354a63c10af524c42f9d36d5b4c77931a Mon Sep 17 00:00:00 2001 From: chenke Date: Tue, 22 Feb 2022 16:56:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=93=E9=A2=98=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/article/subject/article.vue | 33 ++++++++++++++++++++++++++- src/views/article/subject/index.vue | 26 +++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/views/article/subject/article.vue b/src/views/article/subject/article.vue index 6c6f264..8e6dbcb 100644 --- a/src/views/article/subject/article.vue +++ b/src/views/article/subject/article.vue @@ -1,5 +1,37 @@