@@ -52,6 +52,7 @@ const props = withDefaults(
5252const { t } = useI18n ()
5353const paramsFormRef = ref ()
5454const tableList = ref ([] as any [])
55+ const loading = ref (false )
5556const keywords = ref (' ' )
5657const tableListWithSearch = computed (() => {
5758 if (! keywords .value ) return tableList .value
@@ -63,7 +64,7 @@ const total = ref(1000)
6364const showNum = ref (100 )
6465const currentTable = ref <any >({})
6566const ds = ref <any >({})
66- const btnSelect = ref (' q ' )
67+ const btnSelect = ref (' d ' )
6768
6869const init = () => {
6970 datasourceApi .getDs (props .info .id ).then ((res ) => {
@@ -94,13 +95,19 @@ const handleSelectTableList = () => {
9495}
9596
9697const clickTable = (table : any ) => {
98+ loading .value = true
9799 currentTable .value = table
98- datasourceApi .fieldList (table .id ).then ((res ) => {
99- fieldList .value = res
100- datasourceApi .previewData (props .info .id , buildData ()).then ((res ) => {
101- previewData .value = res
100+ datasourceApi
101+ .fieldList (table .id )
102+ .then ((res ) => {
103+ fieldList .value = res
104+ datasourceApi .previewData (props .info .id , buildData ()).then ((res ) => {
105+ previewData .value = res
106+ })
107+ })
108+ .finally (() => {
109+ loading .value = false
102110 })
103- })
104111}
105112
106113const closeTable = () => {
@@ -228,12 +235,14 @@ const back = () => {
228235 </div >
229236 </div >
230237
231- <div v-if =" currentTable.table_name" class =" info-table" >
238+ <div v-if =" currentTable.table_name" v-loading = " loading " class =" info-table" >
232239 <div class =" table-name" >
233240 <div class =" name" >{{ currentTable.table_name }}</div >
234241 <div class =" notes" >
235242 {{ $t('about.remark') }}:
236- {{ currentTable.custom_comment || '-' }}
243+ <span :title =" currentTable.custom_comment" class =" field-notes" >{{
244+ currentTable.custom_comment || '-'
245+ }}</span >
237246 <el-icon style =" margin-left : 8px ; cursor : pointer " size =" 16" @click =" editTable" >
238247 <edit ></edit >
239248 </el-icon >
@@ -253,11 +262,13 @@ const back = () => {
253262 <el-table v-if =" btnSelect === 'd'" :data =" fieldList" style =" width : 100% " >
254263 <el-table-column prop =" field_name" :label =" t('datasource.field_name')" width =" 180" />
255264 <el-table-column prop =" field_type" :label =" t('datasource.field_type')" width =" 180" />
256- <el-table-column prop =" field_comment" :label =" t('about.remark ')" />
257- <el-table-column :label =" t('datasource.custom_notes ')" >
265+ <el-table-column prop =" field_comment" :label =" t('datasource.field_original_notes ')" />
266+ <el-table-column :label =" t('datasource.field_notes_1 ')" >
258267 <template #default =" scope " >
259268 <div class =" field-comment" >
260- <span >{{ scope.row.custom_comment }}</span >
269+ <span :title =" scope.row.custom_comment" class =" notes-in_table" >{{
270+ scope.row.custom_comment
271+ }}</span >
261272 <el-tooltip
262273 :offset =" 14"
263274 effect =" dark"
@@ -441,6 +452,7 @@ const back = () => {
441452 right : 0 ;
442453 top : 0 ;
443454 width : calc (100% - 280px );
455+ height : 100% ;
444456 .table-name {
445457 height : 80px ;
446458 padding : 16px 0 0 24px ;
@@ -459,11 +471,20 @@ const back = () => {
459471 color : #646a73 ;
460472 display : flex ;
461473 align-items : center ;
474+
475+ .field-notes {
476+ display : inline-block ;
477+ max-width : calc (100% - 75px );
478+ text-overflow : ellipsis ;
479+ white-space : nowrap ;
480+ overflow : hidden ;
481+ }
462482 }
463483 }
464484
465485 .table-content {
466486 padding : 16px 24px ;
487+ height : calc (100% - 80px );
467488
468489 .btn-select {
469490 height : 32px ;
@@ -495,33 +516,53 @@ const back = () => {
495516
496517 .preview-or-schema {
497518 margin-top : 16px ;
519+ height : calc (100% - 50px );
520+ overflow-y : auto ;
498521
499522 .field-comment {
500- height : 24px ;
501- }
502- .ed-icon {
503- position : relative ;
504- cursor : pointer ;
505- margin-top : 4px ;
506-
507- & ::after {
508- content : ' ' ;
509- background-color : #1f23291a ;
510- position : absolute ;
511- border-radius : 6px ;
512- width : 24px ;
513- height : 24px ;
514- transform : translate (-50% , -50% );
515- top : 50% ;
516- left : 50% ;
517- display : none ;
523+ display : flex ;
524+ align-items : center ;
525+ min-height : 24px ;
526+ .notes-in_table {
527+ max-width : 192px ;
528+ display : -webkit-box ;
529+ max-height : 66px ;
530+ -webkit-box-orient : vertical ;
531+ -webkit-line-clamp : 3 ; /* 限制行数为3 */
532+ overflow : hidden ;
533+ text-overflow : ellipsis ;
518534 }
519-
520535 & :hover {
521- & ::after {
536+ .ed-icon {
522537 display : block ;
523538 }
524539 }
540+ .ed-icon {
541+ position : relative ;
542+ cursor : pointer ;
543+ margin-top : 4px ;
544+ margin-left : 8px ;
545+ display : none ;
546+
547+ & ::after {
548+ content : ' ' ;
549+ background-color : #1f23291a ;
550+ position : absolute ;
551+ border-radius : 6px ;
552+ width : 24px ;
553+ height : 24px ;
554+ transform : translate (-50% , -50% );
555+ top : 50% ;
556+ left : 50% ;
557+ display : none ;
558+ }
559+
560+ & :hover {
561+ & ::after {
562+ display : block ;
563+ }
564+ }
565+ }
525566 }
526567
527568 .preview-num {
0 commit comments