|
@ -43,7 +43,9 @@ |
|
|
<div class="meta-info"> |
|
|
<div class="meta-info"> |
|
|
<span class="date">更新时间:{{ curRowDetail.createTime }}</span> |
|
|
<span class="date">更新时间:{{ curRowDetail.createTime }}</span> |
|
|
<span class="divider">|</span> |
|
|
<span class="divider">|</span> |
|
|
<span class="views" v-if="isAdmin === 1">阅读:123</span> |
|
|
|
|
|
|
|
|
<span class="views" v-if="isAdmin === 1" |
|
|
|
|
|
>阅读:{{ curRowDetail.readCount }}</span |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="tags"> |
|
|
<div class="tags"> |
|
@ -83,7 +85,7 @@ |
|
|
ExportOutlined, |
|
|
ExportOutlined, |
|
|
LeftOutlined, |
|
|
LeftOutlined, |
|
|
} from '@ant-design/icons-vue'; |
|
|
} from '@ant-design/icons-vue'; |
|
|
import { fetchKnowledgeBaseList, findOneById } from '@/api/knowledgeBase'; |
|
|
|
|
|
|
|
|
import { fetchKnowledgeBaseList, findOneById, addReadCount } from '@/api/knowledgeBase'; |
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
import { useUserStore } from '@/store/modules/user'; |
|
|
import { useUserStore } from '@/store/modules/user'; |
|
|
|
|
|
|
|
@ -105,11 +107,13 @@ |
|
|
tags: string; |
|
|
tags: string; |
|
|
solution: string; |
|
|
solution: string; |
|
|
createTime: string; |
|
|
createTime: string; |
|
|
|
|
|
readCount: any; |
|
|
}>({ |
|
|
}>({ |
|
|
title: '', |
|
|
title: '', |
|
|
tags: '', |
|
|
tags: '', |
|
|
solution: '', |
|
|
solution: '', |
|
|
createTime: '', |
|
|
createTime: '', |
|
|
|
|
|
readCount: 0, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const goBack = () => { |
|
|
const goBack = () => { |
|
@ -122,6 +126,11 @@ |
|
|
try { |
|
|
try { |
|
|
const res = await findOneById({ id: newVal[0] }); |
|
|
const res = await findOneById({ id: newVal[0] }); |
|
|
curRowDetail.value = res; |
|
|
curRowDetail.value = res; |
|
|
|
|
|
const count = await addReadCount({ id: newVal[0] }); |
|
|
|
|
|
console.log('count: ', count); |
|
|
|
|
|
if (count) { |
|
|
|
|
|
curRowDetail.value.readCount = count; |
|
|
|
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error(error); |
|
|
console.error(error); |
|
|
} finally { |
|
|
} finally { |
|
|