This commit is contained in:
zyronon
2025-09-14 20:14:29 +08:00
parent 65bba3ea07
commit fadcf0fff6
4 changed files with 53 additions and 46 deletions

1
components.d.ts vendored
View File

@@ -63,6 +63,7 @@ declare module 'vue' {
IconFluentStar16Regular: typeof import('~icons/fluent/star16-regular')['default']
IconFluentStar20Filled: typeof import('~icons/fluent/star20-filled')['default']
IconFluentStarAdd16Regular: typeof import('~icons/fluent/star-add16-regular')['default']
IconFluentTextBulletListSquare20Regular: typeof import('~icons/fluent/text-bullet-list-square20-regular')['default']
IconFluentTextEditStyle20Regular: typeof import('~icons/fluent/text-edit-style20-regular')['default']
IconFluentTextListAbcUppercaseLtr20Regular: typeof import('~icons/fluent/text-list-abc-uppercase-ltr20-regular')['default']
IconFluentTextUnderlineDouble20Regular: typeof import('~icons/fluent/text-underline-double20-regular')['default']

View File

@@ -15,6 +15,7 @@ import EditArticle from "@/pages/pc/article/components/EditArticle.vue";
import Toast from '@/pages/pc/components/base/toast/Toast.ts'
import {getDefaultArticle} from "@/types/func.ts";
import BackIcon from "@/pages/pc/components/BackIcon.vue";
import MiniDialog from "@/pages/pc/components/dialog/MiniDialog.vue";
defineEmits<{
importData: [val: Event]
@@ -24,24 +25,9 @@ const base = useBaseStore()
const runtimeStore = useRuntimeStore()
let article = $ref<Article>(getDefaultArticle())
let show = $ref(false)
let editArticleRef: any = $ref()
let listEl: any = $ref()
onMounted(() => {
emitter.on(EventKey.openArticleListModal, (val: Article) => {
console.log('val', val)
show = true
if (val) {
article = cloneDeep(val)
}
})
})
onUnmounted(() => {
emitter.off(EventKey.openArticleListModal)
})
async function selectArticle(item: Article) {
let r = await checkDataChange()
if (r) {
@@ -99,7 +85,6 @@ async function add() {
}
}
function saveArticle(val: Article): boolean {
if (val.id) {
let rIndex = runtimeStore.editDict.articles.findIndex(v => v.id === val.id)
@@ -153,6 +138,10 @@ function saveAndNext(val: Article) {
let showExport = $ref(false)
useWindowClick(() => showExport = false)
function importData() {
}
</script>
<template>
@@ -178,31 +167,31 @@ useWindowClick(() => showExport = false)
正在添加新文章...
</div>
<div class="footer">
<!-- <div class="import">-->
<!-- <BaseButton>导入</BaseButton>-->
<!-- <input type="file"-->
<!-- accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"-->
<!-- @change="e => emit('importData',e)">-->
<!-- </div>-->
<!-- <div class="export"-->
<!-- style="position: relative"-->
<!-- @click.stop="null">-->
<!-- <BaseButton @click="showExport = true">导出</BaseButton>-->
<!-- <MiniDialog-->
<!-- v-model="showExport"-->
<!-- style="width: 80rem;bottom: calc(100% + 10rem);top:unset;"-->
<!-- >-->
<!-- <div class="mini-row-title">-->
<!-- 导出选项-->
<!-- </div>-->
<!-- <div class="mini-row">-->
<!-- <BaseButton @click="emit('exportData',{type:'all',data:[]})">全部文章</BaseButton>-->
<!-- </div>-->
<!-- <div class="mini-row">-->
<!-- <BaseButton @click="emit('exportData',{type:'chapter',data:article})">当前章节</BaseButton>-->
<!-- </div>-->
<!-- </MiniDialog>-->
<!-- </div>-->
<div class="import">
<BaseButton>导入</BaseButton>
<input type="file"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importData">
</div>
<div class="export"
style="position: relative"
@click.stop="null">
<BaseButton @click="showExport = true">导出</BaseButton>
<MiniDialog
v-model="showExport"
style="width: 8rem;bottom: calc(100% + 1rem);top:unset;"
>
<div class="mini-row-title">
导出选项
</div>
<div class="mini-row">
<BaseButton @click="emit('exportData',{type:'all',data:[]})">全部文章</BaseButton>
</div>
<div class="mini-row">
<BaseButton @click="emit('exportData',{type:'chapter',data:article})">当前章节</BaseButton>
</div>
</MiniDialog>
</div>
<BaseButton @click="add">新增</BaseButton>
</div>
</div>

View File

@@ -263,7 +263,7 @@ async function importData(e) {
if (!entry) continue;
const blob = await entry.async("blob");
const id = filename.replace(/^mp3\//, "").replace(/\.mp3$/, "");
records.push({ id, file: blob });
records.push({id, file: blob});
}
}
await set(LOCAL_FILE_KEY, records);
@@ -332,6 +332,10 @@ function importOldData() {
<IconFluentDatabasePerson20Regular width="20"/>
<span>数据管理</span>
</div>
<div class="tab" :class="tabIndex === 7 && 'active'" @click="tabIndex = 7">
<IconFluentTextBulletListSquare20Regular width="20"/>
<span>更新日志</span>
</div>
<div class="tab" :class="tabIndex === 5 && 'active'" @click="tabIndex = 5">
<IconFluentMailEdit20Regular width="20"/>
<span>反馈</span>
@@ -563,8 +567,6 @@ function importOldData() {
<Slider v-model="settingStore.articleSoundSpeed" :step="0.1" :min="0.5" :max="3"/>
<span class="w-10 pl-5">{{ settingStore.articleSoundSpeed }}</span>
</SettingItem>
</div>
@@ -647,6 +649,22 @@ function importOldData() {
Build {{ gitLastCommitHash }}
</div>
</div>
<div v-if="tabIndex === 7">
<div class="item p-2" v-for="i in 10">
<div class="mb-2">
<div>
<span>2025/9/14</span>
<span>完善文章编辑功能翻译不可用</span>
</div>
<div class="text-base">
<p>除了翻译不可用前端直接调百度接口会跨域有能力可以把浏览器的跨域检测关掉就可以用了</p>
<p>1完善音频管理功能目前已可添加音频设置句子与音频的对应位置</p>
</div>
</div>
<div class="line"></div>
</div>
</div>
</div>
</div>
</BasePage>
@@ -693,7 +711,7 @@ function importOldData() {
flex: 1;
height: 100%;
overflow: auto;
padding: 0 2.6rem;
padding: 0 1.6rem;
.row {
min-height: 2.6rem;

View File

@@ -7,7 +7,6 @@ export const EventKey = {
changeDict: 'changeDict',
openStatModal: 'openStatModal',
openWordListModal: 'openWordListModal',
openArticleListModal: 'openArticleListModal',
closeOther: 'closeOther',
keydown: 'keydown',
keyup: 'keyup',