getMonitoringPosition.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div>
  3. <!-- 我是测试数据 -->
  4. <el-select v-model="position" placeholder="请选择">
  5. <el-option
  6. v-for="item in options"
  7. :label="options.ming_cheng"
  8. :key="item.key"
  9. :value="item.ming_cheng">
  10. </el-option>
  11. <!-- {{item.ming_cheng}} -->
  12. </el-select>
  13. </div>
  14. </template>
  15. <script>
  16. import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
  17. export default {
  18. data(){
  19. return{
  20. position:'',
  21. options:[]
  22. }
  23. },
  24. created(){
  25. },
  26. mounted(){
  27. this.getData()
  28. },
  29. methods:{
  30. getData(){
  31. //罗湖设备登记 当前位置 cun_fang_di_dian_ 位置去重
  32. //房间一览表
  33. let sql1 = "select cun_fang_di_dian_ as ming_cheng from t_sbdj group by ming_cheng"
  34. let sql2 = 'select fang_jian_ming_ha as ming_cheng from t_jjqfjb group by ming_cheng'
  35. Promise.all([
  36. curdPost('sql',sql1),
  37. curdPost('sql',sql2),
  38. ]).then(([res1,res2]) =>{
  39. let data1 = res1.variables.data
  40. let data2 = res2.variables.data
  41. this.options = data1.concat(data2)
  42. console.log('监控位置',data1,data2,this.data)
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. </style>