<script lang="ts" setup name="DbTypeIndex">
import { getBizRuleByList } from '@/api/biz/bizRuleApi'

const state = reactive({
  loading: false,
  // 表格是否自适应高度
  tableAutoHeight: false,
  // 搜索
  search: {
    keywords: '',
  },
  // 列表数据
  dataList: [],
})

const getDataList = async () => {
  state.loading = true
  const { data } = await getBizRuleByList({})
  state.dataList = data
  state.loading = false
}

onMounted(() => {
  getDataList()
})
</script>

<template>
  <div class="absolute-container">
    <tool-header title="业务规则" />

    <page-main>
      <el-table v-loading="state.loading" class="list-table" :data="state.dataList" border stripe highlight-current-row height="100%">
        <el-table-column type="index" label="序号" width="60" header-align="center" align="center" />

        <el-table-column prop="ruleTitle" label="名称" header-align="center" align="center" width="200" />

        <el-table-column prop="ruleDesc" label="说明" />
      </el-table>
    </page-main>
  </div>
</template>

<style lang="scss" scoped>
.absolute-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  .page-header {
    margin-bottom: 0;
  }

  .page-main {
    // 让 page-main 的高度自适应
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;

    .search-container {
      margin-bottom: 0;
    }
  }
}
</style>
