Skip to content

Commit

Permalink
feat: 添加匹配移除条目剧集附件绑定 (#555)
Browse files Browse the repository at this point in the history
* optimize: plus subject sync platform id max length to 100 for support subject detais url

* feat: 添加匹配移除条目剧集附件绑定

* docs: update CHANGELOG.MD

* docs: update CHANGELOG.MD
  • Loading branch information
GuoHao authored Jun 11, 2024
1 parent 5dc1a2f commit beb7d4e
Show file tree
Hide file tree
Showing 40 changed files with 1,513 additions and 554 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
- 添加关于是否展示web端主题的配置开关
- 浏览器记住console的多语言切换选择 #549
- 完善多语言翻译 #548
- 添加匹配移除条目剧集附件绑定 #554

## 优化

- 条目同步的平台ID输入框最大字符限制提升到了100

## 问题修复

Expand Down
8 changes: 3 additions & 5 deletions console/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ import { ElConfigProvider } from 'element-plus';
// import { getBrowserLanguage } from './locales';
import en from 'element-plus/dist/locale/en.mjs';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { useLayoutStore } from './stores/layout';
// const language = getBrowserLanguage();
const layoutStore = useLayoutStore();
const i18nCode = layoutStore.i18nCode;
let locale = zhCn;
console.debug('app i18n code', i18nCode)
console.debug('app i18n code', i18nCode);
if ('en-US' === i18nCode || 'en' == i18nCode) {
locale = en;
} else if ('zhCn' === i18nCode || 'zh' === i18nCode) {
locale = zhCn;
}
}
</script>

