From fb099d4ec4c54108be8b431073316c4c2eda2117 Mon Sep 17 00:00:00 2001 From: gpu Date: Tue, 3 Feb 2026 01:43:47 +0800 Subject: [PATCH 1/2] 21 --- .../views/business/danye/components/DanyeFormDialog.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue index 85d88131..fc245f81 100644 --- a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue +++ b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue @@ -4,6 +4,7 @@ title="编辑单页" width="900px" :close-on-click-modal="false" + :destroy-on-close="true" @close="handleClose" > -
+
{ // 关闭弹窗 const handleClose = () => { - dialogVisible.value = false - resetForm() - // 销毁编辑器实例 + // 先销毁编辑器实例 if (editorRef.value) { editorRef.value.destroy() editorRef.value = undefined } + dialogVisible.value = false + resetForm() } // 提交表单 From 148c8af0c2c926a67879dac899e7f118e78bed25 Mon Sep 17 00:00:00 2001 From: gpu Date: Tue, 3 Feb 2026 02:14:48 +0800 Subject: [PATCH 2/2] 123 --- .../danye/components/DanyeFormDialog.vue | 24 +++++++++++++++++++ .../HoneyBox.Core/Services/QuanYiService.cs | 11 ++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue index fc245f81..5b4a9221 100644 --- a/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue +++ b/server/HoneyBox/src/HoneyBox.Admin/admin-web/src/views/business/danye/components/DanyeFormDialog.vue @@ -159,27 +159,47 @@ const formRules: FormRules = { // 编辑器创建完成 const handleCreated = (editor: IDomEditor) => { + console.log('[DanyeFormDialog] handleCreated called, editor:', editor) + console.log('[DanyeFormDialog] editor.isDestroyed:', editor.isDestroyed()) editorRef.value = editor + + // 如果有内容,设置到编辑器 + if (formData.content) { + console.log('[DanyeFormDialog] Setting initial content to editor:', formData.content.substring(0, 100)) + editor.setHtml(formData.content) + } } // 监听弹窗打开,初始化数据 watch(() => props.modelValue, (visible) => { + console.log('[DanyeFormDialog] modelValue changed:', visible, 'danye:', props.danye?.id) if (visible && props.danye) { formData.title = props.danye.title formData.content = props.danye.content || '' + console.log('[DanyeFormDialog] formData.content set to:', formData.content.substring(0, 100)) + console.log('[DanyeFormDialog] editorRef.value:', editorRef.value) + console.log('[DanyeFormDialog] editorRef.value?.isDestroyed():', editorRef.value?.isDestroyed?.()) } }) +// 监听 dialogVisible 变化 +watch(dialogVisible, (visible) => { + console.log('[DanyeFormDialog] dialogVisible changed:', visible) +}) + // 组件销毁时销毁编辑器 onBeforeUnmount(() => { + console.log('[DanyeFormDialog] onBeforeUnmount called') const editor = editorRef.value if (editor) { + console.log('[DanyeFormDialog] Destroying editor in onBeforeUnmount') editor.destroy() } }) // 重置表单 const resetForm = () => { + console.log('[DanyeFormDialog] resetForm called') formData.title = '' formData.content = '' formRef.value?.resetFields() @@ -187,10 +207,14 @@ const resetForm = () => { // 关闭弹窗 const handleClose = () => { + console.log('[DanyeFormDialog] handleClose called') + console.log('[DanyeFormDialog] editorRef.value before destroy:', editorRef.value) // 先销毁编辑器实例 if (editorRef.value) { + console.log('[DanyeFormDialog] Destroying editor, isDestroyed:', editorRef.value.isDestroyed()) editorRef.value.destroy() editorRef.value = undefined + console.log('[DanyeFormDialog] Editor destroyed and set to undefined') } dialogVisible.value = false resetForm() diff --git a/server/HoneyBox/src/HoneyBox.Core/Services/QuanYiService.cs b/server/HoneyBox/src/HoneyBox.Core/Services/QuanYiService.cs index 64a4f0b5..ea8b3829 100644 --- a/server/HoneyBox/src/HoneyBox.Core/Services/QuanYiService.cs +++ b/server/HoneyBox/src/HoneyBox.Core/Services/QuanYiService.cs @@ -69,7 +69,7 @@ public class QuanYiService : IQuanYiService levelDto.PuJiang = puJiang; // Get prize rewards (type = 2) - var gaoJiang = await _dbContext.VipLevelRewards + var gaoJiangRaw = await _dbContext.VipLevelRewards .Where(r => r.VipLevelId == vipLevel.Id && r.Type == 2 && r.DeletedAt == null) .OrderBy(r => r.Id) .Select(r => new QuanYiRewardDto @@ -77,10 +77,15 @@ public class QuanYiService : IQuanYiService Id = r.Id, Title = r.Title, ZNum = r.ZNum, - ImgUrl = GetImageUrl(r.ImgUrl) + ImgUrl = r.ImgUrl }) .ToListAsync(); - levelDto.GaoJiang = gaoJiang; + // Process image URLs after query + foreach (var item in gaoJiangRaw) + { + item.ImgUrl = GetImageUrl(item.ImgUrl); + } + levelDto.GaoJiang = gaoJiangRaw; // Check if user can claim this level's rewards if ((user.OuQiLevel ?? 0) >= vipLevel.Level)