<template>

</template>

<script>
export default {
    name: "OrgBase",
    created() {

    },
    data() {
    },
    methods: {
        getOrgName(id, isNames, isFullName, okFn) {
            // 是否多部门
            let urlStr = isNames ? "getOrgNameByIds" : "getOrgNameById";
            // 是否全称
            let type = isFullName ? 2 : 1;

            this.$request({
                url: '/apm/open/org/' + urlStr,
                method: 'post',
                data: {
                    id: id,
                    type: type
                }
            }).then(okFn);
        },
        getParams(params) {
            let resParams = {};
            if (typeof params === 'function') {
                resParams = params();
            } else {
                resParams = params || {};
            }
            return resParams
        },
        // 更新组件的model值
        setOrgValue(values) {
            this.$emit('update:orgValue', values);
        }
    }
}
</script>
