const _Http = getApp().globalData.http;
let obj = {
    stagename: {
        "id": 20221128143604,
        "content": {
            "pageNumber": 1,
            "pageSize": 1000,
            "where": {
                "condition": "",
                "allprojecttype": "",
                "projecttype": ""
            }
        }
    },
    brandname: {
        "content": {
            "isExport": 0,
            "pageNumber": 1,
            "pageSize": 1000,
            "isauth": 1, 
            "where": {
                "condition": "",
                "tablefilter": {}
            }
        },
        "id": 20220922085103
    },
    tags: {
        "id": 20221013104401,
        "content": {
            "isExport": 1,
            "pageNumber": 1,
            "pageSize": 1000,
            "sys_systemtagid": 1,
            "where": {
                "condition": ""
            }
        }
    }
}
module.exports = {
    /**
     * 获取筛选分类查询 无分页
     * 项目类型：projecttype
     * 项目等级：projectgrade
     * 项目阶段：stagename
     * 领域：tradefield
     * 品牌：brandname
     * 客户标签：tags
     */
    async getTypes(name) {
        let params = null;
        if (["projecttype", 'projectgrade', 'tradefield'].includes(name)) {
            params = {
                "classname": "sysmanage.develop.optiontype.optiontype",
                "method": "optiontypeselect",
                "content": {
                    "nochace": true,
                    "pageNumber": 1,
                    "pageSize": 1000,
                    "typename": name,
                    "parameter": {
                        "siteid": wx.getStorageSync('userMsg').siteid
                    }
                }
            }
        } else {
            params = obj[name];
        }
        if (!params) return;
        let res = await _Http.basic(params);
        console.log(`查询${name}`, res)
        return res.code == '1' ? res.data : [];
    }
}