add view count
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-flex align="center" justify="space-between" class="title">
|
<n-flex align="center" justify="space-between" class="title">
|
||||||
<n-text class="titleText">预览</n-text>
|
<div>
|
||||||
|
<n-text class="titleText">预览</n-text>
|
||||||
|
<n-text v-if="!!submission.id" depth="3">({{ submission.view_count || 0 }})</n-text>
|
||||||
|
</div>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
||||||
<n-button quaternary @click="open">全屏</n-button>
|
<n-button quaternary @click="open">全屏</n-button>
|
||||||
@@ -14,7 +17,7 @@
|
|||||||
<n-button quaternary v-if="props.submissionId" @click="copyLink">
|
<n-button quaternary v-if="props.submissionId" @click="copyLink">
|
||||||
链接
|
链接
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-flex v-if="!!submission.id">
|
<n-flex v-if="!!submission.id" align="center">
|
||||||
<n-button quaternary @click="emits('showCode')">代码</n-button>
|
<n-button quaternary @click="emits('showCode')">代码</n-button>
|
||||||
<n-popover v-if="submission.my_score === 0">
|
<n-popover v-if="submission.my_score === 0">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
@@ -22,7 +25,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<n-rate :size="30" @update:value="updateScore" />
|
<n-rate :size="30" @update:value="updateScore" />
|
||||||
</n-popover>
|
</n-popover>
|
||||||
<!-- <n-button secondary type="info">智能打分</n-button> -->
|
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
|
|||||||
@@ -275,6 +275,12 @@ const columns: DataTableColumn<SubmissionOut>[] = [
|
|||||||
width: 60,
|
width: 60,
|
||||||
render: (row) => row.submit_count || "-",
|
render: (row) => row.submit_count || "-",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "浏览",
|
||||||
|
key: "view_count",
|
||||||
|
width: 60,
|
||||||
|
render: (row) => row.view_count || "-",
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
async function handleExpand(keys: (string | number)[]) {
|
async function handleExpand(keys: (string | number)[]) {
|
||||||
@@ -398,6 +404,8 @@ onUnmounted(() => {
|
|||||||
html: "",
|
html: "",
|
||||||
css: "",
|
css: "",
|
||||||
js: "",
|
js: "",
|
||||||
|
submit_count: 0,
|
||||||
|
view_count: 0,
|
||||||
created: new Date(),
|
created: new Date(),
|
||||||
modified: new Date(),
|
modified: new Date(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export interface SubmissionOut {
|
|||||||
flag?: FlagType
|
flag?: FlagType
|
||||||
zone?: "featured" | "low" | "pending" | null
|
zone?: "featured" | "low" | "pending" | null
|
||||||
submit_count: number
|
submit_count: number
|
||||||
|
view_count: number
|
||||||
created: Date
|
created: Date
|
||||||
modified: Date
|
modified: Date
|
||||||
}
|
}
|
||||||
@@ -99,6 +100,8 @@ export interface SubmissionAll {
|
|||||||
html: ""
|
html: ""
|
||||||
css: ""
|
css: ""
|
||||||
js: ""
|
js: ""
|
||||||
|
submit_count: number
|
||||||
|
view_count: number
|
||||||
created: Date
|
created: Date
|
||||||
modified: Date
|
modified: Date
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user