Commit d70f0351bccaece99d94847bc15cb29c1c185b76

Authored by 谭毅彬
1 parent 4ce8c79a

点击接口日志重置,同时重置请求时间为默认值

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue
... ... @@ -6,8 +6,7 @@
6 6 <a-row :gutter="24">
7 7 <a-col :xl='6' :lg='7' :md='8' :sm='24'>
8 8 <a-form-item label='接口名称'>
9   - <a-select show-search placeholder='请输入接口名称' option-filter-prop='children'
10   - v-model='queryParam.apiName'>
  9 + <a-select show-search placeholder='请输入接口名称' option-filter-prop='children' v-model='queryParam.apiName'>
11 10 <a-select-option v-for='name in apiNameList' :key='name' :value='name'>
12 11 {{ name }}
13 12 </a-select-option>
... ... @@ -86,10 +85,8 @@
86 85 <!-- 操作按钮区域 -->
87 86 <div class="table-operator">
88 87 <a-button v-has="'apiLog:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
89   - <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出
90   - </a-button>
91   - <j-super-query :fieldList="superFieldList" v-has="'apiLog:superQuery'"
92   - @handleSuperQuery="handleSuperQuery"/>
  88 + <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出</a-button>
  89 + <j-super-query :fieldList="superFieldList" v-has="'apiLog:superQuery'" @handleSuperQuery="handleSuperQuery"/>
93 90 </div>
94 91  
95 92 <!-- table区域-begin -->
... ... @@ -110,40 +107,30 @@
110 107 <template :slot="expandedRowRender" slot-scope="record">
111 108 <div style="margin: 0">
112 109 <div>
113   - <a-button @click="copyToClipboard(record.requestHeader)" type="link" icon="copy"
114   - style="vertical-align: revert;"></a-button>
115   - <span
116   - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:</span>
117   - <a-button @click="record.expandHeader = !record.expandHeader" type="link" icon="down-circle"
118   - style="vertical-align: revert;"></a-button>
119   - <span v-if="record.expandHeader"
120   - style="padding:0 0 0 32px;display: block; vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">{{
121   - record.requestHeader
122   - }}</span>
  110 + <a-button @click="copyToClipboard(record.requestHeader)" type="link" icon="copy" style="vertical-align: revert;"></a-button>
  111 + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:</span>
  112 + <a-button @click="record.expandHeader = !record.expandHeader" type="link" icon="down-circle" style="vertical-align: revert;"></a-button>
  113 + <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;">
  114 + {{ record.requestHeader }}
  115 + </span>
123 116 </div>
124 117 <div>
125   - <a-button @click="copyToClipboard(record.requestBody)" type="link" icon="copy"
126   - style="vertical-align: revert;"></a-button>
127   - <span
128   - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容:{{
129   - record.requestBody
130   - }}</span>
  118 + <a-button @click="copyToClipboard(record.requestBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button>
  119 + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容:
  120 + {{ record.requestBody }}
  121 + </span>
131 122 </div>
132 123 <div>
133   - <a-button @click="copyToClipboard(record.responseBody)" type="link" icon="copy"
134   - style="vertical-align: revert;"></a-button>
135   - <span
136   - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容:{{
137   - record.responseBody
138   - }}</span>
  124 + <a-button @click="copyToClipboard(record.responseBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button>
  125 + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容:
  126 + {{ record.responseBody }}
  127 + </span>
139 128 </div>
140 129 <div v-if="record.exception">
141   - <a-button @click="copyToClipboard(record.exception)" type="link" icon="copy"
142   - style="vertical-align: revert;"></a-button>
143   - <span
144   - style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息:{{
145   - record.exception
146   - }}</span>
  130 + <a-button @click="copyToClipboard(record.exception)" type="link" icon="copy" style="vertical-align: revert;"></a-button>
  131 + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息:
  132 + {{ record.exception }}
  133 + </span>
147 134 </div>
148 135 </div>
149 136 </template>
... ... @@ -265,10 +252,17 @@ export default {
265 252 }
266 253 },
267 254 methods: {
  255 + searchReset() {
  256 + let that = this;
  257 + Object.keys(that.queryParam).forEach(function (key) {
  258 + that.queryParam[key] = '';
  259 + });
  260 + that.queryParam['requestTime_begin'] = this.getDefaultDate()
  261 + },
268 262 getDefaultDate() {
269 263 var tempDate = new Date()
270 264 tempDate.setDate(tempDate.getDate() - 7)
271   - return moment(tempDate).utcOffset(480).format('YYYY-MM-DD HH:mm:ss');
  265 + return moment(tempDate).utcOffset(480).format('YYYY-MM-DD 00:00:00');
272 266 },
273 267 loadFrom() {
274 268 getApiNameList().then((res) => {
... ...