| <template> | 
|   <LoadingLayout :loading="state.loading"> | 
|     <AppContainer> | 
|       <ProTableQueryFilterBar @on-reset="reset"> | 
|         <template #query> | 
|           <QueryFilterItem tip-content="创建时间"> | 
|             <FieldDatePicker | 
|               v-model="extraParamState.createdTime" | 
|               type="daterange" | 
|               range-separator="~" | 
|               start-placeholder="开始时间" | 
|               end-placeholder="结束时间" | 
|               clearable | 
|               @change="getList()" | 
|             ></FieldDatePicker> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.createdUser" | 
|               style="width: 260px" | 
|               placeholder="操作人createdUser" | 
|               @on-click-search="getList()" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.traceId" | 
|               style="width: 260px" | 
|               placeholder="跟踪Id(traceId)" | 
|               @on-click-search="getList()" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.type" | 
|               style="width: 260px" | 
|               placeholder="类型type" | 
|               @on-click-search="getList()" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.code" | 
|               style="width: 260px" | 
|               placeholder="代码code" | 
|               @on-click-search="getList()" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.message" | 
|               style="width: 260px" | 
|               placeholder="消息message" | 
|               @on-click-search="getList()" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|         </template> | 
|       </ProTableQueryFilterBar> | 
|       <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> | 
|         <template #createdUser="{ row }"> | 
|           <el-button | 
|             v-if="row.createdUser" | 
|             type="primary" | 
|             link | 
|             @click="handleAdd({ json: { createdUser: row.createdUser } })" | 
|             >查看</el-button | 
|           > | 
|         </template> | 
|       </ProTableV2> | 
|       <JsonViewerDialog v-bind="dialogProps" /> | 
|     </AppContainer> | 
|   </LoadingLayout> | 
| </template> | 
|   | 
| <script setup lang="ts"> | 
| import { | 
|   ProTableQueryFilterBar, | 
|   SearchInput, | 
|   LoadingLayout, | 
|   AppContainer, | 
|   QueryFilterItem, | 
|   useTable, | 
|   ProTableV2, | 
|   FieldRadio, | 
|   FieldDatePicker, | 
|   useFormDialog, | 
| } from '@bole-core/components'; | 
| import * as logRecordsServices from '@/services/api/logRecords'; | 
| import { ModelValueType } from 'element-plus'; | 
| import { format } from '@/utils'; | 
| import JsonViewerDialog from './components/JsonViewerDialog.vue'; | 
|   | 
| defineOptions({ | 
|   name: 'ExceptionLogs', | 
| }); | 
|   | 
| const operationBtnMap: Record<string, OperationBtnType> = { | 
|   detailBtn: { emits: { onClick: (role) => openDialog(role) } }, | 
| }; | 
|   | 
| const { column, operationBtns } = useAccess({ | 
|   operationBtnMap, | 
| }); | 
|   | 
| const BaseState = { | 
|   loading: true, | 
| }; | 
|   | 
| const state = reactive({ ...BaseState }); | 
|   | 
| onMounted(async () => { | 
|   await getList(); | 
|   state.loading = false; | 
| }); | 
|   | 
| const { | 
|   getDataSource: getList, | 
|   proTableProps, | 
|   paginationState, | 
|   extraParamState, | 
|   reset, | 
| } = useTable( | 
|   async ({ pageIndex, pageSize }, extraParamState) => { | 
|     try { | 
|       let params: API.GetExceptionLogsQuery = { | 
|         pageModel: { | 
|           rows: pageSize, | 
|           page: pageIndex, | 
|           orderInput: extraParamState.orderInput, | 
|         }, | 
|         createdTimeBegin: format(extraParamState.createdTime?.[0] ?? '', 'YYYY-MM-DD 00:00:00'), | 
|         createdTimeEnd: format(extraParamState.createdTime?.[1] ?? '', 'YYYY-MM-DD 23:59:59'), | 
|         createdUser: extraParamState.createdUser, | 
|         traceId: extraParamState.traceId, | 
|         type: extraParamState.type, | 
|         code: extraParamState.code, | 
|         message: extraParamState.message, | 
|       }; | 
|       let res = await logRecordsServices.getExceptionLogs(params, { | 
|         showLoading: !state.loading, | 
|       }); | 
|       return res; | 
|     } catch (error) {} | 
|   }, | 
|   { | 
|     defaultExtraParams: { | 
|       createdUser: '', | 
|       traceId: '', | 
|       type: '', | 
|       code: '', | 
|       message: '', | 
|       createdTime: [] as unknown as ModelValueType, | 
|       orderInput: [{ property: 'createdTime', order: EnumPagedListOrder.Desc }], | 
|     }, | 
|     columnsRenderProps: { | 
|       createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, | 
|     }, | 
|   } | 
| ); | 
|   | 
| const { dialogProps, handleAdd } = useFormDialog({ | 
|   defaultFormParams: { | 
|     json: null, | 
|   }, | 
| }); | 
|   | 
| function openDialog(row: API.GetResourceLogsQueryResultItem) { | 
|   handleAdd({ | 
|     json: { | 
|       createdUser: row.createdUser, | 
|     }, | 
|   }); | 
| } | 
| </script> | 
|   | 
| <style lang="scss" scoped> | 
| @use '@/style/common.scss' as *; | 
| </style> |