Revert "feat: add 静态数据可修改功能"

This reverts commit 2541874d34ad002e3c47a5ea0d2cdaf6d4437ae5.
This commit is contained in:
lyq 2025-03-19 13:50:13 +08:00
parent 2541874d34
commit ed259ea68f

View File

@ -113,15 +113,7 @@
</div>
</n-space>
<n-card size="small">
<!-- <n-code :code="toString(source)" language="json"></n-code> -->
<monaco-editor
:modelValue="JSON.stringify(source, null, 2)"
@update:modelValue="handleEditorUpdate"
language="json"
width="100%"
height="520px"
/>
<n-button class="sourceBtn-item" @click="handleRun"> 运行 </n-button>
<n-code :code="toString(source)" language="json"></n-code>
</n-card>
</n-space>
</n-timeline-item>
@ -138,7 +130,6 @@ import { ChartDataMonacoEditor } from '../ChartDataMonacoEditor'
import { useFile } from '../../hooks/useFile.hooks'
import { useTargetData } from '../../../hooks/useTargetData.hook'
import { toString, isArray } from '@/utils'
import { MonacoEditor } from '@/components/Pages/MonacoEditor'
const { targetData } = useTargetData()
defineProps({
@ -249,21 +240,6 @@ const initFieldListHandle = () => {
}
}
//
const handleEditorUpdate = (val: string) => {
try {
if (!val) return (source.value = '此组件无数据源')
source.value = JSON.parse(val)
} catch (error) {
console.log(error)
}
}
//
const handleRun = () => {
targetData.value.option.dataset = source.value
}
watch(
() => targetData.value?.option?.dataset,
(