mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -12,10 +12,14 @@ template:
|
||||
- SQL查询中不能使用星号(*),必须明确指定字段名.
|
||||
- SQL查询的字段名不要自动翻译,别名必须为英文。
|
||||
- 计算占比,百分比类型字段,保留两位小数,以%结尾。
|
||||
- 生成SQL时,必须避免关键字冲突:
|
||||
- 生成SQL时,必须避免关键字冲突。
|
||||
- 如数据库引擎是 PostgreSQL、Oracle,则在schema、表名、字段名、别名外层加双引号;
|
||||
- 如数据库引擎是 MySQL,则在表名、字段名、别名外层加反引号;
|
||||
- 如数据库引擎是 Microsoft SQL Server,则在schema、表名、字段名、别名外层加方括号。
|
||||
- 以PostgreSQL为例,查询Schema为TEST表TABLE下所有数据,则生成的SQL为:
|
||||
SELECT * FROM "TEST"."TABLE"
|
||||
- 注意在表名外双引号的位置,千万不要生成为:
|
||||
SELECT * FROM "TEST.TABLE"
|
||||
- 如果生成SQL的字段内有时间格式的字段(重要):
|
||||
- 若提问中没有指定查询顺序,则默认按时间升序排序
|
||||
- 若提问是时间,且没有指定具体格式,则格式化为yyyy-MM-dd HH:mm:ss的格式
|
||||
|
||||
@@ -22,7 +22,7 @@ withDefaults(
|
||||
<logo_fold v-if="!hideAvatar" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div :class="{ 'row-full': msg.role === 'assistant' }">
|
||||
<div style="width: 100%" :class="{ 'row-full': msg.role === 'assistant' }">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@ function clickPredict() {
|
||||
<span v-else-if="message?.record?.predict_record_id" class="prefix-title" @click="clickPredict">
|
||||
{{ t('qa.data_predict') }}
|
||||
</span>
|
||||
<span>{{ message?.content }}</span>
|
||||
<span style="width: 100%">{{ message?.content }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -113,6 +113,12 @@ export class Bar extends BaseG2Chart {
|
||||
}
|
||||
return `${value}${_data.isPercent ? '%' : ''}`
|
||||
},
|
||||
position: (data: any) => {
|
||||
if (data[y[0].value] < 0) {
|
||||
return 'left'
|
||||
}
|
||||
return 'right'
|
||||
},
|
||||
transform: [
|
||||
{ type: 'contrastReverse' },
|
||||
{ type: 'exceedAdjust' },
|
||||
|
||||
@@ -102,7 +102,12 @@ export class Column extends BaseG2Chart {
|
||||
}
|
||||
return `${value}${_data.isPercent ? '%' : ''}`
|
||||
},
|
||||
position: 'top',
|
||||
position: (data: any) => {
|
||||
if (data[y[0].value] < 0) {
|
||||
return 'bottom'
|
||||
}
|
||||
return 'top'
|
||||
},
|
||||
transform: [
|
||||
{ type: 'contrastReverse' },
|
||||
{ type: 'exceedAdjust' },
|
||||
|
||||
Reference in New Issue
Block a user