Commit 04de9dfb759e5d6b130131f721a18b2a47fdbd9a

Authored by 谭毅彬
1 parent 24657a47

接口日志添加接口名称动态筛选功能,优化若干页面按钮显示

Signed-off-by: TanYibin <5491541@qq.com>
ant-design-vue-jeecg/src/api/api.js
... ... @@ -58,6 +58,8 @@ const queryMyDepartTreeList = (params) =&gt; getAction(&quot;/sys/sysDepart/queryMyDeptT
58 58 //日志管理
59 59 const deleteLog = (params) => deleteAction("/sys/log/delete", params);
60 60 const deleteLogList = (params) => deleteAction("/sys/log/deleteBatch", params);
  61 +//获得所有接口日志名称
  62 +const getApiNameList = (params) => deleteAction("/monitor/apiLog/getApiNameList", params);
61 63  
62 64 //数据字典
63 65 const addDict = (params) => postAction("/sys/dict/add", params);
... ... @@ -160,11 +162,11 @@ export const selectPort = (params) =&gt; postAction(&#39;/task/taskHeader/selectPort&#39;,
160 162 //创建跨站任务
161 163 export const createOverStationTask = (params) => postAction('/task/taskHeader/createOverStationTask', params);
162 164 //盘点任务创建
163   -export const stockTakeTask = (params,headerId,code) => postAction('/cycleCountDetail/cycleCountDetail/stockTakeTask?ids='+params+'&headerId='+headerId+'&code='+code, code);
  165 +export const stockTakeTask = (params, headerId, code) => postAction('/cycleCountDetail/cycleCountDetail/stockTakeTask?ids=' + params + '&headerId=' + headerId + '&code=' + code, code);
164 166 //盘盈添加
165 167 export const increaseInInventoryGain = (params) => postAction('/cycleCountDetail/cycleCountDetail/increaseInInventoryGain', params);
166 168 //盘点任务生成
167   -export const createCycleCoutTaskByDetailId = (params,toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId='+params+'&toPort='+toPort, params);
  169 +export const createCycleCoutTaskByDetailId = (params, toPort) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCoutTaskByDetailId?cycleId=' + params + '&toPort=' + toPort, params);
168 170 //盘点确定实盘数量
169 171 export const confirmGapQty = (params) => postAction('/cycleCountDetail/cycleCountDetail/confirmGapQty', params);
170 172 //创建空托盘组入库任务
... ... @@ -277,5 +279,6 @@ export {
277 279 saveDeptRolePermission,
278 280 queryMyDepartTreeList,
279 281 getUserNoticeInfo,
280   - getDictItemsFromCache
  282 + getDictItemsFromCache,
  283 + getApiNameList
281 284 }
... ...
ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue
... ... @@ -90,9 +90,7 @@
90 90 </template>
91 91  
92 92 <span slot="action" slot-scope="text, record">
93   - <a v-has="'bomHeader:edit'" @click="handleEdit(record)">编辑</a>
94   -
95   - <a-divider type="vertical"/>
  93 + <a v-has="'bomHeader:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
96 94 <a-dropdown>
97 95 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
98 96 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/config/CarrierList.vue
... ... @@ -74,9 +74,7 @@
74 74 </template>
75 75  
76 76 <span slot="action" slot-scope="text, record">
77   - <a v-has="'carrier:edit'" @click="handleEdit(record)">编辑</a>
78   -
79   - <a-divider type="vertical"/>
  77 + <a v-has="'carrier:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
80 78 <a-dropdown>
81 79 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
82 80 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/config/CustomerList.vue
... ... @@ -74,9 +74,7 @@
74 74 </template>
75 75  
76 76 <span slot="action" slot-scope="text, record">
77   - <a v-has="'customer:edit'" @click="handleEdit(record)">编辑</a>
78   -
79   - <a-divider type="vertical"/>
  77 + <a v-has="'customer:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
80 78 <a-dropdown>
81 79 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
82 80 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/config/LocationHighList.vue
... ... @@ -100,9 +100,7 @@
100 100 </template>
101 101  
102 102 <span slot="action" slot-scope="text, record">
103   - <a v-has="'locationHigh:edit'" @click="handleEdit(record)">编辑</a>
104   -
105   - <a-divider type="vertical"/>
  103 + <a v-has="'locationHigh:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
106 104 <a-dropdown>
107 105 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
108 106 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/config/SupplierList.vue
... ... @@ -101,9 +101,7 @@
101 101 </template>
102 102  
103 103 <span slot="action" slot-scope="text, record">
104   - <a v-has="'supplier:edit'" @click="handleEdit(record)">编辑</a>
105   -
106   - <a-divider type="vertical"/>
  104 + <a v-has="'supplier:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
107 105 <a-dropdown>
108 106 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
109 107 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
... ... @@ -166,9 +166,7 @@
166 166 </template>
167 167  
168 168 <span slot="action" slot-scope="text, record">
169   - <a v-has="'inventoryTransaction:edit'" @click="handleEdit(record)">编辑</a>
170   -
171   - <a-divider type="vertical"/>
  169 + <a v-has="'inventoryTransaction:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
172 170 <a-dropdown>
173 171 <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
174 172 <a-menu slot="overlay">
... ...
ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue
... ... @@ -4,9 +4,13 @@
4 4 <div class="table-page-search-wrapper">
5 5 <a-form layout="inline" @keyup.enter.native="searchQuery">
6 6 <a-row :gutter="24">
7   - <a-col :xl="6" :lg="7" :md="8" :sm="24">
8   - <a-form-item label="接口名称">
9   - <j-input placeholder="请输入接口名称" v-model="queryParam.apiName"></j-input>
  7 + <a-col :xl='6' :lg='7' :md='8' :sm='24'>
  8 + <a-form-item label='接口名称'>
  9 + <a-select show-search placeholder='请输入接口名称' option-filter-prop='children' v-model='queryParam.apiName'>
  10 + <a-select-option v-for='name in apiNameList' :key='name' :value='name'>
  11 + {{ name }}
  12 + </a-select-option>
  13 + </a-select>
10 14 </a-form-item>
11 15 </a-col>
12 16 <a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -128,6 +132,7 @@ import { mixinDevice } from &#39;@/utils/mixin&#39;
128 132 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
129 133 import ApiLogModal from './modules/ApiLogModal'
130 134 import JEllipsis from '@comp/jeecg/JEllipsis'
  135 +import {getApiNameList} from '@api/api'
131 136  
132 137 export default {
133 138 name: 'ApiLogList',
... ... @@ -139,6 +144,7 @@ export default {
139 144 data() {
140 145 return {
141 146 description: '接口日志管理页面',
  147 + apiNameList: [],
142 148 // 表头
143 149 columns: [
144 150 {
... ... @@ -211,6 +217,7 @@ export default {
211 217 },
212 218 created() {
213 219 this.getSuperFieldList()
  220 + this.loadFrom()
214 221 },
215 222 mounted() {
216 223 this.expandedRowRender = "expandedRowRender";
... ... @@ -221,6 +228,13 @@ export default {
221 228 }
222 229 },
223 230 methods: {
  231 + loadFrom() {
  232 + getApiNameList().then((res) => {
  233 + if (res.success) {
  234 + this.apiNameList = res.result
  235 + }
  236 + })
  237 + },
224 238 initDictConfig() {},
225 239 getSuperFieldList() {
226 240 let fieldList = []
... ...
ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue
... ... @@ -72,9 +72,8 @@
72 72  
73 73 <span slot="action" slot-scope="text, record">
74 74 <a v-has="'receiptDetail:edit'" @click="edit(record)">编辑</a>
75   - <a-divider type="vertical"/>
76 75 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
77   - <a v-has="'receiptDetail:delete'">删除</a>
  76 + <a v-has="'receiptDetail:delete'"><a-divider type="vertical"/>删除</a>
78 77 </a-popconfirm>
79 78 </span>
80 79  
... ...
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue
... ... @@ -120,11 +120,11 @@
120 120 </template>
121 121  
122 122 <span slot="action" slot-scope="text, record">
123   - <a v-if="record.status == 0" @click="selectPort(record)">生成任务<a-divider type="vertical"/></a>
  123 + <a v-if="record.status == 0" @click="selectPort(record)">生成任务</a>
124 124 <a-popconfirm v-if="record.status == 0" v-has="'shipmentContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)">
125   - <a>取消配盘<a-divider type="vertical"/></a>
  125 + <a><a-divider type="vertical"/>取消配盘</a>
126 126 </a-popconfirm>
127   - <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)">编辑</a>
  127 + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-divider type="vertical"/>编辑</a>
128 128 </span>
129 129 </a-table>
130 130 </div>
... ...
ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue
... ... @@ -111,8 +111,8 @@
111 111 <a-menu-item>
112 112 <a @click="handleDetail(record)">详情</a>
113 113 </a-menu-item>
114   - <a-menu-item>
115   - <a v-has="'agvTask:edit'" @click="handleEdit(record)">编辑</a>
  114 + <a-menu-item v-has="'agvTask:edit'">
  115 + <a @click="handleEdit(record)">编辑</a>
116 116 </a-menu-item>
117 117 </a-menu>
118 118 </a-dropdown>
... ...
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... ... @@ -148,9 +148,8 @@
148 148 <a-divider type="vertical"/></a>
149 149 <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据
150 150 <a-divider type="vertical"/></a>
151   - <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a>
  151 + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消</a>
152 152 </span>
153   -
154 153 </a-table>
155 154 </div>
156 155  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java
... ... @@ -13,7 +13,14 @@ import org.jeecg.common.system.query.QueryGenerator;
13 13 import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog;
14 14 import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService;
15 15 import org.springframework.beans.factory.annotation.Autowired;
16   -import org.springframework.web.bind.annotation.*;
  16 +import org.springframework.web.bind.annotation.DeleteMapping;
  17 +import org.springframework.web.bind.annotation.GetMapping;
  18 +import org.springframework.web.bind.annotation.PostMapping;
  19 +import org.springframework.web.bind.annotation.RequestBody;
  20 +import org.springframework.web.bind.annotation.RequestMapping;
  21 +import org.springframework.web.bind.annotation.RequestMethod;
  22 +import org.springframework.web.bind.annotation.RequestParam;
  23 +import org.springframework.web.bind.annotation.RestController;
17 24 import org.springframework.web.servlet.ModelAndView;
18 25  
19 26 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
... ... @@ -148,4 +155,12 @@ public class ApiLogController extends JeecgController&lt;ApiLog, IApiLogService&gt; {
148 155 return super.importExcel(request, response, ApiLog.class);
149 156 }
150 157  
  158 + /**
  159 + * 获得所有接口日志名称
  160 + */
  161 + @RequestMapping(value = "/getApiNameList")
  162 + public Result<?> getApiNameList(HttpServletRequest request) {
  163 + return Result.OK(apiLogService.getApiNameList());
  164 + }
  165 +
151 166 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/IApiLogService.java
1 1 package org.jeecg.modules.wms.monitor.apiLog.service;
2 2  
3   -import com.baomidou.mybatisplus.extension.service.IService;
  3 +import java.util.List;
  4 +
4 5 import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog;
5 6  
  7 +import com.baomidou.mybatisplus.extension.service.IService;
  8 +
6 9 /**
7 10 * @Description: 接口日志
8 11 * @Author: jeecg-boot
... ... @@ -11,4 +14,6 @@ import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog;
11 14 */
12 15 public interface IApiLogService extends IService<ApiLog> {
13 16  
  17 + public List<String> getApiNameList();
  18 +
14 19 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/service/impl/ApiLogServiceImpl.java
1 1 package org.jeecg.modules.wms.monitor.apiLog.service.impl;
2 2  
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +import java.util.stream.Collectors;
  6 +
3 7 import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog;
4 8 import org.jeecg.modules.wms.monitor.apiLog.mapper.ApiLogMapper;
5 9 import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService;
  10 +import org.springframework.cache.annotation.Cacheable;
6 11 import org.springframework.stereotype.Service;
7 12  
  13 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  14 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
8 15 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 16  
  17 +import cn.hutool.core.date.DateUtil;
  18 +
10 19 /**
11 20 * @Description: 接口日志
12 21 * @Author: jeecg-boot
... ... @@ -16,4 +25,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 25 @Service
17 26 public class ApiLogServiceImpl extends ServiceImpl<ApiLogMapper, ApiLog> implements IApiLogService {
18 27  
  28 + @Override
  29 + @Cacheable(cacheNames = "getApiNameList#7200", key = "#root.methodName", unless = "#result == null ")
  30 + public List<String> getApiNameList() {
  31 + LambdaQueryWrapper<ApiLog> lambdaQueryWrapper = Wrappers.lambdaQuery();
  32 + lambdaQueryWrapper.select(ApiLog::getApiName).groupBy(ApiLog::getApiName).ge(ApiLog::getCreateTime, DateUtil.offsetDay(new Date(), -7));
  33 + List<ApiLog> apiLogList = list(lambdaQueryWrapper);
  34 + return apiLogList.stream().map(t -> t.getApiName()).collect(Collectors.toList());
  35 + }
  36 +
19 37 }
... ...