前端eslint调整
This commit is contained in:
@@ -2,27 +2,52 @@
|
||||
<div class="gva-table-box">
|
||||
<warning-bar title="使用GPT-3.5模型,存在一定不稳定性,成功率为50%左右,使用GPT-4可以极大提升成功率,但是费用较高。" />
|
||||
<div v-if="!chatToken">
|
||||
<el-input v-model="skObj.sk" class="query-ipt" placeholder="请输入您的ChatGpt SK" clearable />
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-input
|
||||
v-model="skObj.sk"
|
||||
class="query-ipt"
|
||||
placeholder="请输入您的ChatGpt SK"
|
||||
clearable
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="save"
|
||||
>保存</el-button>
|
||||
<div class="secret">
|
||||
<el-empty description="请到gpt网站获取您的sk:https://platform.openai.com/account/api-keys" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form
|
||||
:model="form"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="删除当前sk:">
|
||||
<el-popover placement="top" width="160">
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="160"
|
||||
>
|
||||
<p>确定要删除并返回吗?</p>
|
||||
<div style="text-align: right; margin-top: 8px;">
|
||||
<el-button type="primary" @click="deleteSK">确定</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="deleteSK"
|
||||
>确定</el-button>
|
||||
</div>
|
||||
<template #reference>
|
||||
<el-button type="primary" link icon="delete">删除</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="delete"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item label="查询db名称:">
|
||||
<el-select v-model="form.dbname" placeholder="请选择库" style="width: 115px">
|
||||
<el-select
|
||||
v-model="form.dbname"
|
||||
placeholder="请选择库"
|
||||
style="width: 115px"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dbArr"
|
||||
:key="index"
|
||||
@@ -42,14 +67,17 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="GPT生成SQL:">
|
||||
<el-input
|
||||
v-model="sql"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
type="textarea"
|
||||
disabled
|
||||
placeholder="此处展示自动生成的sql"
|
||||
v-model="sql"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
type="textarea"
|
||||
disabled
|
||||
placeholder="此处展示自动生成的sql"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="handleQueryTable">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleQueryTable"
|
||||
>查询</el-button>
|
||||
</el-form>
|
||||
<div class="tables">
|
||||
<el-table
|
||||
@@ -69,7 +97,10 @@
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</el-table>
|
||||
<p v-else class="text">请在对话框输入你需要AI帮你查询的内容:)</p>
|
||||
<p
|
||||
v-else
|
||||
class="text"
|
||||
>请在对话框输入你需要AI帮你查询的内容:)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,7 +119,7 @@ const chatToken = ref(null)
|
||||
const skObj = reactive({
|
||||
sk: '',
|
||||
})
|
||||
const sql = ref("")
|
||||
const sql = ref('')
|
||||
const getSK = async() => {
|
||||
const res = await getSKApi()
|
||||
chatToken.value = res.data.ok
|
||||
@@ -126,7 +157,7 @@ const tableData = ref([])
|
||||
const handleQueryTable = async() => {
|
||||
const res = await getTableApi(form.value)
|
||||
if (res.code === 0) {
|
||||
tableData.value = res.data.results||[]
|
||||
tableData.value = res.data.results || []
|
||||
}
|
||||
sql.value = res.data.sql
|
||||
// 根据后台返回值动态渲染表格
|
||||
|
||||
Reference in New Issue
Block a user