提交 e46ee179 编写于 作者: 奔跑的面条

perf: 优化格式

上级 93e5b384
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<n-input-number <n-input-number
v-model:value="item.lineStyle.width" v-model:value="item.lineStyle.width"
:min="1" :min="1"
:max="100"
size="small" size="small"
placeholder="自动计算" placeholder="自动计算"
></n-input-number> ></n-input-number>
......
...@@ -128,6 +128,7 @@ const sendHandle = async () => { ...@@ -128,6 +128,7 @@ const sendHandle = async () => {
const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.requestGlobalConfig)) const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.requestGlobalConfig))
loading.value = false loading.value = false
if (res) { if (res) {
if(!res?.data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!')
targetData.value.option.dataset = newFunctionHandle(res?.data, res, targetData.value.filter) targetData.value.option.dataset = newFunctionHandle(res?.data, res, targetData.value.filter)
showMatching.value = true showMatching.value = true
return return
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</n-timeline-item> </n-timeline-item>
<n-timeline-item v-show="filterShow" color="#97846c" :title="TimelineTitleEnum.FILTER"> <n-timeline-item v-show="filterShow" color="#97846c" :title="TimelineTitleEnum.FILTER">
<n-space :size="18" vertical> <n-space :size="18" vertical>
<n-text depth="3">过滤器处理接口返回值的「data」字段</n-text> <n-text depth="3">过滤器默认处理接口返回值的「data」字段</n-text>
<chart-data-monaco-editor></chart-data-monaco-editor> <chart-data-monaco-editor></chart-data-monaco-editor>
</n-space> </n-space>
</n-timeline-item> </n-timeline-item>
......
...@@ -58,20 +58,20 @@ ...@@ -58,20 +58,20 @@
<n-space :size="15" vertical> <n-space :size="15" vertical>
<div class="editor-data-show"> <div class="editor-data-show">
<n-space> <n-space>
<n-text depth="3">目标数据(data):</n-text> <n-text depth="3">默认过滤数据(data):</n-text>
<n-code :code="toString(sourceData?.data) || 'undefined'" language="json" :word-wrap="true"></n-code> <n-code :code="toString(sourceData?.data) || '暂无'" language="json" :word-wrap="true"></n-code>
</n-space> </n-space>
</div> </div>
<div class="editor-data-show"> <div class="editor-data-show">
<n-space> <n-space>
<n-text depth="3">目标数据(res):</n-text> <n-text depth="3">接口返回数据(res):</n-text>
<n-code :code="toString(sourceData)" language="json" :word-wrap="true"></n-code> <n-code :code="toString(sourceData) || '暂无'" language="json" :word-wrap="true"></n-code>
</n-space> </n-space>
</div> </div>
<div class="editor-data-show"> <div class="editor-data-show">
<n-space> <n-space>
<n-text depth="3">过滤器结果:</n-text> <n-text depth="3">过滤器结果:</n-text>
<n-code :code="filterRes" language="json" :word-wrap="true"></n-code> <n-code :code="filterRes || '暂无'" language="json" :word-wrap="true"></n-code>
</n-space> </n-space>
</div> </div>
</n-space> </n-space>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</template> </template>
规则 规则
</n-tag> </n-tag>
<n-text class="go-ml-2" depth="2">过滤器处理接口返回值的「data」字段</n-text> <n-text class="go-ml-2" depth="2">过滤器默认处理接口返回值的「data」字段</n-text>
</div> </div>
<n-space> <n-space>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册