fix(Data Source): Data source table structure supports field retrieval #447

This commit is contained in:
dataeaseShu
2025-12-23 11:12:09 +08:00
committed by dataeaseShu
parent 06e79f5839
commit 2e4789bd57
6 changed files with 18 additions and 13 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" fill="white" stroke="#DEE0E3"/>
<circle cx="16" cy="16" r="16.5" fill="white" stroke="#DEE0E3"/>
<mask id="mask0_3062_184766" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="1" width="30" height="30">
<circle cx="16" cy="16" r="15" fill="white"/>
</mask>

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" fill="white" stroke="#DEE0E3"/>
<circle cx="16" cy="16" r="16.5" fill="white" stroke="#DEE0E3"/>
<path d="M3.53105 12.86H4.61105V19.07H8.54106V20H3.53105V12.86ZM9.43926 12.86H12.0393C13.1893 12.86 14.0593 13.18 14.6593 13.83C15.2193 14.43 15.4993 15.3 15.4993 16.43C15.4993 17.55 15.2093 18.42 14.6393 19.04C14.0393 19.68 13.1693 20 12.0193 20H9.43926V12.86ZM10.5293 13.79V19.07H11.8193C12.7193 19.07 13.3893 18.85 13.8093 18.42C14.2193 17.99 14.4293 17.33 14.4293 16.43C14.4293 15.51 14.2193 14.85 13.8193 14.43C13.3993 14 12.7393 13.79 11.8393 13.79H10.5293ZM18.6572 12.86H19.8972L22.6472 20H21.4772L20.8072 18.16H17.7372L17.0672 20H15.9072L18.6572 12.86ZM18.0672 17.26H20.4772L19.2972 14.03H19.2572L18.0672 17.26ZM23.3455 12.86H26.3055C28.0055 12.86 28.8555 13.58 28.8555 15.03C28.8555 16.49 27.9955 17.22 26.2855 17.22H24.4355V20H23.3455V12.86ZM24.4355 13.79V16.29H26.2155C26.7555 16.29 27.1455 16.19 27.3955 15.99C27.6355 15.79 27.7655 15.47 27.7655 15.03C27.7655 14.59 27.6355 14.27 27.3855 14.09C27.1355 13.89 26.7455 13.79 26.2155 13.79H24.4355Z" fill=""/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" fill="white" stroke="#DEE0E3"/>
<circle cx="16" cy="16" r="16.5" fill="white" stroke="#DEE0E3"/>
<path d="M4.86144 13.176C5.72544 13.176 6.41344 13.456 6.91744 14.024C7.39744 14.56 7.63744 15.272 7.63744 16.152C7.63744 17.024 7.39744 17.728 6.91744 18.272C6.41344 18.832 5.72544 19.112 4.86144 19.112C3.98944 19.112 3.30144 18.824 2.80544 18.264C2.32544 17.72 2.09344 17.016 2.09344 16.152C2.09344 15.28 2.32544 14.576 2.80544 14.032C3.30144 13.456 3.98944 13.176 4.86144 13.176ZM4.86144 13.944C4.25344 13.944 3.78144 14.144 3.44544 14.56C3.12544 14.952 2.96544 15.48 2.96544 16.152C2.96544 16.816 3.12544 17.344 3.44544 17.736C3.78144 18.136 4.25344 18.344 4.86144 18.344C5.46944 18.344 5.94144 18.144 6.26944 17.752C6.58944 17.368 6.75744 16.832 6.75744 16.152C6.75744 15.464 6.58944 14.928 6.26944 14.536C5.94144 14.136 5.46944 13.944 4.86144 13.944ZM10.1609 13.288H11.1529L13.3529 19H12.4169L11.8809 17.528H9.42494L8.88894 19H7.96094L10.1609 13.288ZM9.68894 16.808H11.6169L10.6729 14.224H10.6409L9.68894 16.808ZM13.8316 14.864H14.6796V17.384C14.6796 17.736 14.7516 17.992 14.9036 18.152C15.0476 18.312 15.2876 18.4 15.6156 18.4C15.8396 18.4 16.0396 18.304 16.2316 18.128C16.4236 17.944 16.5596 17.696 16.6316 17.392V14.864H17.4796V19H16.6316V18.44C16.2796 18.888 15.8476 19.112 15.3276 19.112C14.3276 19.112 13.8316 18.552 13.8316 17.44V14.864ZM19.7048 13.528V14.864H20.6488V15.568H19.7048V17.968C19.7048 18.08 19.7288 18.16 19.7768 18.216C19.8248 18.264 19.8968 18.296 20.0008 18.296H20.5448V19H19.8648C19.5128 19 19.2488 18.904 19.0888 18.72C18.9288 18.544 18.8568 18.296 18.8568 17.968V15.568H18.0888V14.864H18.8568V13.88L19.7048 13.528ZM21.3316 13.176H22.1796V15.448C22.3316 15.208 22.5236 15.024 22.7556 14.912C22.9636 14.8 23.1956 14.752 23.4596 14.752C23.9556 14.752 24.3316 14.896 24.5876 15.192C24.8276 15.472 24.9476 15.888 24.9476 16.432V19H24.0996V16.576C24.0996 16.208 24.0196 15.936 23.8756 15.744C23.7156 15.544 23.4676 15.448 23.1476 15.448C22.8596 15.448 22.6276 15.56 22.4516 15.792C22.2676 16.024 22.1796 16.32 22.1796 16.68V19H21.3316V13.176ZM27.9177 13.176C28.4617 13.176 28.9177 13.328 29.2697 13.648C29.6137 13.968 29.7897 14.376 29.7897 14.88C29.7897 15.376 29.5977 15.824 29.2297 16.232C29.0057 16.464 28.6137 16.768 28.0457 17.152C27.4297 17.56 27.0617 17.92 26.9417 18.232H29.7977V19H25.8617C25.8617 18.432 26.0457 17.936 26.4297 17.504C26.6377 17.256 27.0697 16.912 27.7177 16.464C28.1017 16.192 28.3737 15.976 28.5337 15.808C28.7897 15.52 28.9257 15.208 28.9257 14.872C28.9257 14.552 28.8377 14.312 28.6617 14.152C28.4857 13.992 28.2217 13.912 27.8857 13.912C27.5257 13.912 27.2537 14.032 27.0697 14.28C26.8777 14.52 26.7817 14.864 26.7657 15.328H25.8937C25.9017 14.688 26.0857 14.176 26.4457 13.792C26.8137 13.376 27.3097 13.176 27.9177 13.176Z" fill=""/>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="" xmlns="http://www.w3.org/2000/svg">
<circle cx="16" cy="16" r="15.5" fill="white" stroke="#DEE0E3"/>
<circle cx="16" cy="16" r="16.5" fill="white" stroke="#DEE0E3"/>
<path d="M7.49184 12.72C8.57184 12.72 9.43184 13.07 10.0618 13.78C10.6618 14.45 10.9618 15.34 10.9618 16.44C10.9618 17.53 10.6618 18.41 10.0618 19.09C9.43184 19.79 8.57184 20.14 7.49184 20.14C6.40184 20.14 5.54184 19.78 4.92184 19.08C4.32184 18.4 4.03184 17.52 4.03184 16.44C4.03184 15.35 4.32184 14.47 4.92184 13.79C5.54184 13.07 6.40184 12.72 7.49184 12.72ZM7.49184 13.68C6.73184 13.68 6.14184 13.93 5.72184 14.45C5.32184 14.94 5.12184 15.6 5.12184 16.44C5.12184 17.27 5.32184 17.93 5.72184 18.42C6.14184 18.92 6.73184 19.18 7.49184 19.18C8.25184 19.18 8.84184 18.93 9.25184 18.44C9.65184 17.96 9.86184 17.29 9.86184 16.44C9.86184 15.58 9.65184 14.91 9.25184 14.42C8.84184 13.92 8.25184 13.68 7.49184 13.68ZM12.0862 12.86H13.1662V20H12.0862V12.86ZM14.5857 12.86H17.1857C18.3357 12.86 19.2057 13.18 19.8057 13.83C20.3657 14.43 20.6457 15.3 20.6457 16.43C20.6457 17.55 20.3557 18.42 19.7857 19.04C19.1857 19.68 18.3157 20 17.1657 20H14.5857V12.86ZM15.6757 13.79V19.07H16.9657C17.8657 19.07 18.5357 18.85 18.9557 18.42C19.3657 17.99 19.5757 17.33 19.5757 16.43C19.5757 15.51 19.3657 14.85 18.9657 14.43C18.5457 14 17.8857 13.79 16.9857 13.79H15.6757ZM24.8537 12.72C25.6837 12.72 26.3737 12.93 26.9137 13.37C27.4337 13.79 27.7537 14.37 27.8637 15.09H26.8037C26.6837 14.61 26.4537 14.25 26.1137 14.02C25.7737 13.79 25.3537 13.68 24.8337 13.68C24.0637 13.68 23.4837 13.94 23.0937 14.47C22.7237 14.95 22.5437 15.61 22.5437 16.44C22.5437 17.3 22.7237 17.96 23.0837 18.43C23.4637 18.93 24.0537 19.18 24.8537 19.18C25.3737 19.18 25.8137 19.05 26.1537 18.79C26.5137 18.51 26.7637 18.09 26.9037 17.53H27.9637C27.8037 18.36 27.4337 19.01 26.8437 19.48C26.2937 19.92 25.6337 20.14 24.8637 20.14C23.6937 20.14 22.8137 19.76 22.2237 19.02C21.7037 18.38 21.4537 17.52 21.4537 16.44C21.4537 15.38 21.7137 14.52 22.2537 13.85C22.8537 13.09 23.7137 12.72 24.8537 12.72Z" fill=""/>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

