// component/faultItem/faultItem.ts
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        //0=已完成 1=维修中 2=待维修
        faultStatus: {
            type: Number,
            value: 0
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        status: 0,
        statusText: ""
    },
    lifetimes: {
        attached: function () {
            // 在组件实例被从页面节点树添加时执行
            let text = "";
            switch (Number(this.properties.faultStatus)) {
                case 0:
                    text = "已完成";

                    break;
                case 1:
                    text = "维修中";
                    break;
                case 2:
                    text = "待维修";
                    break;
            }
            this.setData({
                status: this.properties.faultStatus,
                statusText: text
            })

        },
        detached: function () {
            // 在组件实例被从页面节点树移除时执行

        },
    },

    /**
     * 组件的方法列表
     */
    methods: {

    }
})