mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
重构 PluginCard 组件,替换 DynamicRender 为 FormRender;在 ForkSubscribeDialog 组件中添加处理状态以优化用户体验;删除不再使用的 DynamicRender 组件
This commit is contained in:
@@ -3,7 +3,7 @@ import { useToast } from 'vue-toast-notification'
|
|||||||
import { useConfirm } from 'vuetify-use-dialog'
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Plugin } from '@/api/types'
|
import type { Plugin } from '@/api/types'
|
||||||
import DynamicRender from '@/components/render/DynamicRender.vue'
|
import FormRender from '@/components/render/FormRender.vue'
|
||||||
import PageRender from '@/components/render/PageRender.vue'
|
import PageRender from '@/components/render/PageRender.vue'
|
||||||
import VersionHistory from '@/components/misc/VersionHistory.vue'
|
import VersionHistory from '@/components/misc/VersionHistory.vue'
|
||||||
import { isNullOrEmptyObject } from '@core/utils'
|
import { isNullOrEmptyObject } from '@core/utils'
|
||||||
@@ -490,12 +490,7 @@ watch(
|
|||||||
<DialogCloseBtn v-model="pluginConfigDialog" />
|
<DialogCloseBtn v-model="pluginConfigDialog" />
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<DynamicRender
|
<FormRender v-for="(item, index) in pluginFormItems" :key="index" :config="item" :model="pluginConfigForm" />
|
||||||
v-for="(item, index) in pluginFormItems"
|
|
||||||
:key="index"
|
|
||||||
:config="item"
|
|
||||||
:model="pluginConfigForm"
|
|
||||||
/>
|
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions class="pt-3">
|
<VCardActions class="pt-3">
|
||||||
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo" variant="outlined" color="info">
|
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo" variant="outlined" color="info">
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ const globalSettings: any = inject('globalSettings')
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 处理中
|
||||||
|
const processing = ref(false)
|
||||||
|
|
||||||
// 计算海报图片地址
|
// 计算海报图片地址
|
||||||
const posterUrl = computed(() => {
|
const posterUrl = computed(() => {
|
||||||
const url = props.media?.poster
|
const url = props.media?.poster
|
||||||
@@ -45,9 +48,9 @@ async function doFork() {
|
|||||||
// 开始处理
|
// 开始处理
|
||||||
startNProgress()
|
startNProgress()
|
||||||
try {
|
try {
|
||||||
|
processing.value = true
|
||||||
// 请求API
|
// 请求API
|
||||||
const result: { [key: string]: any } = await api.post('subscribe/fork', props.media)
|
const result: { [key: string]: any } = await api.post('subscribe/fork', props.media)
|
||||||
|
|
||||||
// 订阅状态
|
// 订阅状态
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success(`${props.media?.share_title} 添加订阅成功!`)
|
$toast.success(`${props.media?.share_title} 添加订阅成功!`)
|
||||||
@@ -59,6 +62,7 @@ async function doFork() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
|
processing.value = false
|
||||||
doneNProgress()
|
doneNProgress()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,7 +117,15 @@ async function doFork() {
|
|||||||
</VListItem>
|
</VListItem>
|
||||||
</VList>
|
</VList>
|
||||||
<div class="text-center text-md-left">
|
<div class="text-center text-md-left">
|
||||||
<VBtn color="primary" @click="doFork" prepend-icon="mdi-heart">添加到我的订阅</VBtn>
|
<VBtn
|
||||||
|
color="primary"
|
||||||
|
:disabled="processing"
|
||||||
|
@click="doFork"
|
||||||
|
prepend-icon="mdi-heart"
|
||||||
|
:loading="processing"
|
||||||
|
>
|
||||||
|
添加到我的订阅
|
||||||
|
</VBtn>
|
||||||
</div>
|
</div>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user