From f239994af618d4e3de9ae449de213124658bc61c Mon Sep 17 00:00:00 2001 From: hr121 <568127468@qq.com> Date: Sun, 24 Nov 2024 23:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E9=99=84=E4=BB=B6=E7=AE=A1=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=AE=A1=E7=90=86=E6=89=B9=E9=87=8F=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E7=94=B1=E4=BA=8E=E4=BC=A0=E5=85=A5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=BF=98=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/attachment/index.ts | 37 +++ src/api/video/index.ts | 60 ++++ src/i18n/lang/en.ts | 9 + src/i18n/lang/zh-cn.ts | 8 + src/i18n/lang/zh-tw.ts | 8 + src/router/route.ts | 124 ++++++++ src/views/attachment/component/detail.vue | 212 ++++++++++++++ src/views/attachment/component/upload.vue | 341 ++++++++++++++++++++++ src/views/attachment/index.vue | 231 +++++++++++++++ src/views/video/component/detail.vue | 163 +++++++++++ src/views/video/component/upload.vue | 341 ++++++++++++++++++++++ src/views/video/index.vue | 240 +++++++++++++++ 12 files changed, 1774 insertions(+) create mode 100644 src/api/attachment/index.ts create mode 100644 src/api/video/index.ts create mode 100644 src/views/attachment/component/detail.vue create mode 100644 src/views/attachment/component/upload.vue create mode 100644 src/views/attachment/index.vue create mode 100644 src/views/video/component/detail.vue create mode 100644 src/views/video/component/upload.vue create mode 100644 src/views/video/index.vue 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 e4a69cc..0651556 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -14,6 +14,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 650be90..49b8fbf 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -14,6 +14,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 2576d77..a75aefb 100644 --- a/src/i18n/lang/zh-tw.ts +++ b/src/i18n/lang/zh-tw.ts @@ -14,6 +14,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 9a5f7a3..85cd7cb 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -262,6 +262,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 @@ + + + + +