| | |
| | | })
|
| | | },
|
| | | refreshSelectedTag(view) {
|
| | | this.$store.dispatch('tagsView/delCachedView', view).then(() => {
|
| | | const { fullPath } = view
|
| | | this.$nextTick(() => {
|
| | | this.$router.replace({
|
| | | path: '/redirect' + fullPath
|
| | | })
|
| | | })
|
| | | })
|
| | | this.$tab.refreshPage(view);
|
| | | },
|
| | | closeSelectedTag(view) {
|
| | | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
|
| | | this.$tab.closePage(view).then(({ visitedViews }) => {
|
| | | if (this.isActive(view)) {
|
| | | this.toLastView(visitedViews, view)
|
| | | }
|
| | | })
|
| | | },
|
| | | closeRightTags() {
|
| | | this.$store.dispatch('tagsView/delRightTags', this.selectedTag).then(visitedViews => {
|
| | | this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
|
| | | if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
| | | this.toLastView(visitedViews)
|
| | | }
|
| | | })
|
| | | },
|
| | | closeLeftTags() {
|
| | | this.$store.dispatch('tagsView/delLeftTags', this.selectedTag).then(visitedViews => {
|
| | | this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
|
| | | if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
| | | this.toLastView(visitedViews)
|
| | | }
|
| | |
| | | },
|
| | | closeOthersTags() {
|
| | | this.$router.push(this.selectedTag).catch(()=>{});
|
| | | this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => {
|
| | | this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
| | | this.moveToCurrentTag()
|
| | | })
|
| | | },
|
| | | closeAllTags(view) {
|
| | | this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
|
| | | this.$tab.closeAllPage().then(({ visitedViews }) => {
|
| | | if (this.affixTags.some(tag => tag.path === this.$route.path)) {
|
| | | return
|
| | | }
|
| | |
| | | import tab from './tab'
|
| | | import auth from './auth'
|
| | | import cache from './cache'
|
| | | import modal from './modal'
|
| | |
| | |
|
| | | export default {
|
| | | install(Vue) {
|
| | | // é¡µç¾æä½
|
| | | Vue.prototype.$tab = tab
|
| | | // 认è¯å¯¹è±¡
|
| | | Vue.prototype.$auth = auth
|
| | | // ç¼å对象
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import store from '@/store'
|
| | | import router from '@/router';
|
| | |
|
| | | export default {
|
| | | // å·æ°å½åtab页ç¾
|
| | | refreshPage(obj) {
|
| | | const { path, matched } = router.currentRoute;
|
| | | if (obj === undefined) {
|
| | | matched.forEach((m) => {
|
| | | if (m.components && m.components.default && m.components.default.name) {
|
| | | if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
|
| | | obj = { name: m.components.default.name, path: path };
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | return store.dispatch('tagsView/delCachedView', obj).then(() => {
|
| | | const { path } = obj
|
| | | router.replace({
|
| | | path: '/redirect' + path
|
| | | })
|
| | | })
|
| | |
|
| | |
|
| | | },
|
| | | // å
³éå½åtab页ç¾ï¼æå¼æ°é¡µç¾
|
| | | closeOpenPage(obj) {
|
| | | store.dispatch("tagsView/delView", router.currentRoute);
|
| | | if (obj !== undefined) {
|
| | | return router.push(obj);
|
| | | }
|
| | | },
|
| | | // å
³éæå®tab页ç¾
|
| | | closePage(obj) {
|
| | | if (obj === undefined) {
|
| | | return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => {
|
| | | return router.push(lastPath || '/');
|
| | | });
|
| | | }
|
| | | return store.dispatch('tagsView/delView', obj);
|
| | | },
|
| | | // å
³éæætab页ç¾
|
| | | closeAllPage() {
|
| | | return store.dispatch('tagsView/delAllViews');
|
| | | },
|
| | | // å
³é左侧tab页ç¾
|
| | | closeLeftPage(obj) {
|
| | | return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
|
| | | },
|
| | | // å
³éå³ä¾§tab页ç¾
|
| | | closeRightPage(obj) {
|
| | | return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
|
| | | },
|
| | | // å
³éå
¶ä»tab页ç¾
|
| | | closeOtherPage(obj) {
|
| | | return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
|
| | | },
|
| | | // æ·»å tab页ç¾
|
| | | addPage(title, url) {
|
| | | var obj = { path: url, meta: { title: title } }
|
| | | store.dispatch('tagsView/addView', obj);
|
| | | return router.push(url);
|
| | | },
|
| | | // ä¿®æ¹tab页ç¾
|
| | | updatePage(obj) {
|
| | | return store.dispatch('tagsView/updateVisitedView', obj);
|
| | | }
|
| | | }
|
| | |
| | | },
|
| | | ADD_CACHED_VIEW: (state, view) => {
|
| | | if (state.cachedViews.includes(view.name)) return
|
| | | if (!view.meta.noCache) {
|
| | | if (view.meta && !view.meta.noCache) {
|
| | | state.cachedViews.push(view.name)
|
| | | }
|
| | | },
|
| | |
| | | }, |
| | | // è¿åæé® |
| | | handleClose() { |
| | | this.$store.dispatch("tagsView/delView", this.$route); |
| | | this.$router.push({ path: "/monitor/job" }); |
| | | const obj = { path: "/monitor/job" }; |
| | | this.$tab.closeOpenPage(obj); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | |
| | | v-hasPermi="['system:dict:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | plain
|
| | | icon="el-icon-close"
|
| | | size="mini"
|
| | | @click="handleClose"
|
| | | >å
³é</el-button>
|
| | | </el-col>
|
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | // è¿åæé®
|
| | | handleClose() {
|
| | | const obj = { path: "/system/dict" };
|
| | | this.$tab.closeOpenPage(obj);
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | |
| | | },
|
| | | // è¿åæé®
|
| | | handleClose() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/system/role" });
|
| | | const obj = { path: "/system/role" };
|
| | | this.$tab.closeOpenPage(obj);
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | |
| | | },
|
| | | /** å
³éæé® */
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/system/user" });
|
| | | const obj = { path: "/system/user" };
|
| | | this.$tab.closeOpenPage(obj);
|
| | | },
|
| | | },
|
| | | };
|
| | |
| | | });
|
| | | },
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/index" });
|
| | | this.$tab.closePage();
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | });
|
| | | },
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/index" });
|
| | | this.$tab.closePage();
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | }, |
| | | /** å
³éæé® */ |
| | | close() { |
| | | this.$store.dispatch("tagsView/delView", this.$route); |
| | | this.$router.push({ path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } }) |
| | | const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } }; |
| | | this.$tab.closeOpenPage(obj); |
| | | } |
| | | }, |
| | | mounted() { |