|
|
@@ -1,6 +1,7 @@
|
|
|
import { get } from 'lodash'
|
|
|
import router from '@/router'
|
|
|
import setting from '@/setting.js'
|
|
|
+import common from '@/utils/common'
|
|
|
|
|
|
// 判定是否需要缓存
|
|
|
const isKeepAlive = (data) => get(data, 'meta.cache', false)
|
|
|
@@ -20,7 +21,9 @@ export default {
|
|
|
// 当前页面
|
|
|
current: '',
|
|
|
// 需要缓存的页面 name
|
|
|
- keepAlive: []
|
|
|
+ keepAlive: [],
|
|
|
+ // 当前页面示例集合
|
|
|
+ exampleList: []
|
|
|
},
|
|
|
actions: {
|
|
|
/**
|
|
|
@@ -37,6 +40,24 @@ export default {
|
|
|
}, 10)
|
|
|
})
|
|
|
},
|
|
|
+ getExampleList({ commit }) {
|
|
|
+ common
|
|
|
+ .request('query', {
|
|
|
+ key: 'getFormAttr',
|
|
|
+ params: [null]
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ const { data = [] } = res.variables || {}
|
|
|
+ commit('setExampleList', data)
|
|
|
+ // dispatch('ibps/param/setUserList', data, {
|
|
|
+ // root: true
|
|
|
+ // })
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ alert('获取所有用户信息失败!')
|
|
|
+ })
|
|
|
+ },
|
|
|
/**
|
|
|
* @class opened
|
|
|
* @description 从持久化数据载入标签页列表
|
|
|
@@ -434,6 +455,9 @@ export default {
|
|
|
.filter((item) => isKeepAlive(item))
|
|
|
.map((e) => e.name)
|
|
|
},
|
|
|
+ setExampleList(state, data) {
|
|
|
+ state.exampleList = data
|
|
|
+ },
|
|
|
/**
|
|
|
* @description 删除一个页面的缓存设置
|
|
|
* @param {Object} state state
|