mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat(Data Source): Data source table structure supports field retrieval #447
This commit is contained in:
@@ -17,7 +17,8 @@ export const datasourceApi = {
|
||||
request.post(`/datasource/execSql/${id}`, { sql: sql }),
|
||||
chooseTables: (id: number, data: any) => request.post(`/datasource/chooseTables/${id}`, data),
|
||||
tableList: (id: number) => request.post(`/datasource/tableList/${id}`),
|
||||
fieldList: (id: number) => request.post(`/datasource/fieldList/${id}`),
|
||||
fieldList: (id: number, data = { fieldName: '' }) =>
|
||||
request.post(`/datasource/fieldList/${id}`, data),
|
||||
edit: (data: any) => request.post('/datasource/editLocalComment', data),
|
||||
previewData: (id: number, data: any) => request.post(`/datasource/previewData/${id}`, data),
|
||||
saveTable: (data: any) => request.post('/datasource/editTable', data),
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
"Data Q&A": "Data Q&A",
|
||||
"Data Connections": "Data Sources",
|
||||
"Dashboard": "Dashboard",
|
||||
"AI Model Configuration": "AI Model Configuration",
|
||||
"AI Model Configuration": "AI Model Config",
|
||||
"Details": "Details"
|
||||
},
|
||||
"parameter": {
|
||||
"parameter_configuration": "Parameter Configuration",
|
||||
"parameter_configuration": "Parameter Config",
|
||||
"question_count_settings": "Question Count Settings",
|
||||
"model_thinking_process": "Expand Model Thinking Process",
|
||||
"rows_of_data": "Limit 1000 Rows of Data",
|
||||
@@ -72,7 +72,7 @@
|
||||
"code_for_debugging": "Copy the following code for debugging",
|
||||
"full_screen_mode": "Full screen mode",
|
||||
"editing_terminology": "Editing Terminology",
|
||||
"professional_terminology": "Terminology Configuration",
|
||||
"professional_terminology": "Terminology Config",
|
||||
"term_name": "Term Name",
|
||||
"term_description": "Term Description",
|
||||
"search_term": "Search Term",
|
||||
@@ -388,7 +388,7 @@
|
||||
"set_successfully": "Set successfully",
|
||||
"operate_with_caution": "After the system default model is replaced, the result of intelligent question will be affected, please operate with caution.",
|
||||
"system_default_model": "Do you want to set {msg} as the system default model?",
|
||||
"ai_model_configuration": "AI model configuration",
|
||||
"ai_model_configuration": "AI model config",
|
||||
"system_default_model_de": "System default model",
|
||||
"relevant_results_found": "No relevant results found",
|
||||
"add_model": "Add model",
|
||||
@@ -508,7 +508,7 @@
|
||||
"find_user": "Find user",
|
||||
"add_successfully": "Add successfully",
|
||||
"member_management": "Member management",
|
||||
"permission_configuration": "Permission configuration",
|
||||
"permission_configuration": "Permission Config",
|
||||
"set": "Settings",
|
||||
"operate_with_caution": "After deletion, the users under the workspace will be removed and all resources will be deleted. Please operate with caution."
|
||||
},
|
||||
|
||||
@@ -244,13 +244,17 @@ const renderHeader = ({ column }: any) => {
|
||||
return column.label
|
||||
}
|
||||
|
||||
const fieldNameSearch = () => {
|
||||
btnSelectClick(btnSelect.value)
|
||||
}
|
||||
const fieldName = ref('')
|
||||
const btnSelectClick = (val: any) => {
|
||||
btnSelect.value = val
|
||||
loading.value = true
|
||||
|
||||
if (val === 'd') {
|
||||
datasourceApi
|
||||
.fieldList(currentTable.value.id)
|
||||
.fieldList(currentTable.value.id, { fieldName: fieldName.value })
|
||||
.then((res) => {
|
||||
fieldList.value = res
|
||||
pageInfo.total = res.length
|
||||
@@ -403,6 +407,15 @@ const btnSelectClick = (val: any) => {
|
||||
{{ t('ds.preview') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="btnSelect === 'd'" class="field-name">
|
||||
<el-input
|
||||
:placeholder="t('dashboard.search')"
|
||||
v-model="fieldName"
|
||||
@blur="fieldNameSearch"
|
||||
autocomplete="off"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!loading"
|
||||
@@ -785,6 +798,14 @@ const btnSelectClick = (val: any) => {
|
||||
.table-content {
|
||||
padding: 16px 24px;
|
||||
height: calc(100% - 80px);
|
||||
position: relative;
|
||||
|
||||
.field-name {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.btn-select {
|
||||
height: 32px;
|
||||
|
||||
Reference in New Issue
Block a user