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