Commit 7bdd0173e3b543ec78bfd86ace30510e290b1cc4
1 parent
85708822
优化WMS调用第三方API接口日志记录
Signed-off-by: TanYibin <5491541@qq.com>
Showing
8 changed files
with
230 additions
and
245 deletions
ant-design-vue-jeecg/src/views/system/config/AddressList.vue
... | ... | @@ -5,18 +5,28 @@ |
5 | 5 | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | + <a-form-item label="任务名称"> | |
9 | + <j-input placeholder="请输入任务名称" v-model="queryParam.remark"></j-input> | |
10 | + </a-form-item> | |
11 | + </a-col> | |
12 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
8 | 13 | <a-form-item label="编码"> |
9 | - <a-input placeholder="请输入编码" v-model="queryParam.code"></a-input> | |
14 | + <j-input placeholder="请输入编码" v-model="queryParam.param"></j-input> | |
15 | + </a-form-item> | |
16 | + </a-col> | |
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
18 | + <a-form-item label="库区"> | |
19 | + <a-select show-search placeholder="请选择库区" option-filter-prop="children" v-model="queryParam.zoneCode" > | |
20 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code"> | |
21 | + {{ item.name }} | |
22 | + </a-select-option> | |
23 | + </a-select> | |
10 | 24 | </a-form-item> |
11 | 25 | </a-col> |
12 | 26 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
13 | 27 | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
14 | 28 | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
15 | 29 | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
16 | - <a @click="handleToggleSearch" style="margin-left: 8px"> | |
17 | - {{ toggleSearchStatus ? '收起' : '展开' }} | |
18 | - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |
19 | - </a> | |
20 | 30 | </span> |
21 | 31 | </a-col> |
22 | 32 | </a-row> |
... | ... | @@ -28,16 +38,13 @@ |
28 | 38 | <div class="table-operator"> |
29 | 39 | <a-button @click="handleAdd" v-has="'address:add'" type="primary" icon="plus">新增</a-button> |
30 | 40 | <a-button v-has="'address:export'" type="primary" icon="download" @click="handleExportXls('接口地址')">导出</a-button> |
31 | - <a-upload v-has="'address:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" | |
32 | - @change="handleImportExcel"> | |
41 | + <a-upload v-has="'address:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |
33 | 42 | <a-button type="primary" icon="import">导入</a-button> |
34 | 43 | </a-upload> |
35 | 44 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
36 | 45 | <a-menu slot="overlay" v-has="'address:deleteBatch'"> |
37 | 46 | <a-menu-item key="1" @click="batchDel"> |
38 | - <a-icon type="delete"/> | |
39 | - 删除 | |
40 | - </a-menu-item> | |
47 | + <a-icon type="delete"/> 删除 </a-menu-item> | |
41 | 48 | </a-menu> |
42 | 49 | <a-button style="margin-left: 8px"> 批量操作 |
43 | 50 | <a-icon type="down"/> |
... | ... | @@ -47,12 +54,6 @@ |
47 | 54 | |
48 | 55 | <!-- table区域-begin --> |
49 | 56 | <div> |
50 | - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
51 | - <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a | |
52 | - style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 | |
53 | - <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
54 | - </div> | |
55 | - | |
56 | 57 | <a-table |
57 | 58 | ref="table" |
58 | 59 | size="middle" |
... | ... | @@ -63,30 +64,14 @@ |
63 | 64 | :dataSource="dataSource" |
64 | 65 | :pagination="ipagination" |
65 | 66 | :loading="loading" |
66 | - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |
67 | 67 | class="j-table-force-nowrap" |
68 | 68 | @change="handleTableChange"> |
69 | 69 | |
70 | - <template slot="htmlSlot" slot-scope="text"> | |
71 | - <div v-html="text"></div> | |
72 | - </template> | |
73 | - <template slot="imgSlot" slot-scope="text"> | |
74 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
75 | - <img v-else :src="getImgView(text)" height="25px" alt="" | |
76 | - style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
77 | - </template> | |
78 | - <template slot="fileSlot" slot-scope="text"> | |
79 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
80 | - <a-button | |
81 | - v-else | |
82 | - :ghost="true" | |
83 | - type="primary" | |
84 | - icon="download" | |
85 | - size="small" | |
86 | - @click="downloadFile(text)"> | |
87 | - 下载 | |
88 | - </a-button> | |
89 | - </template> | |
70 | + <span slot="zoneCode" slot-scope="zoneCode"> | |
71 | + <a-tag :key="zoneCode" color="blue"> | |
72 | + {{ solutionZoneCode(zoneCode) }} | |
73 | + </a-tag> | |
74 | + </span> | |
90 | 75 | |
91 | 76 | <span slot="action" slot-scope="text, record"> |
92 | 77 | <a v-has="'address:edit'" @click="handleEdit(record)">编辑</a> |
... | ... | @@ -115,11 +100,11 @@ |
115 | 100 | </template> |
116 | 101 | |
117 | 102 | <script> |
118 | - | |
119 | 103 | import '@/assets/less/TableExpand.less' |
120 | -import {mixinDevice} from '@/utils/mixin' | |
121 | -import {JeecgListMixin} from '@/mixins/JeecgListMixin' | |
104 | +import { mixinDevice } from '@/utils/mixin' | |
105 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
122 | 106 | import AddressModal from './modules/AddressModal' |
107 | +import { getZoneList } from '@/api/api' | |
123 | 108 | |
124 | 109 | export default { |
125 | 110 | name: 'AddressList', |
... | ... | @@ -130,6 +115,7 @@ export default { |
130 | 115 | data() { |
131 | 116 | return { |
132 | 117 | description: '接口地址管理页面', |
118 | + zoneList: [], | |
133 | 119 | // 表头 |
134 | 120 | columns: [ |
135 | 121 | { |
... | ... | @@ -137,93 +123,109 @@ export default { |
137 | 123 | dataIndex: '', |
138 | 124 | key: 'rowIndex', |
139 | 125 | width: 60, |
140 | - align: "center", | |
141 | - customRender: function (t, r, index) { | |
142 | - return parseInt(index) + 1; | |
126 | + align: 'center', | |
127 | + customRender: function(t, r, index) { | |
128 | + return parseInt(index) + 1 | |
143 | 129 | } |
144 | 130 | }, |
145 | 131 | { |
132 | + title: '接口名称', | |
133 | + align: 'center', | |
134 | + dataIndex: 'remark' | |
135 | + }, | |
136 | + { | |
146 | 137 | title: '编码', |
147 | - align: "center", | |
138 | + align: 'center', | |
148 | 139 | dataIndex: 'param' |
149 | 140 | }, |
141 | + | |
150 | 142 | { |
151 | 143 | title: '库区', |
152 | - align: "center", | |
153 | - dataIndex: 'zoneCode' | |
144 | + align: 'center', | |
145 | + dataIndex: 'zoneCode', | |
146 | + key: 'zoneCode', | |
147 | + scopedSlots: { customRender: 'zoneCode' } | |
154 | 148 | }, |
155 | 149 | { |
156 | 150 | title: '接口地址', |
157 | - align: "center", | |
151 | + align: 'center', | |
158 | 152 | dataIndex: 'url' |
159 | 153 | }, |
160 | 154 | { |
161 | - title: '备注', | |
162 | - align: "center", | |
163 | - dataIndex: 'remark' | |
164 | - }, | |
165 | - { | |
166 | 155 | title: '创建人', |
167 | - align: "center", | |
156 | + align: 'center', | |
168 | 157 | dataIndex: 'createBy' |
169 | 158 | }, |
170 | 159 | { |
171 | 160 | title: '创建日期', |
172 | - align: "center", | |
161 | + align: 'center', | |
173 | 162 | dataIndex: 'createTime' |
174 | 163 | }, |
175 | 164 | { |
176 | 165 | title: '更新人', |
177 | - align: "center", | |
166 | + align: 'center', | |
178 | 167 | dataIndex: 'updateBy' |
179 | 168 | }, |
180 | 169 | { |
181 | 170 | title: '更新日期', |
182 | - align: "center", | |
171 | + align: 'center', | |
183 | 172 | dataIndex: 'updateTime' |
184 | 173 | }, |
185 | 174 | { |
186 | 175 | title: '操作', |
187 | 176 | dataIndex: 'action', |
188 | - align: "center", | |
189 | - fixed: "right", | |
177 | + align: 'center', | |
178 | + fixed: 'right', | |
190 | 179 | width: 147, |
191 | - scopedSlots: {customRender: 'action'} | |
180 | + scopedSlots: { customRender: 'action' } | |
192 | 181 | } |
193 | 182 | ], |
194 | 183 | url: { |
195 | - list: "/config/address/list", | |
196 | - delete: "/config/address/delete", | |
197 | - deleteBatch: "/config/address/deleteBatch", | |
198 | - exportXlsUrl: "/config/address/exportXls", | |
199 | - importExcelUrl: "config/address/importExcel", | |
200 | - | |
184 | + list: '/config/address/list', | |
185 | + delete: '/config/address/delete', | |
186 | + deleteBatch: '/config/address/deleteBatch', | |
187 | + exportXlsUrl: '/config/address/exportXls', | |
188 | + importExcelUrl: 'config/address/importExcel' | |
201 | 189 | }, |
202 | 190 | dictOptions: {}, |
203 | - superFieldList: [], | |
191 | + superFieldList: [] | |
204 | 192 | } |
205 | 193 | }, |
206 | 194 | created() { |
207 | - this.getSuperFieldList(); | |
195 | + this.getSuperFieldList() | |
196 | + getZoneList().then(res => { | |
197 | + if (res.success) { | |
198 | + this.zoneList = res.result | |
199 | + } | |
200 | + }) | |
208 | 201 | }, |
209 | 202 | computed: { |
210 | - importExcelUrl: function () { | |
211 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
212 | - }, | |
203 | + importExcelUrl: function() { | |
204 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | |
205 | + } | |
213 | 206 | }, |
214 | 207 | methods: { |
215 | - initDictConfig() { | |
216 | - }, | |
208 | + initDictConfig() {}, | |
217 | 209 | getSuperFieldList() { |
218 | - let fieldList = []; | |
219 | - fieldList.push({type: 'string', value: 'code', text: '编码', dictCode: ''}) | |
220 | - fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''}) | |
221 | - fieldList.push({type: 'string', value: 'url', text: '接口地址', dictCode: ''}) | |
222 | - fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''}) | |
223 | - fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'}) | |
224 | - fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''}) | |
225 | - fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'}) | |
210 | + let fieldList = [] | |
211 | + fieldList.push({ type: 'string', value: 'code', text: '编码', dictCode: '' }) | |
212 | + fieldList.push({ type: 'string', value: 'zoneCode', text: '库区', dictCode: '' }) | |
213 | + fieldList.push({ type: 'string', value: 'url', text: '接口地址', dictCode: '' }) | |
214 | + fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' }) | |
215 | + fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' }) | |
216 | + fieldList.push({ type: 'string', value: 'updateBy', text: '更新人', dictCode: '' }) | |
217 | + fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' }) | |
226 | 218 | this.superFieldList = fieldList |
219 | + }, | |
220 | + solutionZoneCode(value) { | |
221 | + var actions = [] | |
222 | + Object.keys(this.zoneList).some(key => { | |
223 | + if (this.zoneList[key].code == '' + value) { | |
224 | + actions.push(this.zoneList[key].name) | |
225 | + return true | |
226 | + } | |
227 | + }) | |
228 | + return actions.join('') | |
227 | 229 | } |
228 | 230 | } |
229 | 231 | } |
... | ... |
ant-design-vue-jeecg/src/views/system/config/LocationList.vue
... | ... | @@ -35,10 +35,10 @@ |
35 | 35 | </a-col> |
36 | 36 | <template v-if="toggleSearchStatus"> |
37 | 37 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
38 | - <a-form-item label="库区编码"> | |
38 | + <a-form-item label="库区"> | |
39 | 39 | <a-select |
40 | 40 | show-search |
41 | - placeholder="请选择库区编码" | |
41 | + placeholder="请选择库区" | |
42 | 42 | option-filter-prop="children" |
43 | 43 | v-model="queryParam.zoneCode" |
44 | 44 | > |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/AddressForm.vue
... | ... | @@ -4,13 +4,26 @@ |
4 | 4 | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
5 | 5 | <a-row> |
6 | 6 | <a-col :span="24"> |
7 | + <a-form-model-item label="接口名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> | |
8 | + <a-input v-model="model.remark" placeholder="请输入接口名称"></a-input> | |
9 | + </a-form-model-item> | |
10 | + </a-col> | |
11 | + <a-col :span="24"> | |
7 | 12 | <a-form-model-item label="编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> |
8 | 13 | <a-input v-model="model.param" placeholder="请输入编码"></a-input> |
9 | 14 | </a-form-model-item> |
10 | 15 | </a-col> |
11 | 16 | <a-col :span="24"> |
12 | 17 | <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode"> |
13 | - <a-input v-model="model.zoneCode" placeholder="请输入库区"></a-input> | |
18 | + <a-select | |
19 | + show-search | |
20 | + placeholder="请选择库区" | |
21 | + option-filter-prop="children" | |
22 | + v-model="model.zoneCode"> | |
23 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code"> | |
24 | + {{ item.name }} | |
25 | + </a-select-option> | |
26 | + </a-select> | |
14 | 27 | </a-form-model-item> |
15 | 28 | </a-col> |
16 | 29 | <a-col :span="24"> |
... | ... | @@ -18,11 +31,6 @@ |
18 | 31 | <a-input v-model="model.url" placeholder="请输入接口地址"></a-input> |
19 | 32 | </a-form-model-item> |
20 | 33 | </a-col> |
21 | - <a-col :span="24"> | |
22 | - <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> | |
23 | - <a-input v-model="model.remark" placeholder="请输入备注"></a-input> | |
24 | - </a-form-model-item> | |
25 | - </a-col> | |
26 | 34 | </a-row> |
27 | 35 | </a-form-model> |
28 | 36 | </j-form-container> |
... | ... | @@ -33,6 +41,7 @@ |
33 | 41 | |
34 | 42 | import {httpAction, getAction} from '@/api/manage' |
35 | 43 | import {validateDuplicateValue} from '@/utils/util' |
44 | +import {getZoneList} from '@/api/api' | |
36 | 45 | |
37 | 46 | export default { |
38 | 47 | name: 'AddressForm', |
... | ... | @@ -47,6 +56,7 @@ export default { |
47 | 56 | }, |
48 | 57 | data() { |
49 | 58 | return { |
59 | + zoneList: [], | |
50 | 60 | model: {}, |
51 | 61 | labelCol: { |
52 | 62 | xs: {span: 24}, |
... | ... | @@ -73,6 +83,7 @@ export default { |
73 | 83 | created() { |
74 | 84 | //备份model原始值 |
75 | 85 | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
86 | + this.loadFrom(); | |
76 | 87 | }, |
77 | 88 | methods: { |
78 | 89 | add() { |
... | ... | @@ -82,6 +93,13 @@ export default { |
82 | 93 | this.model = Object.assign({}, record); |
83 | 94 | this.visible = true; |
84 | 95 | }, |
96 | + loadFrom() { | |
97 | + getZoneList().then((res) => { | |
98 | + if (res.success) { | |
99 | + this.zoneList = res.result | |
100 | + } | |
101 | + }); | |
102 | + }, | |
85 | 103 | submitForm() { |
86 | 104 | const that = this; |
87 | 105 | // 触发表单验证 |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/LocationForm.vue
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | show-search |
15 | 15 | placeholder="请选择库区" |
16 | 16 | option-filter-prop="children" |
17 | - | |
18 | 17 | v-model="model.zoneCode"> |
19 | 18 | <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{ |
20 | 19 | item.name |
... | ... | @@ -29,7 +28,7 @@ |
29 | 28 | show-search |
30 | 29 | placeholder="请选择库位类型" |
31 | 30 | option-filter-prop="children" |
32 | - | |
31 | + | |
33 | 32 | v-model="model.locationTypeCode"> |
34 | 33 | <a-select-option v-for="item in locationTypeList" :key="item.name" :value="item.code">{{ |
35 | 34 | item.name |
... | ... |
ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue
... | ... | @@ -6,38 +6,23 @@ |
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-input placeholder="请输入接口名称" v-model="queryParam.apiName"></a-input> | |
9 | + <j-input placeholder="请输入接口名称" v-model="queryParam.apiName"></j-input> | |
10 | 10 | </a-form-item> |
11 | 11 | </a-col> |
12 | 12 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
13 | - <a-form-item label="请求类型"> | |
14 | - <a-input placeholder="请输入请求类型" v-model="queryParam.apiMethod"></a-input> | |
13 | + <a-form-item label="请求方名称"> | |
14 | + <j-input placeholder="请输入请求方名称" v-model="queryParam.requestFrom"></j-input> | |
15 | 15 | </a-form-item> |
16 | 16 | </a-col> |
17 | 17 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
18 | - <a-form-item label="请求方地址"> | |
19 | - <a-input placeholder="请输入请求方地址" v-model="queryParam.ip"></a-input> | |
18 | + <a-form-item label="响应方名称"> | |
19 | + <j-input placeholder="请输入响应方名称" v-model="queryParam.responseBy"></j-input> | |
20 | 20 | </a-form-item> |
21 | 21 | </a-col> |
22 | 22 | <template v-if="toggleSearchStatus"> |
23 | 23 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
24 | - <a-form-item label="请求方名称"> | |
25 | - <a-input placeholder="请输入请求方名称" v-model="queryParam.responseFrom"></a-input> | |
26 | - </a-form-item> | |
27 | - </a-col> | |
28 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
29 | - <a-form-item label="响应方名称"> | |
30 | - <a-input placeholder="请输入响应方名称" v-model="queryParam.responseBy"></a-input> | |
31 | - </a-form-item> | |
32 | - </a-col> | |
33 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
34 | 24 | <a-form-item label="请求地址"> |
35 | - <a-input placeholder="请输入请求地址" v-model="queryParam.url"></a-input> | |
36 | - </a-form-item> | |
37 | - </a-col> | |
38 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
39 | - <a-form-item label="响应耗时(毫秒)"> | |
40 | - <a-input placeholder="请输入响应耗时(毫秒)" v-model="queryParam.duration"></a-input> | |
25 | + <j-input placeholder="请输入请求地址" v-model="queryParam.url"></j-input> | |
41 | 26 | </a-form-item> |
42 | 27 | </a-col> |
43 | 28 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
... | ... | @@ -46,12 +31,22 @@ |
46 | 31 | </a-form-item> |
47 | 32 | </a-col> |
48 | 33 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> |
49 | - <a-form-item label="创建日期"> | |
50 | - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" | |
51 | - class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> | |
34 | + <a-form-item label="请求时间"> | |
35 | + <j-date | |
36 | + :show-time="true" | |
37 | + date-format="YYYY-MM-DD HH:mm:ss" | |
38 | + placeholder="请选择开始时间" | |
39 | + class="query-group-cust" | |
40 | + v-model="queryParam.requestTime_begin" | |
41 | + ></j-date> | |
52 | 42 | <span class="query-group-split-cust"></span> |
53 | - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" | |
54 | - class="query-group-cust" v-model="queryParam.createTime_end"></j-date> | |
43 | + <j-date | |
44 | + :show-time="true" | |
45 | + date-format="YYYY-MM-DD HH:mm:ss" | |
46 | + placeholder="请选择结束时间" | |
47 | + class="query-group-cust" | |
48 | + v-model="queryParam.requestTime_end" | |
49 | + ></j-date> | |
55 | 50 | </a-form-item> |
56 | 51 | </a-col> |
57 | 52 | </template> |
... | ... | @@ -61,7 +56,7 @@ |
61 | 56 | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
62 | 57 | <a @click="handleToggleSearch" style="margin-left: 8px"> |
63 | 58 | {{ toggleSearchStatus ? '收起' : '展开' }} |
64 | - <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |
59 | + <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> | |
65 | 60 | </a> |
66 | 61 | </span> |
67 | 62 | </a-col> |
... | ... | @@ -73,21 +68,14 @@ |
73 | 68 | <!-- 操作按钮区域 --> |
74 | 69 | <div class="table-operator"> |
75 | 70 | <a-button v-has="'apiLog:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
76 | - <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')">导出</a-button> | |
77 | -<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> | |
78 | -<!-- @change="handleImportExcel">--> | |
79 | -<!-- <a-button type="primary" icon="import">导入</a-button>--> | |
80 | -<!-- </a-upload>--> | |
71 | + <a-button v-has="'apiLog:export'" type="primary" icon="download" @click="handleExportXls('接口日志')"> | |
72 | + 导出 | |
73 | + </a-button> | |
81 | 74 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
82 | 75 | <a-menu slot="overlay" v-has="'apiLog:deleteBatch'"> |
83 | - <a-menu-item key="1" @click="batchDel"> | |
84 | - <a-icon type="delete"/> | |
85 | - 删除 | |
86 | - </a-menu-item> | |
76 | + <a-menu-item key="1" @click="batchDel"> <a-icon type="delete" /> 删除 </a-menu-item> | |
87 | 77 | </a-menu> |
88 | - <a-button style="margin-left: 8px"> 批量操作 | |
89 | - <a-icon type="down"/> | |
90 | - </a-button> | |
78 | + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /> </a-button> | |
91 | 79 | </a-dropdown> |
92 | 80 | </div> |
93 | 81 | |
... | ... | @@ -96,7 +84,7 @@ |
96 | 84 | <a-table |
97 | 85 | ref="table" |
98 | 86 | size="middle" |
99 | - :scroll="{x:true}" | |
87 | + :scroll="{ x: true }" | |
100 | 88 | bordered |
101 | 89 | rowKey="id" |
102 | 90 | :columns="columns" |
... | ... | @@ -104,33 +92,12 @@ |
104 | 92 | :pagination="ipagination" |
105 | 93 | :loading="loading" |
106 | 94 | class="j-table-force-nowrap" |
107 | - @change="handleTableChange"> | |
108 | - | |
109 | - <template slot="htmlSlot" slot-scope="text"> | |
110 | - <div v-html="text"></div> | |
111 | - </template> | |
112 | - <template slot="imgSlot" slot-scope="text"> | |
113 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |
114 | - <img v-else :src="getImgView(text)" height="25px" alt="" | |
115 | - style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
116 | - </template> | |
117 | - <template slot="fileSlot" slot-scope="text"> | |
118 | - <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |
119 | - <a-button | |
120 | - v-else | |
121 | - :ghost="true" | |
122 | - type="primary" | |
123 | - icon="download" | |
124 | - size="small" | |
125 | - @click="downloadFile(text)">下载 | |
126 | - </a-button> | |
127 | - </template> | |
128 | - | |
95 | + @change="handleTableChange" | |
96 | + > | |
129 | 97 | <span slot="action" slot-scope="text, record"> |
130 | 98 | <a v-has="'apiLog:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> |
131 | 99 | <a @click="handleDetail(record)">详情</a> |
132 | 100 | </span> |
133 | - | |
134 | 101 | </a-table> |
135 | 102 | </div> |
136 | 103 | |
... | ... | @@ -139,12 +106,11 @@ |
139 | 106 | </template> |
140 | 107 | |
141 | 108 | <script> |
142 | - | |
143 | 109 | import '@/assets/less/TableExpand.less' |
144 | -import {mixinDevice} from '@/utils/mixin' | |
145 | -import {JeecgListMixin} from '@/mixins/JeecgListMixin' | |
110 | +import { mixinDevice } from '@/utils/mixin' | |
111 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
146 | 112 | import ApiLogModal from './modules/ApiLogModal' |
147 | -import JEllipsis from "@comp/jeecg/JEllipsis" | |
113 | +import JEllipsis from '@comp/jeecg/JEllipsis' | |
148 | 114 | |
149 | 115 | export default { |
150 | 116 | name: 'ApiLogList', |
... | ... | @@ -154,135 +120,133 @@ export default { |
154 | 120 | JEllipsis |
155 | 121 | }, |
156 | 122 | data() { |
157 | - let ellipsis1 = (v, l = 20) => (<j-ellipsis value={v} length={l}/>) | |
158 | - let ellipsis2 = (v, l = 120) => (<j-ellipsis value={v} length={l}/>) | |
123 | + let ellipsis = (v, l = 40) => <j-ellipsis value={v} length={l} /> | |
159 | 124 | return { |
160 | 125 | description: '接口日志管理页面', |
161 | 126 | // 表头 |
162 | 127 | columns: [ |
163 | 128 | { |
164 | 129 | title: '接口名称', |
165 | - align: "center", | |
130 | + align: 'center', | |
166 | 131 | dataIndex: 'apiName' |
167 | 132 | }, |
168 | 133 | { |
169 | 134 | title: '请求类型', |
170 | - align: "center", | |
135 | + align: 'center', | |
171 | 136 | dataIndex: 'apiMethod' |
172 | 137 | }, |
173 | 138 | { |
174 | - title: '请求内容', | |
175 | - align: "left", | |
176 | - dataIndex: 'requestBody', | |
177 | - customRender: (t) => ellipsis2(t) | |
139 | + title: '请求方名称', | |
140 | + align: 'center', | |
141 | + dataIndex: 'requestFrom' | |
178 | 142 | }, |
179 | 143 | { |
180 | - title: '响应内容', | |
181 | - align: "left", | |
182 | - dataIndex: 'responseBody', | |
183 | - customRender: (t) => ellipsis2(t) | |
144 | + title: '请求方IP', | |
145 | + align: 'center', | |
146 | + dataIndex: 'ip' | |
184 | 147 | }, |
185 | 148 | { |
186 | - title: '请求方名称', | |
187 | - align: "center", | |
188 | - dataIndex: 'requestFrom' | |
149 | + title: '请求地址', | |
150 | + align: 'center', | |
151 | + dataIndex: 'url' | |
189 | 152 | }, |
190 | 153 | { |
191 | - title: '响应方名称', | |
192 | - align: "center", | |
193 | - dataIndex: 'responseBy' | |
154 | + title: '请求内容', | |
155 | + align: 'center', | |
156 | + dataIndex: 'requestBody', | |
157 | + customRender: t => ellipsis(t) | |
194 | 158 | }, |
195 | 159 | { |
196 | - title: '请求方地址', | |
197 | - align: "center", | |
198 | - dataIndex: 'ip' | |
160 | + title: '响应方名称', | |
161 | + align: 'center', | |
162 | + dataIndex: 'responseBy' | |
199 | 163 | }, |
200 | 164 | { |
201 | - title: '请求地址', | |
202 | - align: "left", | |
203 | - dataIndex: 'url', | |
165 | + title: '响应内容', | |
166 | + align: 'center', | |
167 | + dataIndex: 'responseBody', | |
168 | + customRender: t => ellipsis(t) | |
204 | 169 | }, |
205 | 170 | { |
206 | 171 | title: '请求时间', |
207 | - align: "center", | |
172 | + align: 'center', | |
208 | 173 | dataIndex: 'requestTime' |
209 | 174 | }, |
210 | 175 | { |
211 | 176 | title: '响应时间', |
212 | - align: "center", | |
177 | + align: 'center', | |
213 | 178 | dataIndex: 'responseTime' |
214 | 179 | }, |
215 | 180 | { |
216 | 181 | title: '响应耗时(毫秒)', |
217 | - align: "center", | |
182 | + align: 'center', | |
218 | 183 | dataIndex: 'duration' |
219 | 184 | }, |
220 | 185 | { |
221 | - title: 'httpCode', | |
222 | - align: "center", | |
186 | + title: 'Http Code', | |
187 | + align: 'center', | |
223 | 188 | dataIndex: 'httpCode' |
224 | 189 | }, |
225 | 190 | { |
226 | 191 | title: '业务响应码', |
227 | - align: "center", | |
192 | + align: 'center', | |
228 | 193 | dataIndex: 'retCode' |
229 | 194 | }, |
230 | 195 | { |
231 | 196 | title: '异常堆栈信息', |
232 | - align: "center", | |
233 | - dataIndex: 'exception' | |
197 | + align: 'center', | |
198 | + dataIndex: 'exception', | |
199 | + customRender: t => ellipsis(t) | |
234 | 200 | }, |
235 | 201 | { |
236 | 202 | title: '操作', |
237 | 203 | dataIndex: 'action', |
238 | - align: "center", | |
239 | - fixed: "right", | |
204 | + align: 'center', | |
205 | + fixed: 'right', | |
240 | 206 | width: 80, |
241 | - scopedSlots: {customRender: 'action'} | |
207 | + scopedSlots: { customRender: 'action' } | |
242 | 208 | } |
243 | 209 | ], |
244 | 210 | url: { |
245 | - list: "/monitor/apiLog/list", | |
246 | - delete: "/monitor/apiLog/delete", | |
247 | - deleteBatch: "/monitor/apiLog/deleteBatch", | |
248 | - exportXlsUrl: "/monitor/apiLog/exportXls", | |
249 | - importExcelUrl: "monitor/apiLog/importExcel", | |
250 | - | |
211 | + list: '/monitor/apiLog/list', | |
212 | + delete: '/monitor/apiLog/delete', | |
213 | + deleteBatch: '/monitor/apiLog/deleteBatch', | |
214 | + exportXlsUrl: '/monitor/apiLog/exportXls', | |
215 | + importExcelUrl: 'monitor/apiLog/importExcel' | |
251 | 216 | }, |
252 | 217 | dictOptions: {}, |
253 | - superFieldList: [], | |
218 | + superFieldList: [] | |
254 | 219 | } |
255 | 220 | }, |
256 | 221 | created() { |
257 | - this.getSuperFieldList(); | |
222 | + this.getSuperFieldList() | |
258 | 223 | }, |
259 | 224 | computed: { |
260 | - importExcelUrl: function () { | |
261 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
262 | - }, | |
225 | + importExcelUrl: function() { | |
226 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | |
227 | + } | |
263 | 228 | }, |
264 | 229 | methods: { |
265 | - initDictConfig() { | |
266 | - }, | |
230 | + initDictConfig() {}, | |
267 | 231 | getSuperFieldList() { |
268 | - let fieldList = []; | |
269 | - fieldList.push({type: 'string', value: 'apiName', text: '接口名称', dictCode: ''}) | |
270 | - fieldList.push({type: 'string', value: 'apiMethod', text: '请求类型', dictCode: ''}) | |
271 | - fieldList.push({type: 'string', value: 'ip', text: '请求方地址', dictCode: ''}) | |
272 | - fieldList.push({type: 'string', value: 'requestFrom', text: '请求方名称', dictCode: ''}) | |
273 | - fieldList.push({type: 'string', value: 'responseBy', text: '响应方名称', dictCode: ''}) | |
274 | - fieldList.push({type: 'string', value: 'url', text: '请求地址', dictCode: ''}) | |
275 | - fieldList.push({type: 'datetime', value: 'requestTime', text: '请求时间'}) | |
276 | - fieldList.push({type: 'datetime', value: 'responseTime', text: '响应时间'}) | |
277 | - fieldList.push({type: 'Text', value: 'requestHeader', text: '请求头', dictCode: ''}) | |
278 | - fieldList.push({type: 'Text', value: 'requestBody', text: '请求内容', dictCode: ''}) | |
279 | - fieldList.push({type: 'Text', value: 'responseHeader', text: '响应头', dictCode: ''}) | |
280 | - fieldList.push({type: 'Text', value: 'responseBody', text: '响应内容', dictCode: ''}) | |
281 | - fieldList.push({type: 'string', value: 'duration', text: '响应耗时(毫秒)', dictCode: ''}) | |
282 | - fieldList.push({type: 'int', value: 'httpCode', text: 'httpCode', dictCode: ''}) | |
283 | - fieldList.push({type: 'int', value: 'retCode', text: '业务响应码', dictCode: ''}) | |
284 | - fieldList.push({type: 'Text', value: 'exception', text: '异常堆栈信息', dictCode: ''}) | |
285 | - fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'}) | |
232 | + let fieldList = [] | |
233 | + fieldList.push({ type: 'string', value: 'apiName', text: '接口名称', dictCode: '' }) | |
234 | + fieldList.push({ type: 'string', value: 'apiMethod', text: '请求类型', dictCode: '' }) | |
235 | + fieldList.push({ type: 'string', value: 'ip', text: '请求方IP', dictCode: '' }) | |
236 | + fieldList.push({ type: 'string', value: 'requestFrom', text: '请求方名称', dictCode: '' }) | |
237 | + fieldList.push({ type: 'string', value: 'responseBy', text: '响应方名称', dictCode: '' }) | |
238 | + fieldList.push({ type: 'string', value: 'url', text: '请求地址', dictCode: '' }) | |
239 | + fieldList.push({ type: 'datetime', value: 'requestTime', text: '请求时间' }) | |
240 | + fieldList.push({ type: 'datetime', value: 'responseTime', text: '响应时间' }) | |
241 | + fieldList.push({ type: 'Text', value: 'requestHeader', text: '请求头', dictCode: '' }) | |
242 | + fieldList.push({ type: 'Text', value: 'requestBody', text: '请求内容', dictCode: '' }) | |
243 | + fieldList.push({ type: 'Text', value: 'responseHeader', text: '响应头', dictCode: '' }) | |
244 | + fieldList.push({ type: 'Text', value: 'responseBody', text: '响应内容', dictCode: '' }) | |
245 | + fieldList.push({ type: 'string', value: 'duration', text: '响应耗时(毫秒)', dictCode: '' }) | |
246 | + fieldList.push({ type: 'int', value: 'httpCode', text: 'httpCode', dictCode: '' }) | |
247 | + fieldList.push({ type: 'int', value: 'retCode', text: '业务响应码', dictCode: '' }) | |
248 | + fieldList.push({ type: 'Text', value: 'exception', text: '异常堆栈信息', dictCode: '' }) | |
249 | + fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' }) | |
286 | 250 | this.superFieldList = fieldList |
287 | 251 | } |
288 | 252 | } |
... | ... |
ant-design-vue-jeecg/src/views/system/monitor/modules/ApiLogForm.vue
... | ... | @@ -14,13 +14,23 @@ |
14 | 14 | </a-form-model-item> |
15 | 15 | </a-col> |
16 | 16 | <a-col :span="24"> |
17 | - <a-form-model-item label="请求方地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ip"> | |
18 | - <a-input v-model="model.ip" placeholder="请输入请求方地址"></a-input> | |
17 | + <a-form-model-item label="请求方名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requestFrom"> | |
18 | + <a-input v-model="model.requestFrom" placeholder="请输入请求方名称"></a-input> | |
19 | 19 | </a-form-model-item> |
20 | 20 | </a-col> |
21 | 21 | <a-col :span="24"> |
22 | - <a-form-model-item label="请求方名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responseFrom"> | |
23 | - <a-input v-model="model.responseFrom" placeholder="请输入请求方名称"></a-input> | |
22 | + <a-form-model-item label="请求方IP" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ip"> | |
23 | + <a-input v-model="model.ip" placeholder="请输入请求方IP"></a-input> | |
24 | + </a-form-model-item> | |
25 | + </a-col> | |
26 | + <a-col :span="24"> | |
27 | + <a-form-model-item label="请求地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url"> | |
28 | + <a-input v-model="model.url" placeholder="请输入请求地址"></a-input> | |
29 | + </a-form-model-item> | |
30 | + </a-col> | |
31 | + <a-col :span="24"> | |
32 | + <a-form-model-item label="请求内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requestBody"> | |
33 | + <a-input v-model="model.requestBody" placeholder="请输入请求内容"></a-input> | |
24 | 34 | </a-form-model-item> |
25 | 35 | </a-col> |
26 | 36 | <a-col :span="24"> |
... | ... | @@ -29,8 +39,8 @@ |
29 | 39 | </a-form-model-item> |
30 | 40 | </a-col> |
31 | 41 | <a-col :span="24"> |
32 | - <a-form-model-item label="请求地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url"> | |
33 | - <a-input v-model="model.url" placeholder="请输入请求地址"></a-input> | |
42 | + <a-form-model-item label="响应内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responseBody"> | |
43 | + <a-input v-model="model.responseBody" placeholder="请输入响应内容"></a-input> | |
34 | 44 | </a-form-model-item> |
35 | 45 | </a-col> |
36 | 46 | <a-col :span="24"> |
... | ... | @@ -46,16 +56,6 @@ |
46 | 56 | </a-form-model-item> |
47 | 57 | </a-col> |
48 | 58 | <a-col :span="24"> |
49 | - <a-form-model-item label="请求内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requestBody"> | |
50 | - <a-input v-model="model.requestBody" placeholder="请输入请求内容"></a-input> | |
51 | - </a-form-model-item> | |
52 | - </a-col> | |
53 | - <a-col :span="24"> | |
54 | - <a-form-model-item label="响应内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responseBody"> | |
55 | - <a-input v-model="model.responseBody" placeholder="请输入响应内容"></a-input> | |
56 | - </a-form-model-item> | |
57 | - </a-col> | |
58 | - <a-col :span="24"> | |
59 | 59 | <a-form-model-item label="响应耗时(毫秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration"> |
60 | 60 | <a-input v-model="model.duration" placeholder="请输入响应耗时(毫秒)"></a-input> |
61 | 61 | </a-form-model-item> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/entity/Address.java
... | ... | @@ -49,9 +49,9 @@ public class Address implements Serializable { |
49 | 49 | @Excel(name = "接口地址", width = 15) |
50 | 50 | @ApiModelProperty(value = "接口地址") |
51 | 51 | private String url; |
52 | - /** 备注 */ | |
53 | - @Excel(name = "备注", width = 15) | |
54 | - @ApiModelProperty(value = "备注") | |
52 | + /** 接口名称 */ | |
53 | + @Excel(name = "接口名称", width = 15) | |
54 | + @ApiModelProperty(value = "接口名称") | |
55 | 55 | private String remark; |
56 | 56 | /** 备用字段1 */ |
57 | 57 | @Excel(name = "备用字段1", width = 15) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
... | ... | @@ -298,12 +298,14 @@ public class ApiLoggerAspect { |
298 | 298 | try { |
299 | 299 | String[] spList = url.toString().split("/"); |
300 | 300 | String apiName = spList[spList.length - 1]; |
301 | - String ip = JeecgSystemApplication.getLocalHostExactAddress().getHostAddress(); | |
302 | 301 | apiLog.setApiName(apiName); |
303 | 302 | apiLog.setRequestFrom(HUAHENG_SYSTEM_NAME); |
304 | - apiLog.setIp(ip); | |
303 | + apiLog.setIp(JeecgSystemApplication.getLocalHostExactAddress().getHostAddress()); | |
305 | 304 | Address address = addressService.getAddressByUrl(url.toString()); |
306 | - apiLog.setResponseBy(address.getParam().toUpperCase()); | |
305 | + if (address != null) { | |
306 | + apiLog.setApiName(address.getRemark()); | |
307 | + apiLog.setResponseBy(address.getParam().toUpperCase()); | |
308 | + } | |
307 | 309 | } catch (Exception e) { |
308 | 310 | e.printStackTrace(); |
309 | 311 | } |
... | ... |