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 @@ +