<template>
  <div class="app-container">
    <el-table
      height="740"
      v-loading="loading"
      :data="tableList"
    >
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="电机名称" align="center" prop="motorName"/>
      <el-table-column label="隔离点绑定" align="center" prop="pointName" ></el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.current"
      :limit.sync="queryParams.size"
      @pagination="getList"
    />

  </div>
</template>

<script>

import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'

import { getIsMotorListByLotoId } from '@/api/mes/motor'

export default {
  name: 'Team',
  components: { Treeselect },
  props: {
    switchMapId: {
      type: String, // 或 Number，根据你的实际类型
      required: true
    }
  },
  dicts: ['power_type', 'point_type', 'lock_type','switch_status'],
  data() {
    return {
      //自动生成编码
      autoGenFlag: false,
      optType: undefined,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      codes: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,

      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      tableList:[],
      queryParams: {
        current: 1,
        size: 10,
        lotoId:null,
      },

    }
  },

  created() {
    this.getList()

  },

  methods: {

    /** 查询隔离点信息列表 */
    getList() {
      this.loading = true
      this.queryParams.lotoId = this.$route.query.lotoId
      getIsMotorListByLotoId(this.queryParams).then((response) => {
        this.tableList = response.data
        this.total = response.data.length
        this.loading = false
      })

    },

  }
}
</script>
<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
.el-input-width {
  width: 380px !important;
}

</style>
<style lang="scss" scoped>

.image-grid {
  display: flex;
  flex-wrap: wrap;
}

.image-item {
  margin: 5px;
  height: 55px;
  //background: pink;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
  position: relative;
}

.image-item.selected {
  height: 55px;
  border-color: rgb(2, 86, 255);
  border-width: 2px;
}


</style>
