@@ -10,6 +10,7 @@ import { useI18n } from 'vue-i18n'
1010import ParamsForm from ' ./ParamsForm.vue'
1111import TableRelationship from ' @/views/ds/TableRelationship.vue'
1212import icon_mindnote_outlined from ' @/assets/svg/icon_mindnote_outlined.svg'
13+ import { Refresh } from ' @element-plus/icons-vue'
1314interface Table {
1415 name: string
1516 host: string
@@ -223,6 +224,19 @@ const changeStatus = (row: any) => {
223224 })
224225}
225226
227+ const syncFields = () => {
228+ loading .value = true
229+ datasourceApi
230+ .syncFields (currentTable .value .id )
231+ .then (() => {
232+ btnSelectClick (' d' )
233+ loading .value = false
234+ })
235+ .catch (() => {
236+ loading .value = false
237+ })
238+ }
239+
226240const emits = defineEmits ([' back' , ' refresh' ])
227241const back = () => {
228242 emits (' back' )
@@ -316,13 +330,13 @@ const btnSelectClick = (val: any) => {
316330 :key =" ele.table_name"
317331 :draggable =" activeRelationship && !tableName.includes(ele.id)"
318332 class =" model"
319- @dragstart =" ($event: any) => singleDragStartD($event, ele)"
320- @dragend =" singleDragEnd"
321333 :class =" [
322334 currentTable.table_name === ele.table_name && 'isActive',
323335 tableName.includes(ele.id) && activeRelationship && 'disabled-table',
324336 ]"
325337 :title =" ele.table_name"
338+ @dragstart =" ($event: any) => singleDragStartD($event, ele)"
339+ @dragend =" singleDragEnd"
326340 @click =" clickTable(ele)"
327341 >
328342 <el-icon size =" 16" >
@@ -349,7 +363,7 @@ const btnSelectClick = (val: any) => {
349363 </div >
350364 </div >
351365 <div class =" table-relationship" >
352- <div @click = " handleRelationship " :class =" activeRelationship && 'active'" class =" btn" >
366+ <div :class =" activeRelationship && 'active'" class =" btn" @click = " handleRelationship " >
353367 <el-icon size =" 16" >
354368 <icon _mindnote_outlined ></icon _mindnote_outlined >
355369 </el-icon >
@@ -362,9 +376,9 @@ const btnSelectClick = (val: any) => {
362376 <div class =" title" >{{ t('training.table_relationship_management') }}</div >
363377 <div class =" content" >
364378 <TableRelationship
365- @getTableName =" getTableName"
366- :dragging =" isDrag"
367379 :id =" info.id"
380+ :dragging =" isDrag"
381+ @get-table-name =" getTableName"
368382 ></TableRelationship >
369383 </div >
370384 </div >
@@ -409,12 +423,20 @@ const btnSelectClick = (val: any) => {
409423 </div >
410424 <div v-if =" btnSelect === 'd'" class =" field-name" >
411425 <el-input
412- :placeholder =" t('dashboard.search')"
413426 v-model =" fieldName"
414- @blur = " fieldNameSearch "
427+ :placeholder = " t('dashboard.search') "
415428 autocomplete =" off"
416429 clearable
430+ @blur =" fieldNameSearch"
417431 />
432+ <el-button
433+ v-if =" ds.type !== 'excel'"
434+ :icon =" Refresh"
435+ style =" margin-left : 12px "
436+ @click =" syncFields()"
437+ >
438+ {{ t('ds.sync_fields') }}
439+ </el-button >
418440 </div >
419441
420442 <div
@@ -804,7 +826,8 @@ const btnSelectClick = (val: any) => {
804826 position : absolute ;
805827 right : 16px ;
806828 top : 16px ;
807- width : 240px ;
829+ width : 360px ;
830+ display : flex ;
808831 }
809832
810833 .btn-select {
0 commit comments