mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-12 02:21:06 +08:00
fix workflow
This commit is contained in:
@@ -89,7 +89,7 @@ async function editWorkflow() {
|
||||
<VCard>
|
||||
<VCardItem>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-clock-outline" class="me-2" />
|
||||
<VIcon icon="mdi-workflow-outline" class="me-2" />
|
||||
</template>
|
||||
<VCardTitle>{{ title }}</VCardTitle>
|
||||
</VCardItem>
|
||||
|
||||
@@ -155,7 +155,8 @@ export default {
|
||||
installSuccess: 'App installed successfully!',
|
||||
installGuide: 'Installation Guide',
|
||||
installInstructions: 'Install MoviePilot on {platform}:',
|
||||
installNote: 'After installation, you can quickly access MoviePilot from your home screen and enjoy offline features.',
|
||||
installNote:
|
||||
'After installation, you can quickly access MoviePilot from your home screen and enjoy offline features.',
|
||||
gotIt: 'Got it',
|
||||
// Platform specific descriptions
|
||||
platforms: {
|
||||
@@ -330,7 +331,7 @@ export default {
|
||||
},
|
||||
},
|
||||
workflowTabs: {
|
||||
list: 'Workflow',
|
||||
list: 'My Workflows',
|
||||
share: 'Workflow Share',
|
||||
},
|
||||
pluginTabs: {
|
||||
@@ -1135,6 +1136,8 @@ export default {
|
||||
'Share subscription statistics to popular subscriptions for other MP users to reference',
|
||||
pluginStatisticShare: 'Report Plugin Installation Data',
|
||||
pluginStatisticShareHint: 'Report plugin installation data to the server for statistics and display purposes',
|
||||
workflowStatisticShare: 'Share Workflow Data',
|
||||
workflowStatisticShareHint: 'Share workflow statistics to popular workflows for other MP users to reference',
|
||||
bigMemoryMode: 'Large Memory Mode',
|
||||
bigMemoryModeHint: 'Use more memory to cache data and improve system performance',
|
||||
dbWalEnable: 'WAL Mode',
|
||||
|
||||
@@ -329,7 +329,7 @@ export default {
|
||||
},
|
||||
},
|
||||
workflowTabs: {
|
||||
list: '工作流',
|
||||
list: '我的工作流',
|
||||
share: '工作流分享',
|
||||
},
|
||||
pluginTabs: {
|
||||
@@ -1131,6 +1131,8 @@ export default {
|
||||
subscribeStatisticShareHint: '分享订阅统计数据到热门订阅,供其他MPer参考',
|
||||
pluginStatisticShare: '上报插件安装数据',
|
||||
pluginStatisticShareHint: '上报插件安装数据给服务器,用于统计展示插件安装情况',
|
||||
workflowStatisticShare: '分享工作流数据',
|
||||
workflowStatisticShareHint: '分享工作流统计数据到热门工作流,供其他MPer参考',
|
||||
bigMemoryMode: '大内存模式',
|
||||
bigMemoryModeHint: '使用更大的内存缓存数据,提升系统性能',
|
||||
dbWalEnable: 'WAL模式',
|
||||
|
||||
@@ -330,7 +330,7 @@ export default {
|
||||
},
|
||||
},
|
||||
workflowTabs: {
|
||||
list: '工作流',
|
||||
list: '我的工作流',
|
||||
share: '工作流分享',
|
||||
},
|
||||
pluginTabs: {
|
||||
@@ -1130,6 +1130,8 @@ export default {
|
||||
subscribeStatisticShareHint: '分享訂閱統計數據到熱門訂閱,供其他MPer參考',
|
||||
pluginStatisticShare: '上報插件安裝數據',
|
||||
pluginStatisticShareHint: '上報插件安裝數據給服務器,用於統計展示插件安裝情況',
|
||||
workflowStatisticShare: '分享工作流數據',
|
||||
workflowStatisticShareHint: '分享工作流統計數據到熱門工作流,供其他MPer參考',
|
||||
bigMemoryMode: '大內存模式',
|
||||
bigMemoryModeHint: '使用更大的內存緩存數據,提升系統性能',
|
||||
dbWalEnable: 'WAL模式',
|
||||
|
||||
@@ -11,7 +11,7 @@ const { t } = useI18n()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const activeTab = ref((route.query.tab as string) || '')
|
||||
const activeTab = ref((route.query.tab as string) || 'list')
|
||||
const shareViewKey = ref(0)
|
||||
|
||||
// 获取标签页
|
||||
@@ -22,20 +22,20 @@ const workflowTabs = computed(() => {
|
||||
// 新增工作流对话框
|
||||
const addWorkflowDialog = ref(false)
|
||||
|
||||
// 工作流列表刷新key
|
||||
const workflowListKey = ref(0)
|
||||
|
||||
// 分享搜索词
|
||||
const shareKeyword = ref('')
|
||||
|
||||
// 搜索分享对话框
|
||||
const searchShareDialog = ref(false)
|
||||
|
||||
// 搜索分享激活器
|
||||
const searchActivator = computed(() => '[data-menu-activator="search-btn"]')
|
||||
|
||||
// 搜索分享
|
||||
const searchShares = () => {
|
||||
shareViewKey.value++
|
||||
}
|
||||
|
||||
// VMenu activator选择器
|
||||
const searchActivator = computed(() => '[data-menu-activator="search-btn"]')
|
||||
|
||||
// 使用动态标签页
|
||||
const { registerHeaderTab } = useDynamicHeaderTab()
|
||||
|
||||
@@ -45,26 +45,15 @@ registerHeaderTab({
|
||||
modelValue: activeTab,
|
||||
appendButtons: [
|
||||
{
|
||||
icon: 'mdi-movie-search-outline',
|
||||
icon: 'mdi-search',
|
||||
variant: 'text',
|
||||
color: computed(() => (shareKeyword.value ? 'primary' : 'gray')),
|
||||
class: 'settings-icon-button',
|
||||
dataAttr: 'search-btn',
|
||||
action: () => {
|
||||
// 这里可以添加搜索弹窗逻辑
|
||||
console.log('Search workflow shares')
|
||||
},
|
||||
show: computed(() => activeTab.value === 'share'),
|
||||
},
|
||||
{
|
||||
icon: 'mdi-plus',
|
||||
variant: 'text',
|
||||
color: 'gray',
|
||||
class: 'settings-icon-button',
|
||||
action: () => {
|
||||
addWorkflowDialog.value = true
|
||||
searchShareDialog.value = true
|
||||
},
|
||||
show: computed(() => activeTab.value === 'list'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -91,25 +80,6 @@ onMounted(() => {
|
||||
<VWindowItem value="share">
|
||||
<transition name="fade-slide" appear>
|
||||
<div>
|
||||
<div class="mb-4">
|
||||
<VRow>
|
||||
<VCol cols="12" md="6">
|
||||
<VTextField
|
||||
v-model="shareKeyword"
|
||||
:label="t('workflow.searchShares')"
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
clearable
|
||||
@keyup.enter="searchShares"
|
||||
@click:clear="searchShares"
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12" md="6" class="d-flex align-center">
|
||||
<VBtn @click="searchShares" prepend-icon="mdi-magnify" class="me-2">
|
||||
{{ t('workflow.searchShares') }}
|
||||
</VBtn>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</div>
|
||||
<WorkflowShareView :keyword="shareKeyword" :key="shareViewKey" />
|
||||
</div>
|
||||
</transition>
|
||||
@@ -123,6 +93,34 @@ onMounted(() => {
|
||||
@close="addWorkflowDialog = false"
|
||||
@save="addWorkflowDialog = false"
|
||||
/>
|
||||
|
||||
<!-- 搜索工作流分享弹窗 -->
|
||||
<Teleport to="body" v-if="searchShareDialog">
|
||||
<VMenu
|
||||
v-model="searchShareDialog"
|
||||
width="25rem"
|
||||
:close-on-content-click="false"
|
||||
:activator="searchActivator"
|
||||
location="bottom end"
|
||||
>
|
||||
<VCard>
|
||||
<VCardItem>
|
||||
<VCardTitle>
|
||||
<VIcon icon="mdi-movie-search-outline" class="mr-2" />
|
||||
{{ t('workflow.searchShares') }}
|
||||
</VCardTitle>
|
||||
<VDialogCloseBtn @click="searchShareDialog = false" />
|
||||
</VCardItem>
|
||||
<VCardText>
|
||||
<VTextField v-model="shareKeyword" :label="t('workflow.searchShares')" clearable density="comfortable">
|
||||
<template #append>
|
||||
<VBtn prepend-icon="mdi-magnify" color="primary" @click="searchShares">{{ t('common.search') }}</VBtn>
|
||||
</template>
|
||||
</VTextField>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
</VMenu>
|
||||
</Teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -302,12 +302,12 @@ export function getWorkflowTabs() {
|
||||
{
|
||||
title: t('workflowTabs.list'),
|
||||
tab: 'list',
|
||||
icon: 'mdi-format-list-bulleted',
|
||||
icon: 'mdi-workflow-outline',
|
||||
},
|
||||
{
|
||||
title: t('workflowTabs.share'),
|
||||
tab: 'share',
|
||||
icon: 'mdi-share',
|
||||
icon: 'mdi-share-variant',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ const SystemSettings = ref<any>({
|
||||
GLOBAL_IMAGE_CACHE: false,
|
||||
SUBSCRIBE_STATISTIC_SHARE: true,
|
||||
PLUGIN_STATISTIC_SHARE: true,
|
||||
WORKFLOW_STATISTIC_SHARE: true,
|
||||
BIG_MEMORY_MODE: false,
|
||||
DB_WAL_ENABLE: false,
|
||||
AUTO_UPDATE_RESOURCE: true,
|
||||
@@ -801,6 +802,14 @@ onDeactivated(() => {
|
||||
persistent-hint
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12" md="6">
|
||||
<VSwitch
|
||||
v-model="SystemSettings.Advanced.WORKFLOW_STATISTIC_SHARE"
|
||||
:label="t('setting.system.workflowStatisticShare')"
|
||||
:hint="t('setting.system.workflowStatisticShareHint')"
|
||||
persistent-hint
|
||||
/>
|
||||
</VCol>
|
||||
<VCol cols="12" md="6">
|
||||
<VSwitch
|
||||
v-model="SystemSettings.Advanced.BIG_MEMORY_MODE"
|
||||
|
||||
@@ -6,19 +6,20 @@ import WorkflowTaskCard from '@/components/cards/WorkflowTaskCard.vue'
|
||||
import NoDataFound from '@/components/NoDataFound.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { usePWA } from '@/composables/usePWA'
|
||||
import { useDynamicButton } from '@/composables/useDynamicButton'
|
||||
|
||||
// 国际化
|
||||
const { t } = useI18n()
|
||||
|
||||
// 是否刷新
|
||||
const isRefreshed = ref(false)
|
||||
|
||||
// 路由
|
||||
const route = useRoute()
|
||||
|
||||
// PWA模式检测
|
||||
const { appMode } = usePWA()
|
||||
|
||||
// 是否刷新
|
||||
const isRefreshed = ref(false)
|
||||
|
||||
// 新增对话框
|
||||
const addDialog = ref(false)
|
||||
|
||||
@@ -41,6 +42,14 @@ function addDone() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 使用动态按钮钩子 新增
|
||||
useDynamicButton({
|
||||
icon: 'mdi-plus',
|
||||
onClick: () => {
|
||||
addDialog.value = true
|
||||
},
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
@@ -51,7 +60,6 @@ onActivated(() => {
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<VPageContentTitle :title="t('workflow.title')" />
|
||||
<LoadingBanner v-if="!isRefreshed" class="mt-12" />
|
||||
<div v-if="workflowList.length > 0 && isRefreshed" class="grid gap-4 grid-workflow-card px-2">
|
||||
<WorkflowTaskCard v-for="item in workflowList" :key="item.id" :workflow="item" @refresh="fetchData" />
|
||||
@@ -62,5 +70,21 @@ onActivated(() => {
|
||||
:error-title="t('workflow.noWorkflow')"
|
||||
:error-description="t('workflow.noWorkflowDescription')"
|
||||
/>
|
||||
<!-- 新增按钮 -->
|
||||
<Teleport to="body" v-if="route.path === '/workflow'">
|
||||
<VFab
|
||||
v-if="isRefreshed && !appMode"
|
||||
icon="mdi-plus"
|
||||
location="bottom"
|
||||
size="x-large"
|
||||
fixed
|
||||
app
|
||||
appear
|
||||
:class="{ 'mb-12': appMode }"
|
||||
@click="addDialog = true"
|
||||
/>
|
||||
</Teleport>
|
||||
<!-- 新增对话框 -->
|
||||
<WorkflowAddEditDialog v-if="addDialog" v-model="addDialog" @close="addDialog = false" @save="addDone" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user