<!--
 * @Author: Liugh
 * @Date: 2021-05-19 15:48:26
 * @LastEditTime: 2021-05-20 09:32:23
 * @LastEditors: Do not edit
 * @FilePath: \auth-web\src\pages\data-auth-module\auth-subject-manage\subject-prop-manage\agency-list.vue
 * @Description: 
-->
<template>
    <dg-card class="box-card" header="机构列表">
        <el-form ref="form" :model="cardForm" label-suffix=":" inline>
            <el-form-item label="单位名称">
                <el-input clearable placeholder="请输入单位名称" v-model="cardForm.name"></el-input>
            </el-form-item>
            <el-form-item label="机构代码">
                <dg-tree-select
                    v-model="cardForm.institution"
                    placeholder="请选择机构代码"
                    :data="options"
                    clearable
                    filterable
                    multiple
                ></dg-tree-select>
            </el-form-item>
            <el-form-item>
                <dg-button type="primary" icon="el-icon-search" @click="doSearchPersion">查询</dg-button>
                <dg-button type="primary" icon="el-icon-plus">添加</dg-button>
            </el-form-item>
        </el-form>
        <Table
            ref="table"
            :url="tableUrl"
            :headerData="cardAgencylist"
            :condition="reportForm"
            :lazyLoad="true"
            @handleRowClick="handleRowClick"
        >
        </Table>
    </dg-card>
</template>

<script>
import Table from "@/components/table";
import * as dynamicManageApi from "@/api/dynamic-manage";
import addDialog from "./add-dialog";
import { cardAgencylist } from "../DataConfig";
const editorArea = ["1200px", "660px"];
export default {
    name: "personnelList", // 组件名称
    props: {
        // 接收父组件的数据
    },
    data() {
        // 组件内部参数
        return {
            // 参数名称及默认值
            cardAgencylist,
            tableUrl: dynamicManageApi.tableUrl,
            reportForm: {},
            cardForm: {},
            options: [
                {
                    id: "fruits",
                    label: "Fruits",
                    children: [
                        {
                            id: "apple",
                            label: "Apple",
                            isNew: true
                        },
                        {
                            id: "grapes",
                            label: "Grapes",
                            disabled: true
                        },
                        {
                            id: "pear",
                            label: "Pear"
                        },
                        {
                            id: "strawberry",
                            label: "Strawberry 🍓"
                        },
                        {
                            id: "watermelon",
                            label: "Watermelon 🍉"
                        }
                    ]
                },
                {
                    id: "vegetables",
                    label: "Vegetables",
                    children: [
                        {
                            id: "corn",
                            label: "Corn 🌽"
                        },
                        {
                            id: "carrot",
                            label: "Carrot 🥕"
                        },
                        {
                            id: "eggplant",
                            label: "Eggplant 🍆"
                        },
                        {
                            id: "tomato",
                            label: "Tomato 🍅"
                        }
                    ]
                }
            ]
        };
    },
    computed: {}, // 计算属性
    watch: {}, // 侦听器（扩展的计算属性）
    components: { Table }, // 注册局部组件
    methods: {
        /**
         * @description: 查询
         */
        doSearchPersion() {},
        /**
         * @description: 单击表格行
         */
        handleRowClick() {},
        /**
         * @description: 添加
         */
        add() {
            const layer = this.$dgLayer({
                title: "添加机构",
                shade: [0.4, "#FFF"],
                content: addDialog,
                props: {
                    type: "agency"
                },
                on: {
                    success() {
                        layer.close(layer.dialogIndex);
                    }
                },
                area: editorArea
            });
        }
    }, // 内部方法
    beforeCreate() {}, // 组件创建前
    created() {}, // 组件创建完成后
    beforeMount() {}, // 组件挂载前
    mounted() {}, // 组件挂载完成后
    beforeUpdate() {}, // 组件更新前
    updated() {}, // 组件挂载完成后
    beforeDestroy() {}, // 组件销毁前
    destroyed() {} // 组件销毁完成后
};
</script>
<style lang="scss" scoped></style>
