| | |
| | | const params= { |
| | | options:options, |
| | | paramVOS:paramVOS, |
| | | saveCallback:callback |
| | | saveCallback:callback, |
| | | title:paramVOS.title |
| | | } |
| | | |
| | | store.dispatch("setViewtabparams", params); |
| | | router.push({ |
| | | name: "查看详情", |
| | | params:params, |
| | | query:{ |
| | | name:paramVOS.title |
| | | } |
| | | params:params |
| | | }); |
| | | } |
| | | |
| | |
| | | }, |
| | | isShow: { |
| | | handler(newval) { |
| | | debugger; |
| | | if (newval && this.$el.clientHeight > 50) { |
| | | this.parentHeight = this.$el.clientHeight - this.$children[0].$children[1].$children[0].$el.clientHeight - this.$children[0].$children[2].$el.clientHeight - 5; |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | const value = to.query.src || to.fullPath; |
| | | const label = to.query.name || to.name; |
| | | const label = to.query.name ||to.params.title|| to.name; |
| | | const meta = to.meta || router.$avueRouter.meta || {}; |
| | | const i18n = to.query.i18n; |
| | | if(to.query.name){ |
| | | //修改路由标题 |
| | | meta.title=to.query.name; |
| | | } |
| | | if (to.query.target) { |
| | | window.open(value) |
| | | } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) { |
| | |
| | | path: 'viewTab', |
| | | name: '查看详情', |
| | | meta: { |
| | | i18n: 'viewTab', |
| | | title:'查看详情' |
| | | i18n: 'viewTab' |
| | | }, |
| | | component: () => |
| | | import('@/views/base/ViewTab') |
| | |
| | | |
| | | <script> |
| | | import {validatenull} from "@/util/validate"; |
| | | import { getStore } from "@/util/store.js"; |
| | | import { getStore ,removeStore} from "@/util/store.js"; |
| | | |
| | | export default { |
| | | name: "ViewTab", |
| | |
| | | } |
| | | }, |
| | | computed:{ |
| | | title(){ |
| | | return this.paramVOS.title || "查看详情" |
| | | } |
| | | }, |
| | | created() { |
| | | let config = {}; |
| | | if (!validatenull(this.$store.state.viewtabparams)) { |
| | | config = this.$store.state.viewtabparams; |
| | | } else { |
| | | config = getStore('viewtabparams'); |
| | | config = getStore({ name:'viewtabparams'}); |
| | | } |
| | | this.sourceData = config.options.sourceData; |
| | | this.dataStore = config.options.dataStore; |
| | | this.paramVOS = config.paramVOS; |
| | | if(config){ |
| | | this.sourceData = config.options.sourceData; |
| | | this.dataStore = config.options.dataStore; |
| | | this.paramVOS = config.paramVOS; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.loadCompoent(); |
| | | }, |
| | | beforeDestroy() { |
| | | //removeStore({ name:'viewtabparams', type:'session'}); |
| | | }, |
| | | methods: { |
| | | loadCompoent(){ |
| | |
| | | console.log('组件加载失败:', error); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | |