Commit 6bd1ac08 by lijiabin

fix: 修复实名匿名相关展示,文章详情页图片展示等

parent 3022ff4f
...@@ -175,9 +175,10 @@ ...@@ -175,9 +175,10 @@
class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6" class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6"
> >
<el-image <el-image
v-for="item in articleDetail.imgUrl.split(',')" v-for="(item, index) in articleDetail.imgUrl.split(',')"
:key="item" :key="item"
:src="item" :src="item"
:initial-index="index"
fit="cover" fit="cover"
class="rounded-lg w-full h-64 hover:scale-105 transition-transform cursor-pointer" class="rounded-lg w-full h-64 hover:scale-105 transition-transform cursor-pointer"
:preview-src-list="articleDetail.imgUrl.split(',')" :preview-src-list="articleDetail.imgUrl.split(',')"
......
...@@ -101,13 +101,15 @@ ...@@ -101,13 +101,15 @@
<div class="flex gap-3"> <div class="flex gap-3">
<img <img
@click="jumpToUserHomePage({ userId: item.userId, type })" @click="jumpToUserHomePage({ userId: item.userId, type })"
:src="item.avatar" :src="isReal ? item.avatar : item.hiddenAvatar"
alt="" alt=""
class="w-10 h-10 rounded-full object-cover cursor-pointer" class="w-10 h-10 rounded-full object-cover cursor-pointer"
/> />
<div class="flex-1"> <div class="flex-1">
<div class="flex items-center gap-2 mb-2"> <div class="flex items-center gap-2 mb-2">
<span class="font-semibold text-gray-800">{{ item.replyUser }}</span> <span class="font-semibold text-gray-800">{{
isReal ? item.replyUser : item.hiddenName
}}</span>
<!-- <span <!-- <span
class="px-2 py-0.5 text-xs bg-gradient-to-r from-purple-100 to-blue-100 text-purple-600 rounded-full" class="px-2 py-0.5 text-xs bg-gradient-to-r from-purple-100 to-blue-100 text-purple-600 rounded-full"
> >
...@@ -407,9 +409,11 @@ const isReal = computed( ...@@ -407,9 +409,11 @@ const isReal = computed(
type === ArticleTypeEnum.INTERVIEW || type === ArticleTypeEnum.INTERVIEW ||
type === ArticleTypeEnum.QUESTION, type === ArticleTypeEnum.QUESTION,
) )
const userAvatar = computed(() => const userAvatar = computed(() => {
isReal.value ? userInfo.value.avatar : userInfo.value.hiddenAvatar, console.log(isReal.value ? userInfo.value.avatar : userInfo.value.hiddenAvatar)
) return isReal.value ? userInfo.value.avatar : userInfo.value.hiddenAvatar
})
const commentRef = useTemplateRef<HTMLElement | null>('commentRef') const commentRef = useTemplateRef<HTMLElement | null>('commentRef')
const commentListDialogRef = useTemplateRef<typeof CommentListDialog>('commentListDialogRef') const commentListDialogRef = useTemplateRef<typeof CommentListDialog>('commentListDialogRef')
const replyToOtherBoxRefList = ref<HTMLElement[]>([]) const replyToOtherBoxRefList = ref<HTMLElement[]>([])
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
> >
<div class="flex gap-3"> <div class="flex gap-3">
<!-- 用户头像 --> <!-- 用户头像 -->
<el-avatar :size="40" :src="userInfo.hiddenAvatar" /> <el-avatar :size="40" :src="userInfo.avatar" />
<!-- 删除按钮 --> <!-- 删除按钮 -->
<CommentBox <CommentBox
class="flex-1" class="flex-1"
......
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
<!-- 1. 顶部:父级评论展示 --> <!-- 1. 顶部:父级评论展示 -->
<div v-if="parentComment" class="flex gap-4 bg-gray-50 p-5 rounded-xl"> <div v-if="parentComment" class="flex gap-4 bg-gray-50 p-5 rounded-xl">
<img <img
:src="parentComment.hiddenAvatar" :src="parentComment.avatar"
class="w-12 h-12 rounded-full object-cover border-2 border-gray-200 flex-shrink-0" class="w-12 h-12 rounded-full object-cover border-2 border-gray-200 flex-shrink-0"
/> />
<div class="flex-1"> <div class="flex-1">
<div class="flex items-center justify-between mb-2"> <div class="flex items-center justify-between mb-2">
<span class="font-bold text-gray-900 text-base">{{ parentComment.hiddenName }}</span> <span class="font-bold text-gray-900 text-base">{{ parentComment.replyUser }}</span>
<!-- 点赞按钮 --> <!-- 点赞按钮 -->
<div <div
class="flex items-center gap-1.5 cursor-pointer text-gray-500 hover:text-blue-500 transition-colors px-3 py-1.5 rounded-full hover:bg-blue-50" class="flex items-center gap-1.5 cursor-pointer text-gray-500 hover:text-blue-500 transition-colors px-3 py-1.5 rounded-full hover:bg-blue-50"
......
export function useResetData<T>(initialValue: T) { export function useResetData<T>(initialValue: T) {
const state = ref(structuredClone(initialValue)) const state = ref(structuredClone(initialValue))
const reset = () => { const reset = () => {
state.value = structuredClone(initialValue) // state.value = structuredClone(initialValue)
// 优化 防止 出现类似toRef引用丢失问题
Object.assign(state.value, structuredClone(initialValue))
} }
return [state, reset] as [Ref<T>, () => void] return [state, reset] as [Ref<T>, () => void]
} }
...@@ -35,26 +35,26 @@ const handleContent = (content: string) => { ...@@ -35,26 +35,26 @@ const handleContent = (content: string) => {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文化关键词(次关键词选填)" align="center"> <el-table-column label="文化关键词(次关键词选填)" align="center">
<el-table-column prop="cultureKeywordMain" label="主关键词" width="160"> <el-table-column label="主关键词" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag type="primary"> {{ row.cultureMain }}</el-tag> <el-tag type="primary"> {{ row.cultureMain }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词1" width="160"> <el-table-column label="次关键词1" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureSub1" type="primary"> <el-tag v-if="row.cultureSub1" type="primary">
{{ row.cultureSub1 }} {{ row.cultureSub1 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词2" width="160"> <el-table-column label="次关键词2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureSub2" type="primary"> <el-tag v-if="row.cultureSub2" type="primary">
{{ row.cultureSub2 }} {{ row.cultureSub2 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词3" width="160"> <el-table-column label="次关键词3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureSub3" type="primary"> <el-tag v-if="row.cultureSub3" type="primary">
{{ row.cultureSub3 }} {{ row.cultureSub3 }}
...@@ -68,35 +68,35 @@ const handleContent = (content: string) => { ...@@ -68,35 +68,35 @@ const handleContent = (content: string) => {
</el-table-column> </el-table-column>
<el-table-column prop="caseType" label="案例类型(选填)" width="120"></el-table-column> <el-table-column prop="caseType" label="案例类型(选填)" width="120"></el-table-column>
<el-table-column label="关联场景(选填)" align="center"> <el-table-column label="关联场景(选填)" align="center">
<el-table-column prop="sceneMain" label="主关键词" width="160"> <el-table-column label="主关键词" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneMain" type="primary"> <el-tag v-if="row.sceneMain" type="primary">
{{ row.sceneMain }} {{ row.sceneMain }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词1" width="160"> <el-table-column label="次关键词1" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneSub1" type="primary"> <el-tag v-if="row.sceneSub1" type="primary">
{{ row.sceneSub1 }} {{ row.sceneSub1 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词2" width="160"> <el-table-column label="次关键词2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneSub2" type="primary"> <el-tag v-if="row.sceneSub2" type="primary">
{{ row.sceneSub2 }} {{ row.sceneSub2 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词3" width="160"> <el-table-column label="次关键词3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneSub3" type="primary"> <el-tag v-if="row.sceneSub3" type="primary">
{{ row.sceneSub3 }} {{ row.sceneSub3 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词4" width="160"> <el-table-column label="次关键词4" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneSub4" type="primary"> <el-tag v-if="row.sceneSub4" type="primary">
{{ row.sceneSub4 }} {{ row.sceneSub4 }}
...@@ -112,14 +112,14 @@ const handleContent = (content: string) => { ...@@ -112,14 +112,14 @@ const handleContent = (content: string) => {
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxBracket2" label="部门2" width="160"> <el-table-column label="部门2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.dept2" type="primary"> <el-tag v-if="row.dept2" type="primary">
{{ row.dept2 }} {{ row.dept2 }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxBracket3" label="部门3" width="160"> <el-table-column label="部门3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.dept3" type="primary"> <el-tag v-if="row.dept3" type="primary">
{{ row.dept3 }} {{ row.dept3 }}
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="sourceProject" label="来源项目" width="120"></el-table-column> <el-table-column prop="sourceProject" label="来源项目" width="120"></el-table-column>
<el-table-column prop="sourceType" label="来源类型" width="120"></el-table-column> <el-table-column prop="sourceType" label="来源类型" width="120"></el-table-column>
<el-table-column prop="sourceTime" label="来源时间" width="170"> <el-table-column label="来源时间" width="170">
<template #default="{ row }"> <template #default="{ row }">
{{ dayjs(row.sourceTime * 1000).format('YYYY-MM-DD HH:mm:ss') }} {{ dayjs(row.sourceTime * 1000).format('YYYY-MM-DD HH:mm:ss') }}
</template> </template>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<el-table-column prop="title" label="案例标题" width="200"></el-table-column> <el-table-column prop="title" label="案例标题" width="200"></el-table-column>
<!-- 内容过多加入tooltip --> <!-- 内容过多加入tooltip -->
<el-table-column prop="content" label="案例文本内容" width="300"> <el-table-column label="案例文本内容" width="300">
<template #default="{ row }"> <template #default="{ row }">
<!-- 省略号 --> <!-- 省略号 -->
<div class="line-clamp-1 text-blue-500 cursor-pointer" @click="handleContent(row)"> <div class="line-clamp-1 text-blue-500 cursor-pointer" @click="handleContent(row)">
...@@ -92,28 +92,28 @@ ...@@ -92,28 +92,28 @@
</el-table-column> </el-table-column>
<el-table-column label="文化关键词" align="center"> <el-table-column label="文化关键词" align="center">
<el-table-column prop="cultureKeywordMain" label="主关键词" width="160"> <el-table-column label="主关键词" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureKeywordMain[0]" type="primary"> <el-tag v-if="row.cultureKeywordMain[0]" type="primary">
{{ row.cultureKeywordMain[0].title }} {{ row.cultureKeywordMain[0].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词1" width="160"> <el-table-column label="次关键词1" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureKeywordSecond[0]" type="primary"> <el-tag v-if="row.cultureKeywordSecond[0]" type="primary">
{{ row.cultureKeywordSecond[0].title }} {{ row.cultureKeywordSecond[0].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词2" width="160"> <el-table-column label="次关键词2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureKeywordSecond[1]" type="primary"> <el-tag v-if="row.cultureKeywordSecond[1]" type="primary">
{{ row.cultureKeywordSecond[1].title }} {{ row.cultureKeywordSecond[1].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cultureKeywordSecond" label="次关键词3" width="160"> <el-table-column label="次关键词3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.cultureKeywordSecond[2]" type="primary"> <el-tag v-if="row.cultureKeywordSecond[2]" type="primary">
{{ row.cultureKeywordSecond[2].title }} {{ row.cultureKeywordSecond[2].title }}
...@@ -123,14 +123,14 @@ ...@@ -123,14 +123,14 @@
</el-table-column> </el-table-column>
<el-table-column label="年度主推关键词(选填)" align="center"> <el-table-column label="年度主推关键词(选填)" align="center">
<el-table-column prop="yearKeywordMain" label="主关键词" width="160"> <el-table-column label="主关键词" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.yearKeywordMain[0]" type="primary"> <el-tag v-if="row.yearKeywordMain[0]" type="primary">
{{ row.yearKeywordMain[0].title }} {{ row.yearKeywordMain[0].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="yearKeywordSecond" label="次关键词" width="160"> <el-table-column label="次关键词" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.yearKeywordSecond[0]" type="primary"> <el-tag v-if="row.yearKeywordSecond[0]" type="primary">
{{ row.yearKeywordSecond[0].title }} {{ row.yearKeywordSecond[0].title }}
...@@ -147,28 +147,28 @@ ...@@ -147,28 +147,28 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词1" width="160"> <el-table-column label="次关键词1" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneKeywordSecond[0]" type="primary"> <el-tag v-if="row.sceneKeywordSecond[0]" type="primary">
{{ row.sceneKeywordSecond[0].title }} {{ row.sceneKeywordSecond[0].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词2" width="160"> <el-table-column label="次关键词2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneKeywordSecond[1]" type="primary"> <el-tag v-if="row.sceneKeywordSecond[1]" type="primary">
{{ row.sceneKeywordSecond[1].title }} {{ row.sceneKeywordSecond[1].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词3" width="160"> <el-table-column label="次关键词3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneKeywordSecond[2]" type="primary"> <el-tag v-if="row.sceneKeywordSecond[2]" type="primary">
{{ row.sceneKeywordSecond[2].title }} {{ row.sceneKeywordSecond[2].title }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="abnormalReason" label="次关键词4" width="160"> <el-table-column label="次关键词4" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.sceneKeywordSecond[3]" type="primary"> <el-tag v-if="row.sceneKeywordSecond[3]" type="primary">
{{ row.sceneKeywordSecond[3].title }} {{ row.sceneKeywordSecond[3].title }}
...@@ -185,14 +185,14 @@ ...@@ -185,14 +185,14 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxBracket2" label="部门2" width="160"> <el-table-column label="部门2" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.depNameList[1]" type="primary"> <el-tag v-if="row.depNameList[1]" type="primary">
{{ row.depNameList[1] }} {{ row.depNameList[1] }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxBracket3" label="部门3" width="160"> <el-table-column label="部门3" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.depNameList[2]" type="primary"> <el-tag v-if="row.depNameList[2]" type="primary">
{{ row.depNameList[2] }} {{ row.depNameList[2] }}
......
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
class="text-gray-600 text-sm sm:text-base leading-relaxed transition-all duration-300" class="text-gray-600 text-sm sm:text-base leading-relaxed transition-all duration-300"
:class="{ 'line-clamp-3': !item.isExpand }" :class="{ 'line-clamp-3': !item.isExpand }"
> >
<template v-if="item.cultureCommentListVo?.hiddenName"> <template v-if="item.cultureCommentListVo?.replyName">
{{ item.cultureCommentListVo?.hiddenName }} {{ item.cultureCommentListVo?.replyName }}
<span v-html="parseEmoji(item.cultureCommentListVo?.content)"></span> <span v-html="parseEmoji(item.cultureCommentListVo?.content)"></span>
</template> </template>
<template v-else> <template v-else>
......
...@@ -605,6 +605,7 @@ const initPage = () => { ...@@ -605,6 +605,7 @@ const initPage = () => {
} }
const refreshUserAccountData = async () => { const refreshUserAccountData = async () => {
yabiStore.fetchYaBiData()
const { data } = await getUserAccountData() const { data } = await getUserAccountData()
userAccountData.value = data userAccountData.value = data
} }
......
...@@ -384,6 +384,8 @@ const rules: Record<string, FormItemRule[]> = { ...@@ -384,6 +384,8 @@ const rules: Record<string, FormItemRule[]> = {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (form.value.sendType === SendTypeEnum.SCHEDULED && !value) { if (form.value.sendType === SendTypeEnum.SCHEDULED && !value) {
callback(new Error('请选择发布时间')) callback(new Error('请选择发布时间'))
} else {
callback()
} }
}, },
trigger: 'trigger', trigger: 'trigger',
...@@ -506,7 +508,8 @@ const handleClosed = () => { ...@@ -506,7 +508,8 @@ const handleClosed = () => {
const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => { const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
try { try {
console.log(form.value, 'form.value') console.log(form.value, 'form.value')
await formRef.value?.validate() const validateRes = await formRef.value?.validate()
console.log(validateRes, 'validateRes')
loading.value = true loading.value = true
const res = const res =
form.value.type === ArticleTypeEnum.PRACTICE form.value.type === ArticleTypeEnum.PRACTICE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment