Component({
    properties: {
        item: Object
    },
    data: {
        active: {}
    },
    methods: {
        onSelect(e) {
            const {
                i,
                item
            } = e.currentTarget.dataset;
            if (this.data.item.index == i) {
                getApp().globalData.temporaryId = this.data.item.id || "";
                this.setData({
                    "item.index": null,
                    childClass: null
                });
            } else {
                getApp().globalData.temporaryId = this.data.item.selectKey ? item[this.data.item.selectKey] : JSON.parse(JSON.stringify(item));
                this.setData({
                    "item.index": i,
                    childClass: item.subdep.length ? {
                        index: null,
                        label: item.itemclassname + '的下级分类',
                        list: item.subdep,
                        selectKey: this.data.item.selectKey,
                        showName: this.data.item.showName,
                        type: this.data.item.type,
                        value: "",
                        valueKey: this.data.item.valueKey,
                        id: getApp().globalData.temporaryId
                    } : null
                });
            };
        }
    }
})