no message

Former-commit-id: 057dd0a1deaad680e991751bd1a36a9d17825fa8 [formerly 057dd0a1deaad680e991751bd1a36a9d17825fa8 [formerly 057dd0a1deaad680e991751bd1a36a9d17825fa8 [formerly 057dd0a1deaad680e991751bd1a36a9d17825fa8 [formerly 8e83a63e10145658744dd21445dad8eba44466a0 [formerly bd51475e9a45b64342a539141a2d3bad2b93defc]]]]]
Former-commit-id: 596bba56eb613636f5f5c7c7f5cbdb55a3d250d9
Former-commit-id: d6b4414ef70ac46f6c3c72392166d5d9d4810d10
Former-commit-id: c07b8cc58f3c720acb72e1393bf0fd13547cf329 [formerly 5ed4b1e3f9a4ef644f679333a491940a9c6af078]
Former-commit-id: c105880757bab8347a1c01d2c80f3784e0644bd8
Former-commit-id: b6129e20f9b75fce0d57eaad8db6498081b0ce51
Former-commit-id: 7612a3fe80fc49b88f8d850cb95a801e3c55ec69
Former-commit-id: 2a12c98c9f4d98436aed048cb079746dcc111b57
Former-commit-id: 38c475e3433acee4767d71aec229899729d1e01f
This commit is contained in:
liyang
2018-07-01 11:52:33 +08:00
parent c877e15982
commit bc97252bd8
2 changed files with 68 additions and 31 deletions

View File

@@ -22,7 +22,8 @@ export default {
},
mutations: {
/**
* 将 state 中某一项存储到数据库
* @class 通用工具
* @description 将 state 中某一项存储到数据库
* @param {state} state vuex state
*/
d2adminVuex2Db (state, key) {
@@ -37,7 +38,8 @@ export default {
}
},
/**
* 设置当前激活的页面 name
* @class pageCurrent
* @description 设置当前激活的页面 name
* @param {state} state vuex state
* @param {string} name new name
*/
@@ -45,7 +47,17 @@ export default {
state.pageCurrent = name
},
/**
* 更新页面列表上的某一项
* @class tagPool
* @description 保存 tagPool (候选池)
* @param {state} state vuex state
* @param {Array} tagPool tags
*/
d2adminTagPoolSet (state, tagPool) {
state.tagPool = tagPool
},
/**
* @class pageOpenedList
* @description 更新页面列表上的某一项
* @param {state} state vuex state
* @param {info} param1 new page info
*/
@@ -59,20 +71,13 @@ export default {
this.commit('d2adminVuex2Db', 'pageOpenedList')
},
/**
* 保存 tagPool (候选池)
* @param {state} state vuex state
* @param {Array} tagPool tags
*/
d2adminTagPoolSet (state, tagPool) {
state.tagPool = tagPool
},
/**
* 新增一个 tag (打开一个页面)
* @class pageOpenedList
* @description 新增一个 tag (打开一个页面)
* @param {state} state vuex state
* @param {object} param1 new tag info
*/
d2adminTagIncreate (state, { tag, argu, query }) {
// 设置新的 tag
// 设置新的 tag 在新打开一个以前没打开过的页面时使用
let newTag = tag
newTag.argu = argu || newTag.argu
newTag.query = query || newTag.query
@@ -82,7 +87,8 @@ export default {
this.commit('d2adminVuex2Db', 'pageOpenedList')
},
/**
* 关闭一个 tag (关闭一个页面)
* @class pageOpenedList
* @description 关闭一个 tag (关闭一个页面)
* @param {state} state vuex state
* @param {string} name close tag name
*/
@@ -92,16 +98,43 @@ export default {
if (index >= 0) {
state.pageOpenedList.splice(index, 1)
}
// 更新设置到数据库
this.commit('d2adminVuex2Db', 'pageOpenedList')
},
/**
* 关闭所有 tag
* @class pageOpenedList
* @description 关闭当前激活之外的 tag
* @param {state} state vuex state
*/
d2adminTagCloseOther (state) {
let currentIndex = 0
state.pageOpenedList.forEach((page, index) => {
if (page.name === state.pageCurrent) {
currentIndex = index
}
})
if (currentIndex === 0) {
state.pageOpenedList.splice(1)
} else {
state.pageOpenedList.splice(currentIndex + 1)
state.pageOpenedList.splice(1, currentIndex - 1)
}
// 更新设置到数据库
this.commit('d2adminVuex2Db', 'pageOpenedList')
},
/**
* @class pageOpenedList
* @description 关闭所有 tag
* @param {state} state vuex state
*/
d2adminTagCloseAll (state) {
state.pageOpenedList.splice(1)
// 更新设置到数据库
this.commit('d2adminVuex2Db', 'pageOpenedList')
},
/**
* 切换全屏
* @class isFullScreen
* @description 切换全屏
* @param {state} state vuex state
*/
d2adminFullScreenToggle (state) {
@@ -114,14 +147,16 @@ export default {
}
},
/**
* 切换灰度状态
* @class isGrayMode
* @description 切换灰度状态
* @param {state} state vuex state
*/
d2adminGrayModeToggle (state) {
state.isGrayMode = !state.isGrayMode
},
/**
* 设置灰度模式
* @class isGrayMode
* @description 设置灰度模式
* @param {state} state vuex state
* @param {boolean} value new value
*/
@@ -129,7 +164,8 @@ export default {
state.isGrayMode = value
},
/**
* 激活一个主题应用到dom上
* @class themeActive
* @description 激活一个主题应用到dom上
* @param {state} state vuex state
* @param {string} themeValue 需要激活的主题名称
*/
@@ -144,7 +180,8 @@ export default {
this.commit('d2adminVuex2Db', 'themeActive')
},
/**
* 从数据库加载主题设置
* @class themeActive
* @description 从数据库加载主题设置
* @param {state} state vuex state
*/
d2adminThemeLoad (state) {