Quellcode durchsuchen

[Mod 0000] 解决接口返回报错信息不提示的问题

hongrunxia vor 1 Tag
Ursprung
Commit
9c150408d7

+ 4 - 0
src/utils/http/axios/index.ts

@@ -49,6 +49,7 @@ const transform: AxiosTransform = {
       // throw new Error(t('sys.api.apiRequestFailed'));
     }
     //  这里 code,result,message为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式
+    debugger;
     if (data.result) {
       //lxh
       const { code, result, message, success } = data;
@@ -69,6 +70,9 @@ const transform: AxiosTransform = {
         throw new Error(message);
       }
     } else {
+      if (data['code'] !== 0 && data.code != 200) {
+        createMessage.error(data.message);
+      }
       return data;
     }
 

+ 78 - 78
src/views/vent/home/configurable/components/originalNew/moduleLeftBottom.vue

@@ -10,95 +10,95 @@
   </div>
 </template>
 <script lang="ts" setup>
-defineProps<{ title: string; visible: boolean }>();
-const emit = defineEmits(['close', 'click']);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['close', 'click']);
 
-function closeModel() {
-  emit('close');
-}
-function clickHandler() {
-  emit('click');
-}
+  function closeModel() {
+    emit('close');
+  }
+  function clickHandler() {
+    emit('click');
+  }
 </script>
 <style lang="less" scoped>
-@import '/@/design/theme.less';
+  @import '/@/design/theme.less';
+
+  @{theme-deepblue} {
+    .module-content {
+      --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left3.png');
+    }
+  }
 
-@{theme-deepblue} {
   .module-content {
     --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left3.png');
+    --bg-height: 40px;
+    color: #fff;
+    box-sizing: border-box;
+    position: absolute;
+    width: 100%;
+    height: 100%;
   }
-}
-
-.module-content {
-  --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left3.png');
-  --bg-height: 40px;
-  color: #fff;
-  box-sizing: border-box;
-  position: absolute;
-  width: 100%;
-  height: 100%;
-}
-.title {
-  font-size: 14px;
-  font-weight: 500;
-  color: #fff;
-  float: right;
-  padding-right: 25px;
-  font-family: 'douyuFont';
-  line-height: 30px;
-}
-.module-content__title__expand {
-  width: 100%;
-  height: var(--bg-height);
-  background: var(--image-model_original_title_bg) no-repeat;
-  background-size: 100% 100%;
-  position: relative;
-  text-align: center;
+  .title {
+    font-size: 14px;
+    font-weight: 500;
+    color: #fff;
+    float: right;
+    padding-right: 25px;
+    font-family: 'douyuFont';
+    line-height: 30px;
+  }
+  .module-content__title__expand {
+    width: 100%;
+    height: var(--bg-height);
+    background: var(--image-model_original_title_bg) no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    text-align: center;
 
-  line-height: var(--bg-height);
-}
+    line-height: var(--bg-height);
+  }
 
-// .module-content__title {
-//   width: 50%;
-//   height: var(--bg-height);
-//   background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
-//   background-size: 100% 100%;
-//   position: relative;
-//   text-align: right;
-//   padding: 4px 10% 0 0;
-// }
+  // .module-content__title {
+  //   width: 50%;
+  //   height: var(--bg-height);
+  //   background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
+  //   background-size: 100% 100%;
+  //   position: relative;
+  //   text-align: right;
+  //   padding: 4px 10% 0 0;
+  // }
 
-// 固定在父容器右上角的按钮图标
-// .action-btn {
-//   width: 18px;
-//   height: 18px;
-//   background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
-//   position: absolute;
-//   right: 0;
-//   top: 0;
-// }
-// .close-btn {
-//   transform: rotate(-90deg);
-// }
+  // 固定在父容器右上角的按钮图标
+  // .action-btn {
+  //   width: 18px;
+  //   height: 18px;
+  //   background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
+  //   position: absolute;
+  //   right: 0;
+  //   top: 0;
+  // }
+  // .close-btn {
+  //   transform: rotate(-90deg);
+  // }
 
-.module-slot {
-  height: calc(100% - 33px);
-  width: calc(100% - 20px);
-  backdrop-filter: blur(5px);
-  margin-left: 10px;
-}
+  .module-slot {
+    height: calc(100% - 33px);
+    width: calc(100% - 20px);
+    backdrop-filter: blur(5px);
+    margin-left: 10px;
+  }
 
