feat: 媒体库添加手动色情标记功能,默认分页改为10条

This commit is contained in:
2025-08-15 21:18:20 +08:00
parent 925ee5b1ea
commit 367240133f
4 changed files with 58 additions and 1 deletions
+19 -1
View File
@@ -89,6 +89,15 @@
<span v-else class="muted">-</span>
</template>
</el-table-column>
<el-table-column label="色情标记" width="100" align="center">
<template slot-scope="scope">
<el-switch
:value="scope.row.manualNsfw === 'Y'"
active-color="#F56C6C"
@change="handleManualNsfwChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="codec" label="编码" width="120" align="center">
<template slot-scope="scope">
<span class="muted" v-if="!scope.row.codec">-</span>
@@ -157,7 +166,7 @@ export default {
formatOptions: [],
query: {
page: 1,
pageSize: 20,
pageSize: 10,
mediaType: '',
orientation: '',
resolution: '',
@@ -240,6 +249,15 @@ export default {
d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()) +
' ' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds())
)
},
async handleManualNsfwChange(row) {
const newValue = row.manualNsfw === 'Y' ? 'N' : 'Y'
try {
await request.put(`/api/media/${row.id}/manual-nsfw`, { value: newValue })
row.manualNsfw = newValue
} catch (e) {
// 拦截器已提示
}
}
}
}