<template>
  <el-cascader v-model="value" :options="options" :props="props" clearable></el-cascader>
</template>
<script>
// import { buildingQuery } from "@/api/scan/request";
import {buildingQuery} from '@/api/object/build'

export default {
  data() {
    return {
      value: [],
      props: {
        multiple: true,
        value: 'id',
        label: 'name',
        children: 'floor'
      },
      options: []
    }
  },
  props: {
    FloorID: {
      default: ''
    }
  },
  created() {
  },
  methods: {
    getCascader() {
      let param = {
        cascade: [
          // { Name: "floor", Orders: "FloorSequenceID desc" }
          {name: "floor", orders: "floorSequenceId desc"}
        ],
        // Orders: "BuildLocalName asc",
        pageNumber: 1,
        pageSize: 50
      }
      buildingQuery(param, res => {
        // res.content.map(t => {
        //   if (t.floor && t.floor.length) {
        //     t.floor = t.floor.map(item => {
        //       if (item.floorID == this.floorID) return
        //       item.buildID = item.floorID
        //       item.buildLocalName = item.floorLocalName || item.floorName
        //       return item
        //     }).filter(it => it)
        //   }
        // })
        // this.options = res.content
        this.options = res.content
        console.log(this.options,'options')
      })
    },
  }
}
</script>
<style lang="less" scoped>
.el-cascader {
  width: 100%;
}
</style>
