infoPage.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div class="page-container hardwareEquipment-infoPage">
  3. <div class="page-top-title-box">
  4. <p class="page-top-title-name-p">详情</p>
  5. <p class="page-top-title-out-p" @click="backPage">返回</p>
  6. </div>
  7. <div class="content-box scrollbar-box">
  8. <div class="info-max-box">
  9. <div class="info-left-max-box">
  10. <span class="iconfont icon-yingjianshebei"></span>
  11. <p :class="newData.operatingState?'onlineTypeA':'onlineTypeB'">{{newData.operatingState?'开启':'关闭'}}</p>
  12. </div>
  13. <div class="info-right-max-box scrollbar-box">
  14. <div class="info-min-box">
  15. <div>
  16. <p>硬件ID:</p>
  17. <p>{{newData.deviceId}}</p>
  18. </div>
  19. </div>
  20. <div class="info-min-box">
  21. <div>
  22. <p>硬件名称:</p>
  23. <p>{{newData.hardwareName}}</p>
  24. </div>
  25. </div>
  26. <div class="info-min-box">
  27. <div>
  28. <p>硬件编号:</p>
  29. <p>{{newData.deviceNo}}</p>
  30. </div>
  31. </div>
  32. <div class="info-min-box">
  33. <div>
  34. <p>硬件类型:</p>
  35. <p>{{newData.hardwareTypeName}}</p>
  36. </div>
  37. </div>
  38. <div class="info-min-box">
  39. <div>
  40. <p>状态:</p>
  41. <p>{{newData.state?'启用':'停用'}}</p>
  42. </div>
  43. </div>
  44. <div class="info-min-box">
  45. <div>
  46. <p>创建时间:</p>
  47. <p>{{parseTime(newData.createTime)}}</p>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="table-max-box">
  53. <div class="table-button-box" @click="tableCheck(1)" :class="tableType==1?'check-table-box':''">
  54. <p>日志</p>
  55. <p></p>
  56. </div>
  57. <div class="table-button-box" @click="tableCheck(2)" :class="tableType==2?'check-table-box':''">
  58. <p>调试</p>
  59. <p></p>
  60. </div>
  61. <div class="table-null-box">
  62. <p></p>
  63. <p></p>
  64. </div>
  65. </div>
  66. <div class="table-content-box" v-if="tableType == 1">
  67. <hardware-log></hardware-log>
  68. </div>
  69. <div class="table-content-box" v-if="tableType == 2">
  70. <hardware-debug></hardware-debug>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import hardwareLog from "./bottomModule/hardwareLog.vue";
  77. import hardwareDebug from "./bottomModule/hardwareDebug.vue";
  78. import { iotHardwareDetail } from '@/api/iotDevice/index'
  79. export default {
  80. name: 'infoPage',
  81. components: {
  82. hardwareLog,
  83. hardwareDebug
  84. },
  85. props: {
  86. propsData: {}
  87. },
  88. data() {
  89. return {
  90. tableType: 1,
  91. newData: {},
  92. models: []
  93. }
  94. },
  95. created() {
  96. this.initialize()
  97. },
  98. mounted() {
  99. },
  100. methods: {
  101. tableCheck(type) {
  102. if (this.tableType != type) {
  103. this.$set(this, 'tableType', type)
  104. }
  105. },
  106. //初始化
  107. initialize() {
  108. this.$set(this,'newData',this.propsData);
  109. },
  110. // 返回按钮
  111. backPage() {
  112. this.$parent.tableButton(6)
  113. },
  114. //获取详情
  115. iotHardwareDetail(){
  116. iotHardwareDetail({id:this.$parent.propsData.id}).then(response =>{
  117. this.$set(this.propsData,'operatingState',response.data.operatingState);
  118. })
  119. },
  120. }
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .hardwareEquipment-infoPage {
  125. .content-box {
  126. flex: 1;
  127. display: flex;
  128. flex-direction: column;
  129. .info-max-box {
  130. padding: 20px;
  131. display: flex;
  132. .info-left-max-box {
  133. width: 180px;
  134. height: 180px;
  135. img {
  136. width: 100px;
  137. height: 100px;
  138. margin: 20px 40px 0;
  139. }
  140. .iconfont{
  141. display: inline-block;
  142. width: 100px;
  143. height: 100px;
  144. line-height:100px;
  145. text-align: center;
  146. margin: 20px 40px 0;
  147. color:#0183FA;
  148. font-size:100px;
  149. }
  150. p {
  151. width: 100px;
  152. line-height: 30px;
  153. height: 30px;
  154. text-align: center;
  155. font-size: 14px;
  156. margin: 10px 40px 0;
  157. border-radius: 4px;
  158. }
  159. .onlineTypeA {
  160. background-color: #0183FA;
  161. color: #fff;
  162. }
  163. .onlineTypeB {
  164. background-color: #E65D6E;
  165. color: #fff;
  166. }
  167. }
  168. .info-right-max-box {
  169. height: 180px;
  170. padding: 20px 0;
  171. .info-min-box {
  172. width: 440px;
  173. display: inline-block;
  174. div {
  175. display: flex;
  176. padding: 10px;
  177. p {
  178. color: #333;
  179. font-size: 14px;
  180. line-height: 20px;
  181. }
  182. p:nth-child(1) {
  183. width: 140px;
  184. text-align: right;
  185. }
  186. p:nth-child(2) {
  187. width: 300px;
  188. word-wrap: break-word;
  189. word-break: break-all;
  190. overflow: hidden;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. .table-max-box {
  197. display: flex;
  198. .table-button-box {
  199. cursor: pointer;
  200. display: flex;
  201. height: 44px;
  202. flex-direction: column;
  203. p:nth-child(1) {
  204. padding: 0 40px;
  205. font-size: 14px;
  206. line-height: 40px;
  207. height: 40px;
  208. text-align: center;
  209. }
  210. p:nth-child(2) {
  211. height: 4px;
  212. background-color: #dedede;
  213. }
  214. }
  215. .table-null-box {
  216. flex: 1;
  217. display: flex;
  218. height: 44px;
  219. flex-direction: column;
  220. p:nth-child(1) {
  221. height: 40px;
  222. }
  223. p:nth-child(2) {
  224. height: 4px;
  225. background-color: #dedede;
  226. }
  227. }
  228. .check-table-box {
  229. p:nth-child(1) {
  230. font-weight: 700;
  231. color: #0045AF;
  232. }
  233. p:nth-child(2) {
  234. background-color: #0045AF;
  235. }
  236. }
  237. }
  238. .table-content-box {
  239. flex: 1;
  240. flex-direction: column;
  241. display: flex;
  242. overflow: hidden;
  243. }
  244. }
  245. }
  246. </style>