feat 插件配置

This commit is contained in:
jxxghp
2023-07-24 17:27:09 +08:00
parent ba1debf40f
commit dbd1315a9e
2 changed files with 19 additions and 9 deletions

View File

@@ -119,12 +119,6 @@ function showPluginInfo() {
// 显示插件配置
async function showPluginConfig() {
// 加载插件表单
await loadPluginForm()
// 加载插件配置
loadPluginConf()
// 加载详情数据
loadPluginPage()
// 显示对话框
pluginConfigDialog.value = true
}
@@ -141,6 +135,13 @@ const dropdownItems = ref([
},
},
])
// 加载插件配置
onBeforeMount(async () => {
await loadPluginForm()
await loadPluginConf()
await loadPluginPage()
})
</script>
<template>
@@ -207,7 +208,12 @@ const dropdownItems = ref([
<VCard :title="`插件 - ${props.plugin?.plugin_name}`">
<DialogCloseBtn @click="pluginConfigDialog = false" />
<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>
<VCardActions>
<VBtn v-if="pluginPageItems.length > 0" @click="showPluginInfo">

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { type PropType, ref } from 'vue'
// 组件配置
// 组件接口
interface RenderProps {
component: string
content?: any
@@ -26,7 +26,11 @@ const formData = ref<any>(elementProps.form || {})
</script>
<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
v-for="(innerItem, innerIndex) in (formItem.content || [])"
:key="innerIndex"