<template>
  <el-table
    :data="data"
    border
    stripe
    :show-header="false"
    :cell-style="cellSttyle"
  >
    <el-table-column prop="title" align="center">
      <template slot-scope="scope">
        <c-button
          class="c_button_style"
          @click.native="onNarBtnClick(scope.row.url, scope.row.hotsubx)"
          :title="scope.row.title"
          :disabled="scope.row.disabled"
          >{{ scope.row.title }}</c-button
        >
        <!-- <el-link
          :disabled="scope.row.disabled"
          :href="scope.row.url"
          v-if="scope.row.title"
          >{{ scope.row.title }}</el-link
        > -->
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import commonProcess from "~/mixin/commonProcess";
export default {
  inject: ["root"],
  props: ["data", "model"],
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      cellSttyle: { height: "25px" },
    };
  },
  methods: {
    //各入口按钮请求
    async onNarBtnClick(href, hotsubx) {
      let rtnmsg = await this.executeRule(`cfgfil.hotsub${hotsubx}`);
      console.log("cfgfil.code:" + this.model.cfgfil[`subtrn${hotsubx}`]);
      if ((rtnmsg.respCode == SUCCESS)) {
        this.$router.history.push(href);
      } else {
        this.$notify.error({ title: "错误", message: "服务请求失败!" });
      }
    },
  },
};
</script>

<style>
.c_button_style {
  border: 0px;
  border-radius: 5px;
}
</style>