<!--
属性授权
@Author: linqian
@Date: 2021-04-01 13:45
-->
<template>
    <div>
        <dg-row class="property-wapper" gutter="1rem">
            <!-- 属性列表 -->
            <dg-col :span="5" class="property-wapper__left">
                <dg-card header="业务域标签列表"  shadow="never" class="org-card box-card">
                    <business-tag-tree ref="tree" @handleGetNode="handleGetNode" @submitSearchTree="handleClearSubId"></business-tag-tree>
                </dg-card>
            </dg-col>
            <!-- 权限设置 -->
            <dg-col :span="19" :key="key">
                <set-auth :subId="subId" subType="BUSINESS" saveApi="saveLabelDataAuth"></set-auth>
            </dg-col>
        </dg-row>
    </div>
</template>

<script>
import businessTagTree from "./components/business-tag-tree";
import setAuth from "./components/set-auth";

export default {
    components: {
        businessTagTree,
        setAuth
    },
    data() {
        return {
            // 主体id
            subId: "",
            key: 0
        };
    },
    computed: {},
    methods: {
        /**
         * @description: 获取机构节点
         * @param {*} node
         */
        handleGetNode(node) {
            this.subId = node.code;
            this.key++

        },
         /**
         * @description: 搜索标签树，清除授权数据
         */
        handleClearSubId() {
            this.subId = "";
            this.key++;
        }
    },
    created() {},
    mounted() {}
};
</script>

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