fix plugin

This commit is contained in:
jxxghp
2023-07-25 15:18:49 +08:00
parent e636b1e225
commit ad4577f86b
2 changed files with 19 additions and 13 deletions

View File

@@ -29,13 +29,13 @@ const pluginConfigDialog = ref(false)
const pluginConfigForm = ref({}) const pluginConfigForm = ref({})
// 插件表单配置项 // 插件表单配置项
const pluginFormItems = ref([]) let pluginFormItems = reactive([])
// 插件详情页面 // 插件详情页面
const pluginInfoDialog = ref(false) const pluginInfoDialog = ref(false)
// 插件详情页面配置项 // 插件详情页面配置项
const pluginPageItems = ref([]) let pluginPageItems = reactive([])
// 调用API卸载插件 // 调用API卸载插件
async function uninstallPlugin() { async function uninstallPlugin() {
@@ -61,7 +61,7 @@ async function loadPluginForm() {
try { try {
const result: { [key: string]: any } = await api.get(`plugin/form/${props.plugin?.id}`) const result: { [key: string]: any } = await api.get(`plugin/form/${props.plugin?.id}`)
if (result) { if (result) {
pluginFormItems.value = result.conf pluginFormItems = result.conf
if (result.model) if (result.model)
pluginConfigForm.value = result.model pluginConfigForm.value = result.model
} }
@@ -76,7 +76,7 @@ async function loadPluginPage() {
try { try {
const result: [] = await api.get(`plugin/page/${props.plugin?.id}`) const result: [] = await api.get(`plugin/page/${props.plugin?.id}`)
if (result) if (result)
pluginPageItems.value = result pluginPageItems = result
} }
catch (error) { catch (error) {
console.error(error) console.error(error)
@@ -120,6 +120,12 @@ async function showPluginInfo() {
// 显示插件配置 // 显示插件配置
async function showPluginConfig() { async function showPluginConfig() {
// 加载表单
await loadPluginForm()
// 加载配置
await loadPluginConf()
// 加载详情
await loadPluginPage()
// 显示对话框 // 显示对话框
pluginConfigDialog.value = true pluginConfigDialog.value = true
} }
@@ -136,13 +142,6 @@ const dropdownItems = ref([
}, },
}, },
]) ])
// 加载插件配置
onBeforeMount(async () => {
await loadPluginForm()
await loadPluginConf()
loadPluginPage()
})
</script> </script>
<template> <template>
@@ -242,7 +241,6 @@ onBeforeMount(async () => {
v-for="(item, index) in pluginPageItems" v-for="(item, index) in pluginPageItems"
:key="index" :key="index"
:config="item" :config="item"
:handler="pluginInfoDialog"
/> />
</VCardText> </VCardText>
<VCardActions> <VCardActions>

View File

@@ -48,9 +48,11 @@ onUnmounted(() => {
:headers="headers" :headers="headers"
:items="processList" :items="processList"
item-key="fullName" item-key="fullName"
class="table-rounded" class="table-rounded table-list"
hide-default-footer hide-default-footer
disable-sort disable-sort
fixed-header
height="500"
> >
<thead> <thead>
<tr> <tr>
@@ -91,3 +93,9 @@ onUnmounted(() => {
</VTable> </VTable>
</VCard> </VCard>
</template> </template>
<style lang="scss" scoped>
.table-list::-webkit-scrollbar {
display: none;
}
</style>