<template>
  <el-dialog
    title="风险规则清单"
    :visible.sync="dialogVisible"
    width="70%"
  >
    <div class="common-form-table-pagination-layout dialog-risk-rules-list-wrapper">

      <div class="common-form-table-pagination-layout__header"></div>

      <div class="common-form-table-pagination-layout__content">

        <div class="table-wrapper">
          <el-table
            :data="tableData"
            border
            stripe
            max-height="600px"
          >
            <el-table-column type="index" label="序号" align="center"></el-table-column>
            <el-table-column prop="description" label="风险描述" align="center" width="400px"></el-table-column>
            <el-table-column prop="rule" label="风险规则" align="center"></el-table-column>
            <el-table-column prop="level" label="风险等级" align="center" width="100px"></el-table-column>
          </el-table>
        </div>
      </div>
      
    </div>
  
    <div slot="footer" class="common-el-dialog-footer">
      <el-button @click="dialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getWarningRules } from '@/api/utils'

export default {
  name: 'DialogRiskRulesList',

  data() {
    return {
      dialogVisible: false,
      tableData: [],
    }
  },

  methods: {
    open() {
      this.dialogVisible = true
      this.getTableData()
    },

    async getTableData() {
      const { code, msg, data } = (await getWarningRules())
      // console.log({ code, msg, data });
      this.tableData = data
    },
  }
}
</script>

<style lang="scss" scoped>
.dialog-risk-rules-list-wrapper {

}
</style>