const cf = require("../../../utils/checkFile");
Component({
    properties: {
        list: {type:Array},
        checkedId: {type:Number},
        changeId: {type:Function}
    },
    options: {
        addGlobalClass: true
    },
    data: {
        show: false,
        fileSelected: {},
    },
    methods: {
        /* 打开文件 */
        openFile(e) {
            const {
                item
            } = e.currentTarget.dataset;
            if (item.fileType == 'folder') {
                wx.navigateTo({
                    url: '/marketing/mediaLibrary/index?item=' + JSON.stringify(item),
                })
            } else {
                cf.checkFile(item)
            }
        },
        changeChecked(e) {
            this.triggerEvent("changeId", e.target.dataset.item)
        }
    }
})