|
@ -1,12 +1,12 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="column"> |
|
|
<view class="column"> |
|
|
<view :key="index" v-for="(item, index) in tasks"> |
|
|
<view :key="index" v-for="(task, index) in tasks"> |
|
|
<view class="flex"> |
|
|
<view class="flex"> |
|
|
<TimeStatus :content="JSON.stringify(item.process)" :status="item.process" /> |
|
|
<TimeStatus :content="JSON.stringify(task.process)" :status="task.process" /> |
|
|
|
|
|
|
|
|
<view class="flex items-center justify-between flex-1 ml-2 task-column"> |
|
|
<view class="flex items-center justify-between flex-1 ml-2 task-column"> |
|
|
<view> |
|
|
<view> |
|
|
<span>{{ $moment(+item.planStart).format(startTimeFormat) }}</span> |
|
|
<span>{{ $moment(+task.planStart).format(startTimeFormat) }}</span> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 任务功能菜单 --> |
|
|
<!-- 任务功能菜单 --> |
|
@ -18,27 +18,29 @@ |
|
|
<u-card |
|
|
<u-card |
|
|
:show-foot="false" |
|
|
:show-foot="false" |
|
|
:show-head="false" |
|
|
:show-head="false" |
|
|
:style="{ height: setHeight(item.panel) }" |
|
|
:style="{ height: setHeight(task.panel) }" |
|
|
@click="changeTimeNode(item.planStart)" |
|
|
@click="onClickTask(+task.planStart)" |
|
|
class="h-16" |
|
|
class="h-16" |
|
|
margin="0" |
|
|
margin="0" |
|
|
v-if="item.plugins" |
|
|
v-if="task.plugins && task.plugins.length" |
|
|
> |
|
|
> |
|
|
<!-- 任务面板插件 --> |
|
|
<!-- 任务面板插件 --> |
|
|
<view slot="body"> |
|
|
<view slot="body"> |
|
|
<view v-if="!item.plugins.length"> |
|
|
<!-- TODO: 逻辑不完善 --> |
|
|
|
|
|
<view v-if="!task.plugins.length"> |
|
|
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton> |
|
|
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="p-0 u-col-between" v-else> |
|
|
<view class="p-0 u-col-between" v-else> |
|
|
<view :key="pIndex" v-for="(p, pIndex) in item.plugins"> |
|
|
<view :key="pIndex" v-for="(row, pIndex) in task.plugins"> |
|
|
<view class="grid gap-2" v-if="p.length"> |
|
|
<view class="grid gap-2" v-if="row.length"> |
|
|
<Plugin |
|
|
<Plugin |
|
|
:class="getClass(plugin.col, plugin.row)" |
|
|
:class="getClass(plugin.col, plugin.row)" |
|
|
:item="item" |
|
|
:task="task" |
|
|
:key="plugin.pluginTaskId" |
|
|
:key="plugin.pluginTaskId" |
|
|
:pluginId="plugin.pluginId" |
|
|
:pluginId="plugin.pluginId" |
|
|
:styleType="styleType || 0" |
|
|
:styleType="styleType || 0" |
|
|
v-for="plugin in p" |
|
|
v-for="plugin in row" |
|
|
/> |
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -48,14 +50,15 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<!-- 局部弹框操作栏 --> |
|
|
<Tips /> |
|
|
<Tips /> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { mapState, mapMutations, mapGetters } from 'vuex'; |
|
|
import { mapState, mapMutations, mapGetters, mapActions } from 'vuex'; |
|
|
import TimeStatus from './TimeStatus.vue'; |
|
|
|
|
|
import Skeleton from '@/components/Skeleton/Skeleton'; |
|
|
import Skeleton from '@/components/Skeleton/Skeleton'; |
|
|
|
|
|
import TimeStatus from './TimeStatus.vue'; |
|
|
import TaskTools from './TaskTools.vue'; |
|
|
import TaskTools from './TaskTools.vue'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@ -67,11 +70,12 @@ export default { |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
|
...mapState('role', ['roleId']), |
|
|
...mapState('role', ['roleId']), |
|
|
...mapState('task', ['timeNode', 'timeUnit', 'tasks', 'taskLoading']), |
|
|
...mapState('task', ['timeUnit', 'tasks', 'taskLoading']), |
|
|
...mapGetters('task', ['startTimeFormat']), |
|
|
...mapGetters('task', ['startTimeFormat']), |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
...mapActions('task', ['getGlobal']), |
|
|
...mapMutations('task', ['setTipsContent', 'setTipsContent', 'setTimeNode']), |
|
|
...mapMutations('task', ['setTipsContent', 'setTipsContent', 'setTimeNode']), |
|
|
|
|
|
|
|
|
// 设置任务面板高度 |
|
|
// 设置任务面板高度 |
|
@ -83,9 +87,13 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 点击任务面板 修改store时间基准点 |
|
|
/** |
|
|
changeTimeNode(time) { |
|
|
* 点击了定期任务的面板 更新可变的日常任务 |
|
|
this.setTimeNode(time); |
|
|
* @param {number} planStart 任务计划开始时间 |
|
|
|
|
|
*/ |
|
|
|
|
|
onClickTask(planStart) { |
|
|
|
|
|
const param = { roleId: this.roleId, timeNode: planStart, timeUnit: this.timeUnit }; |
|
|
|
|
|
this.getGlobal(param); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 设置网格布局 |
|
|
// 设置网格布局 |
|
|