|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <!-- <el-collapse v-model="activeName" accordion> | 
|---|
|  |  |  | <el-collapse-item | 
|---|
|  |  |  | v-for="item in resourceLogs" | 
|---|
|  |  |  | :key="item.id" | 
|---|
|  |  |  | name="1" | 
|---|
|  |  |  | style="overflow: auto; max-height: 600px" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #title> | 
|---|
|  |  |  | <el-button type="primary" @click="resend(item.id)" link>重新发送</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <ProForm :model="item" is-read style="padding: 0 20px"> | 
|---|
|  |  |  | <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="clientIpAddress:"> {{ item.clientIpAddress }}</ProFormItemV2> | 
|---|
|  |  |  | <ProFormItemV2 label="refererUrl:"> {{ item.refererUrl }}</ProFormItemV2> | 
|---|
|  |  |  | <ProFormItemV2 label="consoleLogs:"> {{ item.consoleLogs }}</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" | 
|---|
|  |  |  | 
|---|
|  |  |  | :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: row.createdUser } })" | 
|---|
|  |  |  | >查看</el-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | import * as logRecordsServices from '@/services/api/logRecords'; | 
|---|
|  |  |  | import { Message } from '@bole-core/core'; | 
|---|
|  |  |  | import JsonViewerDialog from './JsonViewerDialog.vue'; | 
|---|
|  |  |  | import { request } from 'http'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'ResourceLogsView', | 
|---|
|  |  |  | 
|---|
|  |  |  | id: index + '', | 
|---|
|  |  |  | enCode: x, | 
|---|
|  |  |  | name: x, | 
|---|
|  |  |  | width: 160, | 
|---|
|  |  |  | width: 170, | 
|---|
|  |  |  | })) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const operationBtns = defineOperationBtns([ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'detailBtn', | 
|---|
|  |  |  | name: '查看', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => openDialog(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'reSendBtn', | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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: row.createdUser, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss" scoped> | 
|---|