fix: 修复导入插件对话框无法打开的bug,修复插件编辑页面打开多个代码编辑器消失的bug

This commit is contained in:
xiaojunnuo
2025-09-15 18:03:55 +08:00
parent c560cc5add
commit e5a080aebe
3 changed files with 106 additions and 22 deletions

View File

@@ -25,7 +25,7 @@
<a-tab-pane key="editor" tab="元数据"> </a-tab-pane>
</a-tabs>
<div class="metadata-body">
<code-editor id="metadata" v-model:model-value="plugin.metadata" language="yaml" @save="doSave"></code-editor>
<code-editor :id="`metadata_${idRef}`" v-model:model-value="plugin.metadata" language="yaml" @save="doSave"></code-editor>
</div>
</div>
<div class="script">
@@ -33,7 +33,7 @@
<a-tab-pane key="script" tab="脚本"> </a-tab-pane>
</a-tabs>
<div class="script-body">
<code-editor id="content" v-model:model-value="plugin.content" language="javascript" @save="doSave"></code-editor>
<code-editor :id="`content_${idRef}`" v-model:model-value="plugin.content" language="javascript" @save="doSave"></code-editor>
</div>
</div>
</div>
@@ -83,6 +83,7 @@ function initFormOptions() {
}
initFormOptions();
const idRef = ref(route.query.id);
async function getPlugin() {
const id = route.query.id;
const pluginObj = await api.GetObj(id);

View File

@@ -1,12 +1,14 @@
import * as api from "/@/views/sys/plugin/api";
import { useFormWrapper } from "@fast-crud/fast-crud";
import { dict, useFormWrapper } from "@fast-crud/fast-crud";
import { useI18n } from "/@/locales";
import { Modal, notification } from "ant-design-vue";
import { notification } from "ant-design-vue";
export function usePluginImport() {
const { openCrudFormDialog } = useFormWrapper();
const { t } = useI18n();
async function openImportDialog({ crudExpose }) {
async function openImportDialog(opts: any) {
const { crudExpose } = opts;
function createCrudOptions() {
return {
crudOptions: {