我喜欢的音乐

This commit is contained in:
menxipeng
2025-09-30 21:08:03 +08:00
parent b8c87e3bce
commit 4c4d0741da
5 changed files with 99 additions and 34 deletions

View File

@@ -119,6 +119,8 @@ public class MusicController extends BaseController {
}
MusicInfo musicInfo = musicService.getMusicInfo(userId, musicId);
if (musicInfo != null){
// 增加历史
musicService.addHistoryMusic(musicId);
return AjaxResult.success(musicInfo);
}else {
return new AjaxResult(HttpStatus.USER_VIP_EXPIRE, "请开通会员");

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<property name="log.path" value="/Users/firefly/ruoyi/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

View File

@@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectLikeMusicCountByUserId" resultType="int">
SELECT count(1) FROM user_like_music WHERE user_id = #{userId}
SELECT count(mi.id) FROM user_like_music ul left join music_info mi on ul.music_id=mi.music_id
WHERE user_id = #{userId} and mi.is_del=0
</select>
</mapper>

View File

@@ -69,23 +69,28 @@
v-hasPermi="['system:feedback:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:feedback:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="feedbackList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="唯一标识符" align="center" prop="id" />
<el-table-column label="反馈内容" align="center" prop="feedbackContent" />
<el-table-column label="反馈内容" align="center" prop="feedbackContent" width="200">
<template slot-scope="scope">
<el-tooltip
:content="scope.row.feedbackContent"
placement="top"
:disabled="!scope.row.feedbackContent"
:show-after="300"
:hide-after="0"
effect="dark"
:max-width="400">
<div class="feedback-content">
{{ scope.row.feedbackContent }}
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="用户姓名" align="center" prop="userName" :show-overflow-tooltip="true" width="120" />
<el-table-column label="联系方式类型" align="center" prop="contactType" :show-overflow-tooltip="true" width="120" />
<el-table-column label="联系方式信息" align="center" prop="contactInfo" :show-overflow-tooltip="true" width="150" />
@@ -227,19 +232,41 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除用户反馈编号为"' + ids + '"的数据项?').then(function() {
let confirmMessage = ''
if (row && row.feedbackContent) {
// 单个删除,显示反馈内容
const content = row.feedbackContent.length > 50
? row.feedbackContent.substring(0, 50) + '...'
: row.feedbackContent
confirmMessage = `是否确认删除以下反馈内容?\n"${content}"`
} else {
// 批量删除,显示选中的反馈内容
const selectedFeedbacks = this.feedbackList.filter(item => this.ids.includes(item.id))
if (selectedFeedbacks.length === 1) {
const content = selectedFeedbacks[0].feedbackContent
const displayContent = content && content.length > 50
? content.substring(0, 50) + '...'
: content
confirmMessage = `是否确认删除以下反馈内容?\n"${displayContent}"`
} else {
const contents = selectedFeedbacks.map(item => {
const content = item.feedbackContent
return content && content.length > 30
? content.substring(0, 30) + '...'
: content
}).join('\n')
confirmMessage = `是否确认删除以下${selectedFeedbacks.length}条反馈内容?\n${contents}`
}
}
this.$modal.confirm(confirmMessage).then(function() {
return delFeedback(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/feedback/export', {
...this.queryParams
}, `feedback_${new Date().getTime()}.xlsx`)
},
/** 获取状态标签 */
getStatusLabel(status) {
const statusMap = {
@@ -299,4 +326,29 @@ export default {
.el-dropdown-menu__item i {
margin-right: 5px;
}
/* 反馈内容样式 */
.feedback-content {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
line-height: 1.4;
padding: 4px 0;
display: block;
word-break: break-all;
}
.feedback-content:hover {
color: #409EFF;
}
/* 自定义tooltip样式 */
:deep(.el-tooltip__popper) {
max-width: 400px !important;
word-wrap: break-word;
white-space: pre-wrap;
line-height: 1.5;
}
</style>

View File

@@ -162,7 +162,8 @@
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划发送时间">
placeholder="请选择计划发送时间"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-form>
@@ -328,6 +329,13 @@ export default {
sendTime: [
{ required: true, message: "计划发送时间不能为空", trigger: "blur" }
]
},
// 日期选择器配置
pickerOptions: {
disabledDate(time) {
// 禁用今天之前的日期
return time.getTime() < Date.now() - 8.64e7; // 减去一天的毫秒数,确保今天可选
}
}
}
},
@@ -402,6 +410,8 @@ export default {
const id = row.id || this.ids
getNotifications(id).then(response => {
this.form = response.data
// 编辑时清空计划发送时间,让用户重新选择
this.form.sendTime = null
this.open = true
this.title = "修改通知"
})