
<!--租户超管的菜单管理-->
<template>
  <div class="app-container">
    <j-table
      v-loading="loading"
      :show-selection="false"
      :data="tableData"
      :columns="columns"
      :pagination="pagination"
    >
      <template slot="name">租户超管菜单</template>
      <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
        <template slot-scope="{ row }">
          <el-button
            v-hasPermi="['admin:manage:query']"
            size="mini"
            type="text"
            @click="$refs.menuDialogRef.handleEdit(row, true)"
          >详情</el-button>
          <el-button
            v-hasPermi="['admin:manage:edit']"
            size="mini"
            type="text"
            @click="$refs.menuDialogRef.handleEdit(row)"
          >编辑</el-button>
        </template>
      </el-table-column>
    </j-table>

    <menu-dialog ref="menuDialogRef" @ok="loadData" />
  </div>
</template>
<script>
import JTable from '@/components/Table/index.vue'
import { fetchAdminMenuPage } from '@/api/system/adminMenu'
import MenuDialog from '@/views/system/adminMenu/modules/MenuDialog.vue'
export default {
  components: {
    JTable,
    MenuDialog
  },
  data() {
    return {
      loading: false,
      tableData: [],
      pagination: {
        total: 0,
        pageNum: 1,
        pageSize: 10
      },
      columns: [
        { prop: 'name', label: '名称', minWidth: 200, align: 'left', customRender: 'name' },
        { prop: 'createTime', label: '创建时间', minWidth: 160 }
      ]
    }
  },
  created() {
    this.loadData()
  },
  methods: {
    loadData() {
      this.loading = true
      fetchAdminMenuPage(this.pagination).then(({ data, total }) => {
        this.tableData = data
        this.pagination.total = total
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style scoped lang="scss">

</style>
