You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
4.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="main">
  3. <view class="searchBox">
  4. <searchRow placeholder="搜索主机" @searchFn="searchFn"/>
  5. </view>
  6. <view class="tabs">
  7. <myTab :tabList="tabList" @tabClick="tabClick" :current="current"></myTab>
  8. </view>
  9. <view class="ul">
  10. <view class="total" v-if="total">{{total}}</view>
  11. <view class="card" v-for="(item,index) in list" :key="index">
  12. <view class="row">
  13. <view class="lab">机器名称</view>
  14. <view class="val">{{item.machineName}}</view>
  15. </view>
  16. <view class="row">
  17. <view class="lab">机器主机</view>
  18. <view class="val blue">{{item.machineHost}}</view>
  19. </view>
  20. <view class="row">
  21. <view class="lab">插件版本</view>
  22. <view class="val blue">V{{item.latestVersion}}</view>
  23. </view>
  24. <view class="row">
  25. <view class="lab">安装状态</view>
  26. <view class="val">
  27. <view class="flex">
  28. <view class="flex" v-if="item.status==1">
  29. <view class="icon">
  30. <image src="../../../static/images/icon (8).png" mode=""></image>
  31. </view>
  32. <view class="val yellow">启动中</view>
  33. </view>
  34. <view class="flex" style="margin-left: 36rpx;" v-if="item.status==1">
  35. <view class="icon">
  36. <image src="../../../static/images/icon (11).png" mode=""></image>
  37. </view>
  38. <view class="val blue">运行中</view>
  39. </view>
  40. <view class="flex" style="margin-left: 36rpx;" v-if="item.status==3">
  41. <view class="icon">
  42. <image src="../../../static/images/icon (12).png" mode=""></image>
  43. </view>
  44. <view class="val">未启动</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="status_row">
  50. <view class="blueTxt">监控</view>
  51. <view class="blueTxt">检测</view>
  52. <view class="blueTxt">报警配置</view>
  53. <view class="blueTxt" style="text-align: right;">报警记录</view>
  54. </view>
  55. </view>
  56. </view>
  57. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  58. </view>
  59. </template>
  60. <script>
  61. import { monitorList } from '@/config/api.js'
  62. export default {
  63. data() {
  64. return {
  65. tabList: [{
  66. name: '全部',
  67. id: 0
  68. }, {
  69. name: '运行中',
  70. }, {
  71. name: '启动中'
  72. },{
  73. name: '未启动'
  74. }, ],
  75. current: 0,
  76. total: 1,
  77. list: [],
  78. name: '',
  79. status: ''
  80. }
  81. },
  82. onLoad() {
  83. this.monitorListFn()
  84. },
  85. onPullDownRefresh() {
  86. this.monitorListFn()
  87. },
  88. methods: {
  89. tabClick(item) {
  90. console.log('item', item);
  91. this.current = item.index
  92. this.monitorListFn()
  93. },
  94. async monitorListFn() {
  95. let status = this.current?this.current:''
  96. const {data: res} = await monitorList({status, machineName: this.name})
  97. this.list = res.rows
  98. this.total = res.total
  99. if(!res.total) {
  100. this.status = 'nomore'
  101. }else {
  102. this.status = ''
  103. }
  104. uni.stopPullDownRefresh()
  105. },
  106. searchFn(val) {
  107. this.name = val
  108. this.monitorListFn()
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .searchBox {
  115. padding: 16rpx 30rpx;
  116. background-color: #fff;
  117. }
  118. .tabs {
  119. background-color: #fff;
  120. margin-top: 8rpx;
  121. padding: 16rpx 0;
  122. }
  123. .ul {
  124. width: 100%;
  125. padding: 0 30rpx 40rpx 30rpx;
  126. .total {
  127. height: 66rpx;
  128. line-height: 66rpx;
  129. font-size: 24rpx;
  130. color: #999;
  131. text-align: right;
  132. }
  133. .card {
  134. padding: 10rpx 28rpx;
  135. margin-bottom: 24rpx;
  136. .row {
  137. align-items: center;
  138. display: flex;
  139. justify-content: space-between;
  140. padding: 16rpx 0;
  141. font-size: 26rpx;
  142. color: #333;
  143. .lab {
  144. }
  145. .val {
  146. &.blue {
  147. color: $themC;
  148. }
  149. &.hui {
  150. color: #999;
  151. }
  152. &.yellow {
  153. color: #fc7710;
  154. }
  155. }
  156. .flex {
  157. display: flex;
  158. justify-content: flex-end;
  159. .icon {
  160. width: 28rpx;
  161. height: 30rpx;
  162. margin-right: 20rpx;
  163. }
  164. }
  165. }
  166. .status_row {
  167. color: $themC;
  168. font-size: 28rpx;
  169. font-weight: 600;
  170. display: flex;
  171. padding: 20rpx 0;
  172. .blueTxt {
  173. flex: 1;
  174. }
  175. }
  176. }
  177. }
  178. </style>