/** * 组件名称；权限配置 * @author:laiyh * @Date:2020-07-27 */

<template>
  <dg-row>
    <!-- 搜索项 -->
    <search-bar ref="searchBar" :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
    <!-- 表格 -->
    <new-table
      ref="table"
      :tableUrl="tableUrl"
      :tableHeader="tableHeader"
      :condition="condition"
      :tableOptList="tableOptList"
      @submitTableOpt="receviceOpt"
    >
    </new-table>
  </dg-row>
</template>

<script>
import newTable from '@/components/new-table';
import searchBar from '@/components/search-bar';
import { searchOpt } from '@/mixins/page-opt';
import Editor from './edit.vue';
import * as AuthorzationManageApi from '@/api/empower-manage';
import { appRestApi } from '@/api/application';
const area = ['1280px', '880px'];
export default {
  name: '',
  components: {
    newTable,
    searchBar
  },
  mixins: [searchOpt],
  // 接收父节点的参数
  props: {},
  data() {
    return {
      tableUrl: AuthorzationManageApi.authTableUrl,
      tableHeader: [
        { label: '应用系统名称', prop: 'name' },
        { label: '应用系统菜单数', prop: 'menus' },
        { label: '应用系统角色数', prop: 'roles' }
      ],
      conditionForm: [
        {
          label: '应用系统名称',
          name: 'applyName',
          op: '=',
          value: '',
          component: 'SelectApp',
          apiUrl: appRestApi.table,
          valueName: 'applyName',
          labelName: 'applyName'
        },
        // {
        //   label: '单位名称',
        //   name: 'orgCode',
        //   op: '=',
        //   value: '',
        //   apiName: 'getOrgTree',
        //   nodeKey: 'code',
        //   type: 'APP',
        //   component: 'SelectOrgTree',
        //   placeholder: '请选择单位名称',
        //   filterable: true
        // }
      ],
      tableOptList: ['权限配置']
    };
  },
  // 方法
  methods: {
    receviceOpt(opt, row) {
      this.handleEdit(row);
    },
    // 修改
    handleEdit(row) {
      const that = this;
      const layer = that.$dgLayer({
        title: '权限配置',
        area: area,
        shade: [0.4, '#fff'],
        props: {
          sizeForm: row
        },
        content: Editor,
        on: {}
      });
    }
  },
  created() {}
};
</script>

<style lang="scss" scoped></style>
