associated.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view v-show="show">
  3. <view v-for="item in list" :key="item.w_device_assetid" class="item">
  4. <view class="name u-line-1">阀门名称:{{ item.itemname || " --" }}</view>
  5. <view v-if="item.spec" class="row u-line-1"
  6. >阀门规格:<text>{{ item.spec || " --" }}</text></view
  7. >
  8. <view v-if=" item.brandname" class="row u-line-1"
  9. >阀门品牌:<text>{{ item.brandname || " --" }}</text></view
  10. >
  11. <view v-if="item.valveinstalldate" class="row u-line-1"
  12. >安装时间:<text>{{ item.valveinstalldate || " --" }}</text></view
  13. >
  14. <view v-if="item.serialnumber" class="row u-line-1"
  15. >阀门编号:<text>{{ item.serialnumber || " --" }}</text></view
  16. >
  17. <view v-if="item.valvecheckdate" class="row u-line-1"
  18. >阀位监测仪安装时间:<text>{{
  19. item.valvecheckdate || " --"
  20. }}</text></view
  21. >
  22. <!-- <My_Files :attinfos="item.attinfos" /> -->
  23. </view>
  24. <view style="height: 20px" />
  25. <view v-if="empty" style="padding-top: 30px">
  26. <u-empty mode="data" />
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: "associated",
  33. props: {
  34. w_deviceid: String,
  35. },
  36. data() {
  37. return {
  38. show: false,
  39. uninitialized: true,
  40. reverlAll: false,
  41. list: [],
  42. empty: false,
  43. content: {
  44. assettype: "阀门",
  45. pageNumber: 1,
  46. pageSize: 20,
  47. pageTotal: 1,
  48. where: { condition: "" },
  49. },
  50. };
  51. },
  52. methods: {
  53. initialize(init = false) {
  54. this.uninitialized = false;
  55. this.getList(init);
  56. },
  57. getList(init = false) {
  58. console.log("3422332");
  59. let content = this.content;
  60. if (init) {
  61. content.pageNumber = 1;
  62. content.pageTotal = 1;
  63. }
  64. if (content.pageNumber > content.pageTotal) return;
  65. content.w_deviceid = this.w_deviceid;
  66. this.$Http
  67. .basic({
  68. id: 20230802163102,
  69. content,
  70. })
  71. .then((res) => {
  72. console.log("阀门关联信息", res);
  73. if (this.cutoff(res.msg)) return;
  74. this.empty = !res.data.length;
  75. content.pageNumber = res.pageNumber + 1;
  76. content.pageTotal = res.pageTotal;
  77. this.list =
  78. res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  79. this.content = content;
  80. });
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang="scss" scoped>
  86. .item {
  87. position: relative;
  88. width: 355px;
  89. background: #ffffff;
  90. border-radius: 4px;
  91. margin: 5px auto;
  92. margin-bottom: 10px;
  93. padding: 10px;
  94. box-sizing: border-box;
  95. overflow: hidden;
  96. .name {
  97. width: 300px;
  98. line-height: 21px;
  99. font-size: 15px;
  100. font-family: PingFang SC-Medium, PingFang SC;
  101. font-weight: bold;
  102. color: #333333;
  103. margin-bottom: 10px;
  104. }
  105. .row {
  106. line-height: 17px;
  107. font-size: 12px;
  108. color: #666666;
  109. margin-bottom: 5px;
  110. text {
  111. line-height: 17px;
  112. font-size: 12px;
  113. color: #0a3971;
  114. }
  115. }
  116. }
  117. </style>