<template>
    <view>
        <view class="padding bg-white">

            <view class="cu-timeline" :key="index" v-for="(act, index) in historicTaskList">
                <view class="cu-time">{{act.beginDate |formatDate('MM-DD')}}</view>
                <view class="cu-item text-blue">
                    <view class="content">
                        <view class="cu-capsule radius">
                            <view class="cu-tag bg-cyan">{{act.taskName}}</view>
                        </view>

                        <view class="margin-top">
                            审批人 ： {{act.assigneeName}}
                        </view>
<!--                        <view class="margin-top">-->
<!--                            办理状态 ：<view class="cu-tag bg-blue">{{act.comment.status}}</view>-->
<!--                        </view>-->
                        <view class="margin-top">
                            审批意见 ： {{act.comment}}
                        </view>
                        <view class="margin-top">
                            开始时间 : {{act.beginDate |formatDate}}
                        </view>
                        <view class="margin-top">
                            结束时间 : {{act.endDate |formatDate}}
                        </view>
                        <view class="margin-top">
                            用时 : {{act.durationTime || '0秒'}}
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>

    export default {
        name: 'TransferRecordsModule',
        props: {
            historicTaskList: {
                type: Array,
                required: true
            },
        },
        data() {
            return {
            };
        },
        watch: {
            historicTaskList: {
                handler(newVal) {
                    this.initializeFormModel();
                },
                deep: true,
                immediate: true
            }
        },
        methods: {
            initializeFormModel() {
                console.log('this.historicTaskList', this.historicTaskList)
            },
            isEmpty(value) {
                let result = false;
                if (value == null || value == undefined) {
                    result = true;
                }
                if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
                    result = true;
                }
                if (typeof value == "object" && value instanceof Array && value.length === 0) {
                    result = true;
                }
                return result;
            },
            isNotEmpty(value) {
                return !this.isEmpty(value);
            },
        }
    };
</script>