feat(期刊、曲库): 完善

dev
zjb 10 months ago
parent c85bb45f02
commit 421145e948

@ -0,0 +1 @@
ENV = "ddddd"

@ -13,6 +13,12 @@ export default {
data: data data: data
}); });
}, },
getDetail(id) {
return request({
url: `/luoo-music/cms/journal/${id}`,
method: "get"
});
},
/** /**
* 删除 * 删除
* @param {*} id * @param {*} id
@ -31,8 +37,12 @@ export default {
*/ */
publish(id, type, time) { publish(id, type, time) {
return request({ return request({
url: `/luoo-music/cms/journal/publish/${id}?isScheduled=${type}&state=${time}`, url: `/luoo-music/cms/journal/publish/${id}`,
method: "put" method: "put",
data: {
"isScheduled": type,
"pubTime": time
}
}); });
}, },
/** /**
@ -43,8 +53,9 @@ export default {
*/ */
updateStatus(id, state) { updateStatus(id, state) {
return request({ return request({
url: `/luoo-music/cms/journal/publish/${id}?state=${state}`, url: `/luoo-music/cms/journal/update/state/${id}`,
method: "put" method: "put",
data: state
}); });
}, },
/** /**

@ -1,8 +1,14 @@
/*
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-02 21:12:35
*/
import request from '@/utils/request' import request from '@/utils/request'
export function login(username, password) { export function login(username, password) {
return request({ return request({
url: '/user/admin/login', url: '/user/cms/admin/login',
method: 'post', method: 'post',
data: { data: {
username, username,
@ -13,7 +19,7 @@ export function login(username, password) {
export function getInfo(token) { export function getInfo(token) {
return request({ return request({
url: '/user/admin/info', url: '/user/cms/admin/info',
method: 'get', method: 'get',
params: { token } params: { token }
}) })
@ -21,7 +27,7 @@ export function getInfo(token) {
export function logout() { export function logout() {
return request({ return request({
url: '/user/admin/logout', url: '/user/cms/admin/logout',
method: 'post' method: 'post'
}) })
} }

@ -15,24 +15,45 @@ export default {
}, },
getByKeyword(keyword) { getByKeyword(keyword) {
return request({ return request({
url: `/luoo-music/cms/song/search/1/999`, url: `/luoo-music/cms/song/search/1/99`,
method: "post", method: "post",
data: { keyword: keyword } data: { keyword: keyword }
}); });
}, },
updateLyric(id, lyric) { getById(id) {
return request({ return request({
url: `/luoo-music/cms/song/update/lyric/${id}`, url: `/luoo-music/cms/song/${id}`,
method: "get"
})
},
updateInfo(id, data) {
return request({
url: `/luoo-music/cms/song/${id}`,
method: "put", method: "put",
params: { data,
lyric })
} },
getLyric(id) {
return request({
url: `/luoo-music/cms/song/lyric/${id}`,
method: "get"
})
},
updateLyric(id, lyric) {
const url = `/luoo-music/cms/song/update/lyric/${id}`;
return request.put(url, lyric, {
headers: {
'Content-Type': 'application/json',
// 可以添加其他需要的请求头
},
}); });
}, },
updateState(id, state) { updateState(id, state) {
return request({ return request({
url: `/luoo-music/cms/song/update/state/${id}?state=${state}`, url: `/luoo-music/cms/song/update/state/${id}`,
method: "put" method: "put",
data:state
}); });
}, },
delete(id) { delete(id) {

@ -1,3 +1,9 @@
<!--
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-02 21:12:35
-->
<template> <template>
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
@ -29,7 +35,7 @@ export default {
let matched = this.$route.matched.filter(item => item.name) let matched = this.$route.matched.filter(item => item.name)
const first = matched[0] const first = matched[0]
if (first && first.name !== 'dashboard') { if (first && first.name !== 'dashboard') {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
} }
this.levelList = matched this.levelList = matched
} }

@ -1,8 +1,8 @@
/* /*
* @Author: zhangjiabao * @Author: zhangjiabao
* @Date: 2024-01-25 11:05:17 * @Date: 2024-01-25 11:05:17
* @LastEditors: zhangjiabao * @LastEditors: Please set LastEditors
* @LastEditTime: 2024-01-25 18:01:54 * @LastEditTime: 2024-01-28 19:06:17
* @FilePath: /luoo_manage_fe/src/router/index.js * @FilePath: /luoo_manage_fe/src/router/index.js
*/ */
import Vue from "vue"; import Vue from "vue";
@ -50,38 +50,175 @@ export const constantRouterMap = [
] ]
}, },
{ {
path: "/tag", path: "/mainPage",
component: Layout, component: Layout,
redirect: "/mainPage/article",
name: "MainPage",
meta: { title: "首页", icon: "example" },
children: [ children: [
{ {
path: "index", path: "article",
name: "Form", name: "ArticlePublish",
component: () => import("@/views/tag/index"), component: () => import("@/views/common/unfinished"),
meta: { title: "标签管理", icon: "tag" } meta: { title: "期刊发布" }
},
{
path: "user",
name: "UserList",
component: () => import("@/views/common/unfinished"),
meta: { title: "用户列表" }
} }
] ]
}, },
{ {
path: "/song", path: "/article",
component: Layout, component: Layout,
meta: { title: "期刊管理", icon: "artical" },
children: [ children: [
{ {
path: "index", path: "index",
name: "Form", name: "ArticleIndex",
component: () => import("@/views/article"),
meta: { title: "期刊列表" }
}
]
},
{
path: "/userManage",
component: Layout,
redirect: "/userManage/list",
name: "UserManage",
meta: { title: "用户管理", icon: "user" },
children: [
{
path: "list",
name: "UserManageList",
component: () => import("@/views/common/unfinished"),
meta: { title: "用户列表" }
},
{
path: "sign",
name: "UserSign",
component: () => import("@/views/common/unfinished"),
meta: { title: "用户标识设置" }
}
]
},
{
path: "/songLibrary",
component: Layout,
redirect: "/songLibrary/list",
name: "SongLibraryManage",
meta: { title: "曲库管理", icon: "music" },
children: [
{
path: "list",
name: "Song",
component: () => import("@/views/song/index"), component: () => import("@/views/song/index"),
meta: { title: "曲库管理", icon: "music" } meta: { title: "歌曲管理" }
},
{
path: "tag",
name: "Tag",
component: () => import("@/views/tag/index"),
meta: { title: "标签管理" }
},
{
path: "style",
name: "Style",
component: () => import("@/views/common/unfinished"),
meta: { title: "风格管理" }
} }
] ]
}, },
{ {
path: "/article", path: "/contentManage",
component: Layout, component: Layout,
redirect: "/contentManage/article",
name: "ContentManage",
meta: { title: "内容管理", icon: "form" },
children: [ children: [
{ {
path: "index", path: "article",
name: "Form", name: "ContentArticle",
component: () => import("@/views/article"), component: () => import("@/views/common/unfinished"),
meta: { title: "期刊管理", icon: "artical" } meta: { title: "文章列表" }
},
{
path: "comment",
name: "Comment",
component: () => import("@/views/common/unfinished"),
meta: { title: "评论管理" }
},
{
path: "commentCall",
name: "CommentCall",
component: () => import("@/views/common/unfinished"),
meta: { title: "评论举报" }
},
{
path: "ad",
name: "Ad",
component: () => import("@/views/common/unfinished"),
meta: { title: "广告管理" }
}
]
},
{
path: "/backManage",
component: Layout,
redirect: "/backManage/user",
name: "BackManage",
meta: { title: "后台管理", icon: "tree" },
children: [
{
path: "user",
name: "BmUser",
component: () => import("@/views/common/unfinished"),
meta: { title: "后台用户" }
},
{
path: "role",
name: "Role",
component: () => import("@/views/common/unfinished"),
meta: { title: "角色管理" }
},
{
path: "fWord",
name: "FWord",
component: () => import("@/views/common/unfinished"),
meta: { title: "屏蔽词设置" }
},
{
path: "message",
name: "message",
component: () => import("@/views/common/unfinished"),
meta: { title: "消息设置" }
},
{
path: "advance",
name: "advance",
component: () => import("@/views/common/unfinished"),
meta: { title: "意见反馈" }
},
{
path: "log",
name: "log",
component: () => import("@/views/common/unfinished"),
meta: { title: "日志管理" }
},
{
path: "xy",
name: "xy",
component: () => import("@/views/common/unfinished"),
meta: { title: "协议管理" }
},
{
path: "domain",
name: "domain",
component: () => import("@/views/common/unfinished"),
meta: { title: "域名管理" }
} }
] ]
}, },

@ -1,3 +1,9 @@
/*
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-02 21:12:35
*/
import { login, logout, getInfo } from '@/api/login' import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
@ -31,8 +37,8 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, userInfo.password).then(response => { login(username, userInfo.password).then(response => {
const data = response.data const data = response.data
setToken(data.token) setToken("Bearer " + data.token)
commit('SET_TOKEN', data.token) commit('SET_TOKEN', "Bearer " + data.token)
resolve() resolve()
}).catch(error => { }).catch(error => {
reject(error) reject(error)

@ -1,4 +1,4 @@
//sidebar //sidebar
$menuBg:#304156; $menuBg:#222325;
$subMenuBg:#1f2d3d; $subMenuBg:#2c2d2f;
$menuHover:#001528; $menuHover:#38393a;

@ -19,6 +19,7 @@ const service = axios.create({
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
if (store.getters.token) { if (store.getters.token) {
config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['Admin-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
} }
return config return config
}, error => { }, error => {

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zhangjiabao * @Author: zhangjiabao
* @Date: 2024-01-24 10:09:33 * @Date: 2024-01-24 10:09:33
* @LastEditors: zhangjiabao * @LastEditors: Please set LastEditors
* @LastEditTime: 2024-01-26 10:14:39 * @LastEditTime: 2024-01-28 18:13:03
* @FilePath: /luoo_manage_fe/src/views/article/articleModify.vue * @FilePath: /luoo_manage_fe/src/views/article/articleModify.vue
--> -->
<!-- <!--
@ -22,16 +22,16 @@
label-suffix=":" label-suffix=":"
label-width="100px" label-width="100px"
> >
<el-form-item prop="number" label="期刊编号"> <el-form-item prop="journalNo" label="期刊编号">
<el-input <el-input
v-model="data.number" v-model="data.journalNo"
size="small" size="small"
placeholder="期刊编号" placeholder="期刊编号"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="name" label="期刊标题"> <el-form-item prop="title" label="期刊标题">
<el-input <el-input
v-model="data.name" v-model="data.title"
size="small" size="small"
placeholder="请输入期刊标题" placeholder="请输入期刊标题"
></el-input> ></el-input>
@ -48,7 +48,7 @@
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="userId" label="期刊作者"> <el-form-item prop="userId" label="期刊作者">
<el-select placeholder="选择发布人" size="small" v-model="data.userId"> <el-select placeholder="输入发布人名称" size="small" v-model="data.userId">
<el-option <el-option
v-for="item in publisher" v-for="item in publisher"
:label="item.name" :label="item.name"
@ -57,17 +57,14 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="coverPhoto" label="上传封面"> <el-form-item prop="image" label="上传封面">
<img <img style="width: 170px;height: 120px;" :src="data.image" />
style="width: 170px;height: 120px;"
v-if="data.coverPhoto"
:src="data.coverPhoto"
/>
<el-upload <el-upload
action="https://jsonplaceholder.typicode.com/posts/" action="/luoo-music/cms/journal/upload/image"
:on-preview="handlePreview" :on-preview="handlePreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:on-change="handleUploadArticleImageSuccess"
multiple multiple
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
@ -86,11 +83,27 @@
</el-form-item> </el-form-item>
<el-form-item label="期刊音乐" prop="songs"> <el-form-item label="期刊音乐" prop="songs">
<el-row> <el-row>
<el-col :span="4" <el-col :span="4">
><el-button plain size="small" type="primary" icon="el-icon-plus" <el-upload
>上传歌曲</el-button action="/luoo-music/cms/song/batch"
></el-col :on-preview="handlePreview"
> :on-remove="handleRemove"
:before-remove="beforeRemove"
:on-change="handleUploadSongSuccess"
multiple
:limit="1"
:on-exceed="handleExceed"
:file-list="songUploadFileList"
>
<el-button
plain
size="small"
type="primary"
icon="el-icon-circle-plus-outline"
>上传歌曲</el-button
>
</el-upload>
</el-col>
<el-col :span="4" <el-col :span="4"
><el-button ><el-button
plain plain
@ -106,7 +119,7 @@
</el-form> </el-form>
<el-table <el-table
size="mini" size="mini"
:data="data.songs" :data="!data.songs ? [] : data.songs"
style="width: calc(50% + 400px); margin: 0 0 auto auto;" style="width: calc(50% + 400px); margin: 0 0 auto auto;"
stripe stripe
class="draggable-table" class="draggable-table"
@ -121,12 +134,12 @@
<i class="el-icon-sort"></i> <i class="el-icon-sort"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="picture" label="专辑封面" width="100px"> <el-table-column prop="image" label="专辑封面" width="100px">
<template slot-scope="slot"> <template slot-scope="slot">
<img <img
style="width: 50;height: 50px;" style="width: 50;height: 50px;"
v-if="slot.row.picture" v-if="slot.row.image"
:src="slot.row.picture" :src="slot.row.image"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -173,7 +186,7 @@
<el-form-item prop="volid" label="期刊文案"> <el-form-item prop="volid" label="期刊文案">
<quill-editor <quill-editor
ref="text" ref="text"
v-model="data.summary" v-model="data.content"
style="height: 500px;" style="height: 500px;"
class="myQuillEditor" class="myQuillEditor"
:options="editorOption" :options="editorOption"
@ -189,7 +202,9 @@
append-to-body append-to-body
:before-close="handleLyricDialogBeforeClose" :before-close="handleLyricDialogBeforeClose"
> >
<el-input type="textarea" v-model="lyricDialog.data"></el-input> <div v-loading="lyricDialog.loading">
<el-input type="textarea" v-model="lyricDialog.data"></el-input>
</div>
<span slot="footer"> <span slot="footer">
<el-button size="small" type="primary" @click="handleLyricDialogSubmit" <el-button size="small" type="primary" @click="handleLyricDialogSubmit"
>保存</el-button >保存</el-button
@ -263,7 +278,7 @@
<el-button size="small" type="primary" @click="handleMusicDialogSubmit" <el-button size="small" type="primary" @click="handleMusicDialogSubmit"
>保存</el-button >保存</el-button
> >
<el-button size="small" @click="handleMusicDialogCancel" <el-button size="small" @click="musicDialog.visible = false"
>取消</el-button >取消</el-button
> >
</span> </span>
@ -281,8 +296,12 @@
:data="musicModifyDialog.data" :data="musicModifyDialog.data"
></MusicModify> ></MusicModify>
<span slot="footer"> <span slot="footer">
<el-button size="small" type="primary">保存</el-button> <el-button size="small" type="primary" @click="onSaveMusicInfo"
<el-button size="small">取消</el-button> >保存</el-button
>
<el-button size="small" @click="musicModifyDialog.visible = false"
>取消</el-button
>
</span></el-dialog </span></el-dialog
> >
</div> </div>
@ -303,12 +322,15 @@ export default {
type: Object, type: Object,
default: { default: {
id: null, id: null,
name: null, title: null,
tag: [], tag: [],
number: null, journalNo: null,
userId: null, userId: null,
coverPhoto: null, image: null,
songs: [] songs: [],
size: 0,
content: "",
duration: 0
} }
}, },
remoteTagList: { remoteTagList: {
@ -341,6 +363,7 @@ export default {
data: {} data: {}
}, },
coverUploadFileList: [], coverUploadFileList: [],
songUploadFileList: [],
// editorOption // editorOption
// action: '/api/product/richtext_img_upload.do', // // action: '/api/product/richtext_img_upload.do', //
// methods: 'post', // // methods: 'post', //
@ -350,17 +373,15 @@ export default {
// accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' // // accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' //
editorOption: {}, editorOption: {},
rules: { rules: {
number: [ journalNo: [
{ required: true, message: "请输入期刊编号", trigger: "blur" } { required: true, message: "请输入期刊编号", trigger: "blur" }
], ],
name: [{ required: true, message: "请输入期刊标题", trigger: "blur" }], title: [{ required: true, message: "请输入期刊标题", trigger: "blur" }],
tag: [{ required: true, message: "请选择期刊标签", trigger: "change" }], tag: [{ required: true, message: "请选择期刊标签", trigger: "change" }],
userId: [ userId: [
{ required: true, message: "请选择期刊作者", trigger: "blur" } { required: true, message: "请选择期刊作者", trigger: "blur" }
], ],
coverPhoto: [ image: [{ required: true, message: "请上传封面", trigger: "change" }],
{ required: true, message: "请上传封面", trigger: "change" }
],
songs: [{ required: true, message: "请选择音乐", trigger: "change" }] songs: [{ required: true, message: "请选择音乐", trigger: "change" }]
} }
}; };
@ -399,6 +420,9 @@ export default {
for (let j in this.remoteTagList) { for (let j in this.remoteTagList) {
let jId = this.remoteTagList[j].value; let jId = this.remoteTagList[j].value;
if(tag === jId){
this.selectTag.push([jId])
}
for (let k in this.remoteTagList[j].children) { for (let k in this.remoteTagList[j].children) {
let kId = this.remoteTagList[j].children[k].value; let kId = this.remoteTagList[j].children[k].value;
if (tag === this.remoteTagList[j].children[k].value) { if (tag === this.remoteTagList[j].children[k].value) {
@ -420,52 +444,20 @@ export default {
this.data.tag = newTag; this.data.tag = newTag;
}, },
queryFromMusicLibrary(keyword) { queryFromMusicLibrary(keyword) {
// musicApi.getByKeyword(keyword).then(res => { if (!keyword || keyword === "") {
// if (res.code === 200) { this.musicDialog.remoteResult = [];
// this.musicDialog.remoteResult = res.data;
// } else {
// this.musicDialog.remoteResult = [];
// }
// });
this.musicDialog.selectLoading = true;
setTimeout(() => {
let musicList = [
{
album: "范特西",
artist: "周杰伦",
duration: "1h30min",
id: "1",
journal: [1, 2, 3],
lyric: "lllll llll lll",
name: "双节棍",
picture: "https://luoow.wxwenku.com/999/cover_min.jpg",
size: "1.3m",
state: "1",
tags: [3, 5, 11],
updateTime: "2023-01-01",
url: "https://luoow.wxwenku.com/999/03._Du_und_ich_Klee.mp3",
userId: "1"
},
{
album: "范特西1",
artist: "周杰伦1",
duration: "1h30min",
id: "2",
journal: [1, 2, 3],
lyric: "lllll llll lll",
name: "双节棍1",
picture: "https://luoow.wxwenku.com/999/cover_min.jpg",
size: "1.3m",
state: "1",
tags: [3, 5, 11],
updateTime: "2023-01-01",
url: "https://luoow.wxwenku.com/999/03._Du_und_ich_Klee.mp3",
userId: "1"
}
];
this.musicDialog.remoteResult = musicList;
this.musicDialog.selectLoading = false; this.musicDialog.selectLoading = false;
}, 1000); }
this.musicDialog.selectLoading = true;
musicApi.getList({ keyword, state: 1 }, 1, 50).then(res => {
if (res.code === 200) {
this.musicDialog.remoteResult = res.data.rows;
this.musicDialog.selectLoading = false;
} else {
this.musicDialog.remoteResult = [];
this.musicDialog.selectLoading = false;
}
});
}, },
handleMusicLibrarySelectChange(val) { handleMusicLibrarySelectChange(val) {
for (let i in this.musicDialog.tableData) { for (let i in this.musicDialog.tableData) {
@ -503,6 +495,19 @@ export default {
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleUploadArticleImageSuccess(response, file, fileList) {
if (response.status === "success") {
this.$message.success("上传成功");
this.data.image = response.response.data["fullUrl"];
this.data.size = response.response.data["size"];
this.data.duration = response.response.data["duration"];
}
},
handleUploadSongSuccess(response, file, fileList) {
if (response.status === "success") {
this.$message.success("上传成功");
}
},
// ************************* ************************* // ************************* *************************
/** /**
* 曲库添加按扭点击事件 * 曲库添加按扭点击事件
@ -547,32 +552,23 @@ export default {
* 弹窗提交按扭点击事件 * 弹窗提交按扭点击事件
*/ */
handleLyricDialogSubmit() { handleLyricDialogSubmit() {
// musicApi musicApi
// .updateLyric(this.lyricDialog.songId, this.lyricDialog.data) .updateLyric(this.lyricDialog.songId, this.lyricDialog.data)
// .then(res => { .then(res => {
// if (res.code === 200) { if (res.code === 200) {
// for (let sIndex in this.data.songs) { for (let sIndex in this.data.songs) {
// if (this.data.songs[sIndex].id === this.lyricDialog.songId) { if (this.data.songs[sIndex].id === this.lyricDialog.songId) {
// this.data.songs[sIndex].lyric = this.lyricDialog.data; this.data.songs[sIndex].lyric = this.lyricDialog.data;
// } }
// break; break;
// } }
// this.lyricDialog.data = ""; this.lyricDialog.data = "";
// this.lyricDialog.songId = null; this.lyricDialog.songId = null;
// this.lyricDialog.visible = false; this.lyricDialog.visible = false;
// } else { } else {
// this.$message.error(res.message); this.$message.error(res.message);
// } }
// }); });
for (let sIndex in this.data.songs) {
if (this.data.songs[sIndex].id === this.lyricDialog.songId) {
this.data.songs[sIndex].lyric = this.lyricDialog.data;
}
break;
}
this.lyricDialog.data = "";
this.lyricDialog.songId = null;
this.lyricDialog.visible = false;
}, },
/** /**
* 弹窗取消按扭点击事件 * 弹窗取消按扭点击事件
@ -587,8 +583,12 @@ export default {
*/ */
handleLyricClick(row) { handleLyricClick(row) {
this.lyricDialog.songId = row.id; this.lyricDialog.songId = row.id;
this.lyricDialog.data = row.lyric;
this.lyricDialog.visible = true; this.lyricDialog.visible = true;
this.lyricDialog.loading = true;
musicApi.getLyric(row.id).then(res => {
this.lyricDialog.data = res.data.lyric;
this.lyricDialog.loading = false;
})
}, },
/** /**
* 弹窗关闭按扭点击事件 * 弹窗关闭按扭点击事件
@ -619,12 +619,38 @@ export default {
} }
this.musicDialog.visible = false; this.musicDialog.visible = false;
}, },
/** onSaveMusicInfo() {
* 弹窗取消按扭点击事件 let oldInfo = this.musicModifyDialog.data;
*/ let newInfo = {
handleMusicDialogCancel() { album: oldInfo["album"],
this.$message.success("music cancel"); artist: oldInfo["artist"],
this.musicDialog.visible = false; image: oldInfo["image"],
name: oldInfo["name"],
tags: oldInfo["tags"],
url: oldInfo["url"],
size: oldInfo["size"],
duration: oldInfo["duration"]
};
musicApi.updateInfo(oldInfo["id"], newInfo).then(res => {
if (res.code === 200) {
this.$message.success("保存成功");
musicApi.getById(oldInfo.id).then(newQueryRes => {
if (newQueryRes.data === 200) {
for (let songIndex in this.data.songs) {
if (this.data.songs[songIndex].id === newQueryRes.data.id) {
this.data.songs[songIndex] = newQueryRes.data;
}
}
console.log("更新表格数据完成")
} else {
this.message.$error(newQueryRes.message);
}
});
this.musicModifyDialog.visible = false;
} else {
this.$message.error(res.message);
}
});
}, },
/** /**
* 弹窗关闭按扭点击事件 * 弹窗关闭按扭点击事件

@ -49,8 +49,13 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-input
placeholder="选择发布人" placeholder="输入发布人名称"
size="medium"
v-model="queryForm.data.creatorId"
></el-input>
<!-- <el-select
placeholder="输入发布人名称"
size="medium" size="medium"
v-model="queryForm.data.creatorId" v-model="queryForm.data.creatorId"
> >
@ -60,7 +65,7 @@
:value="item.id" :value="item.id"
:key="item.id" :key="item.id"
></el-option> ></el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-date-picker <el-date-picker
@ -122,13 +127,8 @@
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="期刊编号"> <el-table-column label="期刊编号" prop="journalNo"></el-table-column>
<template slot-scope="scope"> <el-table-column label="期刊标题" prop="title"></el-table-column>
<span>VOL.</span>
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column label="期刊标题" prop="name"></el-table-column>
<el-table-column label="风格标签"> <el-table-column label="风格标签">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getTagNameById(scope.row.tag) }}</span> <span>{{ getTagNameById(scope.row.tag) }}</span>
@ -137,19 +137,15 @@
<el-table-column label="歌曲数" prop="songCount"></el-table-column> <el-table-column label="歌曲数" prop="songCount"></el-table-column>
<el-table-column <el-table-column
label="播放次数" label="播放次数"
prop="playCount" prop="visits"
v-if="activateTab === 1" v-if="activateTab === 1"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="评论数" label="评论数"
prop="commentCount" prop="comment"
v-if="activateTab === 1" v-if="activateTab === 1"
></el-table-column> ></el-table-column>
<el-table-column label="期刊作者"> <el-table-column label="期刊作者" prop="userName"></el-table-column>
<template slot-scope="scope">
<span>{{ getAuthorNameById(scope.row.userId) }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime"></el-table-column> <el-table-column label="创建时间" prop="createTime"></el-table-column>
<el-table-column <el-table-column
label="待发布时间" label="待发布时间"
@ -219,13 +215,14 @@
<el-dialog <el-dialog
:title="['新建期刊', '编辑期刊', '详情'][modifyDialog.type]" :title="['新建期刊', '编辑期刊', '详情'][modifyDialog.type]"
class="popup-dialog" class="popup-dialog"
:visible="modifyDialog.visible" :visible="true"
v-if="modifyDialog.visible" v-if="modifyDialog.visible"
width="80%" width="80%"
top="60px" top="60px"
:before-close="handleModifyDialogBeforeClose" :before-close="handleModifyDialogBeforeClose"
> >
<div <div
v-loading="modifyDialog.loading"
style="height: 70vh;overflow: auto;padding-left:20px;padding-right:20px" style="height: 70vh;overflow: auto;padding-left:20px;padding-right:20px"
> >
<ArticleModify <ArticleModify
@ -363,6 +360,7 @@ export default {
// //
modifyDialog: { modifyDialog: {
visible: false, visible: false,
loading: true,
type: 0, // 0for 1for 2for type: 0, // 0for 1for 2for
data: {} // data: {} //
}, },
@ -402,8 +400,8 @@ export default {
end: "", end: "",
keyword: param.name, keyword: param.name,
start: "", start: "",
tab: this.activateTab, tab: this.activateTab + "",
tags: [], tags: param.tags,
userId: param.creatorId userId: param.creatorId
}; };
@ -418,65 +416,17 @@ export default {
} }
this.table.loading = true; this.table.loading = true;
this.table.data = []; this.table.data = [];
// articleApi articleApi
// .getList(queryParam, this.table.page.current, this.table.page.size) .getList(queryParam, this.table.page.current, this.table.page.size)
// .then(res => { .then(res => {
// if(res.code === 200){ if (res.code === 200) {
// this.table.data = res.data.rows; this.table.data = res.data.rows;
// this.table.page.total = res.data.total; this.table.page.total = res.data.total;
// }else{ } else {
// this.$message.error(res.message) this.$message.error(res.message);
// } }
// this.table.loading = false; this.table.loading = false;
// }); });
let res = {
code: 200,
data: {
rows: [
{
commentCount: 0,
coverPhoto: "https://luoow.wxwenku.com/999/cover_min.jpg",
createTime: "2023-01-01",
id: "1",
name: "期刊名称",
number: "742",
playCount: 1,
pubTime: "2023-01-01",
songCount: 1,
songs: [
{
album: "范特西",
artist: "周杰伦",
duration: "1h30min",
id: "1",
journal: [1, 2, 3],
lyric: "lllll llll lll",
name: "双节棍",
picture: "https://luoow.wxwenku.com/999/cover_min.jpg",
size: "1.3m",
state: "1",
tags: [3, 5, 11],
updateTime: "2023-01-01",
url: "https://luoow.wxwenku.com/999/03._Du_und_ich_Klee.mp3",
userId: "1627863701048659968"
}
],
state: "1",
status: "1",
summary: "领军 \n 灵精了",
tag: [1, 3, 5, 11],
userId: "1627863701048659968"
}
],
total: 0
},
message: ""
};
setTimeout(() => {
this.table.data = res.data.rows;
this.table.page.total = res.data.total;
this.table.loading = false;
}, 1000);
}, },
/** /**
* 创建人下拉框 * 创建人下拉框
@ -494,42 +444,22 @@ export default {
* 高级筛选tag * 高级筛选tag
*/ */
fetchSuperFilterTags() { fetchSuperFilterTags() {
// tagApi.queryHierarchical().then(res => { tagApi.queryHierarchical().then(res => {
// console.log(res) let newList = [];
// }) for (let index in res.data) {
let res = [ let item = res.data[index];
{ let newItem = { value: item.id, label: item.nameCh, children: [] };
id: 1, for (let childrenIndex in item.children) {
nameCh: "语言类型", let childrenItem = item.children[childrenIndex];
children: [ newItem.children.push({
{ id: 3, nameCh: "中文" }, value: childrenItem.id,
{ id: 4, nameCh: "日文" }, label: childrenItem.nameCh
{ id: 5, nameCh: "英文" } });
] }
}, newList.push(newItem);
{
id: 10,
nameCh: "期刊标签",
children: [
{ id: 11, nameCh: "民谣" },
{ id: 12, nameCh: "摇滚" }
]
}
];
let newList = [];
for (let index in res) {
let item = res[index];
let newItem = { value: item.id, label: item.nameCh, children: [] };
for (let childrenIndex in item.children) {
let childrenItem = item.children[childrenIndex];
newItem.children.push({
value: childrenItem.id,
label: childrenItem.nameCh
});
} }
newList.push(newItem); this.queryForm.remoteData.superFilterTags = newList;
} });
this.queryForm.remoteData.superFilterTags = newList;
}, },
// ************************* ************************* // ************************* *************************
getAuthorNameById(userId) { getAuthorNameById(userId) {
@ -542,6 +472,9 @@ export default {
} }
}, },
getTagNameById(tagIdList) { getTagNameById(tagIdList) {
if (!tagIdList || typeof exp == "undefined") {
return "";
}
let tagList = []; let tagList = [];
for (let tagIdIndex in tagIdList) { for (let tagIdIndex in tagIdList) {
let tagId = tagIdList[tagIdIndex]; let tagId = tagIdList[tagIdIndex];
@ -604,9 +537,7 @@ export default {
tags.push(val[i].value); tags.push(val[i].value);
} }
let queryParam = { let queryParam = {
name: null, tab: this.activateTab,
creatorId: null,
timeRange: [],
tags: tags tags: tags
}; };
this.fetchData(queryParam); this.fetchData(queryParam);
@ -619,24 +550,35 @@ export default {
handleAddClick() { handleAddClick() {
let newData = { let newData = {
id: null, id: null,
name: null, title: null,
tag: [], tag: [],
number: null, journalNo: null,
userId: null, userId: null,
coverPhoto: null, image: null,
songs: [] songs: []
}; };
this.modifyDialog.data = newData; this.modifyDialog.data = newData;
this.modifyDialog.type = 0; this.modifyDialog.type = 0;
this.modifyDialog.visible = true; this.modifyDialog.visible = true;
this.modifyDialog.loading = false;
}, },
/** /**
* 编辑标签点击事件 * 编辑标签点击事件
*/ */
handleModifyClick(row) { handleModifyClick(row) {
this.modifyDialog.data = JSON.parse(JSON.stringify(row));
this.modifyDialog.type = 1;
this.modifyDialog.visible = true; this.modifyDialog.visible = true;
this.modifyDialog.loading = true;
articleApi.getDetail(row.id).then(res => {
if (res.code === 200) {
this.modifyDialog.data = JSON.parse(JSON.stringify(res.data));
this.modifyDialog.type = 1;
this.modifyDialog.loading = false;
} else {
this.modifyDialog.visible = false;
this.modifyDialog.loading = false;
this.$message.error(res.message);
}
});
}, },
/** /**
* 发布点击事件 * 发布点击事件
@ -685,13 +627,31 @@ export default {
* 弹窗确定按扭点击事件 * 弹窗确定按扭点击事件
*/ */
handleDialogSubmit() { handleDialogSubmit() {
debugger;
this.$refs.modifyDialog.$refs.modifyDialogForm.validate(valid => { this.$refs.modifyDialog.$refs.modifyDialogForm.validate(valid => {
if (valid) { if (valid) {
let orgData = this.$refs.modifyDialog.data;
let param = {
id: orgData["id"],
content: orgData["content"],
image: orgData["image"],
journalNo: orgData["journalNo"],
songs: [],
tag: orgData["tag"],
title: orgData["title"],
userId: orgData["userId"]
};
let newMusicIdList = [];
if (orgData.songs) {
for (let i in orgData.songs) {
newMusicIdList.push(orgData.songs[i].id);
}
}
param.songs = newMusicIdList;
console.log(param);
// //
if (this.modifyDialog.type === 0) { if (this.modifyDialog.type === 0) {
console.log(this.$refs.modifyDialog.data); articleApi.add(param).then(res => {
articleApi.add(this.$refs.modifyDialog.data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.modifyDialog.visible = false; this.modifyDialog.visible = false;
@ -703,27 +663,20 @@ export default {
this.$message.error(res.message); this.$message.error(res.message);
} }
}); });
console.log("编辑"); console.log("新增");
return; return;
} }
// //
if (this.modifyDialog.type === 1) { if (this.modifyDialog.type === 1) {
console.log(this.$refs.modifyDialog.data); articleApi.update(param.id, param).then(res => {
articleApi if (res.code === 200) {
.update( this.$message.success(res.message);
this.$refs.modifyDialog.data.id, this.modifyDialog.visible = false;
this.$refs.modifyDialog.data this.fetchData(this.queryForm.lastQuery);
) } else {
.then(res => { this.$message.error(res.message);
if (res.code === 200) { }
this.$message.success(res.message); });
this.modifyDialog.visible = false;
this.fetchData(this.queryForm.lastQuery);
} else {
this.$message.error(res.message);
}
});
console.log("编辑"); console.log("编辑");
return; return;
} }

@ -0,0 +1,30 @@
<!--
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-28 19:04:19
-->
<template>
<div class="under-construction">
<h1>页面正在建设中</h1>
<p>抱歉这个页面还没有完成开发</p>
<p>请稍后再回来查看感谢您的理解</p>
</div>
</template>
<style>
.under-construction {
text-align: center;
margin: 50px;
}
.under-construction h1 {
font-size: 24px;
color: #333;
}
.under-construction p {
font-size: 16px;
color: #666;
}
</style>

@ -8,7 +8,7 @@
<div class="menu-wrapper"> <div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children"> <template v-for="item in routes" v-if="!item.hidden&&item.children">
<router-link v-if="item.children.length===1 && !item.children[0].children && !item.alwaysShow" :to="item.path+'/'+item.children[0].path" :key="item.children[0].name"> <router-link v-if="item.children.length===0 && !item.children[0].children && !item.alwaysShow" :to="item.path+'/'+item.children[0].path" :key="item.children[0].name">
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon> <svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon>
<span v-if="item.children[0].meta&&item.children[0].meta.title">{{item.children[0].meta.title}}</span> <span v-if="item.children[0].meta&&item.children[0].meta.title">{{item.children[0].meta.title}}</span>

File diff suppressed because one or more lines are too long

@ -21,8 +21,9 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-input v-model="queryForm.data.creatorId" placeholder="输入发布人名称" size="medium"></el-input>
placeholder="选择发布人" <!-- <el-select
placeholder="输入发布人名称"
size="medium" size="medium"
v-model="queryForm.data.creatorId" v-model="queryForm.data.creatorId"
> >
@ -32,7 +33,7 @@
:value="item.id" :value="item.id"
:key="item.id" :key="item.id"
></el-option> ></el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-date-picker <el-date-picker
@ -71,19 +72,14 @@
</el-form> </el-form>
<el-form :inline="true" class="in-card-form"> <el-form :inline="true" class="in-card-form">
<el-form-item> <el-form-item>
<el-button icon="el-icon-upload" type="primary" size="small" <el-button
icon="el-icon-upload"
type="primary"
size="small"
@click="uploadDialog.visible = true"
>上传</el-button >上传</el-button
> >
</el-form-item> </el-form-item>
<el-form-item>
<el-button icon="el-icon-upload2" size="small">批量上传</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-download" size="small">下载</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-delete" size="small">删除</el-button>
</el-form-item>
</el-form> </el-form>
<!-- 表格 --> <!-- 表格 -->
<el-table <el-table
@ -105,13 +101,6 @@
<span>{{ scope.row.name }}</span> <span>{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="">
<template slot-scope="scope">
<el-button style="padding: 0px;" type="text" icon="el-icon-download"
>下载</el-button
>
</template>
</el-table-column>
<el-table-column prop="artist" label="歌手/乐队"></el-table-column> <el-table-column prop="artist" label="歌手/乐队"></el-table-column>
<el-table-column prop="album" label="所属专辑"></el-table-column> <el-table-column prop="album" label="所属专辑"></el-table-column>
<el-table-column label="歌曲风格"> <el-table-column label="歌曲风格">
@ -119,12 +108,12 @@
<span>{{ getTagNameById(scope.row.tags) }}</span> <span>{{ getTagNameById(scope.row.tags) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="picture" label="专辑封面" width="100px"> <el-table-column prop="image" label="专辑封面" width="100px">
<template slot-scope="slot"> <template slot-scope="slot">
<img <img
style="width: 50;height: 50px;" style="width: 50;height: 50px;"
v-if="slot.row.picture" v-if="slot.row.image"
:src="slot.row.picture" :src="slot.row.image"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -146,8 +135,8 @@
v-model="scope.row.state" v-model="scope.row.state"
active-color="#13ce66" active-color="#13ce66"
@change="handleTableRowStatusChange($event, scope.row)" @change="handleTableRowStatusChange($event, scope.row)"
:active-value="1" :active-value="'1'"
:inactive-value="0" :inactive-value="'0'"
size="mini" size="mini"
></el-switch> ></el-switch>
</template> </template>
@ -167,7 +156,12 @@
size="mini" size="mini"
>编辑</el-button >编辑</el-button
> >
<el-button plain icon="el-icon-success" type="success" size="mini" <el-button
plain
icon="el-icon-success"
type="success"
size="mini"
@click="handleLyricClick(scope.row)"
>歌词</el-button >歌词</el-button
> >
<el-popconfirm <el-popconfirm
@ -234,10 +228,68 @@
:data="musicModifyDialog.data" :data="musicModifyDialog.data"
></MusicModify> ></MusicModify>
<span slot="footer"> <span slot="footer">
<el-button size="small" type="primary">保存</el-button> <el-button @click="handleMusicModifySave" size="small" type="primary"
<el-button size="small">取消</el-button> >保存</el-button
>
<el-button @click="handleMusicModifyClose" size="small">取消</el-button>
</span></el-dialog </span></el-dialog
> >
<el-dialog
title="歌词"
:visible="true"
v-if="lyricDialog.visible"
width="40%"
top="60px"
append-to-body
:before-close="handleLyricDialogBeforeClose"
>
<div v-loading="lyricDialog.loading">
<el-input type="textarea" v-model="lyricDialog.data"></el-input>
</div>
<span slot="footer">
<el-button size="small" type="primary" @click="handleLyricDialogSubmit"
>保存</el-button
>
<el-button size="small" @click="handleLyricDialogCancel"
>取消</el-button
>
</span>
</el-dialog>
<el-dialog
title="上传"
:visible="true"
v-if="uploadDialog.visible"
width="40%"
top="60px"
append-to-body
:before-close="handleUploadDialogBeforeClose"
>
<el-upload
action="/luoo-music/cms/song/batch"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:on-change="handleUploadSongSuccess"
multiple
:limit="10"
:on-exceed="handleExceed"
name="files"
:file-list="songUploadFileList"
>
<el-button icon="el-icon-receiving" plain>上传歌曲</el-button>
<div
slot="tip"
style="font-family: '微软雅黑', sans-serif; font-weight: 400; font-style: normal; color: #999999;"
>
支持格式.mp3 .wav .flac 单个文件不能超过20MB支持批量上传
</div>
</el-upload>
<span slot="footer">
<el-button size="small" @click="uploadDialog.visible = false"
>取消</el-button
>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -263,10 +315,19 @@ export default {
timeRange: [] timeRange: []
} }
}, },
songUploadFileList: [],
musicModifyDialog: { musicModifyDialog: {
visible: false, visible: false,
data: {} data: {}
}, },
lyricDialog: {
visible: false,
songId: null,
data: ""
},
uploadDialog: {
visible: false
},
// //
table: { table: {
show: true, show: true,
@ -308,54 +369,21 @@ export default {
}; };
if (param.timeRange) { if (param.timeRange) {
if (param.timeRange[0]) { if (param.timeRange[0]) {
queryParam.start = param.timeRange[0] + " 00:00:00"; queryParam.start = param.timeRange[0];
} }
if (param.timeRange[1]) { if (param.timeRange[1]) {
queryParam.end = param.timeRange[1] + " 23:59:59"; queryParam.end = param.timeRange[1];
} }
} }
this.table.loading = true; this.table.loading = true;
musicApi
setTimeout(() => { .getList(queryParam, this.table.page.current, this.table.page.size)
let musicList = [ .then(res => {
{ this.table.data = res.data.rows;
album: "范特西", this.table.page.total = res.data.total;
artist: "周杰伦", this.table.loading = false;
duration: "1h30min", });
id: "1",
journal: [1, 2, 3],
lyric: "lllll llll lll",
name: "双节棍",
picture: "https://luoow.wxwenku.com/999/cover_min.jpg",
size: "1.3m",
state: "1",
tags: [3, 5, 11],
updateTime: "2023-01-01",
url: "https://luoow.wxwenku.com/999/03._Du_und_ich_Klee.mp3",
userId: "1627863701048659968"
},
{
album: "范特西1",
artist: "周杰伦1",
duration: "1h30min",
id: "2",
journal: [1, 2, 3],
lyric: "lllll llll lll",
name: "双节棍1",
picture: "https://luoow.wxwenku.com/999/cover_min.jpg",
size: "1.3m",
state: "1",
tags: [3, 5, 11],
updateTime: "2023-01-01",
url: "https://luoow.wxwenku.com/999/03._Du_und_ich_Klee.mp3",
userId: "1627863701048659968"
}
];
this.table.data = musicList;
this.table.page.total = 10;
this.table.loading = false;
}, 1000);
}, },
/** /**
* 创建人下拉框 * 创建人下拉框
@ -373,42 +401,22 @@ export default {
* 高级筛选tag * 高级筛选tag
*/ */
fetchTags() { fetchTags() {
// tagApi.queryHierarchical().then(res => { tagApi.queryHierarchical().then(res => {
// console.log(res) let newList = [];
// }) for (let index in res.data) {
let res = [ let item = res.data[index];
{ let newItem = { value: item.id, label: item.nameCh, children: [] };
id: 1, for (let childrenIndex in item.children) {
nameCh: "语言类型", let childrenItem = item.children[childrenIndex];
children: [ newItem.children.push({
{ id: 3, nameCh: "中文" }, value: childrenItem.id,
{ id: 4, nameCh: "日文" }, label: childrenItem.nameCh
{ id: 5, nameCh: "英文" } });
] }
}, newList.push(newItem);
{
id: 10,
nameCh: "期刊标签",
children: [
{ id: 11, nameCh: "民谣" },
{ id: 12, nameCh: "摇滚" }
]
}
];
let newList = [];
for (let index in res) {
let item = res[index];
let newItem = { value: item.id, label: item.nameCh, children: [] };
for (let childrenIndex in item.children) {
let childrenItem = item.children[childrenIndex];
newItem.children.push({
value: childrenItem.id,
label: childrenItem.nameCh
});
} }
newList.push(newItem); this.queryForm.remoteData.tags = newList;
} });
this.queryForm.remoteData.tags = newList;
}, },
// ************************* ************************* // ************************* *************************
getAuthorNameById(userId) { getAuthorNameById(userId) {
@ -470,7 +478,8 @@ export default {
* 编辑标签点击事件 * 编辑标签点击事件
*/ */
handleModifyClick(row) { handleModifyClick(row) {
this.musicModifyDialog.data = row; let newRow = JSON.parse(JSON.stringify(row));
this.musicModifyDialog.data = newRow;
this.musicModifyDialog.visible = true; this.musicModifyDialog.visible = true;
}, },
/** /**
@ -491,8 +500,7 @@ export default {
* 表格内状态滑块切换事件 * 表格内状态滑块切换事件
*/ */
handleTableRowStatusChange($event, row) { handleTableRowStatusChange($event, row) {
this.$message("状态切换" + $event); musicApi.updateState(row.id, $event).then(res => {
musicApi.updateStatus(row.id, $event).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message); this.$message.success(res.message);
} else { } else {
@ -543,6 +551,53 @@ export default {
this.$refs.songTable.toggleRowSelection(rows[rowIndex]); this.$refs.songTable.toggleRowSelection(rows[rowIndex]);
} }
}, },
/**
* 打开弹窗按扭点击事件
*/
handleLyricClick(row) {
this.lyricDialog.songId = row.id;
this.lyricDialog.visible = true;
this.lyricDialog.loading = true;
musicApi.getLyric(row.id).then(res => {
this.lyricDialog.data = res.data.lyric;
this.lyricDialog.loading = false;
});
},
handleLyricDialogBeforeClose(done) {
this.lyricDialog.data = "";
this.lyricDialog.songId = null;
this.lyricDialog.visible = false;
done();
},
handleUploadDialogBeforeClose(done) {
this.uploadDialog.visible = false;
this.songUploadFileList = [];
done();
},
/**
* 弹窗提交按扭点击事件
*/
handleLyricDialogSubmit() {
musicApi
.updateLyric(this.lyricDialog.songId, this.lyricDialog.data)
.then(res => {
if (res.code === 200) {
this.lyricDialog.data = "";
this.lyricDialog.songId = null;
this.lyricDialog.visible = false;
} else {
this.$message.error(res.message);
}
});
},
/**
* 弹窗取消按扭点击事件
*/
handleLyricDialogCancel() {
this.lyricDialog.data = "";
this.lyricDialog.songId = null;
this.lyricDialog.visible = false;
},
/** /**
* 分页组件页数变化事件 * 分页组件页数变化事件
*/ */
@ -563,6 +618,54 @@ export default {
handleMusicModifyDialogBeforeClose(done) { handleMusicModifyDialogBeforeClose(done) {
this.musicModifyDialog.visible = false; this.musicModifyDialog.visible = false;
done(); done();
},
handleMusicModifySave() {
let oldInfo = this.musicModifyDialog.data;
let newInfo = {
album: oldInfo["album"],
artist: oldInfo["artist"],
image: oldInfo["image"],
name: oldInfo["name"],
tags: oldInfo["tags"],
url: oldInfo["url"]
};
musicApi.updateInfo(oldInfo["id"], newInfo).then(res => {
if (res.code === 200) {
this.musicModifyDialog.data = {};
this.$message.success("保存成功");
this.musicModifyDialog.visible = false;
this.fetchData(this.queryForm.lastQuery);
} else {
this.$message.error(res.message);
}
});
},
handleMusicModifyClose() {
this.musicModifyDialog.data = {};
this.musicModifyDialog.visible = false;
},
// ************************* *************************
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 10 个文件,本次选择了 ${
files.length
} 个文件共选择了 ${files.length + fileList.length} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleUploadSongSuccess(response, file, fileList) {
if (response.status === "success") {
this.$message.success("上传成功");
}
} }
} }
}; };

@ -38,20 +38,21 @@
filterable filterable
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="picture" label="上传封面"> <el-form-item prop="image" label="上传封面">
<img <img
style="width: 170px;height: 120px;" style="width: 170px;height: 120px;"
v-if="data.picture" v-if="data.image"
:src="data.picture" :src="data.image"
/> />
<el-upload <el-upload
action="https://jsonplaceholder.typicode.com/posts/" action="/luoo-music/cms/journal/upload/image"
:on-preview="handlePreview" :on-preview="handlePreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:before-remove="beforeRemove" :before-remove="beforeRemove"
multiple multiple
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-change="handleUploadImgSuccess"
:file-list="coverUploadFileList" :file-list="coverUploadFileList"
> >
<el-button size="small" type="primary" icon="el-icon-receiving" <el-button size="small" type="primary" icon="el-icon-receiving"
@ -86,7 +87,7 @@ export default {
journal: [], journal: [],
lyric: null, lyric: null,
name: null, name: null,
picture: null, image: null,
size: null, size: null,
state: "1", state: "1",
tags: [], tags: [],
@ -104,10 +105,35 @@ export default {
}; };
}, },
filters: {}, filters: {},
created() {}, created() {
this.syncTagDataToComponent();
},
components: {}, components: {},
mounted() {}, mounted() {},
methods: { methods: {
syncTagDataToComponent() {
// selectTag
for (let i in this.data.tags) {
let tag = this.data.tags[i];
for (let j in this.remoteTagList) {
let jId = this.remoteTagList[j].value;
if(tag === jId){
this.selectTag.push([jId])
}
for (let k in this.remoteTagList[j].children) {
let kId = this.remoteTagList[j].children[k].value;
if (tag === this.remoteTagList[j].children[k].value) {
this.selectTag.push([jId, kId]);
}else{
console.log(tag)
console.log(this.remoteTagList[j].children[k].value)
console.log("-----")
}
}
}
}
},
handleTagSelectChange(val) { handleTagSelectChange(val) {
let newTag = []; let newTag = [];
for (let i in val) { for (let i in val) {
@ -135,7 +161,13 @@ export default {
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
} },
handleUploadImgSuccess(response, file, fileList){
if(response.status === 'success'){
this.$message.success("上传成功")
this.data.image = response.response.data['fullUrl']
}
},
} }
}; };
</script> </script>

@ -45,7 +45,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select
placeholder="选择发布人" placeholder="输入发布人名称"
size="medium" size="medium"
v-model="queryForm.data.creatorId" v-model="queryForm.data.creatorId"
> >
@ -355,6 +355,7 @@ export default {
let queryParam = { let queryParam = {
...param ...param
}; };
queryParam.level = this.tagType
if (param.timeRange) { if (param.timeRange) {
if (param.timeRange[0]) { if (param.timeRange[0]) {
queryParam.createTimeStart = param.timeRange[0] + " 00:00:00"; queryParam.createTimeStart = param.timeRange[0] + " 00:00:00";

Loading…
Cancel
Save