diff --git a/src/api/attachment/index.ts b/src/api/attachment/index.ts new file mode 100644 index 0000000..ea69638 --- /dev/null +++ b/src/api/attachment/index.ts @@ -0,0 +1,37 @@ +import request from '/@/utils/request'; +import { baseUrlHost } from '../baseUrlHost'; + +/** + * (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参) + * 注意在写get请求时,参数是params,而不是data,要标注好 + * + * 登录api接口集合 + * @method getAttachmentList 分页查询附件 + * @method getAttachmentDetail 查看单个附件 + * @method downloadFiles 批量文件下载 + */ + +export function attachmentApi() { + return { + getAttachmentList: (params: object) => { + return request({ + url: baseUrlHost + '/enAttachment', + method: 'get', + params, + }); + }, + getAttachmentDetail: (id: Number) => { + return request({ + url: baseUrlHost + `/enAttachment/${id}`, + method: 'get', + }); + }, + downloadFiles: (ids: object) => { + return request({ + url: baseUrlHost + '/enAttachment/uploadByType', + method: 'get', + ids, + }) + } + }; +} diff --git a/src/api/video/index.ts b/src/api/video/index.ts new file mode 100644 index 0000000..b0cdc95 --- /dev/null +++ b/src/api/video/index.ts @@ -0,0 +1,60 @@ +import request from '/@/utils/request'; +import { baseUrlHost } from '../baseUrlHost'; + +/** + * (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参) + * 注意在写get请求时,参数是params,而不是data,要标注好 + * + * 登录api接口集合 + * @method getVideoList 分页查询视频 + * @method deleteVideo 删除视频 + * @method getVideoDetail 获取视频详情 + * @method saveVideo 保存视频 + * @method updateVideo 更新视频 + */ + +export function videoApi() { + return { + getVideoList: (params: object) => { + return request({ + url: baseUrlHost + '/cpVideo', + method: 'get', + params, + }); + }, + deleteVideo: (id: Number) => { + return request({ + url: baseUrlHost + `/cpVideo/${id}`, + method: 'delete', + }); + }, + getVideoDetail: (id: Number) => { + return request({ + url: baseUrlHost + `/cpVideo/${id}`, + method: 'get', + }); + }, + saveVideo: (data: object) => { + return request({ + url: baseUrlHost + '/cpVideo', + method: 'post', + data, + }) + }, + updateVideo: (data: object) => { + return request({ + url: baseUrlHost + '/cpVideo', + method: 'put', + data, + }) + }, + uploadFileType: (data: object) => { + return request({ + url: baseUrlHost + '/enAttachment/uploadByType', + method: 'post', + data, + headers: { 'Content-Type': 'multipart/form-data'} + }) + } + }; +} diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 293a6af..8aaf6c5 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -16,6 +16,15 @@ export default { articleDetail: 'articleDetail', addArticle: 'addArticle', editArticle: 'editArticle', + video: 'video', + videoDetail: 'videoDetail', + addVideo: 'addVideo', + editVideo: 'editVideo', + attachment: 'attachment', + attachmentDetail: 'attachmentDetail', + addAttachment: 'addAttachment', + editAttachment: 'editAttachment', + log:'log', limits: 'limits', limitsFrontEnd: 'FrontEnd', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index b23379e..0b603ba 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -16,6 +16,14 @@ export default { articleDetail: '文章详情', addArticle: '新增文章', editArticle: '编辑文章', + video: '视频管理', + videoDetail: '视频详情', + addVideo: '新增视频', + editVideo: '编辑视频', + attachment: '附件管理', + attachmentDetail: '附件详情', + addAttachment: '新增附件', + editAttachment: '编辑附件', log:'系统日志', limits: '权限管理', limitsFrontEnd: '前端控制', diff --git a/src/i18n/lang/zh-tw.ts b/src/i18n/lang/zh-tw.ts index 587f020..eca98f1 100644 --- a/src/i18n/lang/zh-tw.ts +++ b/src/i18n/lang/zh-tw.ts @@ -16,6 +16,14 @@ export default { articleDetail: '文章詳情', addArticle: '文章新增', editArticle: '文章編輯', + video: '視頻管理', + videoDetail: '視頻詳情', + addVideo: '視頻新增', + editVideo: '視頻編輯', + attachment: '附件管理', + attachmentDetail: '附件詳情', + addAttachment: '附件新增', + editAttachment: '附件編輯', log:'系統日誌', limits: '許可權管理', limitsFrontEnd: '前端控制', diff --git a/src/router/route.ts b/src/router/route.ts index 6a9195c..9555dfe 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -295,6 +295,130 @@ export const dynamicRoutes: Array = [ icon: 'iconfont icon-shuju', }, }, + { + path: '/video', + name: 'video', + component: () => import('/@/views/video/index.vue'), + meta: { + title: 'message.router.video', + isLink: '', + isHide: false, + isKeepAlive: true, + isAffix: false, + isIframe: false, + roles: ['admin', 'common'], + icon: 'iconfont icon-jiliandongxuanzeqi', + }, + children: [ + { + path: '/video/detail', + name: 'videoDetail', + component: () => import('/@/views/video/component/detail.vue'), + meta: { + title: 'message.router.videoDetail', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + }, + { + path: '/video/add', + name: 'addVideo', + component: () => import('/@/views/video/component/upload.vue'), + meta: { + title: 'message.router.addVideo', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + }, + { + path: '/video/edit', + name: 'editVideo', + component: () => import('/@/views/video/component/upload.vue'), + meta: { + title: 'message.router.editVideo', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + } + ] + }, + { + path: '/attachment', + name: 'attachment', + component: () => import('/@/views/attachment/index.vue'), + meta: { + title: 'message.router.attachment', + isLink: '', + isHide: false, + isKeepAlive: true, + isAffix: false, + isIframe: false, + roles: ['admin', 'common'], + icon: 'iconfont icon-jiliandongxuanzeqi', + }, + children: [ + { + path: '/attachment/detail', + name: 'attachmentDetail', + component: () => import('/@/views/attachment/component/detail.vue'), + meta: { + title: 'message.router.attachmentDetail', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + }, + { + path: '/attachment/add', + name: 'addVideo', + component: () => import('/@/views/attachment/component/upload.vue'), + meta: { + title: 'message.router.addVideo', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + }, + { + path: '/attachment/edit', + name: 'editVideo', + component: () => import('/@/views/attachment/component/upload.vue'), + meta: { + title: 'message.router.editVideo', + isLink: '', + isHide: true, + isKeepAlive: false, + isAffix: false, + isIframe: false, + roles: ['admin','common'], + icon: 'ele-Document', + }, + } + ] + }, { path: '/limits', name: 'limits', diff --git a/src/views/attachment/component/detail.vue b/src/views/attachment/component/detail.vue new file mode 100644 index 0000000..2c76646 --- /dev/null +++ b/src/views/attachment/component/detail.vue @@ -0,0 +1,212 @@ + + + + \ No newline at end of file diff --git a/src/views/attachment/component/upload.vue b/src/views/attachment/component/upload.vue new file mode 100644 index 0000000..774e1ed --- /dev/null +++ b/src/views/attachment/component/upload.vue @@ -0,0 +1,341 @@ + + + + + + diff --git a/src/views/attachment/index.vue b/src/views/attachment/index.vue new file mode 100644 index 0000000..52ac4f4 --- /dev/null +++ b/src/views/attachment/index.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/src/views/video/component/detail.vue b/src/views/video/component/detail.vue new file mode 100644 index 0000000..b8cb41a --- /dev/null +++ b/src/views/video/component/detail.vue @@ -0,0 +1,163 @@ + + + + diff --git a/src/views/video/component/upload.vue b/src/views/video/component/upload.vue new file mode 100644 index 0000000..ff35c8f --- /dev/null +++ b/src/views/video/component/upload.vue @@ -0,0 +1,341 @@ + + + + + + diff --git a/src/views/video/index.vue b/src/views/video/index.vue new file mode 100644 index 0000000..20f8ed8 --- /dev/null +++ b/src/views/video/index.vue @@ -0,0 +1,240 @@ + + + + +