| | |
| | | <template> |
| | | <!-- <el-collapse v-model="activeName" accordion> |
| | | <el-collapse-item |
| | | v-for="item in threeResourceLogs" |
| | | :key="item.id" |
| | | name="1" |
| | | style="overflow: auto; max-height: 600px" |
| | | > |
| | | <ProForm :model="item" is-read> |
| | | <ProFormItemV2 label="method:"> |
| | | {{ EnumResourceMethodText[item.method] }} |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="domain:">{{ item.domain }} </ProFormItemV2> |
| | | <ProFormItemV2 label="path:"> {{ item.path }}</ProFormItemV2> |
| | | <ProFormItemV2 label="requestHeaders:" label-position="top"> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :value="JSON.parse(item.requestHeaders)" |
| | | ></json-viewer> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="request:" label-position="top"> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :value="JSON.parse(item.request)" |
| | | ></json-viewer> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="responseHeaders:" label-position="top"> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :value="JSON.parse(item.responseHeaders)" |
| | | ></json-viewer> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="response:" label-position="top"> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :value="JSON.parse(item.response)" |
| | | ></json-viewer> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="isSuccess:"> {{ item.isSuccess ? '是' : '否' }}</ProFormItemV2> |
| | | <ProFormItemV2 label="elapsedMilliseconds:"> {{ item.elapsedMilliseconds }}</ProFormItemV2> |
| | | <ProFormItemV2 label="createdUser:"> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :value="JSON.parse(JSON.stringify(item.createdUser))" |
| | | ></json-viewer> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="createdTime:"> |
| | | {{ format(item.createdTime, 'YYYY-MM-DD HH:mm:ss') }}</ProFormItemV2 |
| | | > |
| | | </ProForm> |
| | | </el-collapse-item> |
| | | </el-collapse> --> |
| | | <AppContainer> |
| | | <ProTableV2 |
| | | :columns="columns" |
| | | :show-pagination="false" |
| | | :operationBtns="operationBtns" |
| | | :table-data="threeResourceLogs" |
| | | :column-render-map="columnsRenderProps" |
| | | > |
| | | <template #requestHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.requestHeaders) })" |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: { requestHeaders: JSON.parse(row.requestHeaders) } })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #request="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.request) })" |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: { request: JSON.parse(row.request) } })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #responseHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.responseHeaders) })" |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: { responseHeaders: JSON.parse(row.responseHeaders) } })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #response="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.response) })" |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: { response: JSON.parse(row.response) } })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: JSON.parse(JSON.stringify(row.createdUser)) })" |
| | | @click="handleAdd({ json: { createdUser: JSON.parse(JSON.stringify(row.createdUser)) } })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | |
| | | defineColumns, |
| | | ProTableV2Props, |
| | | useFormDialog, |
| | | defineOperationBtns, |
| | | } from '@bole-core/components'; |
| | | import { EnumResourceMethodText } from '@/constants'; |
| | | import JsonViewerDialog from './JsonViewerDialog.vue'; |
| | |
| | | })) |
| | | ); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | | data: { |
| | | enCode: 'detailBtn', |
| | | name: '查看', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => openDialog(role), |
| | | }, |
| | | }, |
| | | ]); |
| | | |
| | | const columnsRenderProps: ProTableV2Props['columnRenderMap'] = { |
| | | method: { type: 'enum', valueEnum: EnumResourceMethodText }, |
| | | isSuccess: { |
| | |
| | | json: null, |
| | | }, |
| | | }); |
| | | |
| | | function openDialog(row: API.GetResourceLogsQueryResultItem) { |
| | | handleAdd({ |
| | | json: { |
| | | requestHeaders: JSON.parse(row.requestHeaders), |
| | | request: JSON.parse(row.request), |
| | | responseHeaders: JSON.parse(row.responseHeaders), |
| | | response: JSON.parse(row.response), |
| | | createdUser: JSON.parse(JSON.stringify(row.createdUser)), |
| | | }, |
| | | }); |
| | | } |
| | | </script> |