finish mook
This commit is contained in:
parent
1f7e5b8b7d
commit
47d5d6474a
@ -163,24 +163,26 @@ function getDefaultValue(property: any): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改 watch 逻辑
|
watch(
|
||||||
// watch(
|
() => props.modelValue,
|
||||||
// () => props.modelValue,
|
(newVal) => {
|
||||||
// (newVal) => {
|
// 当前编辑器内容
|
||||||
// const currentParsed = tryParse(inputValue.value)
|
const currentContent = editorView.value?.state.doc.toString() ?? '';
|
||||||
// if (!isDeepEqual(currentParsed, newVal)) {
|
const newContent = JSON.stringify(newVal ?? {}, null, 2);
|
||||||
// const newContent = JSON.stringify(newVal, null, 2)
|
|
||||||
// editorView.value?.dispatch({
|
if (currentContent !== newContent && editorView.value) {
|
||||||
// changes: {
|
editorView.value.dispatch({
|
||||||
// from: 0,
|
changes: {
|
||||||
// to: editorView.value.state.doc.length,
|
from: 0,
|
||||||
// insert: newContent
|
to: editorView.value.state.doc.length,
|
||||||
// }
|
insert: newContent
|
||||||
// })
|
}
|
||||||
// }
|
});
|
||||||
// },
|
}
|
||||||
// { deep: true }
|
},
|
||||||
// )
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// 辅助函数:尝试解析 JSON
|
// 辅助函数:尝试解析 JSON
|
||||||
const tryParse = (value: string): any => {
|
const tryParse = (value: string): any => {
|
||||||
|
@ -52,7 +52,6 @@ import { getDefaultValue, normaliseJavascriptType } from '@/hook/mcp';
|
|||||||
import KInputObject from '@/components/k-input-object/index.vue';
|
import KInputObject from '@/components/k-input-object/index.vue';
|
||||||
import { mcpClientAdapter } from '@/views/connect/core';
|
import { mcpClientAdapter } from '@/views/connect/core';
|
||||||
import { JSONSchemaFaker } from 'json-schema-faker';
|
import { JSONSchemaFaker } from 'json-schema-faker';
|
||||||
import { faker } from '@faker-js/faker';
|
|
||||||
|
|
||||||
defineComponent({ name: 'tool-executor' });
|
defineComponent({ name: 'tool-executor' });
|
||||||
|
|
||||||
@ -149,6 +148,7 @@ const generateMockData = async () => {
|
|||||||
// 将 mock 数据绑定到表单
|
// 将 mock 数据绑定到表单
|
||||||
Object.keys(mockData).forEach(key => {
|
Object.keys(mockData).forEach(key => {
|
||||||
tabStorage.formData[key] = mockData[key];
|
tabStorage.formData[key] = mockData[key];
|
||||||
|
console.log(mockData[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 如果需要刷新表单校验,可以加上
|
// 如果需要刷新表单校验,可以加上
|
||||||
|
Loading…
x
Reference in New Issue
Block a user