Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/assets/svg/logo_cas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/assets/svg/logo_ldap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/assets/svg/logo_oauth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/assets/svg/logo_oidc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 13 additions & 8 deletions frontend/src/views/ds/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
})
Expand Down Expand Up @@ -313,22 +317,23 @@ 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
loading.value = true

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
Expand Down Expand Up @@ -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'"
Expand Down Expand Up @@ -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"
Expand Down