<!--
机构授权
@Author: linqian
@Date: 2021-04-02 09:08
-->
<template>
    <div>
        <dg-row class="property-wapper" gutter="1rem">
            <!-- 机构列表 -->
            <dg-col :span="5" class="property-wapper__left">
                <dg-card header="机构列表" class="org-card box-card">
                    <org-tree
                        ref="tree"
                        class="u-pm__left"
                        treeHeight="calc(100vh - 18rem)"
                        :search="true"
                        paddingRight="15px"
                        @handleGetNode="handleGetNode"
                        @submitRootNode="handleGetNode"
                    ></org-tree>
                </dg-card>
            </dg-col>
            <!-- 权限设置 -->
            <dg-col :span="19" :key="key">
                <set-auth :subId="subId" subType="ORG" saveApi="saveOrgDataAuth"></set-auth>
            </dg-col>
        </dg-row>
    </div>
</template>

<script>
import orgTree from "@/components/tree";
import setAuth from "./components/set-auth";
export default {
    components: {
        orgTree,
        setAuth
    },
    data() {
        return {
            subId: "",
            key: 0
        };
    },
    computed: {},
    methods: {
        /**
         * @description: 获取机构节点
         * @param {*} node
         */
        handleGetNode(node) {
            this.subId = node.code;
            this.key++;
        },
        submitRootNode(node) {}
        /**
         * @description: 获取清单
         */
    },
    created() {},
    mounted() {}
};
</script>

<style lang='scss' scoped>
@import "./index.scss";
</style>