Commit ae95efd5e280c309dfc7ddeaeae416ff8e1c96cf

Authored by fengwotao
1 parent 74e271e1

perf(src/packages): 信息里更多新增自定义echarts组件

1 <template> 1 <template>
2 - <collapse-item name="数据源" :expanded="true"> 2 + <collapse-item name="数据源(option配置里的内容)" :expanded="true">
3 <monaco-editor v-model:modelValue="optionData.dataset" width="400px" height="480px" language="json" /> 3 <monaco-editor v-model:modelValue="optionData.dataset" width="400px" height="480px" language="json" />
4 </collapse-item> 4 </collapse-item>
5 </template> 5 </template>
@@ -74,9 +74,13 @@ watch( @@ -74,9 +74,13 @@ watch(
74 () => props.chartConfig.option.dataset, 74 () => props.chartConfig.option.dataset,
75 newValue => { 75 newValue => {
76 try { 76 try {
  77 + //嵌套字符串使用JSON.parse会报错,这里使用eval函数
77 updateVChart(eval('(' + newValue + ')')) 78 updateVChart(eval('(' + newValue + ')'))
78 } catch (e) { 79 } catch (e) {
79 - console.log(e) 80 + console.error(
  81 + `文件位置:src\\packages\\components\\external\\InformationsMores\\CustomEcharts\\index.vue`,
  82 + '错误信息:您的json格式有误'
  83 + )
80 } 84 }
81 }, 85 },
82 { 86 {