<template>
    <div class="tips">
        <div class="title">确认提交</div>
        <div class="msg" v-if="taskCount && taskCount.uncheck > 0">
            <div>还剩余{{taskCount.uncheck}}项未检查</div>
            <div>是否确认检查项未涉及</div>
        </div>
        <div class="info" v-if="taskCount">
            <div class="item">
                <div class="label">检查耗时</div>
                <div class="value">{{ taskCount.time }}</div>
            </div>
            <div class="item">
                <div class="label">检查项</div>
                <div class="value">{{ taskCount.total }}</div>
            </div>
        </div>
        <div class="info" v-if="taskCount">
            <div class="item">
                <div class="label">合格项</div>
                <div class="value green">{{ taskCount.pass }}</div>
            </div>
            <div class="item">
                <div class="label">不合格项</div>
                <div class="value red">{{ taskCount.refuse }}</div>
            </div>
            <div class="item">
                <div class="label">不涉及项</div>
                <div class="value orange">{{ taskCount.uninvolved }}</div>
            </div>
        </div>
        <div class="btns">
            <div class="btn" @click="cancel">
                <span>取消</span>
            </div>
            <div class="btn" @click="confirm">
                <span>确定</span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        taskCount: {
            /**
             * time
             * total
             * uncheck
             * pass
             * refuse
             * uninvolved
             */
            type: Object,
            default: null,
        },
    },
    methods: {
        confirm() {
            this.$emit('confirm')
        },
        cancel() {
            this.$emit('cancel')
        }
    }
}
</script>

<style lang="scss" scoped>
.tips {
    width: 75%;
    background-color: #FFFFFF;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .title {
        margin: 10px auto;
        font-size: 18px;
        color: #343434;
        font-weight: bolder;
    }
    .msg {
        text-align: center;
        font-size: 16px;
        color: #565656;
    }
    .info {
        margin-top: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .item {
            width: 80px;
            min-width: 80px;
            display: flex;
            flex-direction: column;
            align-items: center;
            .label {
                font-size: 14px;
                color: #888888;
            }
            .value {
                font-size: 14px;
                color: #02A7F0;
            }
            .green {
                color: #00b856;
            }
            .red {
                color: #ff5d5d;
            }
            .orange {
                color: #fa9a23;
            }
        }
    }
    .btns {
        width: 100%;
        display: flex;
        margin-top: 30px;
        border-top: 1px solid #F5F5F5;
        .btn {
            padding: 10px 0;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #02A7F0;
            font-weight: bolder;
        }
        .btn:last-child {
            border-left: 1px solid #F5F5F5;
        }
    }
}
</style>