<template>
    <div
        class="tooltip"
        ref="tooltip"
    >
        <p><span>销售订单号: </span><span>{{ query.saleOrderNo }}</span></p>
        <p><span>主计划工单号: </span><span>{{ query.planOrderNo }}</span></p>
        <p><span>车间计划工单号: </span><span>{{ query.code }}</span></p>
        <p><span>车型: </span><span>{{ query.busType }}</span></p>
        <p><span>订单数量: </span><span>{{ query.orderSize }}</span></p>
        <p><span>单位: </span><span>{{ query.unit }}</span></p>
        <p><span>车间: </span><span>{{ query.shop }}</span></p>
        <p><span>产线: </span><span>{{ query.line }}</span></p>
        <!-- <p><span>计划完工时间: </span><span>{{ query.saleOrderNo }}</span></p> -->
        <div
            class="close-btn"
            @click="closeTooltip"
        >
            <i class="el-icon-circle-close"></i>
        </div>
    </div>
</template>
<script>
/**
 * @author MARS  <wangyunfan@vtstar.net>
 * @fileoverview Tooltip封装
 */
export default {
    props: {
        query: {
            type: Object,
            default: () => {}
        }
    },
    data () {
        return {
            data: {}
        }
    },

    watch: {
        query (v) {
            this.data = _.cloneDeep(v)
        }
    },

    methods: {
        closeTooltip () {
            this.$refs.tooltip.style.visibility = 'hidden'
        }
    }
}
</script>
<style lang="scss" scoped>
.tooltip {
    position: absolute;
    padding: 20px 0 0 0;
    width: 260px;
    height: 266px;
    border-radius: 9px;
    background: #000000;
    opacity: 0.8;
    color: #ffffff;
    visibility: hidden;

    p {
        margin: 5px 0;
        font-size: 14px;
        font-weight: bold;
        overflow: hidden;

        span:nth-child(1) {
            display: block;
            width: 120px;
            float: left;
            text-align: right;
        }
        span:nth-child(2) {
            display: block;
            float: left;
            width: 110px;
            margin-left: 15px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    }

    .close-btn {
        position: relative;
        top: 15px;
        cursor: pointer;
        text-align: center;
        color: #ffffff;
        font-weight: bold;
        font-size: 18px;
    }
}
</style>
