xiaohaizhao 7 månader sedan
förälder
incheckning
52fc18b60b
3 ändrade filer med 130 tillägg och 1 borttagningar
  1. 1 1
      main.js
  2. 7 0
      pages/facility/detail.vue
  3. 122 0
      pages/facility/modules/associated.vue

+ 1 - 1
main.js

@@ -30,7 +30,7 @@ Vue.component('connectingDevice', connectingDevice);
 
 console.log("process.env.NODE_ENV", process.env.NODE_ENV)
 //挂载接口 'production'
-let isDev = false; // ['development'].includes(process.env.NODE_ENV);
+let isDev = false //['development'].includes(process.env.NODE_ENV);
 console.log('运行环境', isDev ? '开发' : '生产');
 
 const http = {};

+ 7 - 0
pages/facility/detail.vue

@@ -61,6 +61,8 @@
         :isfeedback="detail.isfeedback"
         :w_deviceid="w_deviceid"
       />
+
+      <associated ref="关联信息" :w_deviceid="w_deviceid" />
       <preview ref="详情信息" :detail="detail" />
       <alerts ref="告警记录" :w_deviceid="w_deviceid" />
       <view style="height: 30px" />
@@ -71,6 +73,7 @@
 <script>
 import horizontalDirection from "./modules/horizontalDirection.vue";
 import tabs from "./modules/tabs.vue";
+import associated from "./modules/associated.vue";
 import preview from "./modules/preview.vue";
 import dailyRecord from "./modules/dailyRecord.vue";
 import control from "./modules/control.vue";
@@ -82,6 +85,7 @@ export default {
   components: {
     horizontalDirection,
     tabs,
+    associated,
     preview,
     dailyRecord,
     control,
@@ -107,6 +111,9 @@ export default {
         {
           name: "告警记录",
         },
+        {
+          name: "关联信息",
+        },
         {
           name: "详情信息",
         },

+ 122 - 0
pages/facility/modules/associated.vue

@@ -0,0 +1,122 @@
+<template>
+  <view v-show="show">
+    <view v-for="item in list" :key="item.w_device_assetid" class="item">
+      <view class="name u-line-1">阀门名称:{{ item.itemname || " --" }}</view>
+      <view v-if="item.spec" class="row u-line-1"
+        >阀门规格:<text>{{ item.spec || " --" }}</text></view
+      >
+      <view v-if=" item.brandname" class="row u-line-1"
+        >阀门品牌:<text>{{ item.brandname || " --" }}</text></view
+      >
+      <view v-if="item.valveinstalldate" class="row u-line-1"
+        >安装时间:<text>{{ item.valveinstalldate || " --" }}</text></view
+      >
+      <view v-if="item.serialnumber" class="row u-line-1"
+        >阀门编号:<text>{{ item.serialnumber || " --" }}</text></view
+      >
+      <view v-if="item.valvecheckdate" class="row u-line-1"
+        >阀位监测仪安装时间:<text>{{
+          item.valvecheckdate || " --"
+        }}</text></view
+      >
+      <!-- <My_Files :attinfos="item.attinfos" /> -->
+    </view>
+    <view style="height: 20px" />
+    <view v-if="empty" style="padding-top: 30px">
+      <u-empty mode="data" />
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "associated",
+  props: {
+    w_deviceid: String,
+  },
+  data() {
+    return {
+      show: false,
+      uninitialized: true,
+      reverlAll: false,
+      list: [],
+      empty: false,
+      content: {
+        assettype: "阀门",
+        pageNumber: 1,
+        pageSize: 20,
+        pageTotal: 1,
+        where: { condition: "" },
+      },
+    };
+  },
+  methods: {
+    initialize(init = false) {
+      this.uninitialized = false;
+      this.getList(init);
+    },
+    getList(init = false) {
+      console.log("3422332");
+      let content = this.content;
+      if (init) {
+        content.pageNumber = 1;
+        content.pageTotal = 1;
+      }
+      if (content.pageNumber > content.pageTotal) return;
+      content.w_deviceid = this.w_deviceid;
+      this.$Http
+        .basic({
+          id: 20230802163102,
+          content,
+        })
+        .then((res) => {
+          console.log("阀门关联信息", res);
+          if (this.cutoff(res.msg)) return;
+          this.empty = !res.data.length;
+          content.pageNumber = res.pageNumber + 1;
+          content.pageTotal = res.pageTotal;
+          this.list =
+            res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+          this.content = content;
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.item {
+  position: relative;
+  width: 355px;
+  background: #ffffff;
+  border-radius: 4px;
+  margin: 5px auto;
+  margin-bottom: 10px;
+  padding: 10px;
+  box-sizing: border-box;
+  overflow: hidden;
+
+  .name {
+    width: 300px;
+    line-height: 21px;
+    font-size: 15px;
+    font-family: PingFang SC-Medium, PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    margin-bottom: 10px;
+  }
+
+  .row {
+    line-height: 17px;
+    font-size: 12px;
+    color: #666666;
+    margin-bottom: 5px;
+
+    text {
+      line-height: 17px;
+      font-size: 12px;
+      color: #0a3971;
+    }
+  }
+}
+</style>