Novecane
2025-02-17 ff934f8fc407d0aadefc3303994613d64178120e
unpackage/dist/dev/mp-weixin/pages/router/deviceInfo/index.js
@@ -10,6 +10,8 @@
    const logEntry = common_vendor.ref([]);
    const temp = common_vendor.ref({});
    const controInfo = common_vendor.ref({});
    const flag = common_vendor.ref(false);
    let positionInterval;
    common_vendor.onMounted(async () => {
      const option = getCurrentPages()[getCurrentPages().length - 1].options;
      const deviceInfo = JSON.parse(decodeURIComponent(option.device));
@@ -23,9 +25,30 @@
          ...deviceInfo
        };
      } catch (error) {
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:88", "Failed to fetch device info:", error);
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:95", "Failed to fetch device info:", error);
      }
    });
    const startGetPosition = () => {
      common_vendor.index.showLoading({
        title: "正在操作设备",
        mask: true
      });
      if (positionInterval) {
        clearInterval(positionInterval);
      }
      positionInterval = setInterval(() => {
        api_index.getControlInfo(state.value.facilityCode).then((res) => {
          if (res.data.position >= 100) {
            flag.value = false;
            clearInterval(positionInterval);
            common_vendor.index.hideLoading();
          }
        }).catch((error) => {
          common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:116", "Error fetching control info:", error);
          clearInterval(positionInterval);
        });
      }, 2e3);
    };
    const removeSharedDevice = async () => {
      temp.value = {
        facilityCode: state.value.facilityCode
@@ -43,7 +66,7 @@
          });
        }
      } catch (error) {
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:112", "Failed to delete device:", error);
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:145", "Failed to delete device:", error);
      }
    };
    const handleControlChange = (e) => {
@@ -52,8 +75,12 @@
        destinationPosition: e.detail.value
      };
      api_index.deviceControlInfo(controInfo.value).then((res) => {
        if (res.code === 200) {
          flag.value = true;
          startGetPosition();
        }
      }).catch((error) => {
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:124", "Failed to control device:", error);
        common_vendor.index.__f__("error", "at pages/router/deviceInfo/index.vue:162", "Failed to control device:", error);
      });
    };
    const getOpeHistory = () => {
@@ -62,7 +89,7 @@
          logEntry.value = res.data;
        }
      }).catch((e) => {
        common_vendor.index.__f__("log", "at pages/router/deviceInfo/index.vue:135", "fail info", e);
        common_vendor.index.__f__("log", "at pages/router/deviceInfo/index.vue:176", "fail info", e);
      });
    };
    const getControlData = () => {
@@ -81,7 +108,8 @@
        f: common_vendor.t(state.value.rssi),
        g: common_vendor.o(handleControlChange),
        h: controlValue.value,
        i: common_vendor.f(logEntry.value, (item, index, i0) => {
        i: flag.value,
        j: common_vendor.f(logEntry.value, (item, index, i0) => {
          return {
            a: common_vendor.t(item.operateName),
            b: common_vendor.t(item.operateStatus),
@@ -89,7 +117,7 @@
            d: index
          };
        }),
        j: common_vendor.o(removeSharedDevice)
        k: common_vendor.o(removeSharedDevice)
      });
    };
  }