mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-30 12:49:55 +08:00
Update confirmation dialog styles and props in UserProfile.vue, FileList.vue, PluginCard.vue, and dashboard.vue
This commit is contained in:
@@ -61,6 +61,8 @@ export interface Subscribe {
|
|||||||
save_path: string
|
save_path: string
|
||||||
// 时间
|
// 时间
|
||||||
date: string
|
date: string
|
||||||
|
// 编辑框设置项
|
||||||
|
show_edit_dialog: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// 历史记录
|
// 历史记录
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<script lang='ts' setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
|
import SubscribeEditDialog from '../dialog/SubscribeEditDialog.vue'
|
||||||
import { formatDateDifference } from '@/@core/utils/formatters'
|
import { formatDateDifference } from '@/@core/utils/formatters'
|
||||||
@@ -25,11 +25,7 @@ const imageLoaded = ref(false)
|
|||||||
const subscribeEditDialog = ref(false)
|
const subscribeEditDialog = ref(false)
|
||||||
|
|
||||||
// 上一次更新时间
|
// 上一次更新时间
|
||||||
const lastUpdateText = ref(
|
const lastUpdateText = ref(props.media && props.media.last_update ? formatDateDifference(props.media.last_update) : '')
|
||||||
props.media && props.media.last_update
|
|
||||||
? formatDateDifference(props.media.last_update)
|
|
||||||
: '',
|
|
||||||
)
|
|
||||||
|
|
||||||
// 图片加载完成响应
|
// 图片加载完成响应
|
||||||
function imageLoadHandler() {
|
function imageLoadHandler() {
|
||||||
@@ -38,23 +34,17 @@ function imageLoadHandler() {
|
|||||||
|
|
||||||
// 根据 type 返回不同的图标
|
// 根据 type 返回不同的图标
|
||||||
function getIcon() {
|
function getIcon() {
|
||||||
if (props.media?.type === '电影')
|
if (props.media?.type === '电影') return 'mdi-movie'
|
||||||
return 'mdi-movie'
|
else if (props.media?.type === '电视剧') return 'mdi-television-classic'
|
||||||
else if (props.media?.type === '电视剧')
|
else return 'mdi-help-circle'
|
||||||
return 'mdi-television-classic'
|
|
||||||
else
|
|
||||||
return 'mdi-help-circle'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算百分比
|
// 计算百分比
|
||||||
function getPercentage() {
|
function getPercentage() {
|
||||||
if (props.media?.total_episode === 0)
|
if (props.media?.total_episode === 0) return 0
|
||||||
return 0
|
|
||||||
|
|
||||||
return Math.round(
|
return Math.round(
|
||||||
(((props.media?.total_episode ?? 0) - (props.media?.lack_episode ?? 0))
|
(((props.media?.total_episode ?? 0) - (props.media?.lack_episode ?? 0)) / (props.media?.total_episode ?? 1)) * 100,
|
||||||
/ (props.media?.total_episode ?? 1))
|
|
||||||
* 100,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,16 +61,13 @@ function getTextClass() {
|
|||||||
// 删除订阅
|
// 删除订阅
|
||||||
async function removeSubscribe() {
|
async function removeSubscribe() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.delete(
|
const result: { [key: string]: any } = await api.delete(`subscribe/${props.media?.id}`)
|
||||||
`subscribe/${props.media?.id}`,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
// 通知父组件刷新
|
// 通知父组件刷新
|
||||||
emit('remove')
|
emit('remove')
|
||||||
}
|
}
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,15 +75,11 @@ async function removeSubscribe() {
|
|||||||
// 搜索订阅
|
// 搜索订阅
|
||||||
async function searchSubscribe() {
|
async function searchSubscribe() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get(
|
const result: { [key: string]: any } = await api.get(`subscribe/search/${props.media?.id}`)
|
||||||
`subscribe/search/${props.media?.id}`,
|
|
||||||
)
|
|
||||||
|
|
||||||
// 提示
|
// 提示
|
||||||
if (result.success)
|
if (result.success) $toast.success(`${props.media?.name} 提交搜索请求成功!`)
|
||||||
$toast.success(`${props.media?.name} 提交搜索请求成功!`)
|
} catch (e) {
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,11 +116,7 @@ const dropdownItems = ref([
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/media',
|
path: '/media',
|
||||||
query: {
|
query: {
|
||||||
mediaid: `${
|
mediaid: `${props.media?.tmdbid ? `tmdb:${props.media?.tmdbid}` : `douban:${props.media?.doubanid}`}`,
|
||||||
props.media?.tmdbid
|
|
||||||
? `tmdb:${props.media?.tmdbid}`
|
|
||||||
: `douban:${props.media?.doubanid}`
|
|
||||||
}`,
|
|
||||||
type: props.media?.type,
|
type: props.media?.type,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -160,6 +139,7 @@ const dropdownItems = ref([
|
|||||||
<VCard
|
<VCard
|
||||||
:key="props.media?.id"
|
:key="props.media?.id"
|
||||||
:class="`${props.media?.best_version ? 'outline-dashed outline-1' : ''}`"
|
:class="`${props.media?.best_version ? 'outline-dashed outline-1' : ''}`"
|
||||||
|
class="flex flex-col"
|
||||||
@click="editSubscribeDialog"
|
@click="editSubscribeDialog"
|
||||||
>
|
>
|
||||||
<template #image>
|
<template #image>
|
||||||
@@ -173,11 +153,7 @@ const dropdownItems = ref([
|
|||||||
</template>
|
</template>
|
||||||
<VCardItem>
|
<VCardItem>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon
|
<VIcon size="1.9rem" :color="getTextColor()" :icon="getIcon()" />
|
||||||
size="1.9rem"
|
|
||||||
:color="getTextColor()"
|
|
||||||
:icon="getIcon()"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<VCardTitle :class="getTextClass()">
|
<VCardTitle :class="getTextClass()">
|
||||||
{{ props.media?.name }}
|
{{ props.media?.name }}
|
||||||
@@ -186,14 +162,8 @@ const dropdownItems = ref([
|
|||||||
<template #append>
|
<template #append>
|
||||||
<div class="me-n3">
|
<div class="me-n3">
|
||||||
<IconBtn>
|
<IconBtn>
|
||||||
<VIcon
|
<VIcon icon="mdi-dots-vertical" :color="getTextColor()" />
|
||||||
icon="mdi-dots-vertical"
|
<VMenu activator="parent" close-on-content-click>
|
||||||
:color="getTextColor()"
|
|
||||||
/>
|
|
||||||
<VMenu
|
|
||||||
activator="parent"
|
|
||||||
close-on-content-click
|
|
||||||
>
|
|
||||||
<VList>
|
<VList>
|
||||||
<VListItem
|
<VListItem
|
||||||
v-for="(item, i) in dropdownItems"
|
v-for="(item, i) in dropdownItems"
|
||||||
@@ -213,29 +183,15 @@ const dropdownItems = ref([
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
|
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<p
|
<p class="clamp-text mb-0" :class="getTextClass()">
|
||||||
class="clamp-text mb-0"
|
|
||||||
:class="getTextClass()"
|
|
||||||
>
|
|
||||||
{{ props.media?.description }}
|
{{ props.media?.description }}
|
||||||
</p>
|
</p>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|
||||||
<VCardText class="d-flex justify-space-between align-center flex-wrap">
|
<VCardText class="d-flex justify-space-between align-center flex-wrap">
|
||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<IconBtn
|
<IconBtn icon="mdi-star" :color="getTextColor()" class="me-1" />
|
||||||
icon="mdi-star"
|
<span class="text-subtitle-2 me-4" :class="getTextClass()">{{ props.media?.vote }}</span>
|
||||||
:color="getTextColor()"
|
|
||||||
class="me-1"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
class="text-subtitle-2 me-4"
|
|
||||||
:class="getTextClass()"
|
|
||||||
>{{
|
|
||||||
props.media?.vote
|
|
||||||
}}</span>
|
|
||||||
<IconBtn
|
<IconBtn
|
||||||
v-if="props.media?.total_episode"
|
v-if="props.media?.total_episode"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
@@ -243,51 +199,39 @@ const dropdownItems = ref([
|
|||||||
:color="getTextColor()"
|
:color="getTextColor()"
|
||||||
class="me-1"
|
class="me-1"
|
||||||
/>
|
/>
|
||||||
<span
|
<span v-if="props.media?.season" class="text-subtitle-2 me-4" :class="getTextClass()"
|
||||||
v-if="props.media?.season"
|
>{{ (props.media?.total_episode || 0) - (props.media?.lack_episode || 0) }} /
|
||||||
class="text-subtitle-2 me-4"
|
{{ props.media?.total_episode }}</span
|
||||||
:class="getTextClass()"
|
|
||||||
>{{ (props.media?.total_episode || 0) - (props.media?.lack_episode || 0) }} /
|
|
||||||
{{ props.media?.total_episode }}</span>
|
|
||||||
<IconBtn
|
|
||||||
v-if="props.media?.username"
|
|
||||||
icon="mdi-account"
|
|
||||||
:color="getTextColor()"
|
|
||||||
class="me-1"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
v-if="props.media?.username"
|
|
||||||
class="text-subtitle-2 me-4"
|
|
||||||
:class="getTextClass()"
|
|
||||||
>
|
>
|
||||||
|
<IconBtn v-if="props.media?.username" icon="mdi-account" :color="getTextColor()" class="me-1" />
|
||||||
|
<span v-if="props.media?.username" class="text-subtitle-2 me-4" :class="getTextClass()">
|
||||||
{{ props.media?.username }}
|
{{ props.media?.username }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardText
|
<VCardText v-if="lastUpdateText" class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300">
|
||||||
v-if="lastUpdateText"
|
<VIcon icon="mdi-download" class="me-1" />
|
||||||
class="absolute right-0 bottom-0 d-flex align-center p-2 text-gray-300"
|
|
||||||
>
|
|
||||||
<VIcon
|
|
||||||
icon="mdi-download"
|
|
||||||
class="me-1"
|
|
||||||
/>
|
|
||||||
{{ lastUpdateText }}
|
{{ lastUpdateText }}
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VProgressLinear
|
<VProgressLinear v-if="getPercentage() > 0" :model-value="getPercentage()" bg-color="success" color="success" />
|
||||||
v-if="getPercentage() > 0"
|
|
||||||
:model-value="getPercentage()"
|
|
||||||
bg-color="success"
|
|
||||||
color="success"
|
|
||||||
/>
|
|
||||||
</VCard>
|
</VCard>
|
||||||
<!-- 订阅编辑弹窗 -->
|
<!-- 订阅编辑弹窗 -->
|
||||||
<SubscribeEditDialog
|
<SubscribeEditDialog
|
||||||
v-if="subscribeEditDialog"
|
v-if="subscribeEditDialog"
|
||||||
v-model="subscribeEditDialog"
|
v-model="subscribeEditDialog"
|
||||||
:subid="props.media?.id"
|
:subid="props.media?.id"
|
||||||
@remove="() => { emit('remove');subscribeEditDialog = false; }"
|
@remove="
|
||||||
@save="() => { emit('save');subscribeEditDialog = false; }"
|
() => {
|
||||||
|
emit('remove')
|
||||||
|
subscribeEditDialog = false
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@save="
|
||||||
|
() => {
|
||||||
|
emit('save')
|
||||||
|
subscribeEditDialog = false
|
||||||
|
}
|
||||||
|
"
|
||||||
@close="subscribeEditDialog = false"
|
@close="subscribeEditDialog = false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -18,27 +18,15 @@ function handleImport() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VDialog
|
<VDialog width="40rem" scrollable max-height="85vh">
|
||||||
width="40rem"
|
<VCard :title="props.title" class="rounded-t">
|
||||||
scrollable
|
|
||||||
max-height="85vh"
|
|
||||||
>
|
|
||||||
<VCard
|
|
||||||
:title="props.title"
|
|
||||||
class="rounded-t"
|
|
||||||
>
|
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
<VCardText class="pt-2">
|
<VCardText class="pt-2">
|
||||||
<VTextarea v-model="codeString" />
|
<VTextarea v-model="codeString" />
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn
|
<VBtn variant="elevated" @click="handleImport" prepend-icon="mdi-import" class="px-5 me-3"> 导入 </VBtn>
|
||||||
variant="tonal"
|
|
||||||
@click="handleImport"
|
|
||||||
>
|
|
||||||
导入
|
|
||||||
</VBtn>
|
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VDialog>
|
</VDialog>
|
||||||
|
|||||||
@@ -287,9 +287,8 @@ onMounted(() => {
|
|||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn depressed @click="emit('close')"> 取消 </VBtn>
|
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="tonal" @click="transfer"> 开始整理 </VBtn>
|
<VBtn variant="elevated" @click="transfer" prepend-icon="mdi-arrow-right-bold" class="px-5"> 开始整理 </VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
<!-- 手动整理进度框 -->
|
<!-- 手动整理进度框 -->
|
||||||
|
|||||||
@@ -5,10 +5,14 @@ import { doneNProgress, startNProgress } from '@/api/nprogress'
|
|||||||
import { numberValidator, requiredValidator } from '@/@validators'
|
import { numberValidator, requiredValidator } from '@/@validators'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
|
|
||||||
|
// 确认框
|
||||||
|
const createConfirm = useConfirm()
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
siteid: Number,
|
siteid: Number,
|
||||||
@@ -86,6 +90,13 @@ async function addSite() {
|
|||||||
|
|
||||||
// 调用API删除站点信息
|
// 调用API删除站点信息
|
||||||
async function deleteSiteInfo() {
|
async function deleteSiteInfo() {
|
||||||
|
const isConfirmed = await createConfirm({
|
||||||
|
title: '确认',
|
||||||
|
content: `是否确认删除站点?`,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isConfirmed) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.delete(`site/${siteForm.value?.id}`)
|
const result: { [key: string]: any } = await api.delete(`site/${siteForm.value?.id}`)
|
||||||
if (result.success) emit('remove')
|
if (result.success) emit('remove')
|
||||||
@@ -220,11 +231,30 @@ async function updateSiteInfo() {
|
|||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn v-if="props.oper === 'add'" @click="emit('close')"> 取消 </VBtn>
|
<VBtn v-if="props.oper !== 'add'" color="error" @click="deleteSiteInfo" variant="outlined" class="me-3">
|
||||||
<VBtn v-else color="error" @click="deleteSiteInfo"> 删除 </VBtn>
|
删除
|
||||||
|
</VBtn>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn v-if="props.oper === 'add'" color="primary" variant="tonal" @click="addSite"> 新增 </VBtn>
|
<VBtn
|
||||||
<VBtn v-else color="primary" variant="tonal" @click="updateSiteInfo"> 保存 </VBtn>
|
v-if="props.oper === 'add'"
|
||||||
|
color="primary"
|
||||||
|
variant="elevated"
|
||||||
|
@click="addSite"
|
||||||
|
prepend-icon="mdi-plus"
|
||||||
|
class="px-5"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</VBtn>
|
||||||
|
<VBtn
|
||||||
|
v-else
|
||||||
|
color="primary"
|
||||||
|
variant="elevated"
|
||||||
|
@click="updateSiteInfo"
|
||||||
|
prepend-icon="mdi-content-save"
|
||||||
|
class="px-5"
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
</VDialog>
|
</VDialog>
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ import { numberValidator } from '@/@validators'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Site, Subscribe } from '@/api/types'
|
import type { Site, Subscribe } from '@/api/types'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
import { useConfirm } from 'vuetify-use-dialog'
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
|
|
||||||
|
// 确认框
|
||||||
|
const createConfirm = useConfirm()
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
subid: Number,
|
subid: Number,
|
||||||
@@ -145,6 +149,12 @@ async function getSubscribeInfo() {
|
|||||||
|
|
||||||
// 删除订阅
|
// 删除订阅
|
||||||
async function removeSubscribe() {
|
async function removeSubscribe() {
|
||||||
|
const isConfirmed = await createConfirm({
|
||||||
|
title: '确认',
|
||||||
|
content: `是否确认取消订阅?`,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isConfirmed) return
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.delete(`subscribe/${props.subid}`)
|
const result: { [key: string]: any } = await api.delete(`subscribe/${props.subid}`)
|
||||||
|
|
||||||
@@ -361,9 +371,16 @@ onMounted(() => {
|
|||||||
</VCardText>
|
</VCardText>
|
||||||
|
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn v-if="!props.default" color="error" @click="removeSubscribe"> 取消订阅 </VBtn>
|
<VBtn v-if="!props.default" color="error" @click="removeSubscribe" variant="outlined" class="me-3">
|
||||||
|
取消订阅
|
||||||
|
</VBtn>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="tonal" @click=";`${props.default ? saveDefaultSubscribeConfig() : updateSubscribeInfo()}`">
|
<VBtn
|
||||||
|
variant="elevated"
|
||||||
|
@click=";`${props.default ? saveDefaultSubscribeConfig() : updateSubscribeInfo()}`"
|
||||||
|
prepend-icon="mdi-content-save"
|
||||||
|
class="px-5"
|
||||||
|
>
|
||||||
保存
|
保存
|
||||||
</VBtn>
|
</VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ app
|
|||||||
.use(VuetifyUseDialog, {
|
.use(VuetifyUseDialog, {
|
||||||
confirmDialog: {
|
confirmDialog: {
|
||||||
dialogProps: {
|
dialogProps: {
|
||||||
maxWidth: '50rem',
|
maxWidth: '40rem',
|
||||||
},
|
},
|
||||||
confirmationButtonProps: {
|
confirmationButtonProps: {
|
||||||
variant: 'elevated',
|
variant: 'elevated',
|
||||||
|
|||||||
Reference in New Issue
Block a user