diff --git a/src/api/theme/theme.js b/src/api/theme/theme.js index 2ac1f89..59ed290 100644 --- a/src/api/theme/theme.js +++ b/src/api/theme/theme.js @@ -45,3 +45,38 @@ export function FetchUpdateThemeState(parameter) { data: parameter }) } + +// 我的画册 +export function FetchMyAlbum(parameter) { + return request({ + url: 'api/material/myAlbum', + method: 'post', + data: parameter + }) +} +// 添加到画册 +export function FetchAddToMyAlbum(parameter) { + return request({ + url: 'api/material/addMyAlbum', + method: 'post', + data: parameter + }) +} + +// 删除我的画册主题素材 +export function FetchDeleteMyAlbum(parameter) { + return request({ + url: 'api/material/deleteMyAlbum', + method: 'post', + data: parameter + }) +} + +// 编辑/新增文件夹-主题库 +export function FetchSaveThemeFolder(parameter) { + return request({ + url: 'api/material/saveThemeFolder', + method: 'post', + data: parameter + }) +} diff --git a/src/views/ThemeGallery/index.vue b/src/views/ThemeGallery/index.vue index 8e13b5d..312bac6 100644 --- a/src/views/ThemeGallery/index.vue +++ b/src/views/ThemeGallery/index.vue @@ -83,7 +83,7 @@ 竖屏 - + @@ -91,11 +91,11 @@ -

文件名:{{ fileNames }}

+ - +
- + @@ -209,8 +209,7 @@ export default { uploadDialogVisible: false, // 上传主题内容 - 弹框 uploadHistoryVisible: false, // 上传主题历史 - 弹框 uploadTitle: '上传', // 上传-弹框内 - isUploadThemeType: 0, - + isUploadThemeType: 0, // 判断上传-新增还是编辑 uploadForm: { // 上传素材 class_ids: [ // 素材类id集合 @@ -337,6 +336,20 @@ export default { this.addDialogVisible = false this.uploadDialogVisible = false this.searchClassify = [] + // 上传表单重置 + this.selectClassifyList = [] + this.uploadForm.device_direction = 0 + this.uploadForm.deposit_url = null + this.formatType = -1 + this.uploadForm.material_type = null + this.uploadForm.img_path = null + this.materialImgPath = null + this.$nextTick(() => { + this.$refs.uploadMaterial.filePercent = 0 + if (this.$refs.childUpload) { + this.$refs.childUpload.imageUrl = null + } + }) this.$refs[formName].resetFields() }, // list - 多选btn @@ -357,6 +370,7 @@ export default { this.uploadDialogVisible = true this.isUploadThemeType = 0 this.uploadTitle = '新增' + this.uploadForm.device_direction = 0 }, // 编辑 - 上传 editUploadTheme(row) { @@ -381,25 +395,16 @@ export default { this.fileNames = row.material_name this.uploadForm.deposit_url = row.deposit_url - const postfix = row.deposit_url.substring(row.deposit_url.lastIndexOf('.') + 1, row.deposit_url.length) - if (postfix == 'mp3') { - this.formatType = 2 + this.formatType = row.material_type + if (this.formatType != 0) { this.$nextTick(() => { if (this.$refs.childUpload) { this.$refs.childUpload.imageUrl = row.img_path } }) - } else if (postfix == 'mp4') { - this.formatType = 1 - this.$nextTick(() => { - if (this.$refs.childUpload) { - this.$refs.childUpload.imageUrl = row.img_path - } - }) - } else if (postfix == ('jpg' || 'png' || 'gif')) { - this.formatType = 0 + } else { + this.uploadForm.img_path = row.deposit_url } - // this.materialImgPath = row.img_path this.uploadForm.material_type = this.formatType this.uploadForm.duration = row.duration this.uploadForm.file_size = row.file_size @@ -407,8 +412,6 @@ export default { }, // 素材上传完之后 - 获取相关info saveMaterial() { - console.log(this.$refs.uploadMaterial) - console.log(this.$refs.uploadMaterial.uploadFileUrl) const formatType = this.$refs.uploadMaterial.formatType const uploadFileUrl = this.$refs.uploadMaterial.uploadFileUrl // 视频和音频的时长 @@ -461,6 +464,20 @@ export default { }) this.uploadDialogVisible = false this.getThemeHistoryList() + // 上传表单重置 + this.selectClassifyList = [] + this.uploadForm.device_direction = 0 + this.uploadForm.deposit_url = null + this.formatType = -1 + this.uploadForm.material_type = null + this.uploadForm.img_path = null + this.materialImgPath = null + this.$nextTick(() => { + this.$refs.uploadMaterial.filePercent = 0 + if (this.$refs.childUpload) { + this.$refs.childUpload.imageUrl = null + } + }) this.$refs.uploadForm.resetFields() } else { this.$message.error(res.msg) diff --git a/src/views/components/ThemeGalleryList.vue b/src/views/components/ThemeGalleryList.vue index 32243e4..a167724 100644 --- a/src/views/components/ThemeGalleryList.vue +++ b/src/views/components/ThemeGalleryList.vue @@ -10,46 +10,57 @@
-
+
创建文件夹
-
-
- - +
+
+
+ + +
+

{{ item.name }}

+
-

文件夹

-
- +
+ +
- {{ item.type }} - 03:00 + {{ item.deposit_url | getFileFormat }} + {{ item.duration | getSeconds }}
-
{{ item.name }}
- +
{{ item.material_name }}
+
- 即时发布 - 定时发布 - 下载 - 添加到画册 - 移动 - 删除 +
+ 即时发布 + 定时发布 + 下载 + 添加到画册 + 移动 + 删除 +
+
+ 编辑 + 删除 +
+
- + - + - - -
- -
-
+
+
@@ -95,10 +102,20 @@