+1 -1
View File
@@ -53,7 +53,7 @@
"all_data_sources": "All data sources",
"partial_data_sources": "Partial data sources",
"add_it_here": "Drag the table name on the left to add it here",
"table_relationship_management": "Table relationship management",
"table_relationship_management": "Table relationship manage",
"system_management": "System Management",
"data_training": "SQL Sample Lib",
"problem_description": "Problem Description",
+13 -8
View File
@@ -13,6 +13,7 @@ import UploaderRemark from '@/views/system/excel-upload/UploaderRemark.vue'
import TableRelationship from '@/views/ds/TableRelationship.vue'
import icon_mindnote_outlined from '@/assets/svg/icon_mindnote_outlined.svg'
import { Refresh } from '@element-plus/icons-vue'
import { debounce } from 'lodash-es'
interface Table {
name: string
@@ -106,7 +107,9 @@ const handleCurrentChange = (val: number) => {
const fieldListComputed = computed(() => {
const { currentPage, pageSize } = pageInfo
return fieldList.value.slice((currentPage - 1) * pageSize, currentPage * pageSize)
return fieldList.value
.filter((ele: any) => ele.field_name.toLowerCase().includes(fieldName.value.toLowerCase()))
.slice((currentPage - 1) * pageSize, currentPage * pageSize)
})
const init = (reset = false) => {
@@ -166,6 +169,7 @@ const clickTable = (table: any) => {
fieldList.value = res
pageInfo.total = res.length
pageInfo.currentPage = 1
fieldName.value = ''
datasourceApi.previewData(props.info.id, buildData()).then((res) => {
previewData.value = res
})
@@ -313,10 +317,10 @@ const renderHeader = ({ column }: any) => {
document.body.removeChild(span)
return column.label
}
const fieldNameSearch = () => {
btnSelectClick(btnSelect.value)
}
const fieldNameSearch = debounce(() => {
pageInfo.currentPage = 1
pageInfo.total = fieldListComputed.value.length
}, 100)
const fieldName = ref('')
const btnSelectClick = (val: any) => {
btnSelect.value = val
@@ -324,11 +328,12 @@ const btnSelectClick = (val: any) => {
if (val === 'd') {
datasourceApi
.fieldList(currentTable.value.id, { fieldName: fieldName.value })
.fieldList(currentTable.value.id, { fieldName: '' })
.then((res) => {
fieldList.value = res
pageInfo.total = res.length
pageInfo.currentPage = 1
fieldName.value = ''
})
.finally(() => {
loading.value = false
@@ -496,7 +501,7 @@ const btnSelectClick = (val: any) => {
:placeholder="t('dashboard.search')"
autocomplete="off"
clearable
@blur="fieldNameSearch"
@input="fieldNameSearch"
/>
<el-button
v-if="ds.type !== 'excel'"
@@ -565,7 +570,7 @@ const btnSelectClick = (val: any) => {
</el-table-column>
</el-table>
</div>
<div v-if="fieldList.length && btnSelect === 'd'" class="pagination-container">
<div v-if="pageInfo.total && btnSelect === 'd'" class="pagination-container">
<el-pagination
v-model:current-page="pageInfo.currentPage"
v-model:page-size="pageInfo.pageSize"