chore: perf remote- select

This commit is contained in:
xiaojunnuo
2026-02-09 19:20:34 +08:00
parent 2f40f795ee
commit 79c77ce3a3

View File

@@ -79,6 +79,17 @@ const getPluginType: any = inject("get:plugin:type", () => {
return "plugin"; return "plugin";
}); });
function getInputFromForm(form: any, pluginType: string) {
let input: any = {};
if (pluginType === "plugin") {
input = form?.input || {};
} else if (pluginType === "access") {
input = form?.access || {};
} else {
input = form || {};
}
return input;
}
const searchKeyRef = ref(""); const searchKeyRef = ref("");
const optionsRef = ref([]); const optionsRef = ref([]);
const message = ref(""); const message = ref("");
@@ -104,7 +115,7 @@ const getOptions = async () => {
} }
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form } = getScope(); const { form } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
for (let key in define.input) { for (let key in define.input) {
const inWatches = props.watches?.includes(key); const inWatches = props.watches?.includes(key);
@@ -200,7 +211,7 @@ watch(
() => { () => {
const pluginType = getPluginType(); const pluginType = getPluginType();
const { form, key } = getScope(); const { form, key } = getScope();
const input = (pluginType === "plugin" ? form?.input : form) || {}; const input = getInputFromForm(form, pluginType);
const watches: any = {}; const watches: any = {};
if (props.watches && props.watches.length > 0) { if (props.watches && props.watches.length > 0) {
for (const key of props.watches) { for (const key of props.watches) {