<template>
  <div class="knowledge-6">
    <div class="query mg-b-8">
      <div class="query-items">
        <div class="query-item">
          <div class="lable">型号：</div>
          <div class="search-input">
            <el-select
              v-model="model"
              placeholder="请选择"
              popper-class="select"
            >
              <el-option
                v-for="item in models"
                :key="item"
                :label="item"
                :value="item"
              >
              </el-option>
            </el-select>
          </div>
        </div>
      </div>
      <div class="query-actions">
        <button class="btn green" @click="onClickSearch">搜索</button>
      </div>
    </div>
    <div>
      <ComTable :data="tableData" height="85vh"></ComTable>
    </div>
  </div>
</template>

<script>
import ComTable from "@com/coms/table/table.vue";

export default {
  components: { ComTable },
  data() {
    return {
      model: "",
      models: ["UP82","UP77","UP97","UP105-2000-S","SG500KTL","NTE-N500KTL","CCWE-1500","AE-500-50-PV-X-HV"],
      tableData: {
        column: [
          {
            name: "预警编号",
            field: "tid",
            is_num: true,
            is_light: false,
          },
          {
            name: "名称",
            field: "name",
            is_num: false,
            is_light: false,
          },
          {
            name: "风机型号",
            field: "model",
            is_num: false,
            is_light: false,
          },
          {
            name: "故障排查方法",
            field: "gzpc",
            is_num: false,
            is_light: false,
          },
          {
            name: "故障处理",
            field: "gzyy",
            is_num: false,
            is_light: false,
          },
          {
            name: "工器具",
            field: "gqj",
            is_num: false,
            is_light: false,
          },
          {
            name: "故障处理时长",
            field: "xqsc",
            is_num: false,
            is_light: false,
          }
        ],
        data: [],
      },
    };
  },
  created() {
    this.model = this.models[0];   
    this.requestSafeList();
  },
  methods: {
    // 搜索按钮
    onClickSearch() {
      this.requestSafeList();
    },
    requestSafeList() {
      let that = this;
      this.API.requestData({
        method: "GET",
        baseURL: "http://10.155.32.4:8034/",
        subUrl: "/experienceBase/pcjxfa",
        data: {
          model: that.model,
          pageNum: 1,
          pageSize: 1000,
        }, // 请求所携带参数，默认为空，可缺省
        success(res) {
          if (res.code == 200) {
            that.tableData.data = res.data
          }
        },
      });
    },
  },
};
</script>

<style lang="less" scope>
@titleGray: #9ca5a8;
@rowGray: #606769;
@darkBack: #536268;
.knowledge-6 {
  .el-select {
    width: 200px;
  }
  .el-input {
    width: 200px;
  }
}
</style>