<template>
Expand Down
5 changes: 3 additions & 2 deletions console/src/components/video/Artplayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getSubtitleSimpleNameByAttachmentName = (name: string): string => {
const getSubtitleChineseSimpleNameBySimpleName = (name: string): string => {
const cnName = subtitleNameChineseMap.get(name) as string;
return (cnName != null && cnName != undefined && cnName != '') ? cnName : name;
return cnName != null && cnName != undefined && cnName != '' ? cnName : name;
};
const artSubtitles = ref<ArtSubtitle[]>([]);
Expand All @@ -66,7 +66,8 @@ const getVideoSubtitles = async () => {
data![index].name as string
);
var artSubtitle: ArtSubtitle = {
default: simpleName === 'SC' || simpleName === 'sc' || simpleName == 'JPSC',
default:
simpleName === 'SC' || simpleName === 'sc' || simpleName == 'JPSC',
html: getSubtitleChineseSimpleNameBySimpleName(simpleName),
url: data![index].url as string,
};
Expand Down
6 changes: 3 additions & 3 deletions console/src/layouts/components/LanguageSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const changeLanguage = () => {
layoutStore.setI18nCode(selectedLanguage.value);
window.location.reload();
};
onMounted(()=>{
const selectdI18nCode = layoutStore.i18nCode
onMounted(() => {
const selectdI18nCode = layoutStore.i18nCode;
if (selectdI18nCode && selectdI18nCode != '') {
// console.debug('selectdI18nCode', selectdI18nCode)
selectedLanguage.value = selectdI18nCode;
changeI18nLocal(selectedLanguage.value);
}
})
});
</script>

<template>
Expand Down
5 changes: 5 additions & 0 deletions console/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ module:
success: Request to update entry information succeeded
cancel:
success: Cancel Subject Collect Success
delete-batch-attachments:
success: Batch removed episode attachment bindings successfully
text:
collect:
not: Not Collect
Expand Down Expand Up @@ -436,6 +438,9 @@ module:
done: Done
push: Push
pull: Pull
cancel-batch-resources: Cancel Batch
cancel-batch-popconfirm:
title: Are you sure cancel batching atts bind?
relaction:
title: Subject Relactions
drawer:
Expand Down
5 changes: 5 additions & 0 deletions console/src/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ module:
success: 请求更新条目信息成功
cancel:
success: 取消条目收藏成功
delete-batch-attachments:
success: 批量移除剧集附件绑定成功
episode:
label:
group: 分组
Expand All @@ -473,6 +475,9 @@ module:
done: 看完
push: 推送
pull: 拉取
cancel-batch-resources: 批量移除
cancel-batch-popconfirm:
title: 您确定要批量移除绑定吗?
collect:
message:
operate:
Expand Down
2 changes: 1 addition & 1 deletion console/src/modules/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ export const subtitleNameChineseMap = new Map([
['JPSC', '简体中文'],
['jpsc', '简体中文'],
['JPTC', '繁体中文'],
['jptc', '繁体中文']
['jptc', '繁体中文'],
]);
44 changes: 29 additions & 15 deletions console/src/modules/content/attachment/AttachmentDeatilDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const handleDelete = async () => {
})
.then(() => {
ElMessage.success(
t('module.attachment.details.message.event.delete') + ' ' + file.value.name
t('module.attachment.details.message.event.delete') +
' ' +
file.value.name
);
emit('delete', file.value);
drawerVisible.value = false;
Expand Down Expand Up @@ -112,7 +114,9 @@ const handleUpdateName = async () => {
attachment: file.value,
})
.then(() => {
ElMessage.success(t('module.attachment.details.message.event.updateName'));
ElMessage.success(
t('module.attachment.details.message.event.updateName')
);
});
} catch (error) {
console.error(error);
Expand All @@ -125,7 +129,9 @@ const getCompleteFileUrl = (reactiveUrl: string | undefined): string => {
var curPageUrl = window.location.href;
var pathName = window.location.pathname;
var localhostPath = curPageUrl.substring(0, curPageUrl.indexOf(pathName));
return reactiveUrl?.startsWith('http') ? reactiveUrl : localhostPath + reactiveUrl;
return reactiveUrl?.startsWith('http')
? reactiveUrl
: localhostPath + reactiveUrl;
};
const handleClose = (done: () => void) => {
Expand All @@ -134,23 +140,21 @@ const handleClose = (done: () => void) => {
};
const attachmentRelationsDialogVisible = ref(false);
const onAttachmentRelationsDialogClose = async ()=>{
const onAttachmentRelationsDialogClose = async () => {
// artplayerRef.value.getVideoSubtitles();
// artplayerRef.value.reloadArtplayer();
window.location.reload();
}
const onClose = async()=>{
};
const onClose = async () => {
drawerVisible.value = false;
emit('close');
}
};
const artplayer = ref<Artplayer>();
const artplayerRef = ref();
const getArtplayerInstance = (art: Artplayer) => {
artplayer.value = art;
}
};
</script>

<template>
Expand Down Expand Up @@ -199,7 +203,9 @@ const getArtplayerInstance = (art: Artplayer) => {
>
{{ t('module.attachment.details.message.hint.audioFormat') }}
</audio>
<div v-else>{{ t('module.attachment.details.message.hint.preview') }}</div>
<div v-else>
{{ t('module.attachment.details.message.hint.preview') }}
</div>
</div>
</el-col>
</el-row>
Expand All @@ -219,7 +225,9 @@ const getArtplayerInstance = (art: Artplayer) => {
<el-descriptions-item label="ID">
{{ file.id }}
</el-descriptions-item>
<el-descriptions-item :label="t('module.attachment.details.descItemLabel.name')">
<el-descriptions-item
:label="t('module.attachment.details.descItemLabel.name')"
>
<span v-if="editable">
<el-input
ref="nameInput"
Expand All @@ -245,7 +253,10 @@ const getArtplayerInstance = (art: Artplayer) => {
>
{{ file.updateTime }}
</el-descriptions-item>
<el-descriptions-item v-if="file.path" :label="t('module.attachment.details.descItemLabel.path')">
<el-descriptions-item
v-if="file.path"
:label="t('module.attachment.details.descItemLabel.path')"
>
{{ file.path }}
</el-descriptions-item>
<el-descriptions-item v-if="file.url" label="URL">
Expand Down Expand Up @@ -281,8 +292,11 @@ const getArtplayerInstance = (art: Artplayer) => {
</el-popconfirm>
</template>

<AttachmentRelationsDialog v-model:visible="attachmentRelationsDialogVisible" :attachmentId="file.id" @close="onAttachmentRelationsDialogClose"/>

<AttachmentRelationsDialog
v-model:visible="attachmentRelationsDialogVisible"
:attachmentId="file.id"
@close="onAttachmentRelationsDialogClose"
/>
</el-drawer>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ElButton, ElDialog } from 'element-plus';
import AttachmentDirectoryTreeSelect from '@/components/modules/content/attachment/AttachmentDirectoryTreeSelect.vue';
import { useI18n } from 'vue-i18n';
const {t} = useI18n();
const { t } = useI18n();
const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -61,10 +61,14 @@ const onDirectorySelectDialogButtonClick = async () => {
<template #footer>
<span class="dialog-footer">
<el-button @click="onClose">
{{ t('module.attachment.dialog.directory-select.footer.button.cancel') }}
{{
t('module.attachment.dialog.directory-select.footer.button.cancel')
}}
</el-button>
<el-button type="primary" @click="onDirectorySelectDialogButtonClick">
{{ t('module.attachment.dialog.directory-select.footer.button.submit') }}
{{
t('module.attachment.dialog.directory-select.footer.button.submit')
}}
</el-button>
</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ const handleClose = (done: () => void) => {
t('module.attachment.drawer.fragment-upload.confirm.message'),
t('module.attachment.drawer.fragment-upload.confirm.title'),
{
confirmButtonText: t('module.attachment.drawer.fragment-upload.confirm.confirm'),
cancelButtonText: t('module.attachment.drawer.fragment-upload.confirm.cancel'),
confirmButtonText: t(
'module.attachment.drawer.fragment-upload.confirm.confirm'
),
cancelButtonText: t(
'module.attachment.drawer.fragment-upload.confirm.cancel'
),
type: 'warning',
}
)
Expand All @@ -88,7 +92,9 @@ const handleClose = (done: () => void) => {
handleVisibleChange(false);
})
.catch(() => {
ElMessage.warning(t('module.attachment.drawer.fragment-upload.confirm.hintMsg'));
ElMessage.warning(
t('module.attachment.drawer.fragment-upload.confirm.hintMsg')
);
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from 'element-plus';
import { useI18n } from 'vue-i18n';
const {t} = useI18n();
const { t } = useI18n();
const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -166,7 +166,9 @@ onMounted(fetchAttachments);
</el-button>
</el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-form-item :label="t('module.attachment.dialog.multi-select.parent-dir')">
<el-form-item
:label="t('module.attachment.dialog.multi-select.parent-dir')"
>
<AttachmentDirectoryTreeSelect
v-model:target-dirid="attachmentCondition.parentId"
@change="onParentDirSelected"
Expand All @@ -178,7 +180,9 @@ onMounted(fetchAttachments);
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-input
v-model="attachmentCondition.name"
:placeholder="t('module.attachment.dialog.multi-select.search.placeholder')"
:placeholder="
t('module.attachment.dialog.multi-select.search.placeholder')
"
clearable
@change="onSearchNameChange"
>
Expand Down Expand Up @@ -221,7 +225,9 @@ onMounted(fetchAttachments);
<!-- <el-table-column prop="id" label="ID" width="60" /> -->
<el-table-column
prop="name"
:label="t('module.attachment.dialog.multi-select.table.colum.label.name')"
:label="
t('module.attachment.dialog.multi-select.table.colum.label.name')
"
show-overflow-tooltip
sortable
>
Expand All @@ -244,15 +250,32 @@ onMounted(fetchAttachments);
</span>
</template>
</el-table-column>
<el-table-column prop="path" :label="t('module.attachment.dialog.multi-select.table.colum.label.path')" show-overflow-tooltip />
<el-table-column
prop="path"
:label="
t('module.attachment.dialog.multi-select.table.colum.label.path')
"
show-overflow-tooltip
/>
<el-table-column
prop="updateTime"
:label="t('module.attachment.dialog.multi-select.table.colum.label.update-time')"
:label="
t(
'module.attachment.dialog.multi-select.table.colum.label.update-time'
)
"
sortable
width="160"
:formatter="dateFormat"
/>
<el-table-column prop="size" :label="t('module.attachment.dialog.multi-select.table.colum.label.size')" width="130" sortable>
<el-table-column
prop="size"
:label="
t('module.attachment.dialog.multi-select.table.colum.label.size')
"
width="130"
sortable
>
<template #default="scoped">
<span v-if="scoped.row.type === 'File'">
{{ formatFileSize(scoped.row.size) }}
Expand All @@ -266,10 +289,10 @@ onMounted(fetchAttachments);
<template #footer>
<span class="dialog-footer">
<el-button plain type="info" @click="dialogVisible = false">
{{t('common.button.cancel')}}
{{ t('common.button.cancel') }}
</el-button>
<el-button plain @click="onConfirm">
{{t('common.button.confirm')}}
<el-button plain @click="onConfirm">
{{ t('common.button.confirm') }}
</el-button>
</span>
</template>
Expand Down
Loading

0 comments on commit beb7d4e

Please sign in to comment.