<template>
    <view :style="getStyle">{{ value }}</view>
</template>

<script setup>
import { computed } from 'vue'

const ps = defineProps({
    // OPEN/CLOSE/跟踪
    value: {
        type: String,
        default: ''
    },
    size: {
        type: [String, Number],
        default: 34
    },
    CLOSEStyle: {
        type: Object,
        default: () => {
            return {}
        }
    }
})
const getStyle = computed(() => {
    const _style = {}
    if (ps.value == 'OPEN') {
        _style.color = '#F53F3F'
    }
    if (ps.value == 'CLOSE') {
        _style.color = '#F53F3F'
        Object.assign(_style, ps.CLOSEStyle)
    }
    if (ps.value == 'OI') {
        _style.color = '#00B42A'
    }
    if (ps.value == '跟踪') {
        _style.color = '#00B42A'
    }
    if (ps.value == '未完成') {
        _style.color = '#F53F3F'
    }
    if (ps.value == '保留OPEN') {
        _style.color = '#0e42d2'
    }
    return {
        ..._style,
        fontSize: ps.size + 'rpx',
        display: 'inline-block'
    }
})
</script>
<style lang="scss" scoped></style>
