<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
          @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>
a {
  text-decoration-line: none;
  color: #606266;
}
a:hover {
  color: blue;
}
</style>