getMonitoringName.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div>
  3. <!-- 监控设备 -->
  4. <!-- <el-select v-model="position" placeholder="请选择设备名称" id="name">
  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. </el-select> -->
  12. <select id="name" class="select_name">
  13. <option :key= "item.key" :value="item.ming_cheng" v-for="item in options">{{item.ming_cheng}}</option>
  14. </select>
  15. </div>
  16. </template>
  17. <script>
  18. import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
  19. export default {
  20. data(){
  21. return{
  22. position:'',
  23. options:[]
  24. }
  25. },
  26. created(){
  27. },
  28. mounted(){
  29. this.getData()
  30. },
  31. methods:{
  32. getData(){
  33. //罗湖设备登记 当前位置 cun_fang_di_dian_ 位置去重
  34. //房间一览表
  35. let sql = "select she_bei_ming_cheng_ AS ming_cheng FROM t_sbdj GROUP BY ming_cheng"
  36. curdPost('sql',sql).then(res => {
  37. this.options = res.variables.data
  38. // const position = document.getElementById('position')
  39. // let str = ''
  40. // this.options.forEach(item => {
  41. // str += `<option value="${item.wei_zhi}">${item.wei_zhi}</option>`
  42. // })
  43. // position.innerHTML = str
  44. // console.log('设备名称',this.options)
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .select_name{
  52. outline:none;
  53. border: 1px solid rgb(204, 204, 204);
  54. width: 700px;
  55. border-radius: 6px;
  56. height: 35px;
  57. font-size: 400;
  58. }
  59. </style>