Skip to content

Commit

Permalink
fix: no some types can select in SubjectRelationPostDialog.vue (#658)
Browse files Browse the repository at this point in the history
* fix: no some types can select in SubjectRelationPostDialog.vue

* fix: update episode progress when subject not collect

* docs: update CHANGELOG.MD
  • Loading branch information
chivehao committed Aug 16, 2024
1 parent 839438c commit b8b940e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 45 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

- Console条目关系页使用Tab进行显示

## 问题修复

- 修复没有收藏条目时点击标记剧集已看过的异常提示问题
- 修复新增条目关系缺失部分类型如OAD的问题

# 0.15.4

## 新特性
Expand Down
1 change: 1 addition & 0 deletions console/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ module:
message:
operate:
mark-finish: Mark episode is finished success
mark-finish-notcollect: operate fail, current subject not collect.
group:
MAIN: Main
PROMOTION_VIDEO: PV
Expand Down
2 changes: 1 addition & 1 deletion console/src/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ module:
subject:
title: 条目
sidebar: 条目

label:
name: 原始名称
name_cn: 中文名称
Expand Down Expand Up @@ -737,6 +736,7 @@ module:
message:
operate:
mark-finish: 标记是否观看完成成功
mark-finish-notcollect: 操作失败,当前条目未收藏。
group:
MAIN: 正片
PROMOTION_VIDEO: PV
Expand Down
16 changes: 16 additions & 0 deletions console/src/modules/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,19 @@ export const subtitleNameChineseMap = new Map([
['JPTC', '繁体中文'],
['jptc', '繁体中文'],
]);

export const subjectRelationTypes = [
'OTHER',
'ANIME',
'COMIC',
'GAME',
'MUSIC',
'NOVEL',
'REAL',
'BEFORE',
'AFTER',
'SAME_WORLDVIEW',
'ORIGINAL_SOUND_TRACK',
'ORIGINAL_VIDEO_ANIMATION',
'ORIGINAL_ANIMATION_DISC'
];
4 changes: 4 additions & 0 deletions console/src/modules/content/subject/SubjectDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ const udpateEpisodeCollectionProgress = async (
isFinish: boolean,
episode: Episode
) => {
if (!(subjectCollection.value.id)) {
ElMessage.warning(t('module.subject.episode.collect.message.operate.mark-finish-notcollect'));
return;
}
await apiClient.collectionEpisode.updateCollectionEpisodeFinish({
episodeId: episode.id as number,
finish: isFinish,
Expand Down
49 changes: 5 additions & 44 deletions console/src/modules/content/subject/SubjectRelationPostDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Tickets} from '@element-plus/icons-vue';
import SubjectSelectDrawer from './SubjectSelectDrawer.vue';
import {apiClient} from '@/utils/api-client';
import {useI18n} from 'vue-i18n';
import {subjectRelationTypes} from '@/modules/common/constants';
const { t } = useI18n();
Expand Down Expand Up @@ -115,50 +116,10 @@ const reqCreateRelaction = async () => {
>
<el-select v-model="selectSubjectReactionType" clearable>
<el-option
:label="t('module.subject.relaction.dialog.post.type.after')"
value="AFTER"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.before')"
value="BEFORE"
/>
<el-option
:label="
t('module.subject.relaction.dialog.post.type.same-worldview')
"
value="SAME_WORLDVIEW"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.ost')"
value="ORIGINAL_SOUND_TRACK"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.anime')"
value="ANIME"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.comic')"
value="COMIC"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.game')"
value="GAME"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.music')"
value="MUSIC"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.novel')"
value="NOVEL"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.real')"
value="REAL"
/>
<el-option
:label="t('module.subject.relaction.dialog.post.type.other')"
value="OTHER"
v-for="type in subjectRelationTypes"
:key="type"
:label="t('module.subject.relaction.type.' + type)"
:value="type"
/>
</el-select>
</el-form-item>
Expand Down

0 comments on commit b8b940e

Please sign in to comment.