import { reactive, ref } from 'vue';


export function use(){
    const state = reactive({
        window: null,   // CURD窗口编号 
    });

}


/**
 * 是否允许新建数据
 * @param {*} window CURD窗口定义
 * @returns 
 */
const allowCreate = function (window) {
    var allTabReadOnly = true;
    // 如果所有的页签都是只读
    if (window != undefined && window.tabs != undefined) {
        for (
            var tabIndex = 0; tabIndex < window.tabs.length; tabIndex++
        ) {
            if (
                window.tabs[tabIndex].isReadOnly == undefined ||
                window.tabs[tabIndex].isReadOnly == false
            ) {
                allTabReadOnly = false;
                break;
            }
        }
    }
    return !allTabReadOnly;
}
