perf: 优化格式

This commit is contained in:
奔跑的面条 2022-10-13 19:52:41 +08:00
parent 166b5b98e8
commit e08a7723b6
4 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,6 @@
<n-input-number
v-model:value="item.lineStyle.width"
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>

View File

@ -128,6 +128,7 @@ const sendHandle = async () => {
const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.requestGlobalConfig))
loading.value = false
if (res) {
if(!res?.data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!')
targetData.value.option.dataset = newFunctionHandle(res?.data, res, targetData.value.filter)
showMatching.value = true
return

View File

@ -27,7 +27,7 @@
</n-timeline-item>
<n-timeline-item v-show="filterShow" color="#97846c" :title="TimelineTitleEnum.FILTER">
<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>
</n-space>
</n-timeline-item>

View File

@ -58,20 +58,20 @@
<n-space :size="15" vertical>
<div class="editor-data-show">
<n-space>
<n-text depth="3">目标数据(data)</n-text>
<n-code :code="toString(sourceData?.data) || 'undefined'" language="json" :word-wrap="true"></n-code>
<n-text depth="3">默认过滤数据(data)</n-text>
<n-code :code="toString(sourceData?.data) || '暂无'" language="json" :word-wrap="true"></n-code>
</n-space>
</div>
<div class="editor-data-show">
<n-space>
<n-text depth="3">目标数据(res)</n-text>
<n-code :code="toString(sourceData)" language="json" :word-wrap="true"></n-code>
<n-text depth="3">接口返回数据(res)</n-text>
<n-code :code="toString(sourceData) || '暂无'" language="json" :word-wrap="true"></n-code>
</n-space>
</div>
<div class="editor-data-show">
<n-space>
<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>
</div>
</n-space>
@ -87,7 +87,7 @@
</template>
规则
</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>
<n-space>