You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
1.3 KiB

const actions = {
/**
* 通过项目id获取项目信息
* @param {any} commit
* @param {object} params 提交的参数
*/
async getProjectById({ commit }, params) {
try {
const res = await uni.$u.api.findProjectById(params);
commit('setProject', res);
return res;
} catch (error) {
throw error || '获取项目信息失败';
}
},
/**
* 通过项目id获取角色信息
* @param {any} commit
* @param {object} params 提交的参数
*/
async getRoles({ commit }, params) {
try {
const res = await uni.$u.api.findShowRole(params);
commit('setInvisibleRoles', res.invisibleList);
commit('setVisibleRoles', res.visibleList);
return res;
} catch (error) {
throw error || '获取角色信息失败';
}
},
/**
* 根据时间基准点和角色查找定期任务
* @param {string} roleId 角色id
* @param {string} timeNode 时间基准点 默认当前
* @param {string} timeUnit 时间颗粒度 默认天
*/
async handleRegularTask({ commit }, param) {
try {
console.log('commit: ', commit);
return await uni.$u.api.getRegularTask(param);
} catch (error) {
throw error || '获取定期任务失败';
}
},
};
export default actions;