131131 />
132132 </template >
133133 </el-table >
134-
135- <div class =" pagination-container" >
136- <el-pagination
137- v-model:current-page =" state.pageInfo.currentPage"
138- v-model:page-size =" state.pageInfo.pageSize"
139- :page-sizes =" [10, 20, 30]"
140- :background =" true"
141- layout =" total, sizes, prev, pager, next, jumper"
142- :total =" state.pageInfo.total"
143- @size-change =" handleSizeChange"
144- @current-change =" handleCurrentChange"
145- />
146- </div >
134+ </div >
135+ <div class =" pagination-container" >
136+ <el-pagination
137+ v-model:current-page =" state.pageInfo.currentPage"
138+ v-model:page-size =" state.pageInfo.pageSize"
139+ :page-sizes =" [10, 20, 30]"
140+ :background =" true"
141+ layout =" total, sizes, prev, pager, next, jumper"
142+ :total =" state.pageInfo.total"
143+ @size-change =" handleSizeChange"
144+ @current-change =" handleCurrentChange"
145+ />
147146 </div >
148147
149148 <div v-if =" multipleSelectionAll.length" class =" bottom-select" >
193192 <el-form-item prop =" account" :label =" t('user.account')" >
194193 <el-input
195194 v-model =" state.form.account"
195+ :disabled =" !!state.form.id"
196196 :placeholder =" $t('datasource.please_enter') + $t('common.empty') + $t('user.account')"
197197 autocomplete =" off"
198198 />
@@ -316,6 +316,7 @@ const dialogVisiblePassword = ref(false)
316316const isIndeterminate = ref (true )
317317const drawerMainRef = ref ()
318318const userImportRef = ref ()
319+ const selectionLoading = ref (false )
319320const filterOption = ref <any []>([
320321 {
321322 type: ' enum' ,
@@ -359,7 +360,7 @@ const defaultForm = {
359360 account: ' ' ,
360361 oid: 0 ,
361362 email: ' ' ,
362- status: ' ' ,
363+ status: 1 ,
363364 phoneNumber: ' ' ,
364365 oid_list: [],
365366}
@@ -451,7 +452,9 @@ const handleConfirmPassword = () => {
451452 })
452453 dialogVisiblePassword .value = false
453454}
455+
454456const handleSelectionChange = (val : any []) => {
457+ if (selectionLoading .value ) return
455458 const ids = state .tableData .map ((ele : any ) => ele .id )
456459 multipleSelectionAll .value = [
457460 ... multipleSelectionAll .value .filter ((ele ) => ! ids .includes (ele .id )),
@@ -481,6 +484,7 @@ const handleToggleRowSelection = (check: boolean = true) => {
481484 }
482485 checkAll .value = i === state .tableData .length
483486 isIndeterminate .value = ! (i === 0 || i === state .tableData .length )
487+ selectionLoading .value = false
484488}
485489const handleSearch = () => {
486490 search ()
@@ -541,6 +545,7 @@ const deleteBatchUser = () => {
541545 autofocus: false ,
542546 }).then (() => {
543547 userApi .deleteBatch (multipleSelectionAll .value .map ((ele ) => ele .id )).then (() => {
548+ multipleSelectionAll .value = []
544549 ElMessage ({
545550 type: ' success' ,
546551 message: t (' dashboard.delete_success' ),
@@ -557,13 +562,20 @@ const deleteHandler = (row: any) => {
557562 customClass: ' confirm-no_icon' ,
558563 autofocus: false ,
559564 }).then (() => {
560- userApi .delete (row .id ).then (() => {
561- ElMessage ({
562- type: ' success' ,
563- message: t (' dashboard.delete_success' ),
564- })
565- search ()
565+ multipleSelectionAll .value = multipleSelectionAll .value .filter ((ele ) => ele .id !== row .id )
566+ ElMessage ({
567+ type: ' success' ,
568+ message: t (' dashboard.delete_success' ),
566569 })
570+ search ()
571+ // userApi.delete(row.id).then(() => {
572+ // multipleSelectionAll.value = multipleSelectionAll.value.filter((ele) => ele.id !== row.id)
573+ // ElMessage({
574+ // type: 'success',
575+ // message: t('dashboard.delete_success'),
576+ // })
577+ // search()
578+ // })
567579 })
568580}
569581
@@ -613,7 +625,7 @@ const search = () => {
613625 .then ((res : any ) => {
614626 state .tableData = res .items
615627 state .pageInfo .total = res .total
616-
628+ selectionLoading . value = true
617629 nextTick (() => {
618630 handleToggleRowSelection ()
619631 })
@@ -692,11 +704,13 @@ onMounted(() => {
692704 height : 64px ;
693705 width : calc (100% + 48px );
694706 left : -24px ;
707+ background-color : #fff ;
695708 bottom : 0 ;
696709 border-top : 1px solid #1f232926 ;
697710 display : flex ;
698711 align-items : center ;
699712 padding-left : 24px ;
713+ z-index : 10 ;
700714
701715 .danger-button {
702716 border : 1px solid var (--ed-color-danger );
@@ -734,12 +748,8 @@ onMounted(() => {
734748 .sqlbot-table {
735749 border-radius : 6px ;
736750 width : 100% ;
737- max-height : calc (100vh - 100 px );
751+ max-height : calc (100vh - 150 px );
738752 overflow-y : auto ;
739-
740- & .is-filter {
741- max-height : calc (100vh - 256px );
742- }
743753 :deep(.ed-table ) {
744754 --el-table-header-bg-color : #f5f7fa ;
745755 --el-table-border-color : #ebeef5 ;
@@ -795,12 +805,13 @@ onMounted(() => {
795805 }
796806 }
797807 }
798- .pagination-container {
799- display : flex ;
800- justify-content : end ;
801- align-items : center ;
802- margin-top : 16px ;
803- }
808+ }
809+
810+ .pagination-container {
811+ display : flex ;
812+ justify-content : end ;
813+ align-items : center ;
814+ margin-top : 16px ;
804815 }
805816}
806817
0 commit comments