list.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <My_listbox ref="List" :empty='empty' @getlist="getlist">
  3. <navigator v-for="item in list" :key="item.w_deviceid" class="item"
  4. :url="'/pages/facility/detail?id=' + item.w_deviceid">
  5. <view class="name u-line-1">设备:{{ item.devicename || ' --' }}</view>
  6. <view class="row u-line-1">产品名称:<text>{{ item.prodname || ' --' }}</text></view>
  7. <view class="row u-line-1">设备编号:<text>{{ item.serialnumber || ' --' }}</text></view>
  8. <view class="row u-line-1">设备地址:<text>{{ (item.province + item.city + item.county + item.address) || ' --'
  9. }}</text>
  10. </view>
  11. <view class="status" :style="{ background: item.bgColor }">{{ item.status }}</view>
  12. </navigator>
  13. <view style="height: 20px;" />
  14. </My_listbox>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. list: Array,
  20. empty: Boolean,
  21. tabHeight: Number
  22. },
  23. name: "list",
  24. data() {
  25. return {
  26. uninitialized: true
  27. }
  28. },
  29. methods: {
  30. init() {
  31. this.uninitialized = false;
  32. setTimeout(() => this.$refs.List.setHeight("minus", this.tabHeight), 300)
  33. },
  34. getlist() {
  35. if (this.$Http.updateFacilityList) {
  36. this.$Http.updateFacilityList().then(res => this.$refs.List.RefreshToComplete())
  37. } else {
  38. this.$refs.List.RefreshToComplete();
  39. }
  40. },
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .item {
  46. position: relative;
  47. width: 355px;
  48. background: #FFFFFF;
  49. border-radius: 4px;
  50. margin: 5px auto;
  51. margin-bottom: 10px;
  52. padding: 10px;
  53. box-sizing: border-box;
  54. overflow: hidden;
  55. .name {
  56. width: 300px;
  57. line-height: 21px;
  58. font-size: 15px;
  59. font-family: PingFang SC-Medium, PingFang SC;
  60. font-weight: bold;
  61. color: #333333;
  62. margin-bottom: 10px;
  63. }
  64. .row {
  65. line-height: 17px;
  66. font-size: 12px;
  67. color: #666666;
  68. margin-bottom: 5px;
  69. text {
  70. line-height: 17px;
  71. font-size: 12px;
  72. color: #0A3971;
  73. }
  74. }
  75. .status {
  76. position: absolute;
  77. right: 0;
  78. top: 0;
  79. border-radius: 0px 4px 0px 4px;
  80. background: red;
  81. text-align: center;
  82. line-height: 24px;
  83. padding: 0 10px;
  84. font-size: 12px;
  85. font-family: PingFang SC-Regular, PingFang SC;
  86. color: #FFFFFF;
  87. }
  88. }
  89. </style>