所有tabs切换路径时页面都设置为可缓存

1、所有tabs切换路径时页面都设置为可缓存
2、优化存在缓存时列表请求两次接口的问题
3、form表单点击返回时还原表单数据,清除缓存状态
This commit is contained in:
康冉冉
2026-03-11 17:43:46 +08:00
parent be00acb4ea
commit ad1df9cfa5
29 changed files with 416 additions and 295 deletions
+3
View File
@@ -441,6 +441,9 @@
// 返回
handleReset() {
this.$refs.ruleForm.resetFields();
// 步骤1:从 keep-alive 缓存列表中移除当前页面
this.$store.dispatch('tagsView/delCachedView', this.$route);
// 清除所有表单校验提示
this.$emit("fnClick", {fnCode: 'cancel'});
},
// change事件
+1 -1
View File
@@ -2,7 +2,7 @@
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view v-if="!$route.meta.link" :key="key" />
<router-view v-if="!$route.meta.link" :key="$route.fullPath" />
</keep-alive>
</transition>
<iframe-toggle />
+12 -12
View File
@@ -193,7 +193,7 @@ export const dynamicRoutes = [
{
path: 'index/:id?',
component: () => import('@/views/earnManage/busValueCount/details'),
name: 'busValueCountEdit',
name: 'busValueCount_Details',
meta: { title: '新增任务', activeMenu: '/earnManage/busValueCount' }
}
]
@@ -310,7 +310,7 @@ export const dynamicRoutes = [
path: ':id?',
component: () => import('@/views/earnManage/businessScript/details'),
name: 'BusinessScriptDetails',
meta: { title: '脚本信息', noCache: true ,activeMenu: '/earnManage/businessScript' }
meta: { title: '脚本信息', activeMenu: '/earnManage/businessScript' }
}
]
},
@@ -325,7 +325,7 @@ export const dynamicRoutes = [
path: ':id?',
component: () => import('@/views/earnManage/businessIssued/details'),
name: 'BusinessIssuedDetails',
meta: { title: '业务下发信息', noCache: true ,activeMenu: '/earnManage/businessIssued' }
meta: { title: '业务下发信息', activeMenu: '/earnManage/businessIssued' }
}
]
},
@@ -369,7 +369,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/serverRegister/handle'),
name: 'serverRegisterEdit',
name: 'serverRegister_Edit',
meta: { title: '服务器管理信息', activeMenu: '/resource/serverRegister' }
}
]
@@ -470,7 +470,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/frpServerManage/details'),
name: 'FrpServerManageEdit',
name: 'frpServerDetails',
meta: { title: '修改FRP服务端配置', activeMenu: '/resource/frpServerManage' }
}
]
@@ -514,7 +514,7 @@ export const dynamicRoutes = [
{
path: 'index/:id?',
component: () => import('@/views/resource/topology/details'),
name: 'TopologyEdit',
name: 'TopologyDetails',
meta: { title: '拓扑信息', activeMenu: '/resource/topology' }
}
]
@@ -571,7 +571,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/messagePush/details'),
name: 'MessagePushDetails',
name: 'messagePushDetails',
meta: { title: '消息推送信息', activeMenu: '/resource/messagePush' }
}
]
@@ -616,7 +616,7 @@ export const dynamicRoutes = [
{
path: 'index/:id?',
component: () => import('@/views/resource/serverScriptStrat/details'),
name: 'serverScriptStatEdit',
name: 'severScriptStratDetails',
meta: { title: '服务器脚本策略信息', activeMenu: '/resource/serverScriptStrat' }
}
]
@@ -778,7 +778,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/alarmLog/alarmLogDetails'),
name: 'alarmLogAdd',
name: 'AlarmLogDetails',
meta: { title: '告警阈值配置', activeMenu: '/resource/alarmLog' }
}
]
@@ -866,7 +866,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/mtrProbe/mtrProbeView'),
name: 'mtrAgentLossRateProbe',
name: 'mtrProbe_view',
meta: { title: '新建MTR探测策略', activeMenu: '/resource/mtrAgent' }
}
]
@@ -881,7 +881,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/mtrProbe/mtrProbeView'),
name: 'mtrProbeView',
name: 'mtrProbe_view',
meta: { title: 'MTR探测策略信息', activeMenu: '/resource/mtrProbe' }
}
]
@@ -896,7 +896,7 @@ export const dynamicRoutes = [
{
path: ':id?',
component: () => import('@/views/resource/agentUpdate/agentUpdateView'),
name: 'agentUpdateView',
name: 'AgentUpdateView',
meta: { title: 'AGENT更新信息', activeMenu: '/resource/agentUpdate' }
}
]
+228 -228
View File
@@ -1,228 +1,228 @@
const state = {
visitedViews: [],
cachedViews: [],
iframeViews: []
}
const mutations = {
ADD_IFRAME_VIEW: (state, view) => {
if (state.iframeViews.some(v => v.path === view.path)) return
state.iframeViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
if (view.meta && !view.meta.noCache) {
state.cachedViews.push(view.name)
}
},
DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
break
}
}
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
},
DEL_IFRAME_VIEW: (state, view) => {
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
},
DEL_CACHED_VIEW: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
index > -1 && state.cachedViews.splice(index, 1)
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => {
return v.meta.affix || v.path === view.path
})
state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
if (index > -1) {
state.cachedViews = state.cachedViews.slice(index, index + 1)
} else {
state.cachedViews = []
}
},
DEL_ALL_VISITED_VIEWS: state => {
// keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
state.visitedViews = affixTags
state.iframeViews = []
},
DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = []
},
UPDATE_VISITED_VIEW: (state, view) => {
for (let v of state.visitedViews) {
if (v.path === view.path) {
v = Object.assign(v, view)
break
}
}
},
DEL_RIGHT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path)
if (index === -1) {
return
}
state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx <= index || (item.meta && item.meta.affix)) {
return true
}
const i = state.cachedViews.indexOf(item.name)
if (i > -1) {
state.cachedViews.splice(i, 1)
}
if(item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path)
state.iframeViews.splice(fi, 1)
}
return false
})
},
DEL_LEFT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path)
if (index === -1) {
return
}
state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx >= index || (item.meta && item.meta.affix)) {
return true
}
const i = state.cachedViews.indexOf(item.name)
if (i > -1) {
state.cachedViews.splice(i, 1)
}
if(item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path)
state.iframeViews.splice(fi, 1)
}
return false
})
}
}
const actions = {
addView({ dispatch }, view) {
dispatch('addVisitedView', view)
dispatch('addCachedView', view)
},
addIframeView({ commit }, view) {
commit('ADD_IFRAME_VIEW', view)
},
addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view)
},
addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view)
},
delView({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delVisitedView', view)
dispatch('delCachedView', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delVisitedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
delIframeView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_IFRAME_VIEW', view)
resolve([...state.iframeViews])
})
},
delCachedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_CACHED_VIEW', view)
resolve([...state.cachedViews])
})
},
delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delOthersVisitedViews', view)
dispatch('delOthersCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_CACHED_VIEWS', view)
resolve([...state.cachedViews])
})
},
delAllViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delAllVisitedViews', view)
dispatch('delAllCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delAllVisitedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
},
delAllCachedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_CACHED_VIEWS')
resolve([...state.cachedViews])
})
},
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
},
delRightTags({ commit }, view) {
return new Promise(resolve => {
commit('DEL_RIGHT_VIEWS', view)
resolve([...state.visitedViews])
})
},
delLeftTags({ commit }, view) {
return new Promise(resolve => {
commit('DEL_LEFT_VIEWS', view)
resolve([...state.visitedViews])
})
},
}
export default {
namespaced: true,
state,
mutations,
actions
}
const state = {
visitedViews: [],
cachedViews: [],
iframeViews: []
}
const mutations = {
ADD_IFRAME_VIEW: (state, view) => {
if (state.iframeViews.some(v => v.path === view.path)) return
state.iframeViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
if (view.meta && !view.meta.noCache) {
state.cachedViews.push(view.name)
}
},
DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
break
}
}
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
},
DEL_IFRAME_VIEW: (state, view) => {
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
},
DEL_CACHED_VIEW: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
index > -1 && state.cachedViews.splice(index, 1)
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => {
return v.meta.affix || v.path === view.path
})
state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
if (index > -1) {
state.cachedViews = state.cachedViews.slice(index, index + 1)
} else {
state.cachedViews = []
}
},
DEL_ALL_VISITED_VIEWS: state => {
// keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
state.visitedViews = affixTags
state.iframeViews = []
},
DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = []
},
UPDATE_VISITED_VIEW: (state, view) => {
for (let v of state.visitedViews) {
if (v.path === view.path) {
v = Object.assign(v, view)
break
}
}
},
DEL_RIGHT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path)
if (index === -1) {
return
}
state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx <= index || (item.meta && item.meta.affix)) {
return true
}
const i = state.cachedViews.indexOf(item.name)
if (i > -1) {
state.cachedViews.splice(i, 1)
}
if(item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path)
state.iframeViews.splice(fi, 1)
}
return false
})
},
DEL_LEFT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path)
if (index === -1) {
return
}
state.visitedViews = state.visitedViews.filter((item, idx) => {
if (idx >= index || (item.meta && item.meta.affix)) {
return true
}
const i = state.cachedViews.indexOf(item.name)
if (i > -1) {
state.cachedViews.splice(i, 1)
}
if(item.meta.link) {
const fi = state.iframeViews.findIndex(v => v.path === item.path)
state.iframeViews.splice(fi, 1)
}
return false
})
}
}
const actions = {
addView({ dispatch }, view) {
dispatch('addVisitedView', view)
dispatch('addCachedView', view)
},
addIframeView({ commit }, view) {
commit('ADD_IFRAME_VIEW', view)
},
addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view)
},
addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view)
},
delView({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delVisitedView', view)
dispatch('delCachedView', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delVisitedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
delIframeView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_IFRAME_VIEW', view)
resolve([...state.iframeViews])
})
},
delCachedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_CACHED_VIEW', view)
resolve([...state.cachedViews])
})
},
delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delOthersVisitedViews', view)
dispatch('delOthersCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_CACHED_VIEWS', view)
resolve([...state.cachedViews])
})
},
delAllViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delAllVisitedViews', view)
dispatch('delAllCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delAllVisitedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
},
delAllCachedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_CACHED_VIEWS')
resolve([...state.cachedViews])
})
},
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
},
delRightTags({ commit }, view) {
return new Promise(resolve => {
commit('DEL_RIGHT_VIEWS', view)
resolve([...state.visitedViews])
})
},
delLeftTags({ commit }, view) {
return new Promise(resolve => {
commit('DEL_LEFT_VIEWS', view)
resolve([...state.visitedViews])
})
},
}
export default {
namespaced: true,
state,
mutations,
actions
}
@@ -54,6 +54,7 @@
watch: {
activeName: {
handler(val) {
this.keepAliveFirst = true;
this.getList();
},
deep: true,
@@ -99,6 +100,7 @@
pageSize: 8,
total: 0,
},
keepAliveFirst: false
}
},
// created() {
@@ -106,11 +108,13 @@
// this.getList(1);
// });
// },
// activated() {
// this.$nextTick(() => {
// this.getList();
// });
// },
activated() {
this.$nextTick(() => {
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
/** 查询角色列表 */
getList(num) {
@@ -122,6 +126,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
+1 -1
View File
@@ -14,7 +14,7 @@
<script>
import busValueCount from './busValueCount'
export default {
name: 'busValueCount_index',
name: 'BusValueCount',
components: {busValueCount},
data() {
return {
@@ -83,15 +83,19 @@
// {content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', hasPermi: 'disRevenue:earnManage:business:edit'},
// ]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -111,6 +115,9 @@
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
@@ -72,15 +72,19 @@
{content: '提交审核', fnCode: 'upAudit', type: 'primary', showName: 'reviewStatus', showVal: ['0', '3'], icon: 'el-icon-document-checked', hasPermi: 'earnManage:businessIssued:upAudit'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -100,6 +104,9 @@
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
@@ -60,15 +60,19 @@
{content: '删除', fnCode: 'delete', type: 'danger', icon: 'el-icon-delete', hasPermi: 'earnManage:businessScript:delete'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -88,6 +92,9 @@
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
+1 -1
View File
@@ -41,7 +41,7 @@
import {listRecord} from "@/api/disRevenue/earnManage"
import {getRegistList} from "@/api/disRevenue/resource"
export default {
name: 'revenueMethod',
name: 'RevenueMethod',
dicts: ['sys_normal_disable'],
components: {TableList},
data() {
+1 -1
View File
@@ -14,7 +14,7 @@
<script>
import SwitchTabs from './switchTabs'
export default {
name: 'SwitchIndex',
name: 'Switch',
components: {SwitchTabs},
data() {
return {
@@ -93,15 +93,19 @@
// {content: '手动更新', fnCode: 'update', type: 'primary', icon: 'el-icon-refresh-right', hasPermi: 'disRevenue:resource:agentUpdate:update'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -112,6 +116,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
// 处理子组件传递的新值
+9 -2
View File
@@ -81,15 +81,19 @@
{content: '详情', fnCode: 'details', type: 'primary', showName: 'alarmType', showVal: ['1','4','5'], icon: 'el-icon-view', hasPermi: 'resource:alarmLog:details'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -100,6 +104,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
// 处理子组件传递的新值
@@ -46,7 +46,7 @@
import TableList from "@/components/table/index.vue"
import {listFrpcConfig} from "@/api/disRevenue/resource"
export default {
name: 'frpServerManage',
name: 'FrpServerManage',
components: {TableList},
dicts: ['frpc_status', 'frpc_connection_status'],
data() {
@@ -90,12 +90,19 @@
{content: '详情', fnCode: 'details', type: 'primary', icon: 'el-icon-view', hasPermi: 'resource:frpServerManage:details'}
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
if (!this.keepAliveFirst) {
this.getList();
}
},
methods: {
/** 查询列表 */
getList() {
@@ -104,7 +111,10 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
})
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
});
},
// 处理子组件传递的新值
handleValueChange(newValue) {
@@ -71,15 +71,19 @@
{content: '详情', fnCode: 'details', type: 'primary', icon: 'el-icon-view', hasPermi: 'resource:messagePush:details'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -90,6 +94,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
// 处理子组件传递的新值
@@ -89,7 +89,7 @@
import {monitorViewChart, delMonitorConfig, getMonitorGroup} from "@/api/disRevenue/resource";
import { checkPermi } from "@/utils/permission";
export default {
name: "monitor-board",
name: "MonitorBoard",
components: {dialogMonitor,monitorBoardView, EchartsLine},
props: {
timeModelDefault: {
+9 -2
View File
@@ -100,7 +100,7 @@
import mtrAgentView from './mtrAgentView';
import mtrProbeView from '../mtrProbe/mtrProbeView';
export default {
name: 'mtrAgent',
name: 'MtrAgent',
components: {TableList,Form, mtrAgentView, mtrProbeView},
dicts: ['rm_moreip_status', 'rm_register_status', 'rm_register_online_state', 'policy_method'],
data() {
@@ -155,15 +155,19 @@
mtrProbeOpen: false,
dialogRowData: {},
logicalNodeList: [],
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
this.fnLogicalNode();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -190,6 +194,9 @@
listMtrAgent(this.addDateRange(params)).then(response => {
this.roleList = response.rows;
this.queryParams.total = response.total;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
+9 -2
View File
@@ -37,7 +37,7 @@
import {listMtrPolicy, delMtrPolicy} from '@/api/disRevenue/resource';
import TableList from '@/components/table/index.vue';
export default {
name: 'mtrProbe',
name: 'MtrProbe',
components: {TableList,Form},
dicts: ['rm_register_snmp_detect'],
data() {
@@ -80,14 +80,18 @@
pageSize: 10,
total: 0
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -106,6 +110,9 @@
listMtrPolicy(this.addDateRange(params)).then(response => {
this.roleList = response.rows;
this.queryParams.total = response.total;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
@@ -138,7 +138,7 @@
import Form from '@/components/form/index.vue';
import {addResourcePolicy, updateResourcePolicy,getMonitorTempList, getMonitorPolicy, getRegistList} from "@/api/disRevenue/resource"
export default {
name: "LinuxMonitorStratEdit",
name: "serverMonitorStratEdit",
components: {Form},
dicts: ['collection_cycle', 'policy_status'],
props: {
@@ -450,6 +450,8 @@
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
// 步骤1:从 keep-alive 缓存列表中移除当前页面
this.$store.dispatch('tagsView/delCachedView', this.$route);
this.$router.push("/resource/serverMonitorStrat");
}
},
@@ -44,7 +44,7 @@
import TableList from "@/components/table/index.vue"
import {listMonitorPolicy, delMonitorPolicy, getMonitorPolicyList} from "@/api/disRevenue/resource"
export default {
name: 'serverMonitorStrat',
name: 'ServerMonitorStrat',
components: {TableList},
dicts: ['policy_status'],
data() {
@@ -83,15 +83,19 @@
{content: '删除', fnCode: 'delete', type: 'danger', showName: 'status', showVal: '0', icon: 'el-icon-delete', hasPermi: 'resource:serverMonitorStrat:delete'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -102,7 +106,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
// this.$modal.closeLoading();
this.keepAliveFirst = false;
}).catch(err => {
this.keepAliveFirst = false;
// this.$modal.closeLoading();
})
},
@@ -54,7 +54,7 @@
import TableList from '@/components/table/index.vue';
import {getRmTcpdumpConfig, rmOutTrafficFlow, updateRmTcpdum} from "@/api/disRevenue/resource";
export default {
name: "flowForm",
name: "SerRegisterFlowForm",
dicts: ['pppoe_enabled', 'frequency'],
components: {Form, TableList},
props: {
+11 -5
View File
@@ -385,18 +385,22 @@
alarmFlagHight: false,
frpOpen: false,
frpDialogContent: {},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getHightLight();
this.fnBusNameList();
this.fnLogicalNode();
},
// activated() {
// this.$nextTick(() => {
// this.getList();
// });
// },
activated() {
this.$nextTick(() => {
if (!this.keepAliveFirst) {
this.getHightLight();
}
});
},
methods: {
handleClick(val) {
if (val && val === 'noRequest' && this.cacheActiveName === this.activeName) return;
@@ -477,7 +481,9 @@
this.roleList = response.rows;
delete this.queryParams.resetVal;
this.queryParams.total = response.total;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
this.config = {...this.firstConfig};
});
},
@@ -81,7 +81,7 @@
import TableList from "@/components/table/index.vue"
import {listPolicy, delPolicy, getScriptResultBySn} from "@/api/disRevenue/resource"
export default {
name: 'serverMonitorStrat',
name: 'ServerScriptStrat',
components: {TableList},
dicts: ['policy_status', 'policy_method'],
data() {
@@ -140,14 +140,18 @@
},
clientList: [],
changeRowData: {},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -157,8 +161,10 @@
listPolicy(this.queryParams).then(response => {
this.tableList = response.rows;
this.queryParams.total = response.total;
this.keepAliveFirst = false;
// this.$modal.closeLoading();
}).catch(err => {
this.keepAliveFirst = false;
// this.$modal.closeLoading();
})
},
@@ -118,7 +118,7 @@
import TableList from "@/components/table/index.vue"
import {addResourcePolicy, updateResourcePolicy,getMonitorTempList, getMonitorPolicy, listAllSwitchName, listMonitorPolicy} from "@/api/disRevenue/resource"
export default {
name: "MonitorStrategy",
name: "switchMonitorStatEdit",
components: {Form, TableList},
dicts: ['policy_status', 'collection_cycle', 'switch_type'],
props: {
@@ -426,6 +426,8 @@
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
// 步骤1:从 keep-alive 缓存列表中移除当前页面
this.$store.dispatch('tagsView/delCachedView', this.$route);
this.$router.push("/resource/switchMonitorStrat");
}
},
@@ -47,7 +47,7 @@
import TableList from "@/components/table/index.vue"
import {listMonitorPolicy, delMonitorPolicy, getMonitorPolicyList} from "@/api/disRevenue/resource"
export default {
name: 'switchMonitorStrat',
name: 'SwitchMonitorStrat',
components: {TableList},
dicts: ['switch_type','eps_bandwidth_type', 'policy_status'],
data() {
@@ -87,15 +87,19 @@
{}
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
@@ -106,7 +110,9 @@
this.tableList = response.rows;
this.queryParams.total = response.total;
// this.$modal.closeLoading();
this.keepAliveFirst = false;
}).catch(err => {
this.keepAliveFirst = false;
// this.$modal.closeLoading();
})
},
+1 -1
View File
@@ -34,7 +34,7 @@
import TableList from '@/components/table/index.vue';
import {addSwitchManage, getSwitchManage, updateSwitchManage,updateSwitchInterface, delSwitchInterface} from "@/api/disRevenue/resource"
export default {
name: 'RegisterHandle',
name: 'SwitchRegisterEdit',
components: {Form, TableList},
dicts: ['switch_type', 'rm_register_online_state','rm_register_version', 'rm_register_security_level', 'rm_register_permission', 'rm_register_encryption'],
data() {
+13 -6
View File
@@ -137,17 +137,21 @@
pageNum: 1,
pageSize: 10,
total: 0
}
},
keepAliveFirst: false,
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
// activated() {
// this.$nextTick(() => {
// this.getList();
// });
// },
activated() {
this.$nextTick(() => {
if (!this.keepAliveFirst) {
this.getList();
}
});
},
methods: {
//
handleValueChange(newValue) {
@@ -162,6 +166,9 @@
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
@@ -8,7 +8,7 @@
import Form from '@/components/form/index.vue';
import {listAllSwitchName, addSwitchInterface, getSwitchInterface, updateSwitchInterface, postInterFaceName} from "@/api/disRevenue/resource"
export default {
name: 'PortRemarks',
name: 'SwitchRegisterPortRemarks',
components: {Form},
dicts: ['rm_topology_type'],
data() {
+12 -2
View File
@@ -29,7 +29,7 @@
import TableList from "@/components/table/index.vue"
import {listTopology, delTopology} from "@/api/disRevenue/resource"
export default {
name: 'TopologyIndex',
name: 'Topology',
components: {TableList},
dicts: ['rm_topology_type'],
data() {
@@ -73,12 +73,19 @@
{content: '修改', fnCode: 'edit', type: 'primary', icon: 'el-icon-edit', hasPermi: 'resource:topology:edit'},
]
}
}
},
keepAliveFirst: false
}
},
created() {
this.keepAliveFirst = true;
this.getList();
},
activated() {
if (!this.keepAliveFirst) {
this.getList();
}
},
methods: {
/** 查询列表 */
getList() {
@@ -87,6 +94,9 @@
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
this.keepAliveFirst = false;
}).catch(() => {
this.keepAliveFirst = false;
})
},
//