<template>
  <div id="orgListManage">
    <a-card :bordered="false">
      <!--<a-row :gutter="48">-->
      <!--<a-col>-->
      <!--<a-space>-->
      <!--<a-button type="primary" @click="addItem" v-if="!buttonState || buttonState.add">-->
      <!--<a-icon :style="iconStyle" type="plus"/>新增-->
      <!--</a-button>-->
      <!--<a-button-->
      <!--v-if="!buttonState || buttonState.edit"-->
      <!--:loading="editDataLoading"-->
      <!--:disabled="!isModify"-->
      <!--class="btn-success"-->
      <!--type="dashed"-->
      <!--@click="editItem">-->
      <!--<a-icon :style="iconStyle" type="edit"/>修改-->
      <!--</a-button>-->
      <!--<a-button :disabled="!isDelete" type="danger" @click="deleteItem" v-if="!buttonState || buttonState.delete">-->
      <!--<a-icon :style="iconStyle" type="delete"/>删除-->
      <!--</a-button>-->
      <!--</a-space>-->
      <!--<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">-->
      <!--<a-button-group>-->
      <!--<a-button @click="toggleIsFormShow">-->
      <!--<a-icon :style="iconStyle" type="vertical-align-top"/>-->
      <!--</a-button>-->
      <!--<a-button @click="refresh(true)">-->
      <!--<a-icon :style="iconStyle" type="reload" />-->
      <!--</a-button>-->
      <!--<a-button @click="showDrawer">-->
      <!--<a-icon :style="iconStyle" type="table" />-->
      <!--</a-button>-->
      <!--<a-button @click="exports">-->
      <!--<a-icon :style="iconStyle" type="cloud-download"/>-->
      <!--</a-button>-->
      <!--</a-button-group>-->
      <!--</span>-->
      <!--</a-col>-->
      <!--</a-row>-->
      <a-table
        :columns="columns"
        :data-source="funTree"
        :pagination="false"
        bordered
        rowKey="id"
        size="middle">
      </a-table>
    </a-card>
  </div>
</template>

<script>
  import { getOrganization, searchFun } from '@vue2-client/base-client/plugins/GetLoginInfoService'
  import { getConfigByName } from '@vue2-client/services/api/common'
  export default {
    // 组织管理
    name: 'OrgListManage',
    data () {
      return {
        columnsJson: [],
        funTree: [],
        columns: [
          {
            title: '组织名称',
            dataIndex: 'name'
          },
          {
            title: '排序',
            dataIndex: 'position'
          },
          {
            title: '组件目录',
            dataIndex: 'f_dir'
          },
          {
            title: '描述',
            dataIndex: 'f_description'
          }
        ]
      }
    },
    created () {
    },
    async mounted () {
      getConfigByName('orgListManage', (res) => {
        this.columnsJson = res
      })
      const fun = await getOrganization()
      this.funTree = searchFun(fun, '组织机构')
    },
    methods: {
    }
  }
</script>

<style lang="less">
</style>
