This commit is contained in:
zpc 2025-11-22 01:02:58 +08:00
parent b98ae8fbe3
commit 17dbef0aab
6 changed files with 138 additions and 3 deletions

View File

@ -10,6 +10,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1591,8603,8602,8604,8600,8618</NoWarn> <NoWarn>1701;1702;1591,8603,8602,8604,8600,8618</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\Business\**" />
<Content Remove="Controllers\Business\**" />
<EmbeddedResource Remove="Controllers\Business\**" />
<None Remove="Controllers\Business\**" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ZR.CodeGenerator\ZR.CodeGenerator.csproj" /> <ProjectReference Include="..\ZR.CodeGenerator\ZR.CodeGenerator.csproj" />
@ -29,7 +35,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Controllers\Business\" />
<Folder Include="Properties\PublishProfiles\" /> <Folder Include="Properties\PublishProfiles\" />
</ItemGroup> </ItemGroup>

View File

@ -72,4 +72,19 @@ namespace ZR.LiveForum.Model.Liveforum.Dto
[ExcelColumn(Name = "反馈状态")] [ExcelColumn(Name = "反馈状态")]
public string? StatusLabel { get; set; } public string? StatusLabel { get; set; }
} }
/// <summary>
/// 反馈回复对象
/// </summary>
public class T_FeedbackReplyDto
{
[Required(ErrorMessage = "Id不能为空")]
public long Id { get; set; }
[Required(ErrorMessage = "回复内容不能为空")]
public string Reply { get; set; }
[Required(ErrorMessage = "反馈状态不能为空")]
public int Status { get; set; }
}
} }

View File

@ -16,6 +16,7 @@ namespace ZR.Service.Liveforum.ILiveforumService
T_Feedbacks AddT_Feedbacks(T_Feedbacks parm); T_Feedbacks AddT_Feedbacks(T_Feedbacks parm);
int UpdateT_Feedbacks(T_Feedbacks parm); int UpdateT_Feedbacks(T_Feedbacks parm);
int Reply(T_FeedbackReplyDto parm);
PagedInfo<T_FeedbacksDto> ExportList(T_FeedbacksQueryDto parm); PagedInfo<T_FeedbacksDto> ExportList(T_FeedbacksQueryDto parm);
} }

View File

@ -1,4 +1,4 @@
using Infrastructure.Attribute; using Infrastructure.Attribute;
using Infrastructure.Extensions; using Infrastructure.Extensions;
using ZR.LiveForum.Model.Liveforum.Dto; using ZR.LiveForum.Model.Liveforum.Dto;
using ZR.LiveForum.Model.Liveforum; using ZR.LiveForum.Model.Liveforum;
@ -100,5 +100,10 @@ namespace ZR.Service.Liveforum
predicate = predicate.AndIF(parm.UserId != null, it => it.UserId == parm.UserId); predicate = predicate.AndIF(parm.UserId != null, it => it.UserId == parm.UserId);
return predicate; return predicate;
} }
public int Reply(T_FeedbackReplyDto parm)
{
throw new NotImplementedException();
}
} }
} }

View File

