diff --git a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue index 1927cfb..806ecba 100644 --- a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue +++ b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue @@ -6,8 +6,7 @@ <a-row :gutter="24"> <a-col :xl='6' :lg='7' :md='8' :sm='24'> <a-form-item label='接口名称'> - <a-select show-search placeholder='请输入接口名称' option-filter-prop='children' - v-model='queryParam.apiName'> + <a-select show-search placeholder='请输入接口名称' option-filter-prop='children' v-model='queryParam.apiName'> <a-select-option v-for='name in apiNameList' :key='name' :value='name'> {{ name }} </a-select-option> @@ -86,10 +85,8 @@ <!-- 操作按钮区域 --> <div class="table-operator"> <a-button v-has="'apiLog:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> - <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出 - </a-button> - <j-super-query :fieldList="superFieldList" v-has="'apiLog:superQuery'" - @handleSuperQuery="handleSuperQuery"/> + <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出</a-button> + <j-super-query :fieldList="superFieldList" v-has="'apiLog:superQuery'" @handleSuperQuery="handleSuperQuery"/> </div> <!-- table区域-begin --> @@ -110,40 +107,30 @@ <template :slot="expandedRowRender" slot-scope="record"> <div style="margin: 0"> <div> - <a-button @click="copyToClipboard(record.requestHeader)" type="link" icon="copy" - style="vertical-align: revert;"></a-button> - <span - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:</span> - <a-button @click="record.expandHeader = !record.expandHeader" type="link" icon="down-circle" - style="vertical-align: revert;"></a-button> - <span v-if="record.expandHeader" - style="padding:0 0 0 32px;display: block; vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">{{ - record.requestHeader - }}</span> + <a-button @click="copyToClipboard(record.requestHeader)" type="link" icon="copy" style="vertical-align: revert;"></a-button> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:</span> + <a-button @click="record.expandHeader = !record.expandHeader" type="link" icon="down-circle" style="vertical-align: revert;"></a-button> + <span v-if="record.expandHeader" style="padding:0 0 0 32px;display: block; vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;"> + {{ record.requestHeader }} + </span> </div> <div> - <a-button @click="copyToClipboard(record.requestBody)" type="link" icon="copy" - style="vertical-align: revert;"></a-button> - <span - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容:{{ - record.requestBody - }}</span> + <a-button @click="copyToClipboard(record.requestBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容: + {{ record.requestBody }} + </span> </div> <div> - <a-button @click="copyToClipboard(record.responseBody)" type="link" icon="copy" - style="vertical-align: revert;"></a-button> - <span - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容:{{ - record.responseBody - }}</span> + <a-button @click="copyToClipboard(record.responseBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容: + {{ record.responseBody }} + </span> </div> <div v-if="record.exception"> - <a-button @click="copyToClipboard(record.exception)" type="link" icon="copy" - style="vertical-align: revert;"></a-button> - <span - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息:{{ - record.exception - }}</span> + <a-button @click="copyToClipboard(record.exception)" type="link" icon="copy" style="vertical-align: revert;"></a-button> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息: + {{ record.exception }} + </span> </div> </div> </template> @@ -265,10 +252,17 @@ export default { } }, methods: { + searchReset() { + let that = this; + Object.keys(that.queryParam).forEach(function (key) { + that.queryParam[key] = ''; + }); + that.queryParam['requestTime_begin'] = this.getDefaultDate() + }, getDefaultDate() { var tempDate = new Date() tempDate.setDate(tempDate.getDate() - 7) - return moment(tempDate).utcOffset(480).format('YYYY-MM-DD HH:mm:ss'); + return moment(tempDate).utcOffset(480).format('YYYY-MM-DD 00:00:00'); }, loadFrom() { getApiNameList().then((res) => {