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.
 
 
 
 

121 lines
3.3 KiB

<template>
<view class="column">
<view :key="index" v-for="(item, index) in tasks">
<view class="flex">
<TimeStatus :content="JSON.stringify(item.process)" :status="item.process" />
<view class="flex items-center justify-between flex-1 ml-2 task-column">
<view>
<span>{{ $moment(+item.planStart).format('MM-DD HH:mm') }}</span>
</view>
<view>
<view class="flex justify-between" style="min-width: 90px">
<u-icon custom-prefix="custom-icon" name="C-bxl-redux" size="17px"></u-icon>
<u-icon custom-prefix="custom-icon" name="attachment" size="21px"></u-icon>
<u-icon custom-prefix="custom-icon" name="moneycollect" size="20px"></u-icon>
</view>
</view>
</view>
</view>
<view class="border-l-2 border-gray-300 plugin">
<view class="ml-3 overflow-hidden shadow-lg task-box">
<u-card
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
@click="changeTimeNode(item.planStart)"
class="h-16"
margin="0"
v-if="item.plugins"
>
<!-- 任务面板插件 -->
<view slot="body">
<view v-if="!item.plugins.length">
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
</view>
<view class="p-0 u-col-between" v-else>
<view :key="pIndex" v-for="(p, pIndex) in item.plugins">
<view class="grid gap-2" v-if="p.length">
<Plugin
:class="getClass(plugin.col, plugin.row)"
:item="item"
:key="plugin.pluginTaskId"
:pluginId="plugin.pluginId"
:styleType="styleType || 0"
v-for="plugin in p"
/>
</view>
</view>
</view>
</view>
</u-card>
</view>
</view>
</view>
<Tips />
</view>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import TimeStatus from './TimeStatus.vue';
import Skeleton from '@/components/Skeleton/Skeleton';
export default {
name: 'TimeBox',
components: { TimeStatus, Skeleton },
data() {
return { currentComponent: '', styleType: 0 };
},
computed: mapState('home', ['roleId', 'timeNode', 'timeUnit', 'tasks', 'taskLoading']),
created() {},
methods: {
...mapMutations('home', ['setTipsContent', 'setTipsContent', 'setTimeNode']),
// 设置任务面板高度
setHeight(panel) {
if (panel && panel.height) {
return panel.height + 'px';
} else {
return 'auto';
}
},
// 点击任务面板 修改store时间基准点
changeTimeNode(time) {
this.setTimeNode(time);
},
// 设置网格布局
getClass(col, row) {
return [`row-span-${row}`, `col-span-${col}`];
},
},
};
</script>
<style scoped lang="scss">
.task-box {
border-radius: 24rpx;
}
.column {
padding: 24px 14px;
}
.task-column {
height: 33px;
}
.plugin {
margin-top: 8px;
margin-bottom: 8px;
margin-left: 15px;
}
/deep/ .ml-2 {
margin-left: 16px;
}
/deep/ .ml-3 {
margin-left: 20px;
}
</style>