123
This commit is contained in:
parent
fb099d4ec4
commit
148c8af0c2
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user