-// Transition动画相关
-.v-enter-active,
-.v-leave-active {
-  transition: all 0.3s ease;
-}
+  // Transition动画相关
+  .v-enter-active,
+  .v-leave-active {
+    transition: all 0.3s ease;
+  }
 
-.v-enter-from,
-.v-leave-to {
-  // opacity: 1;
-  transform: translateX(-100%);
-  // transform: scaleY(0);
-  // transform-origin: center top;
-}
+  .v-enter-from,
+  .v-leave-to {
+    // opacity: 1;
+    transform: translateX(-100%);
+    // transform: scaleY(0);
+    // transform-origin: center top;
+  }
 </style>

+ 78 - 77
src/views/vent/home/configurable/components/originalNew/moduleLeftCenter.vue

@@ -10,93 +10,94 @@
   </div>
 </template>
 <script lang="ts" setup>
-defineProps<{ title: string; visible: boolean }>();
-const emit = defineEmits(['close', 'click']);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['close', 'click']);
 
-function closeModel() {
-  emit('close');
-}
-function clickHandler() {
-  emit('click');
-}
+  function closeModel() {
+    emit('close');
+  }
+  function clickHandler() {
+    emit('click');
+  }
 </script>
 <style lang="less" scoped>
-@import '/@/design/theme.less';
+  @import '/@/design/theme.less';
+
+  @{theme-deepblue} {
+    .module-content {
+      --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left2.png');
+    }
+  }
 
-@{theme-deepblue} {
   .module-content {
     --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left2.png');
+    --bg-height: 40px;
+    color: #fff;
+    box-sizing: border-box;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+  }
+  .title {
+    font-size: 14px;
+    font-weight: 500;
+    color: #fff;
+    float: right;
+    padding-right: 25px;
+    line-height: 30px;
+    font-family: 'douyuFont';
+  }
+  .module-content__title__expand {
+    width: 100%;
+    height: var(--bg-height);
+    background: var(--image-model_original_title_bg) no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    text-align: center;
+    line-height: var(--bg-height);
   }
-}
-
-.module-content {
-  --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left2.png');
-  --bg-height: 40px;
-  color: #fff;
-  box-sizing: border-box;
-  position: absolute;
-  width: 100%;
-  height: 100%;
-}
-.title {
-  font-size: 14px;
-  font-weight: 500;
-  color: #fff;
-  float: right;
-  padding-right: 25px;
-  line-height: 30px;    font-family: 'douyuFont';
-}
-.module-content__title__expand {
-  width: 100%;
-  height: var(--bg-height);
-  background: var(--image-model_original_title_bg) no-repeat;
-  background-size: 100% 100%;
-  position: relative;
-  text-align: center;
-  line-height: var(--bg-height);
-}
 
-// .module-content__title {
-//   width: 50%;
-//   height: var(--bg-height);
-//   background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
-//   background-size: 100% 100%;
-//   position: relative;
-//   text-align: right;
-//   padding: 4px 10% 0 0;
-// }
+  // .module-content__title {
+  //   width: 50%;
+  //   height: var(--bg-height);
+  //   background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
+  //   background-size: 100% 100%;
+  //   position: relative;
+  //   text-align: right;
+  //   padding: 4px 10% 0 0;
+  // }
 
-// 固定在父容器右上角的按钮图标
-// .action-btn {
-//   width: 18px;
-//   height: 18px;
-//   background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
-//   position: absolute;
-//   right: 0;
-//   top: 0;
-// }
-// .close-btn {
-//   transform: rotate(-90deg);
-// }
+  // 固定在父容器右上角的按钮图标
+  // .action-btn {
+  //   width: 18px;
+  //   height: 18px;
+  //   background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
+  //   position: absolute;
+  //   right: 0;
+  //   top: 0;
+  // }
+  // .close-btn {
+  //   transform: rotate(-90deg);
+  // }
 
-.module-slot {
-  height: calc(100% - 33px);
-  width: calc(100% - 20px);
-  backdrop-filter: blur(5px);
-  margin-left: 10px;
-}
+  .module-slot {
+    height: calc(100% - 33px);
+    width: calc(100% - 20px);
+    backdrop-filter: blur(5px);
+    margin-left: 10px;
+  }
 
-// Transition动画相关
-.v-enter-active,
-.v-leave-active {
-  transition: all 0.3s ease;
-}
+  // Transition动画相关
+  .v-enter-active,
+  .v-leave-active {
+    transition: all 0.3s ease;
+  }
 
