mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
feat 插件配置
This commit is contained in:
@@ -119,12 +119,6 @@ function showPluginInfo() {
|
|||||||
|
|
||||||
// 显示插件配置
|
// 显示插件配置
|
||||||
async function showPluginConfig() {
|
async function showPluginConfig() {
|
||||||
// 加载插件表单
|
|
||||||
await loadPluginForm()
|
|
||||||
// 加载插件配置
|
|
||||||
loadPluginConf()
|
|
||||||
// 加载详情数据
|
|
||||||
loadPluginPage()
|
|
||||||
// 显示对话框
|
// 显示对话框
|
||||||
pluginConfigDialog.value = true
|
pluginConfigDialog.value = true
|
||||||
}
|
}
|
||||||
@@ -141,6 +135,13 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// 加载插件配置
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
await loadPluginForm()
|
||||||
|
await loadPluginConf()
|
||||||
|
await loadPluginPage()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -207,7 +208,12 @@ const dropdownItems = ref([
|
|||||||
<VCard :title="`插件 - ${props.plugin?.plugin_name}`">
|
<VCard :title="`插件 - ${props.plugin?.plugin_name}`">
|
||||||
<DialogCloseBtn @click="pluginConfigDialog = false" />
|
<DialogCloseBtn @click="pluginConfigDialog = false" />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<FormRender v-for="(item, index) in pluginFormItems" :key="index" :config="item" :form="pluginConfigForm" />
|
<FormRender
|
||||||
|
v-for="(item, index) in pluginFormItems"
|
||||||
|
:key="index"
|
||||||
|
:config="item"
|
||||||
|
:form="pluginConfigForm"
|
||||||
|
/>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo">
|
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { type PropType, ref } from 'vue'
|
import { type PropType, ref } from 'vue'
|
||||||
|
|
||||||
// 组件配置
|
// 组件接口
|
||||||
interface RenderProps {
|
interface RenderProps {
|
||||||
component: string
|
component: string
|
||||||
content?: any
|
content?: any
|
||||||
@@ -26,7 +26,11 @@ const formData = ref<any>(elementProps.form || {})
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component :is="formItem.component" v-bind="formItem.props" v-model="formData[formItem.props?.model || '']">
|
<Component
|
||||||
|
:is="formItem.component"
|
||||||
|
v-bind="formItem.props"
|
||||||
|
v-model="formData[formItem.props?.model || '']"
|
||||||
|
>
|
||||||
<FormRender
|
<FormRender
|
||||||
v-for="(innerItem, innerIndex) in (formItem.content || [])"
|
v-for="(innerItem, innerIndex) in (formItem.content || [])"
|
||||||
:key="innerIndex"
|
:key="innerIndex"
|
||||||
|
|||||||
Reference in New Issue
Block a user