mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-11 18:10:32 +08:00
✨ Feature(custom): imporve page loading performance and remove duplicated init call
This commit is contained in:
@@ -21,26 +21,6 @@
|
||||
<transition name="fade-slide" mode="out-in">
|
||||
<!-- General Settings Tab -->
|
||||
<div v-if="activeTab === 'general'" key="general" class="tab-content">
|
||||
<div class="settings-section">
|
||||
<div class="section-header">
|
||||
<div class="section-icon">
|
||||
<FileText :size="20" />
|
||||
</div>
|
||||
<div class="section-title-group">
|
||||
<h2>{{ $t('pages.imageProcess.general.skipProcessExtList') }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea
|
||||
v-model="skipProcessForm.skipProcessExtList"
|
||||
class="form-textarea"
|
||||
rows="3"
|
||||
:placeholder="'zip,rar,7z,tar,gz'"
|
||||
/>
|
||||
<small>{{ $t('pages.imageProcess.general.skipProcessExtListPlaceholder') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-section">
|
||||
<div class="section-header">
|
||||
<div class="section-icon">
|
||||
@@ -62,6 +42,7 @@
|
||||
</label>
|
||||
|
||||
<PerPicbedSetting
|
||||
v-if="!configId"
|
||||
:map-field="compressForm.isRemoveExifMap"
|
||||
:default-value="defaultCompressSetting.isRemoveExif"
|
||||
field-name="isRemoveExif"
|
||||
@@ -892,6 +873,29 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Skip Process Tab -->
|
||||
<div v-else-if="activeTab === 'skipProcess'" key="skipProcess" class="tab-content">
|
||||
<div class="settings-section">
|
||||
<div class="section-header">
|
||||
<div class="section-icon">
|
||||
<FileText :size="20" />
|
||||
</div>
|
||||
<div class="section-title-group">
|
||||
<h2>{{ $t('pages.imageProcess.general.skipProcessExtList') }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea
|
||||
v-model="skipProcessForm.skipProcessExtList"
|
||||
class="form-textarea"
|
||||
rows="3"
|
||||
:placeholder="'zip,rar,7z,tar,gz'"
|
||||
/>
|
||||
<small>{{ $t('pages.imageProcess.general.skipProcessExtListPlaceholder') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
@@ -933,7 +937,6 @@ import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { configPaths } from '@/utils/configPaths'
|
||||
import { getConfig, saveConfig } from '@/utils/dataSender'
|
||||
import { updatePicBedGlobal } from '@/utils/global'
|
||||
|
||||
import PerPicbedSetting from './PerPicbedSetting.vue'
|
||||
|
||||
@@ -944,6 +947,13 @@ const activeTab = ref('general')
|
||||
const tabRefs = useTemplateRef('tabRefs')
|
||||
const tabIndicatorStyle = ref<Record<string, string>>({})
|
||||
|
||||
interface IProps {
|
||||
// 传递配置ID以加载特定配置
|
||||
configId: string
|
||||
}
|
||||
|
||||
const { configId } = defineProps<IProps>()
|
||||
|
||||
function updateTabIndicator() {
|
||||
if (!tabRefs.value || tabRefs.value.length === 0) return
|
||||
const activeIndex = tabs.value.findIndex(tab => tab.id === activeTab.value)
|
||||
@@ -985,6 +995,16 @@ const tabs = computed(() => [
|
||||
label: t('pages.imageProcess.transformSettings'),
|
||||
icon: RotateCw,
|
||||
},
|
||||
{
|
||||
id: 'skipProcess',
|
||||
label: t('pages.imageProcess.skipProcessSettings'),
|
||||
icon: FileText,
|
||||
},
|
||||
{
|
||||
id: 'rename',
|
||||
label: t('pages.imageProcess.renameSettings'),
|
||||
icon: Sliders,
|
||||
},
|
||||
])
|
||||
|
||||
const waterMarkPositionMap = new Map([
|
||||
@@ -1193,13 +1213,10 @@ function safeSetMapValue(form: any, fieldName: string, picbedType: string, value
|
||||
}
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await updatePicBedGlobal()
|
||||
await initData()
|
||||
|
||||
setTimeout(() => {
|
||||
onBeforeMount(() => {
|
||||
initData().then(() => {
|
||||
isInitialized.value = true
|
||||
}, 100)
|
||||
})
|
||||
})
|
||||
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user