Commit 9ab3fdaa01958d5a091c9d5b6cd0a2012ffd82ea
1 parent
c2536032
缓存路由菜单切换,查询条件不变,刷新列表
Showing
2 changed files
with
18 additions
and
1 deletions
ant-design-vue-jeecg/src/components/layouts/TabLayout.vue
... | ... | @@ -132,6 +132,10 @@ export default { |
132 | 132 | let oldIndex = this.linkList.indexOf(newRoute.fullPath) |
133 | 133 | let oldPositionRoute = this.pageList[oldIndex] |
134 | 134 | this.pageList.splice(oldIndex, 1, Object.assign({}, newRoute, {meta: oldPositionRoute.meta})) |
135 | + let obj = Object.assign({}, newRoute, {meta: oldPositionRoute.meta}); | |
136 | + if(obj.matched.length >= 3 && obj.matched[2].components.default.mounted != undefined) { | |
137 | + obj.matched[2].components.default.mounted(); | |
138 | + } | |
135 | 139 | } |
136 | 140 | }, |
137 | 141 | 'activePage': function (key) { |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | </template> |
81 | 81 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
82 | 82 | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
83 | - <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |
83 | + <a-button id="search" type="primary" @click="searchQuery" icon="search">查询</a-button> | |
84 | 84 | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
85 | 85 | <a @click="handleToggleSearch" style="margin-left: 8px"> |
86 | 86 | {{ toggleSearchStatus ? '收起' : '展开' }} |
... | ... | @@ -376,6 +376,8 @@ export default { |
376 | 376 | }, |
377 | 377 | selectedMainId: '', |
378 | 378 | superFieldList: [], |
379 | + | |
380 | + | |
379 | 381 | } |
380 | 382 | }, |
381 | 383 | created() { |
... | ... | @@ -389,6 +391,17 @@ export default { |
389 | 391 | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
390 | 392 | } |
391 | 393 | }, |
394 | + mounted() { | |
395 | + //页面没加载完,此时methods里的方法找不到,使用定时器模拟点击 | |
396 | + let timeSearch=setInterval(()=>{ | |
397 | + let eleSearch= document.getElementById("search"); | |
398 | + if (eleSearch!=null){ | |
399 | + //调用成功,清除定时器 | |
400 | + clearInterval(timeSearch) | |
401 | + eleSearch.click(); | |
402 | + } | |
403 | + },200) | |
404 | + }, | |
392 | 405 | methods: { |
393 | 406 | getDocumentAduitFlowStaus(){ |
394 | 407 | getDocumentAduitFlow().then((res) => { |
... | ... |