buildfloorCascader.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <el-cascader v-model="value" :options="options" :props="props" clearable></el-cascader>
  3. </template>
  4. <script>
  5. import { buildingQuery } from "@/api/scan/request";
  6. export default {
  7. data() {
  8. return {
  9. value: [],
  10. props: {
  11. multiple: true,
  12. value: 'BuildID',
  13. label: 'BuildLocalName',
  14. children: 'Floor'
  15. },
  16. options: []
  17. }
  18. },
  19. props: {
  20. FloorID: {
  21. default: ''
  22. }
  23. },
  24. created() { },
  25. methods: {
  26. getCascader() {
  27. let param = {
  28. Cascade: [
  29. { Name: "floor", Orders: "FloorSequenceID desc" }
  30. ],
  31. Orders: "BuildLocalName asc",
  32. PageNumber: 1,
  33. PageSize: 50
  34. }
  35. buildingQuery(param, res => {
  36. res.Content.map(t => {
  37. if (t.Floor && t.Floor.length) {
  38. t.Floor = t.Floor.map(item => {
  39. if (item.FloorID == this.FloorID) return
  40. item.BuildID = item.FloorID
  41. item.BuildLocalName = item.FloorLocalName || item.FloorName
  42. return item
  43. }).filter(it => it)
  44. }
  45. })
  46. this.options = res.Content
  47. })
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang="less" scoped>
  53. .el-cascader {
  54. width: 100%;
  55. }
  56. </style>