|
@ -5,9 +5,7 @@ |
|
|
<view class="container flex flex-col flex-1 overflow-hidden bg-gray-100"> |
|
|
<view class="container flex flex-col flex-1 overflow-hidden bg-gray-100"> |
|
|
<!-- 角色栏 --> |
|
|
<!-- 角色栏 --> |
|
|
<Roles @getTasksByRole="getTasksByRole" /> |
|
|
<Roles @getTasksByRole="getTasksByRole" /> |
|
|
<!-- 日常任务 --> |
|
|
<Globals :tasks="allPlugins.concat(timePlugins)" /> |
|
|
<Globals :plugins="plugins" /> |
|
|
|
|
|
<!-- 定期任务 --> |
|
|
|
|
|
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="child" /> |
|
|
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="child" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -167,10 +165,13 @@ export default { |
|
|
try { |
|
|
try { |
|
|
this.allPlugins = []; |
|
|
this.allPlugins = []; |
|
|
const res = await this.$u.api.getPermanent({ roleId: this.roleId }); |
|
|
const res = await this.$u.api.getPermanent({ roleId: this.roleId }); |
|
|
for (let item of res) { |
|
|
// for (let item of res) { |
|
|
this.allPlugins = this.allPlugins.concat(item.plugins); |
|
|
// if (item.plugins) { |
|
|
} |
|
|
// this.allPlugins = this.allPlugins.concat(item.plugins); |
|
|
console.log('res', res); |
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
this.allPlugins = res; |
|
|
|
|
|
console.log('allPlugins', this.allPlugins); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log('error: ', error); |
|
|
console.log('error: ', error); |
|
|
} |
|
|
} |
|
@ -188,11 +189,12 @@ export default { |
|
|
const { roleId, timeNode, timeUnit } = this; |
|
|
const { roleId, timeNode, timeUnit } = this; |
|
|
const params = { roleId, timeNode, timeUnit }; |
|
|
const params = { roleId, timeNode, timeUnit }; |
|
|
const res = await this.$u.api.getGlobal(params); |
|
|
const res = await this.$u.api.getGlobal(params); |
|
|
for (let task of res) { |
|
|
// for (let task of res) { |
|
|
for (let item of task.plugins) { |
|
|
// for (let item of task.plugins) { |
|
|
this.timePlugins.push(...item); |
|
|
// this.timePlugins.push(...item); |
|
|
} |
|
|
// } |
|
|
} |
|
|
// } |
|
|
|
|
|
this.timePlugins = res; |
|
|
this.setDailyTasks(res); |
|
|
this.setDailyTasks(res); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log('error: ', error); |
|
|
console.log('error: ', error); |
|
|