11import time
2- import uuid
32from dash import ctx , dcc
43from dash .dependencies import Input , Output , State , ALL
54from dash .exceptions import PreventUpdate
@@ -42,7 +41,7 @@ def generate_operlog_table(query_params: Dict):
4241 item .get ('oper_time' )
4342 )
4443 item ['key' ] = str (item ['oper_id' ])
45- item ['cost_time' ] = f" { item [' cost_time' ]} 毫秒"
44+ item ['cost_time' ] = f' { item [" cost_time" ]} 毫秒'
4645 item ['operation' ] = [
4746 {'content' : '详情' , 'type' : 'link' , 'icon' : 'antd-eye' }
4847 if PermissionManager .check_perms ('monitor:operlog:query' )
@@ -60,7 +59,6 @@ def generate_operlog_table(query_params: Dict):
6059 operation_log_table_pagination = Output (
6160 'operation_log-list-table' , 'pagination' , allow_duplicate = True
6261 ),
63- operation_log_table_key = Output ('operation_log-list-table' , 'key' ),
6462 operation_log_table_selectedrowkeys = Output (
6563 'operation_log-list-table' , 'selectedRowKeys'
6664 ),
@@ -110,7 +108,7 @@ def get_operation_log_table_data(
110108 begin_time = begin_time ,
111109 end_time = end_time ,
112110 order_by_column = sorter .get ('columns' )[0 ] if sorter else None ,
113- is_asc = f" { sorter .get (' orders' )[0 ]} ing" if sorter else None ,
111+ is_asc = f' { sorter .get (" orders" )[0 ]} ing' if sorter else None ,
114112 page_num = 1 ,
115113 page_size = 10 ,
116114 )
@@ -127,7 +125,6 @@ def get_operation_log_table_data(
127125 return dict (
128126 operation_log_table_data = table_data ,
129127 operation_log_table_pagination = table_pagination ,
130- operation_log_table_key = str (uuid .uuid4 ()),
131128 operation_log_table_selectedrowkeys = None ,
132129 )
133130
@@ -141,7 +138,7 @@ def get_operation_log_table_data(
141138 if (reset_click) {
142139 return [null, null, null, null, null, {'type': 'reset'}]
143140 }
144- return window.dash_clientside.no_update ;
141+ throw window.dash_clientside.PreventUpdate ;
145142 }
146143 """ ,
147144 [
@@ -167,7 +164,7 @@ def get_operation_log_table_data(
167164 hidden_status ? '隐藏搜索' : '显示搜索'
168165 ]
169166 }
170- return window.dash_clientside.no_update ;
167+ throw window.dash_clientside.PreventUpdate ;
171168 }
172169 """ ,
173170 [
@@ -370,7 +367,7 @@ def export_operation_log_list(
370367 begin_time = begin_time ,
371368 end_time = end_time ,
372369 order_by_column = sorter .get ('columns' )[0 ] if sorter else None ,
373- is_asc = f" { sorter .get (' orders' )[0 ]} ing" if sorter else None ,
370+ is_asc = f' { sorter .get (" orders" )[0 ]} ing' if sorter else None ,
374371 )
375372 export_operation_log_res = OperlogApi .export_operlog (export_params )
376373 export_operation_log = export_operation_log_res .content
0 commit comments