|
@ -44,8 +44,8 @@ export default { |
|
|
timeNode(val) { |
|
|
timeNode(val) { |
|
|
if (val && this.roleId) { |
|
|
if (val && this.roleId) { |
|
|
// 根据时间和角色查找日常任务 |
|
|
// 根据时间和角色查找日常任务 |
|
|
this.getGlobalData(); |
|
|
// this.getGlobalData(); |
|
|
this.getInitTasks(); |
|
|
// this.getInitTasks(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -57,7 +57,11 @@ export default { |
|
|
*/ |
|
|
*/ |
|
|
roleId(val) { |
|
|
roleId(val) { |
|
|
if (val) { |
|
|
if (val) { |
|
|
this.setTimeNode(Date.now()); |
|
|
// 如果storage里有timeNode,修改store里的timeNode |
|
|
|
|
|
this.setTimeNode(+this.$t.storage.getStorageSync('timeNode') || Date.now()); |
|
|
|
|
|
// 清空storage |
|
|
|
|
|
this.$t.storage.setStorageSync('timeNode', ''); |
|
|
|
|
|
console.log('当角色发生变化时: ', this.timeNode); |
|
|
// 根据角色查找永久的日常任务 |
|
|
// 根据角色查找永久的日常任务 |
|
|
this.getPermanent(val); |
|
|
this.getPermanent(val); |
|
|
} |
|
|
} |
|
@ -106,6 +110,11 @@ export default { |
|
|
// 没有项目id参数 |
|
|
// 没有项目id参数 |
|
|
this.$t.ui.showToast('缺少项目信息参数'); |
|
|
this.$t.ui.showToast('缺少项目信息参数'); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
// 如果storage里有timeNode,修改store里的timeNode |
|
|
|
|
|
this.setTimeNode(this.$t.storage.getStorageSync('timeNode') - 0); |
|
|
|
|
|
// 清空storage |
|
|
|
|
|
this.$t.storage.setStorageSync('timeNode', ''); |
|
|
|
|
|
console.log('timeNode: ', this.$t.storage.getStorageSync('timeNode'), this.timeNode); |
|
|
// 根据项目id获取项目信息 |
|
|
// 根据项目id获取项目信息 |
|
|
await this.getProjectById({ projectId: options.p }); |
|
|
await this.getProjectById({ projectId: options.p }); |
|
|
// 根据项目id获取角色列表 |
|
|
// 根据项目id获取角色列表 |
|
@ -145,8 +154,11 @@ export default { |
|
|
setInitialRoleId(visibleList) { |
|
|
setInitialRoleId(visibleList) { |
|
|
const index = visibleList.findIndex(item => item.mine === '1'); |
|
|
const index = visibleList.findIndex(item => item.mine === '1'); |
|
|
const currentRole = index > 0 ? visibleList[index] : visibleList[0]; |
|
|
const currentRole = index > 0 ? visibleList[index] : visibleList[0]; |
|
|
const currentRoleId = currentRole ? currentRole.id : ''; |
|
|
const storageRoleId = this.$t.storage.getStorageSync('roleId'); |
|
|
|
|
|
const currentRoleId = storageRoleId ? storageRoleId : currentRole ? currentRole.id : ''; |
|
|
this.setRoleId(currentRoleId); |
|
|
this.setRoleId(currentRoleId); |
|
|
|
|
|
// 清空storage |
|
|
|
|
|
this.$t.storage.setStorageSync('roleId', ''); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -169,7 +181,7 @@ export default { |
|
|
queryNum: query.queryNum || 3, |
|
|
queryNum: query.queryNum || 3, |
|
|
queryType: query.queryType, |
|
|
queryType: query.queryType, |
|
|
}; |
|
|
}; |
|
|
|
|
|
console.log('params: ', params); |
|
|
await this.getRegulars(params); |
|
|
await this.getRegulars(params); |
|
|
this.setShowSkeleton(false); |
|
|
this.setShowSkeleton(false); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|