-.v-enter-from,
-.v-leave-to {
-  // opacity: 1;
-  transform: translateX(-100%);
-  // transform: scaleY(0);
-  // transform-origin: center top;
-}
+  .v-enter-from,
+  .v-leave-to {
+    // opacity: 1;
+    transform: translateX(-100%);
+    // transform: scaleY(0);
+    // transform-origin: center top;
+  }
 </style>

+ 76 - 77
src/views/vent/home/configurable/components/originalNew/moduleTop.vue

@@ -1,4 +1,3 @@
-
 <template>
   <div v-if="visible" class="module-content">
     <div class="left-solt"></div>
@@ -32,92 +31,92 @@
 </template>
 
 <script lang="ts" setup>
-defineProps<{ title: string; visible: boolean }>();
-const emit = defineEmits(['close', 'click']);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['close', 'click']);
 </script>
 
 <style lang="less" scoped>
-@import '/@/design/theme.less';
-
-.module-content {
-  background: url('@/assets/images/vent/homeNew/content.png') no-repeat;
-  background-size: 100% 100%;
-  color: #fff;
-  box-sizing: border-box;
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  display: flex;
-  align-items: center;
-}
+  @import '/@/design/theme.less';
 
-.left-solt {
-  left: 8%;
-  top: 13%;
-  width: 30px;
-  height: 30px;
-  cursor: pointer;
-  position: absolute;
-  background: url('@/assets/images/vent/homeNew/Top-left.png') no-repeat;
-  background-size: 100% 100%;
-}
+  .module-content {
+    background: url('@/assets/images/vent/homeNew/content.png') no-repeat;
+    background-size: 100% 100%;
+    color: #fff;
+    box-sizing: border-box;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+  }
 
-.right-solt {
-  right: 8%;
-  top: 13%;
-  width: 30px;
-  height: 30px;
-  cursor: pointer;
-  position: absolute;
-  background: url('@/assets/images/vent/homeNew/Top-right.png') no-repeat;
-  background-size: 100% 100%;
-}
+  .left-solt {
+    left: 8%;
+    top: 13%;
+    width: 30px;
+    height: 30px;
+    cursor: pointer;
+    position: absolute;
+    background: url('@/assets/images/vent/homeNew/Top-left.png') no-repeat;
+    background-size: 100% 100%;
+  }
 
-.center-solt {
-  display: flex;
-  position: absolute;
-  left: 15%;
-  bottom: 50%;
-  width: 70%;
-  height: 60%;
-  align-items: center;
-  justify-content: space-around;
-}
+  .right-solt {
+    right: 8%;
+    top: 13%;
+    width: 30px;
+    height: 30px;
+    cursor: pointer;
+    position: absolute;
+    background: url('@/assets/images/vent/homeNew/Top-right.png') no-repeat;
+    background-size: 100% 100%;
+  }
 
-.data-item {
-  left: 10%;
-  display: flex;
-  align-items: center;
-  gap: 5px;
-  .data-icon {
-    width: 60px;
-    height: 100%;
+  .center-solt {
+    display: flex;
+    position: absolute;
+    left: 15%;
+    bottom: 50%;
+    width: 70%;
+    height: 60%;
+    align-items: center;
+    justify-content: space-around;
   }
-  .data-content {
+
+  .data-item {
+    left: 10%;
     display: flex;
-    flex-direction: column;
-    .title {
-      font-size: 16px;
-      font-weight: bold;
-      color: #999999;
+    align-items: center;
+    gap: 5px;
+    .data-icon {
+      width: 60px;
+      height: 100%;
     }
-    .air-num {
-      font-size: 25px;
+    .data-content {
+      display: flex;
+      flex-direction: column;
+      .title {
+        font-size: 16px;
+        font-weight: bold;
+        color: #999999;
+      }
+      .air-num {
+        font-size: 25px;
+      }
     }
   }
-}
-.air-num1 {
-  color: #4ca8d5;
-}
-.air-num2 {
-  color: #b9f3fc;
-}
-.air-num3 {
-  color: #4ad1cc;
-}
-.divider {
-  width: 1px;
-  height: 40px;
-  background: url('@/assets/images/vent/homeNew/Top-divider.png') no-repeat;
-}
+  .air-num1 {
+    color: #4ca8d5;
+  }
+  .air-num2 {
+    color: #b9f3fc;
+  }
+  .air-num3 {
+    color: #4ad1cc;
+  }
+  .divider {
+    width: 1px;
+    height: 40px;
+    background: url('@/assets/images/vent/homeNew/Top-divider.png') no-repeat;
+  }
 </style>