internet.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div>
  3. <!-- 物联数据-->
  4. <div class="basic-details" id="internet">
  5. <div class="basic-details-title">
  6. <span class="border-span">物联数据</span>
  7. <el-button type="primary" @click="updateInfo">更新</el-button>
  8. </div>
  9. </div>
  10. <div class="basic-details-name">{{ name }}</div>
  11. <!-- 挤压机 65 -->
  12. <!-- <InternetExtruder :info="info" v-if="parentClassId == '65'" /> -->
  13. <!-- 干燥箱 57 -->
  14. <!-- <InternetDryingBox :info="info" v-else-if="parentClassId == '57'" /> -->
  15. <!-- 其他设备 -->
  16. <!-- <InternetOther v-else :id="id"></InternetOther> -->
  17. <internetDetail ref="internetDetailRef" :info="info" :id="id"></internetDetail>
  18. </div>
  19. </template>
  20. <script>
  21. import InternetExtruder from './InternetExtruder/InternetExtruder';
  22. import InternetDryingBox from './InternetDryingBox/InternetDryingBox';
  23. import InternetOther from './InternetOther';
  24. import internetDetail from './components/internetDetail.vue';
  25. import { getDetail } from '@/api/ledgerAssets/equipment';
  26. export default {
  27. props: ['id', 'name'],
  28. components: { InternetExtruder, InternetDryingBox, InternetOther, internetDetail },
  29. data() {
  30. return {
  31. iotId: null,
  32. // 设备信息
  33. info: '',
  34. // 设备名称
  35. // name: '',
  36. // 父类id
  37. parentClassId: '65'
  38. };
  39. },
  40. created() {
  41. this.getInfo();
  42. },
  43. methods: {
  44. getInfo() {
  45. getDetail(
  46. this.id
  47. ).then((res) => {
  48. this.info = res;
  49. console.log(this.info);
  50. // this.parentClassId = this.setParentClassId(
  51. // this.info.information.classificationUrlId
  52. // );
  53. });
  54. },
  55. // 获取父类id
  56. setParentClassId(val) {
  57. let data = JSON.parse(val);
  58. return data[1];
  59. },
  60. // 更新信息
  61. updateInfo() {
  62. this.$refs.internetDetailRef.getRealData();
  63. }
  64. }
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .basic-details {
  69. background: #fff;
  70. padding: 20px;
  71. }
  72. .basic-details-title {
  73. display: flex;
  74. justify-content: space-between;
  75. align-items: center;
  76. }
  77. .basic-details-name {
  78. font-size: 14px;
  79. font-weight: bold;
  80. margin-bottom: 10px;
  81. margin-left: 5px;
  82. }
  83. .wrapper {
  84. background: #fff;
  85. padding: 20px;
  86. }
  87. .no-data {
  88. background: #fff;
  89. line-height: 100px;
  90. font-size: 26px;
  91. text-align: center;
  92. }
  93. </style>