<!--仅进行状态对应颜色的管理，状态颜色对应关系查看lj-base.less的lj-status-系列-->
<!--slots-->
<!--default-->
<template>
    <div :class="colorClass">
        <slot></slot>
    </div>
</template>

<script>
    export default {
        name: "lj-status-manager",
        props: {
            // 当前状态的值，对应statusDic的key
            value: {
                type: [Number, String],
                default: -1
            },
            // 根据value显示当前状态描述与颜色，用法参考默认值
            statusDic: {
                type: Object,
                default: function () {
                    return {
                        0: {dscrp: "待审核", color: "Alert"},
                        1: {dscrp: "已审核", color: "Pass"},
                        "待审核": {color: "Alert"},
                        "在进行": {color: "Normal"},
                        "已完成": {color: "Pass"},
                        "待财审": {color: "Normal"},
                        "已财审": {color: "Pass"},
                        "待确认": {color: "Alert"},
                        "初确认": {color: "Normal"},
                        "已确认": {color: "Pass"},
                        "待审": {color: "Alert"},
                        "在途": {color: "Pass-Sec"},
                        "验收中": {color: "Pass"},
                        "已收货": {color: "Normal"},
                        "退货中": {color: "Alert-Sec"},
                        "退货已收": {color: "gray1"},
                    }
                }
            }
        },
        computed: {
            colorClass() {
                let statusInfo = this.statusDic[this.value];
                if (statusInfo) {
                    return "lj-status-" + statusInfo.color.toLowerCase();
                }
                return "lj-status-alert";
            }
        }
    }
</script>

<style scoped>

</style>