问题描述
我们有一个带有多值下拉菜单的Grafana Dashbaord。仪表板已连接到postgresql数据源。我们在grafana中有查询变量,其选项如下所示
下拉菜单如下:
该值通过以下方式传递给查询:
<v-data-table
v-if="orders.length > 0"
:headers="headers"
:items="orders"
multi-sort
:search="search"
class="elevation-1"
>
<template v-slot:[`item.length`]="{ item }">
<span>{{item.length | transform}}</span>
</template>
<template v-slot:[`item.weight`]="{ item }">
<span>{{item.weight | transform}}</span>
</template>
<template v-slot:[`item.actions`]="{ item }">
<v-icon small @click="canceloverlay = true" color="red">mdi-cancel</v-icon>
<v-overlay v-if="canceloverlay">
<v-card light color="#f6f9fc" max-width="1000px">
<v-card-title primary-title>
<div>
<span class="display-1 mb-0 black--text">Are you sure you want to cancel order #{{item.order_id}}?</span>
</div>
<v-spacer></v-spacer>
<v-btn icon dark color="black" @click="canceloverlay = false">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-card-title>
<v-container>
<CancelOrderComponent :orderId="item.order_id" />
</v-container>
</v-card>
</v-overlay>
</template>
</v-data-table>
问题是,如果选择“全部”,它将以正确的格式传递所有值。但是,如果它是“ Selected(0)”(选择(0)),然后在外部单击并返回,则会看到“ All”被选中,但是没有任何内容传递给查询:
SELECT number_of_cities
FROM list
WHERE time_of_survey = curr_date AND country in (${TEST:sqlstring})
导致仪表板上出现错误消息。这导致不良的用户体验。用户需要取消选择“所有”,然后重新选择“所有”或其他一些选项,以便查询以正确的值运行。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)