finish mook

This commit is contained in:
锦恢 2025-06-29 22:30:52 +08:00
parent 1f7e5b8b7d
commit 47d5d6474a
2 changed files with 21 additions and 19 deletions

View File

@ -163,24 +163,26 @@ function getDefaultValue(property: any): string {
}
}
// watch
// watch(
// () => props.modelValue,
// (newVal) => {
// const currentParsed = tryParse(inputValue.value)
// if (!isDeepEqual(currentParsed, newVal)) {
// const newContent = JSON.stringify(newVal, null, 2)
// editorView.value?.dispatch({
// changes: {
// from: 0,
// to: editorView.value.state.doc.length,
// insert: newContent
// }
// })
// }
// },
// { deep: true }
// )
watch(
() => props.modelValue,
(newVal) => {
//
const currentContent = editorView.value?.state.doc.toString() ?? '';
const newContent = JSON.stringify(newVal ?? {}, null, 2);
if (currentContent !== newContent && editorView.value) {
editorView.value.dispatch({
changes: {
from: 0,
to: editorView.value.state.doc.length,
insert: newContent
}
});
}
},
{ deep: true }
);
// JSON
const tryParse = (value: string): any => {

View File

@ -52,7 +52,6 @@ import { getDefaultValue, normaliseJavascriptType } from '@/hook/mcp';
import KInputObject from '@/components/k-input-object/index.vue';
import { mcpClientAdapter } from '@/views/connect/core';
import { JSONSchemaFaker } from 'json-schema-faker';
import { faker } from '@faker-js/faker';
defineComponent({ name: 'tool-executor' });
@ -149,6 +148,7 @@ const generateMockData = async () => {
// mock
Object.keys(mockData).forEach(key => {
tabStorage.formData[key] = mockData[key];
console.log(mockData[key]);
});
//