no message

Former-commit-id: 6c0824b8d2e59ef3a72a65a6044c1217cd3a351d [formerly c9f42aa09c4b0b5de2ac5473f9384d6f7e187063] [formerly 6c0824b8d2e59ef3a72a65a6044c1217cd3a351d [formerly c9f42aa09c4b0b5de2ac5473f9384d6f7e187063] [formerly 6c0824b8d2e59ef3a72a65a6044c1217cd3a351d [formerly c9f42aa09c4b0b5de2ac5473f9384d6f7e187063] [formerly c9f42aa09c4b0b5de2ac5473f9384d6f7e187063 [formerly 5dde11521f5740d96ce6b0c8b4d4dc6ec738bf57 [formerly e474ecb99ef86f507fc991cb4aeb89b6f4b7afc0]]]]]
Former-commit-id: 81e5bed2d676b45a8097efe31e1862e2065a8e54
Former-commit-id: 82dad2622857f00c98550e67eb002617f76871d5
Former-commit-id: d87b796d20ce2f6e113c44b45e09e88f154788be [formerly 3f52ba8cba47a6470c20c9495b639959f74022e3]
Former-commit-id: 054f1738830a6c8af8385e54c06efc097ecd4259
Former-commit-id: 61560008239c38171cf4798db3ba5763dbf3108a
Former-commit-id: ddff9ce6841ba7387b1a572321b5723b442839bf
Former-commit-id: 8f689cf6a6844f6afa197e1238954636b98836d8
Former-commit-id: c218d2c370666254593f7102c2a959ffdd175583
This commit is contained in:
liyang
2018-06-30 17:52:57 +08:00
parent 6ec19d0994
commit e09198e49b
6 changed files with 73 additions and 41 deletions

View File

@@ -11,29 +11,36 @@ export default {
// 主题
themeList,
themeActive: themeList[1],
// 可以在多页 tab 模式下显示的页面
tagPool: [],
// 当前显示的多页面列表
pageOpenedList: [
{
name: 'index',
title: '首页'
}
{ name: 'index', title: '首页' }
],
// 可以在多页 tab 模式下显示的页面
tagPool: []
// 当前页面
pageCurrent: '',
// 使用缓存的页面 (需要在页面中写 name)
pageCacheList: [],
// 不使用缓存的页面
pageDisableCacheList: [
'no-cache'
]
},
mutations: {
/**
* 设置当前激活的页面 name
* @param {state} state vuex state
* @param {string} name new name
*/
d2adminPageSetCurrentName (state, name) {
state.pageCurrent = name
},
/**
* 更新页面列表上的某一项
* @param {state} state vuex state
* @param {info} param1 new page info
*/
d2adminpageOpenedListUpdateItem (state, { index, argu, query }) {
// dev
console.group('d2adminpageOpenedListUpdateItem')
console.log('index: ', index)
console.log('argu: ', argu)
console.log('query: ', query)
console.groupEnd()
// 更新页面列表某一项
let page = state.pageOpenedList[index]
page.argu = argu || page.argu
@@ -64,12 +71,37 @@ export default {
* @param {object} param1 new tag info
*/
d2adminTagIncreate (state, { tag, argu, query }) {
// if (!Util.oneOf(tagObj.name, state.dontCache)) {
// state.cachePage.push(tagObj.name);
// localStorage.cachePage = JSON.stringify(state.cachePage);
// }
// state.pageOpenedList.push(tagObj);
// localStorage.pageOpenedList = JSON.stringify(state.pageOpenedList);
// 设置新的 tag
let newTag = tag
newTag.argu = argu || newTag.argu
newTag.query = query || newTag.query
// 检查这个页面是不是属于不使用缓存的页面
if (!util.isOneOf(newTag.name, state.pageDisableCacheList)) {
// 在缓存页面的列表加入这个页面的 name
state.pageCacheList.push(newTag.name)
// 更新设置到数据库
const setting = db.get('pageCacheList').find({uuid: util.uuid()})
if (setting.value()) {
setting.assign({value: state.pageCacheList}).write()
} else {
db.get('pageCacheList').push({
uuid: util.uuid(),
value: state.pageCacheList
}).write()
}
}
// 添加进当前显示的页面数组
state.pageOpenedList.push(newTag)
// 更新设置到数据库
const setting = db.get('pageOpenedList').find({uuid: util.uuid()})
if (setting.value()) {
setting.assign({value: state.pageOpenedList}).write()
} else {
db.get('pageOpenedList').push({
uuid: util.uuid(),
value: state.pageOpenedList
}).write()
}
console.log('d2adminTagIncreate')
},
/**