页面路由跳转返回后数据回显,记住原先的状态
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
<script>
|
||||
import Container from './container.vue'
|
||||
import operatingSingleBar from './operatingSingleBar.vue'
|
||||
import { pushNavigation, saveNavigationState } from '@/utils/navigationReturnState';
|
||||
|
||||
export default {
|
||||
name: 'ProductionStatus',
|
||||
@@ -129,11 +130,27 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleDashboardClick(path) {
|
||||
// 从路径提取详情页名称,如 '/salesVolumeAnalysis/salesVolumeAnalysisBase' -> 'salesVolumeAnalysisBase'
|
||||
const toPage = path.split('/').pop();
|
||||
// 保存当前页面状态并入栈
|
||||
const currentPath = this.$route.path;
|
||||
const state = {
|
||||
dateData: {
|
||||
startTime: this.dateData.startTime,
|
||||
endTime: this.dateData.endTime
|
||||
},
|
||||
factory: this.$route.query.factory ? this.$route.query.factory : this.factory,
|
||||
toPage
|
||||
};
|
||||
pushNavigation(currentPath, state);
|
||||
saveNavigationState(currentPath, state);
|
||||
// query 仅支持字符串,时间范围用 startTime/endTime 传递
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: {
|
||||
factory: this.$route.query.factory ? this.$route.query.factory : this.factory,
|
||||
dateData:this.dateData
|
||||
startTime: this.dateData && this.dateData.startTime != null ? String(this.dateData.startTime) : '',
|
||||
endTime: this.dateData && this.dateData.endTime != null ? String(this.dateData.endTime) : ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user