fix: SQL数据集右侧的数据表和字段需要排序

This commit is contained in:
dataeaseShu 2023-01-11 15:21:09 +08:00
parent 3dbaef12ad
commit 1d10d2e728
4 changed files with 46 additions and 25 deletions

View File

@ -1721,3 +1721,34 @@ div:focus {
display: inline-block;
}
}
.operator-bar {
width: 100%;
height: 70px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
background: #fff;
top: 0;
z-index: 15;
.title {
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
}
}
.el-table-column--selection {
.cell {
padding: 0 14px !important;
}
}
.dept-popper {
.el-tree-node__label {
color: var(--deTextPrimary, #1F2329) !important;
}
}

View File

@ -698,17 +698,17 @@ export default {
},
keywords(val) {
if (!val) {
this.tableDataCopy = [...this.tableData]
this.fieldDataCopy = [...this.fieldData]
this.tableDataCopy = this.arrSort([...this.tableData], 'name')
this.fieldDataCopy = this.arrSort([...this.fieldData])
return
}
if (this.dataSource && !this.dataTable) {
this.tableDataCopy = this.tableData.filter(ele => ele.name.includes(val))
this.tableDataCopy = this.arrSort(this.tableData.filter(ele => ele.name.includes(val)), 'name')
}
if (this.dataSource && this.dataTable) {
this.fieldDataCopy = this.fieldData.filter(ele => ele.fieldName.includes(val))
this.fieldDataCopy = this.arrSort(this.fieldData.filter(ele => ele.fieldName.includes(val)))
}
}
},
@ -760,7 +760,7 @@ export default {
info: JSON.stringify({ table: name })
}).then((res) => {
this.fieldData = res.data
this.fieldDataCopy = [...this.fieldData]
this.fieldDataCopy = this.arrSort([...this.fieldData])
})
.finally(() => {
this.tableLoading = false
@ -818,12 +818,19 @@ export default {
post('/datasource/getTables/' + this.dataSource, {})
.then((response) => {
this.tableData = response.data
this.tableDataCopy = [...this.tableData]
this.tableDataCopy = this.arrSort([...this.tableData], 'name')
})
.finally(() => {
this.tableLoading = false
})
},
arrSort(arr = [], field = 'fieldName') {
arr.sort((a, b) => {
return a[field][0].toLowerCase().charCodeAt() - b[field][0].toLowerCase().charCodeAt()
})
return arr
},
calHeight: _.debounce(function() {
const sqlHeight = Math.max(this.sqlHeight, 248)
const currentHeight = document.documentElement.clientHeight

View File

@ -128,7 +128,7 @@
/>
<ul
class="infinite-list autochecker-list"
style="overflow: auto"
style="overflow: auto;height: 231px"
>
<li
v-for="i in checkListWithFilter"
@ -218,7 +218,7 @@
</ul>
<div class="right-menu-foot">
<div class="footer-left">
{{ $t("auth.added") }} {{ checklist.length }}
&nbsp;
</div>
<div
class="confirm-btn"

View File

@ -17,20 +17,3 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.operator-bar {
width: 100%;
height: 70px;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
}
}
</style>