From 1d10d2e728ccfa64f90b5570269c31a76c16232f Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:21:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20SQL=E6=95=B0=E6=8D=AE=E9=9B=86=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E7=9A=84=E6=95=B0=E6=8D=AE=E8=A1=A8=E5=92=8C=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=9C=80=E8=A6=81=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/styles/index.scss | 31 +++++++++++++++++++ frontend/src/views/dataset/add/AddSQL.vue | 19 ++++++++---- .../dataset/data/components/filterFiled.vue | 4 +-- .../src/views/system/sysParam/Operator.vue | 17 ---------- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 1734757d90..ba40852ec5 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -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; + } +} \ No newline at end of file diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 2aadd10f1c..d3f0f66eba 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -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 diff --git a/frontend/src/views/dataset/data/components/filterFiled.vue b/frontend/src/views/dataset/data/components/filterFiled.vue index 3fcd8a0598..59a5e13847 100644 --- a/frontend/src/views/dataset/data/components/filterFiled.vue +++ b/frontend/src/views/dataset/data/components/filterFiled.vue @@ -128,7 +128,7 @@ />