Pārlūkot izejas kodu

Merge branch 'fw01' into 测试

xiaohaizhao 10 mēneši atpakaļ
vecāks
revīzija
ecef17d1ee

+ 71 - 0
control/components/prodnum-FW01/modules/basics.vue

@@ -0,0 +1,71 @@
+<template>
+  <view class="reset">
+    <view class="update-line">
+      <view class="label">
+        {{ ctrlModel.funcname }}
+      </view>
+      <view
+        class="content"
+        hover-class="navigator-hover"
+        @click="onClick(ctrlModel)"
+        >复位
+      </view>
+    </view>
+    <My_input ref="MyInput" />
+  </view>
+</template>
+<script>
+export default {
+  name: "basics",
+  data() {
+    return {
+      ctrlModel: {},
+    };
+  },
+  methods: {
+    onClick() {
+      let that = this;
+      uni.showModal({
+        title: "提示",
+        content: "确定复位吗?",
+        success: ({ confirm }) => {
+          if (confirm) {
+            let paramName = that.ctrlModel.paramName;
+            for (const key in paramName) {
+              paramName[key] = 0;
+            }
+            that.$refs.MyInput.submit(that.ctrlModel.w_functionid, paramName);
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.reset {
+  margin-bottom: 12px;
+
+  .update-line {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .label {
+      font-size: 3.7333333333333vw;
+      color: #fff;
+      font-weight: bold;
+      text-indent: 1.6vw;
+    }
+
+    .content {
+      background-color: #004a92;
+      font-size: 12px;
+      padding: 4px 8px;
+      border-radius: 4px;
+      box-sizing: border-box;
+      color: #fff;
+    }
+  }
+}
+</style>

+ 11 - 1
control/components/prodnum-FW01/prodnum-FW01.vue

@@ -1,6 +1,7 @@
 <template>
   <view>
     <view style="height: 20px" />
+    <basics ref="basics" />
     <pilotLamp ref="pilotLamp" itemW="21%" />
     <view class="control-title">设备参数</view>
     <preview ref="preview" />
@@ -12,9 +13,10 @@
 import controlPanel from "../prodnum-YK01/modules/controlPanel.vue";
 import preview from "../prodnum-YK01/modules/preview.vue";
 import pilotLamp from "../prodnum-MT03/modules/pilotLamp.vue";
+import basics from "./modules/basics.vue";
 export default {
   name: "prodnum-FW01",
-  components: { controlPanel, pilotLamp, preview },
+  components: { controlPanel, pilotLamp, preview, basics },
   props: {
     control: Object,
   },
@@ -49,6 +51,14 @@ export default {
               value: getBoole("A002"),
             },
           ];
+
+          if (getBoole("A005")) {
+            this.$refs.basics.ctrlModel = this.__proto__.getControlItem(
+              ["开度提醒复位"],
+              newVal
+            )[0];
+            console.log(this.$refs.basics.ctrlModel);
+          }
           function getBoole(name, expect = 1) {
             try {
               return newVal.paramvalues[name] == expect;

+ 5 - 2
pages/index/modules/home.vue

@@ -68,7 +68,6 @@ export default {
     };
   },
   created() {
-    // this.getPlace();
     let userMsg = uni.getStorageSync("userMsg");
     this.sitename = `${userMsg.sitename} - ${userMsg.name}`;
     try {
@@ -80,6 +79,10 @@ export default {
   },
   mounted() {
     this.getWeather();
+    this.getLocation().then((s) => {
+      this.__proto__.location = s;
+      this.getPlace();
+    });
   },
   methods: {
     renderData() {
@@ -111,7 +114,7 @@ export default {
           }
         });
     },
-    setLocation() {
+    async setLocation() {
       let that = this;
       uni.getSetting({
         success({ authSetting }) {