@ -35,6 +35,18 @@ export function updatetfeedbacks(data) {
data: data, data: data,
}) })
} }
/**
* 回复反馈记录
* @param data
*/
export function replytfeedbacks(data) {
return request({
url: 'liveforum/tfeedbacks/reply',
method: 'post',
data: data,
})
}
/** /**
* 获取反馈记录详情 * 获取反馈记录详情
* @param {Id} * @param {Id}

View File

@ -61,6 +61,7 @@
<template #default="scope"> <template #default="scope">
<el-button type="primary" size="small" icon="view" title="详情" @click="handlePreview(scope.row)"></el-button> <el-button type="primary" size="small" icon="view" title="详情" @click="handlePreview(scope.row)"></el-button>
<el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['tfeedbacks:edit']" @click="handleUpdate(scope.row)"></el-button> <el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['tfeedbacks:edit']" @click="handleUpdate(scope.row)"></el-button>
<el-button type="info" size="small" icon="chat-dot-square" title="回复" v-hasPermi="['tfeedbacks:reply']" @click="handleReply(scope.row)"></el-button>
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['tfeedbacks:delete']" @click="handleDelete(scope.row)"></el-button> <el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['tfeedbacks:delete']" @click="handleDelete(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -166,13 +167,40 @@
<el-button type="primary" :loading="state.submitLoading" @click="submitForm">{{ $t('btn.submit') }}</el-button> <el-button type="primary" :loading="state.submitLoading" @click="submitForm">{{ $t('btn.submit') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog :title="replyTitle" :lock-scroll="false" v-model="replyOpen">
<el-form ref="replyFormRef" :model="replyForm" :rules="replyRules" label-width="100px">
<el-row :gutter="20">
<el-col :lg="24">
<el-form-item label="回复内容" prop="reply">
<el-input type="textarea" v-model="replyForm.reply" placeholder="请输入回复内容" />
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item label="反馈状态" prop="status">
<el-select v-model="replyForm.status" placeholder="请选择反馈状态">
<el-option
v-for="item in options.liveforum_feedback_status"
:key="item.dictValue"
:label="item.dictLabel"
:value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button text @click="cancelReply">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" :loading="replySubmitLoading" @click="submitReply">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script setup name="tfeedbacks"> <script setup name="tfeedbacks">
import { listtfeedbacks, import { listtfeedbacks,
addtfeedbacks, deltfeedbacks, addtfeedbacks, deltfeedbacks,
updatetfeedbacks,gettfeedbacks, updatetfeedbacks,gettfeedbacks, replytfeedbacks,
} }
from '@/api/liveforum/tfeedbacks.js' from '@/api/liveforum/tfeedbacks.js'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -284,6 +312,23 @@ liveforum_feedback_status: [],
const { form, rules, options, single, multiple } = toRefs(state) const { form, rules, options, single, multiple } = toRefs(state)
const replyFormRef = ref()
const replyState = reactive({
open: false,
submitLoading: false,
form: {
id: null,
reply: '',
status: null,
},
rules: {
reply: [{ required: true, message: "回复内容不能为空", trigger: "blur" }],
status: [{ required: true, message: "反馈状态不能为空", trigger: "change" , type: "number" }],
},
})
const replyTitle = ref('反馈回复')
const { open: replyOpen, submitLoading: replySubmitLoading, form: replyForm, rules: replyRules } = toRefs(replyState)
// dialog // dialog
function cancel(){ function cancel(){
open.value = false open.value = false
@ -308,6 +353,15 @@ function reset() {
proxy.resetForm("formRef") proxy.resetForm("formRef")
} }
function resetReplyForm() {
replyForm.value = {
id: null,
reply: '',
status: null,
}
proxy.resetForm("replyFormRef")
}
/** /**
* 查看 * 查看
* @param {*} row * @param {*} row
@ -354,6 +408,22 @@ function handleUpdate(row) {
}) })
} }
function handleReply(row) {
resetReplyForm()
const id = row.id
gettfeedbacks(id).then((res) => {
const { code, data } = res
if (code == 200) {
replyOpen.value = true
replyForm.value = {
id: data.id,
reply: data.reply || '',
status: data.status,
}
}
})
}
// & // &
function submitForm() { function submitForm() {
proxy.$refs["formRef"].validate((valid) => { proxy.$refs["formRef"].validate((valid) => {
@ -404,6 +474,33 @@ function handleDelete(row) {
}) })
} }
function cancelReply() {
replyOpen.value = false
resetReplyForm()
}
function submitReply() {
proxy.$refs["replyFormRef"].validate((valid) => {
if (!valid) {
return
}
replyState.submitLoading = true
replytfeedbacks({
id: replyForm.value.id,
reply: replyForm.value.reply,
status: replyForm.value.status,
})
.then(() => {
proxy.$modal.msgSuccess("回复成功")
replyOpen.value = false
getList()
})
.finally(() => {
replyState.submitLoading = false
})
})
}
// //