ソースを参照

feat:“优化按钮,添加睡眠切换按钮,远程开启触摸屏功能”

soobin 1 年間 前
コミット
9b43a446fb

BIN
src/assets/device/operIcon/restartAndroid.png


+ 4 - 0
src/assets/language/en.json

@@ -369,6 +369,9 @@
     "enableMaterialSucceed": "Sent successfully",
     "enableMaterialFailed": "Sent failed",
     "sleepSuccessfully": "Sleep successfully",
+    "changeSleep": "Do you switch sleep states?",
+    "changeSleepSuccess": "Switchover successful",
+    "isReplenishment": "Do you need replenishment?",
     "Succeed": "Request sent successfully",
     "Failed": "Request sent failure",
     "open": "open",
@@ -536,6 +539,7 @@
     "equipLocation": "Machine location",
     "position": "Position",
     "viewPositioning": "View positioning",
+    "restartAndroid": "Restart touch screen",
     "view": "view",
     "oneKeyFeed": "One key feeding",
     "replenishment": "Replenish",

+ 4 - 0
src/assets/language/ja.json

@@ -369,6 +369,9 @@
         "Succeed": "リクエスト送信完了",
         "Failed": "リクエスト送信失敗",
         "sleepSuccessfully": "スリープ完了",
+        "changeSleep": "睡眠を変えるのですか?",
+        "changeSleepSuccess": "変更できました",
+        "isReplenishment": "材料の補充は必要ですか?",
         "open": "OPEN",
         "close": "CLOSE",
         "clickRestart": "炉頭を再稼働します",
@@ -553,6 +556,7 @@
         "equipLocation": "装置の位置",
         "position": "位置情報",
         "viewPositioning": "位置情報を見る",
+        "restartAndroid": "画面を再起動",
         "view": "見る",
         "oneKeyFeed": "ワンタッチ補充",
         "replenishment": "補充",

+ 4 - 0
src/assets/language/zh.json

@@ -370,7 +370,10 @@
     "enableMaterialFailed": "发送失败",
     "Succeed": "请求发送成功",
     "Failed": "请求发送失败",
+    "changeSleep": "是否切换睡眠状态?",
+    "changeSleepSuccess": "切换成功",
     "sleepSuccessfully": "睡眠成功",
+    "isReplenishment": "是否需要补料?",
     "open": "开启",
     "close": "关闭",
     "success": "成功",
@@ -553,6 +556,7 @@
     "equipLocation": "设备位置",
     "position": "定位",
     "viewPositioning": "查看定位",
+    "restartAndroid": "重启触摸屏",
     "view": "查看",
     "oneKeyFeed": "一键补料",
     "replenishment": "补料",

BIN
src/assets/start.png


+ 72 - 69
src/components/NavBar.vue

@@ -33,10 +33,11 @@
     </ul>
   </div> -->
   <!-- <div> -->
-  <van-tabbar route active-color="#4d6add" inactive-color="#404d74">
+  <van-tabbar route active-color="#4d6add" inactive-color="#404d74" class="nav-bar">
     <van-tabbar-item replace to="/home" icon="home-o">{{ $t('navBar.homePage') }}</van-tabbar-item>
-    <van-tabbar-item replace to="/device" :dot="hasAlarm" icon="setting-o">{{ $t('navBar.deviceInformation')}}</van-tabbar-item>
-    <van-tabbar-item replace to="/robotranking" icon="bar-chart-o">{{ $t('navBar.machineRanking')}}</van-tabbar-item>
+    <van-tabbar-item replace to="/device" :dot="hasAlarm" icon="setting-o">{{
+      $t('navBar.deviceInformation') }}</van-tabbar-item>
+    <van-tabbar-item replace to="/robotranking" icon="bar-chart-o">{{ $t('navBar.machineRanking') }}</van-tabbar-item>
     <van-tabbar-item replace to="/user" icon="user-o">{{ $t('navBar.personalCenter') }}</van-tabbar-item>
   </van-tabbar>
   <!-- </div> -->
@@ -76,72 +77,74 @@ export default {
 };
 </script>
 
-<style lang="less" scoped >
+<style lang="less" scoped>
 @import "../common/style/mixin";
 
-// .nav-bar {
-//   position: fixed;
-//   left: 0;
-//   bottom: 0;
-//   width: 100%;
-//   padding: 5px 0;
-//   z-index: 1000;
-//   background: #fff;
-//   transform: translateZ(0);
-//   -webkit-transform: translateZ(0);
-
-//   .nav-list {
-//     width: 100%;
-//     .fj();
-//     flex-direction: row;
-//     padding: 0;
-
-//     .navIconImage {
-//       width: 22px;
-//       height: 22px;
-//     }
-
-//     .dailyImage {
-//       display: inline-block;
-//     }
-
-//     .activeImage {
-//       display: none;
-//     }
-
-//     .nav-list-item {
-//       display: flex;
-//       flex: 1;
-//       flex-direction: column;
-//       text-align: center;
-//       color: #666;
-
-//       &.router-link-active {
-//         color: rgba(77, 106, 221, 1);
-
-//         .dailyImage {
-//           display: none;
-//         }
-
-//         .activeImage {
-//           display: inline-block;
-//         }
-//       }
-
-//       i {
-//         text-align: center;
-//         font-size: 22px;
-//       }
-
-//       span {
-//         font-size: 12px;
-//       }
-
-//       .van-icon-shopping-cart-o {
-//         margin: 0 auto;
-//         margin-bottom: 2px;
-//       }
-//     }
-//   }
-// }
+.nav-bar {
+  //   position: fixed;
+  //   left: 0;
+  //   bottom: 0;
+  //   width: 100%;
+  //   padding: 5px 0;
+  //   z-index: 1000;
+  //   background: #fff;
+  //   transform: translateZ(0);
+  //   -webkit-transform: translateZ(0);
+
+  //   .nav-list {
+  //     width: 100%;
+  //     .fj();
+  //     flex-direction: row;
+  //     padding: 0;
+
+  //     .navIconImage {
+  //       width: 22px;
+  //       height: 22px;
+  //     }
+
+  //     .dailyImage {
+  //       display: inline-block;
+  //     }
+
+  //     .activeImage {
+  //       display: none;
+  //     }
+
+  //     .nav-list-item {
+  //       display: flex;
+  //       flex: 1;
+  //       flex-direction: column;
+  //       text-align: center;
+  //       color: #666;
+
+  //       &.router-link-active {
+  //         color: rgba(77, 106, 221, 1);
+
+  //         .dailyImage {
+  //           display: none;
+  //         }
+
+  //         .activeImage {
+  //           display: inline-block;
+  //         }
+  //       }
+
+  //       i {
+  //         text-align: center;
+  //         font-size: 22px;
+  //       }
+
+  //       span {
+  //         font-size: 12px;
+  //       }
+
+  //       .van-icon-shopping-cart-o {
+  //         margin: 0 auto;
+  //         margin-bottom: 2px;
+  //       }
+  //     }
+  //   }
+  box-shadow: 4px 2px 2px 2px rgba(0, 0, 0, 0.1);
+
+}
 </style>

+ 2 - 0
src/components/dateSelectList/index.less

@@ -6,6 +6,8 @@
     width: calc(100% - 30px);
     margin: 0 auto;
     position: relative;
+    box-shadow: 0 2px 4px 2px rgba(0, 0, 0, 0.1);
+
 
     .timeTabBox {
       display: flex;

+ 5 - 0
src/service/device/index.js

@@ -220,4 +220,9 @@ export function queryLog(params) {
 // 远程锁机
 export function updateLockStatus(params) {
     return axios.get(`/SZWL-SERVER/tEquipment/updateLockStatus`, { params })
+}
+
+// 重启触摸屏
+export function restartScreen(params) {
+    return axios.get(`/SZWL-SERVER/tEquipment/openScreen`, { params })
 }

+ 6 - 2
src/styles/advertManage/index.less

@@ -77,15 +77,19 @@
 
         .adList {
             display: flex;
-            width: 90%;
-            margin: 1.5em auto;
+            // width: 100%;
+            // margin: 10px auto;
+            padding: 10px 25px;
             overflow: hidden;
             align-items: center;
+            height: 120px;
 
             .adImg {
                 width: 100px;
                 height: 100px;
                 border-radius: 10px;
+                box-shadow: 2px 2px 10px 5px rgba(0, 0, 0, 0.1);
+
             }
 
             .adInfoBox {

+ 0 - 5
src/styles/device/index.less

@@ -219,11 +219,6 @@
               display: flex;
               align-items: center;
 
-              .word10 {
-                width: 65%
-                // display: block;
-              }
-
               .word2 {
                 width: 75%;
                 padding: 0 0;

+ 6 - 6
src/styles/home/index.less

@@ -2,12 +2,11 @@
   .homeBox {
     width: 100%;
     height: calc(100% - 50px);
-    padding-bottom: 10px;
     overflow: auto;
 
     .intervalRow {
       width: 100%;
-      height: 10px;
+      height: 5px;
       background-color: #f5f5f5;
     }
 
@@ -394,11 +393,12 @@
         } */
 
         .mod7 {
-          height: 1.5rem;
-          width: 1.5rem;
+          height: 50px;
+          width: 50px;
           margin: 0 auto;
           align-items: center;
           justify-content: center;
+
         }
 
         .TextGroup14 {
@@ -409,10 +409,10 @@
             // height: 14px;
             overflow-wrap: break-word;
             color: rgba(135, 135, 166, 1);
-            font-size: 0.4rem;
+            font-size: 14px;
             text-align: center;
             // white-space: nowrap;
-            line-height: 0.4rem;
+            line-height: 15px;
             display: block;
           }
         }

+ 1 - 1
src/styles/merchantManage/index.less

@@ -80,7 +80,7 @@
                 background-color: rgba(255, 255, 255, 1);
                 border-radius: 4px;
                 height: 250px;
-                margin: 0 auto;
+                margin: 0 10px;
                 margin-bottom: 20px;
                 // width: 100%;
 

+ 7 - 7
src/styles/orderCenter/index.less

@@ -144,7 +144,7 @@
       // width: 100%;
       background: rgba(255, 255, 255, 1) url("../../assets/home/line.png") bottom center no-repeat;
       background-color: #fff;
-      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
+      box-shadow: 0 2px 2px 2px rgba(0, 0, 0, 0.1);
 
 
       .main9 {
@@ -235,9 +235,9 @@
 
       .section5 {
         // width: 100%;
-        height: 170px;
+        height: 160px;
         position: relative;
-        padding: 10px 10px;
+        padding: 5px 10px;
         background-color: #ffffff;
 
         .van-card {
@@ -246,7 +246,7 @@
           display: flex;
           align-items: center;
           border-radius: 20px;
-          box-shadow: 5px 5px 5px 2px rgba(0, 0, 0, 0.1);
+          box-shadow: 0 2px 5px 3px rgba(0, 0, 0, 0.1);
 
         }
 
@@ -317,7 +317,7 @@
             // height: 16px;
             overflow-wrap: break-word;
             color: rgba(77, 193, 147, 1);
-            font-size: 13px;
+            font-size: 15px;
             font-family: PingFangSC-Semibold;
             text-align: center;
             white-space: nowrap;
@@ -332,7 +332,7 @@
             // width: auto;
             overflow-wrap: break-word;
             color: rgba(77, 193, 147, 1);
-            font-size: 13px;
+            font-size: 18px;
             font-family: PingFangSC-Semibold;
             text-align: left;
             white-space: nowrap;
@@ -348,7 +348,7 @@
           // height: 0.325rem;
           overflow-wrap: break-word;
           color: rgba(229, 154, 109, 1);
-          font-size: 10px;
+          font-size: 11px;
           font-family: PingFangSC-Medium;
           text-align: left;
           white-space: nowrap;

+ 37 - 18
src/views/advertManage/index.vue

@@ -2,6 +2,7 @@
   <!-- 广告管理 -->
   <div class="advertPage flex-col">
     <s-header :name="$t('advertManage.advertisingManagement')" :noback="false"></s-header>
+    <!-- <video ref="video" id="video" controls></video> -->
     <div class="advertBox flex-col">
       <van-list v-model:loading="loading" v-model:error="error" error-text="{{$t('advertManage.requestFailed')}}"
         :finished="finished" finished-text="{{$t('advertManage.noMore')}}" offset="300" :immediate-check="false"
@@ -26,7 +27,7 @@
             <div class="flex-row justify-between bd3">
               <div class="flex-col outer4"></div>
               <span class="flex-col txt2 o-ml-10">{{ $t("advertManage.total")
-              }}<span class="discountNumber">{{ adTotal }}</span>{{ $t("advertManage.ads") }}</span>
+                }}<span class="discountNumber">{{ adTotal }}</span>{{ $t("advertManage.ads") }}</span>
             </div>
           </div>
           <div class="flex-col">
@@ -47,32 +48,32 @@
           </div>
         </div>
         <div class="l-flex-between" v-for="(item, index) in adList" :key="index">
-          <div class="adList" @click="adUpdate(item)">
-            <img class="adImg o-mr-10" :src="isAdImgUrl(item)" />
+          <div class="adList">
+            <img class="adImg o-mr-10" :src="isAdImgUrl(item)"  @click="loadVideo(item)" />
             <div class="adInfoBox c-text-12">
               <div class="adTitle c-text-15 c-text-color o-mb-14">
                 {{ item.name }}
               </div>
-              <div class="adRow">
+              <div class="adRow" @click="adUpdate(item)">
                 <span class="adLeft">{{ $t("advertManage.locationType") }}:</span>{{
-                  item.locationType === 0
-                  ? $t("advertManage.advertising")
-                  : $t("advertManage.externalAdvertising")
-                }}
+      item.locationType === 0
+        ? $t("advertManage.advertising")
+        : $t("advertManage.externalAdvertising")
+    }}
               </div>
               <div class="adRow">
                 <span class="adLeft">{{ $t("advertManage.advertisingPosition") }}:</span>{{
-                  item.screenType === 0
-                  ? $t("advertManage.screenA")
-                  : $t("advertManage.screenB")
-                }}
+      item.screenType === 0
+        ? $t("advertManage.screenA")
+        : $t("advertManage.screenB")
+    }}
               </div>
               <div class="adRow">
                 <span class="adLeft">{{ $t("advertManage.advertisingType") }}:</span>{{
-                  item.adType === 0
-                  ? $t("advertManage.picture")
-                  : $t("advertManage.video")
-                }}
+      item.adType === 0
+        ? $t("advertManage.picture")
+        : $t("advertManage.video")
+    }}
               </div>
               <div class="adRow">
                 <span class="adLeft">{{ $t("advertManage.creationTime") }}:</span>{{ showDateTime(item.createDate) }}
@@ -90,6 +91,10 @@
       :confirmBtnTxt="$t('advertManage.confirmDel')" ref="kDialogRef" :dialogContent="$t('advertManage.delPopContent')"
       @confirmclk="confirmClk">
     </kDialog>
+    <van-popup v-model:show="showVideo" style="width: 85vw; height: 50vw; overflow-y: hidden">
+      <video ref="video" id="video" controls style="width: 85vw; height: 50vw;" :src="videoUrl"></video>
+      <!-- 内容 -->
+    </van-popup>
   </div>
 </template>
 
@@ -109,6 +114,8 @@ export default {
   setup() {
     const { t } = useI18n();
     // 删除确认弹窗
+    const showVideo = ref(false);
+    const videoUrl = ref('');
     const kDialogRef = ref(null);
     const confirmClk = () => {
       const ids = [];
@@ -121,7 +128,6 @@ export default {
         ids,
       };
       Api_getDelAd(param).then((res) => {
-        console.log(res);
         if (res.data.code === '00000') {
           isDelete.value = false;
           showToast(res.data.message);
@@ -174,6 +180,7 @@ export default {
       }
     };
     // 获取广告列表
+    // const videoRef = ref(null);
     const getAdListFun = async () => {
       const params = Object.assign({}, searchParams);
       const { data } = await getAdList(params);
@@ -194,8 +201,17 @@ export default {
         showFailToast(data.message);
       }
     };
+    // const videoRef = ref(null);
+    const loadVideo = (item) => {
+      console.log("item>>", item);
+      showVideo.value = true;
+      videoUrl.value = item.url;
+    };
+
+
     const isAdImgUrl = (item) => {
-      return item.adType === 1 ? item.mediaPreview : item.url;
+      return item.adType === 1 ? (item.mediaPreview ? item.mediaPreview : require('../../assets/start.png')) : item.url;
+      // return require('../../assets/start.png');
     };
     const showDateTime = (date) => {
       return date
@@ -259,6 +275,9 @@ export default {
       noticeClk,
       kDialogRef,
       confirmClk,
+      showVideo,
+      loadVideo,
+      videoUrl,
     };
   },
 };

+ 38 - 8
src/views/device/deviceOper.vue

@@ -19,7 +19,8 @@
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/restart.png" />
         </div>
-        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{ $t("device.restartFurnaceHead") }}</div>
+        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{
+    $t("device.restartFurnaceHead") }}</div>
         <div v-else class="operText">{{ $t("device.restart") }}</div>
       </div>
       <!-- 睡眠 -->
@@ -35,7 +36,8 @@
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/onOff.png" />
         </div>
-        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{ $t("device.openFurnHead") }}</div>
+        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{
+    $t("device.openFurnHead") }}</div>
         <div v-else class="operText">{{ $t("device.openDevice") }}</div>
       </div>
       <!-- 关闭炉头/设备 -->
@@ -43,7 +45,8 @@
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/onOff.png" />
         </div>
-        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{ $t("device.closeFurnHead") }}</div>
+        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{
+    $t("device.closeFurnHead") }}</div>
         <div v-else class="operText">{{ $t("device.closeDevice") }}</div>
       </div>
       <!--     <div class="operItem" @click="openDoorFun()">
@@ -68,7 +71,8 @@
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/doSugar.png" />
         </div>
-        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{ $t("device.remoteSugarMaking") }}</div>
+        <div v-if="device.machineType === '0' || device.machineType === null" class="operText">{{
+    $t("device.remoteSugarMaking") }}</div>
         <div v-else class="operText">{{ $t("device.remoteProduction") }}</div>
       </div>
       <!-- 定时开关 -->
@@ -133,7 +137,8 @@
         <div class="operText">{{ $t("device.showGoods") }}</div>
       </div>
       <!-- DIY花型 -->
-      <div class="operItem" v-if="device.equimentType == 'MG320' || device.equimentType == 'MG330'" @click="diyFlowerClk()">
+      <div class="operItem" v-if="device.equimentType == 'MG320' || device.equimentType == 'MG330'"
+        @click="diyFlowerClk()">
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/diyFlower.png" />
         </div>
@@ -174,6 +179,13 @@
         </div>
         <div class="operText">{{ $t("device.lockDevice") }}</div>
       </div>
+      <!-- 远程重启触摸屏 -->
+      <div v-if="user.type < 2" class="operItem" @click="restartAndroid()">
+        <div class="operIcon">
+          <img class="operImg" src="../../assets/device/operIcon/restartAndroid.png" />
+        </div>
+        <div class="operText">{{ $t("device.restartAndroid") }}</div>
+      </div>
       <!-- 查看定位 -->
       <!-- <div class="operItem" @click="viewPosiClk()">
         <div class="operIcon">
@@ -189,8 +201,8 @@
     <div class="operCheckBox">
       <div class="block5 flex-col"></div>
       <span class="word10">{{
-        $t("device.pleaseConfirmAgainWhetherToOperate")
-      }}</span>
+    $t("device.pleaseConfirmAgainWhetherToOperate")
+  }}</span>
       <div class="block6 flex-row justify-between">
         <div class="mod7 flex-col" @click="operCheckClear()">
           <span class="info5">{{ $t("device.IllThinkAboutItAgain") }}</span>
@@ -214,6 +226,7 @@ import {
   delOneDevice,
   enableMaterial,
   updateLockStatus,
+  restartScreen,
 } from "../../service/device";
 import { showFailToast, showSuccessToast } from "vant";
 import { useRouter } from "vue-router";
@@ -386,6 +399,10 @@ export default {
       operType.value = 8;
       operCheckShow.value = true;
     };
+    const restartAndroid = () => {
+      operType.value = 9;
+      operCheckShow.value = true;
+    };
     // 取消操作
     const operCheckClear = () => {
       operCheckShow.value = false;
@@ -478,7 +495,7 @@ export default {
       }
       // 启用物料监控
       if (operType.value === 7) {
-        
+
         let materialMonitorStatus = 0; // 0默认是未开启
         // isMaterialUse是1时,物料监控已启用,按钮是关闭功能
         if (device.value.isMaterialUse === "1") {
@@ -508,6 +525,18 @@ export default {
           showFailToast(t("device.Failed"));
         }
       }
+      // 重启触摸屏
+      if (operType.value === 9) {
+        const { data } = await restartScreen({
+          equipmentId: device.value.id,
+        });
+        if (data.code === '00000') {
+          showSuccessToast(t("device.Succeed"));
+          operCheckShow.value = false;
+        } else {
+          showFailToast(t("device.Failed"));
+        }
+      }
       setTimeout(() => {
         // 关闭弹窗
         show.value = false;
@@ -549,6 +578,7 @@ export default {
       viewLogs,
       deleteDevice,
       lockDevice,
+      restartAndroid,
       // viewPosiClk,
       changePasswordClk,
       sleepIcon,

+ 47 - 30
src/views/device/editAdRule/index.vue

@@ -1,33 +1,37 @@
 <template>
   <div class="tagSetIdx">
     <s-header :name="$t('device.editAdRule.title')" :noback="false"></s-header>
-    <div class="o-p-10 cust_vantBorder">
-      <div class="l-flex-between kBordBott o-pb-20">
-        <div class="c-border o-ptb-10 o-plr-12 l-flex-RC l-flex-w o-w" style="padding-bottom: 0; min-height: 36px; width: 74%;">
-          <div class="c-border l-flex-RC o-p-3 c-color-f o-mr-10 o-mb-10"
-            style="background: #e59a6d; border: 1px solid #e59a6d" v-for="(item, index) in tagList" :key="index">
+    <div class="cust_vantBorder">
+      <div class="o-p-10 l-flex-between kBordBott">
+        <div class="ruleList l-flex-RC">
+          <div class="ruleItem l-flex-RC" style="background: #e59a6d; border: 1px solid #e59a6d"
+            v-for="(item, index) in tagList" :key="index">
             <span class="o-mr-3">{{ item.name }}</span>
             <van-icon @click.stop="delTag(item, index)" name="clear" />
           </div>
         </div>
-        
-        <div @click="submitClk" class="submitBtn">
-          <van-button type="primary">{{
-            $t("device.editAdRule.submitPush")
-          }}</van-button>
+        <div @click="submitClk" class="submitBtn o-ml-5">
+          <van-button round type="primary" size="small" style="padding: 20px 10px;">{{
+      $t("device.editAdRule.submitPush")
+    }}</van-button>
         </div>
       </div>
-      <van-field colon :border="false" v-model="cofficentForm.name" clearable
+      <van-field :border="false" v-model="cofficentForm.name" clearable
         :placeholder="$t('device.editAdRule.ruleNamePlace')" :label="$t('device.editAdRule.ruleName')" />
       <div class="l-flex-center" style="margin: 16px">
-        <van-button round class="searchBtn" type="primary" size="large" @click="toSearch">
+        <van-button round class="searchBtn" type="primary" @click="toSearch" style="padding: 20px 50px;">
           {{ $t("advertManage.advertRule.addRule.search") }}
         </van-button>
       </div>
-      <div class="o-mt-30">
+      <div class="o-mt-30 o-ml-10">
         <div class="l-flex-RC l-flex-w">
-          <div @click="addAllTag(item)" class="c-border l-flex-RC o-p-3 c-color-f o-mr-10 o-mb-10"
-            style="background: #e59a6d; border: 1px solid #e59a6d" v-for="(item, index) in allTagList" :key="index">
+          <div
+              @click="addAllTag(item)"
+              class="c-border l-flex-RC o-p-3 c-color-f o-mr-10 o-mb-10"
+              style="background: #e59a6d; border: 1px solid #e59a6d"
+              v-for="(item, index) in allTagList"
+              :key="index"
+          >
             <span class="o-mr-3">{{ item.name }}</span>
           </div>
         </div>
@@ -116,25 +120,38 @@ export default {
 
 <style lang="less" scoped>
 .tagSetIdx {
-  height: calc(100%-44px);
-  overflow: hidden;
-  overflow-y: auto;
+  // height: calc(100%-44px);
+  // overflow: hidden;
+  // overflow-y: auto;
+  // .submitBtn {
+  //   flex: 0 0 80px;
 
-  .submitBtn {
-    flex: 0 0 80px;
+  //   :deep(.van-button--round) {
+  //     width: 100%;
+  //   }
+  // }
 
-    :deep(.van-button) {
-      width: 100%;
-    }
-  }
+  // .searchBtn {
+  //   width: 50%;
+  // }
 
-  .searchBtn {
-    width: 50%;
-  }
+  // .van-button--primary {
+  //   background-color: #4d6add;
+  //   border-color: #4d6add;
+  // }
 
-  .van-button--primary {
-    background-color: #4d6add;
-    border-color: #4d6add;
+  .ruleList {
+    border-radius: 2px;
+    border: 1px solid #B9BAD0;
+    padding: 10px;
+    width: 65%;
+    box-sizing: content-box;
+
+    .ruleItem {
+      padding: 4px;
+      border-radius: 5px;
+      color: #FFFFFF;
+    }
   }
 }
 </style>

+ 94 - 98
src/views/device/index.vue

@@ -36,17 +36,13 @@
                 <div @click="eqeStatusClk(1)" class="TextGroup3 flex-col">
                   <div class="group1 flex-col justify-between align-center">
                     <span class="word4">{{ equipStatus.machineUseNum }}</span>
-                    <span class="info1">{{
-        $t("device.totalNumberOfRuns")
-      }}</span>
+                    <span class="info1">{{ $t("device.totalNumberOfRuns") }}</span>
                   </div>
                 </div>
                 <div @click="eqeStatusClk('')" class="TextGroup3 flex-col">
                   <div class="group1 flex-col justify-between align-center">
                     <span class="word4">{{ equipStatus.machineTotalNum }}</span>
-                    <span class="info1">{{
-        $t("device.totalNumberOfEquipment")
-      }}</span>
+                    <span class="info1">{{ $t("device.totalNumberOfEquipment") }}</span>
                   </div>
                 </div>
               </div>
@@ -70,88 +66,44 @@
                       <span class="txt1">{{ item.name == null ? item.clientId.slice(-6) : item.name }}</span>
                     </div>
                   </div>
-                  <!-- <div class="l-flex-RC"> -->
-                  <!-- <div v-if="item.hasTodayAlarm" class="l-flex-between o-pl-5">
-                      <div class="box4 flex-col"></div>
-                      <span class="o-pl-2" style="color: #fe5d55">{{ $t("device.alarmClock") }}</span>
-                    </div> -->
                   <div v-if="item.hasTodayAlarm" :class="{ 'flash-icon': showAlert }" class="box4 o-mr-5"></div>
-                  <div v-if="!item.hasTodayAlarm" class="layer2 o-mr-5" :class="{
-        deviceOn: item.eqeStatus === 1,
-        layerLeft: item.hasTodayAlarm,
-      }"></div>
-                  <!-- </div> -->
+                  <div v-if="!item.hasTodayAlarm" class="layer2 o-mr-5"
+                    :class="{ deviceOn: item.eqeStatus === 1, layerLeft: item.hasTodayAlarm, }"></div>
                 </div>
                 <!-- 所属商家 -->
-                <span class="txt1 o-mt-10">{{ $t("device.affiliatedMerchants") }}:{{
-        item.adminUserName
-      }}</span>
+                <span class="txt1 o-mt-10">{{ $t("device.affiliatedMerchants") }}:{{ item.adminUserName }}</span>
                 <!-- 机器编码 -->
-                <span class="txt1 o-mt-10">{{ $t("device.machineUniqueCode") }}:{{
-        item.clientId
-      }}</span>
+                <span class="txt1 o-mt-10">{{ $t("device.machineUniqueCode") }}:{{ item.clientId }}</span>
                 <!-- 锁机状态 -->
-                <span v-if="user.type < 1" class="txt1 o-mt-10">{{ $t("device.lockCondition") }}:{{
-        item.isBlocked ? $t("device.lockState") : $t("device.unLockState")
-      }}</span>
+                <span v-if="user.type < 1" class="txt1 o-mt-10">
+                  {{ $t("device.lockCondition") }}:{{ item.isBlocked ? $t("device.lockState") : $t("device.unLockState")
+                  }}
+                </span>
                 <img v-if="item.checkType" class="pic1" referrerpolicy="no-referrer" src="../../assets/home/line.png" />
                 <div class="contentBottomCon" v-if="item.checkType">
                   <!-- 睡眠状态 -->
                   <div class="contentWord kBordBott">
-                    <span class="">{{ $t("device.sleepState") }}:{{
-        item.isSleep
-          ? $t("device.sleeping")
-          : $t("device.notSleeping")
-      }}</span>
-                    <!-- <van-switch v-model="checked" disabled /> -->
-
+                    <span class="o-mr-10">{{ $t("device.sleepState") }}:{{ item.isSleep ? $t("device.sleeping") :
+        $t("device.notSleeping") }}</span>
+                    <van-switch :model-value="item.isSleep"  size="23px" @click="changeSleep(item)" />
                   </div>
-                  <!-- <div v-if="item.isSleep" class="layer3 o-ptb-7">
-                    <span class="word1">
-                      <div v-if="!sleepDescBoxShow">
-                        <van-field colon center class="word2" v-model="item.sleepDesc"
-                          :placeholder="$t('device.sleepDescPlace')" :label="$t('device.sleepDesc')" label-width="auto">
-                          <template #button class="button_1">
-                            <van-button size="small" type="primary" @click="sleepDescChg(item.sleepDesc, item.id)">{{
-                              $t("device.confirm") }}
-                            </van-button>
-                            <van-button size="small" type="primary" @click="editSleepDesc()">{{ $t("device.cancel")
-                            }}</van-button>
-                          </template>
-                        </van-field>
-                      </div>
-                      <div v-else>
-                        <span class="word3 o-pr-10">{{ $t("device.sleepDesc") }}:</span>
-                        <span class="word3">{{ item.sleepDesc == null ? $t("device.SuspendBusiness") :
-                          item.sleepDesc }}</span>
-                        <van-icon name="edit" size="18" class="editIcon" @click="editSleepDesc()" />
-                      </div>
-                    </span>
-                  </div> -->
+                  <!-- 睡眠描述 -->
                   <div v-if="item.isSleep" class="contentWord kBordBott">
                     <span class="">{{ $t("device.sleepDesc") }}:</span>
-                    <!-- <div v-if="!sleepDescBoxShow" class="container l-flex-RC"> -->
                     <van-field colon center class="word2" v-model="item.sleepDesc" v-if="!sleepDescBoxShow"
                       :placeholder="$t('device.sleepDescPlace')" label-width="auto">
                       <template #button class="button_1">
-                        <van-button type="primary" @click="sleepDescChg(item.sleepDesc, item.id)">{{
-        $t("device.confirm") }}
+                        <van-button type="primary" @click="sleepDescChg(item.sleepDesc, item.id)">
+                          {{ $t("device.confirm") }}
                         </van-button>
-                        <van-button type="primary" @click="editSleepDesc()">{{ $t("device.cancel")
-                          }}</van-button>
+                        <van-button type="primary" @click="editSleepDesc()">{{ $t("device.cancel") }}</van-button>
                       </template>
                     </van-field>
-                    <!-- <div class="l-flex-RC">
-                        </div> -->
-                    <!-- </span> -->
-                    <!-- </div> -->
-                    <!-- <div v-else class="container l-flex-RC"> -->
-                    <span class="word10 l-flex-RC" v-if="sleepDescBoxShow">{{ item.sleepDesc == null ?
-        $t("device.SuspendBusiness") :
-        item.sleepDesc }}
-                      <van-icon name="edit" size="18" class="editIcon o-pl-5" @click="editSleepDesc()" />
-                    </span>
-                    <!-- </div> -->
+                    <div class="l-flex-RC" v-else>
+                      <span class="o-mr-10">{{ item.sleepDesc == null ? $t("device.SuspendBusiness") : item.sleepDesc
+                        }}</span>
+                      <van-button type="primary" @click="editSleepDesc()">{{ $t("device.modify") }}</van-button>
+                    </div>
                   </div>
                   <span v-if="item.machineType == null || item.machineType == '0'"
                     class="contentWord kBordBott l-flex-RC">
@@ -160,16 +112,11 @@
                   </span>
                   <!-- 炉头状态 -->
                   <div class="contentWord kBordBott" v-if="item.machineType == null || item.machineType == '0'">
-                    <!-- <div> -->
-                    <!-- <span class="word3 o-pr-5" v-if="item.machineType == '0' || item.machineType == null">{{
-                        $t("device.furnHeadStatus") }}: </span>
-                      <span class="word3 o-pr-5" v-else>{{ $t("device.deviceStatus") }}: </span> -->
-                    <span>{{ (item.machineType == '0' || item.machineType == null) ? $t("device.furnHeadStatus") :
+                    <span>
+                      {{ (item.machineType == '0' || item.machineType == null) ? $t("device.furnHeadStatus") :
         $t("device.deviceStatus") }}:
-                      {{ item.eqeStatus === 1 ? $t("device.opened") : $t("device.closed") }}</span>
-                    <!-- <span>{{ item.eqeStatus === 1 ? $t("device.opened") : $t("device.closed") }} -->
-                    <!-- </span> -->
-                    <!-- </div> -->
+                      {{ item.eqeStatus === 1 ? $t("device.opened") : $t("device.closed") }}
+                    </span>
                     <div class="o-ml-10">
                       <van-button @click="openCloseHead(item.id, 1)" type="primary">{{ $t("device.open") }}</van-button>
                       <van-button @click="openCloseHead(item.id, 0)" type="primary">{{ $t("device.close")
@@ -277,16 +224,16 @@
           : $t("device.alarmContentNoData")
       }}
                     </span>
-                    <van-button v-if="item.alarmList && item.alarmList[0] && item.alarmList[0].alarmContent" style="flex-shrink: 0; margin: 0;"
-                      type="primary" color="#07c160" :text="$t('device.eliminateAlarm')"
-                      @click="clearAlarm(item.alarmList[0], item)"></van-button>
+                    <van-button v-if="item.alarmList && item.alarmList[0] && item.alarmList[0].alarmContent"
+                      style="flex-shrink: 0; margin: 0;" type="primary" color="#07c160"
+                      :text="$t('device.eliminateAlarm')" @click="clearAlarm(item.alarmList[0], item)"></van-button>
                     <!-- </div> -->
                   </div>
                   <div class="editDeviceBtnCon l-flex-center o-mt-10">
                     <div class="l-flex-RC" @click="deviceSet(item)">
                       <span class="c-text-14">{{
-                        $t("device.editDevice")
-                        }}</span>
+        $t("device.editDevice")
+      }}</span>
                       <div class="box2 flex-col"></div>
                     </div>
                     <div class="l-flex-RC" @click="deviceOprShow(item)">
@@ -327,7 +274,7 @@ import {
   Api_postMachineNum,
 } from "../../service/home";
 import { onMounted, reactive, toRefs, ref, onActivated } from "vue";
-import { showFailToast, showSuccessToast, showToast, showDialog, showConfirmDialog } from "vant";
+import { showFailToast, showSuccessToast, showToast, showConfirmDialog } from "vant";
 // import navBar from "../../components/NavBar";
 import sHeader from "../../components/SimpleHeader";
 import { getLoginUser, Format_calcuDecial, styleUrl } from "../../common/js/utils";
@@ -337,6 +284,7 @@ import {
   Api_getReplenishment,
   changeSleepDesc,
   setFurnace,
+  sleepEquipment,
 } from "../../service/device/index";
 import deviceSearch from "./deviceSearch";
 import deviceOper from "./deviceOper";
@@ -570,20 +518,39 @@ export default {
 
     // 点击补料
     const replenishmentClk = (row) => {
-      console.log("row >>>", row);
-      Api_getReplenishment({ equipmentId: row.id }).then((res) => {
-        console.log("res >>>", res);
-        // Toast(res.data.message);
-        showDialog({
-          message: t('device.sentSuccessfully'),
-        }).then(() => {
-          //返回上一页
-          router.go(0);
+      // console.log("row >>>", row);
+      showConfirmDialog({
+        title: t('user.tips'),
+        message: t('device.isReplenishment'),
+      }).then(async () => {
+        const { data } = await Api_getReplenishment({
+          equipmentId: row.id
         });
-        setTimeout(() => {
-          getList();
-        }, 500);
-      });
+        if (data.code) {
+          showSuccessToast(t("device.sentSuccessfully")); 
+          setTimeout(() => {
+            // router.go(0);
+            init();
+          }, 1500);
+        } else {
+          showFailToast(data.message);
+        }
+      }).catch(() => {
+        return;
+      })
+      // Api_getReplenishment({ equipmentId: row.id }).then((res) => {
+      //   console.log("res >>>", res);
+      //   // Toast(res.data.message);
+      //   showDialog({
+      //     message: t('device.sentSuccessfully'),
+      //   }).then(() => {
+      //     //返回上一页
+      //     router.go(0);
+      //   });
+      //   setTimeout(() => {
+      //     getList();
+      //   }, 500);
+      // });
     };
     // 操作弹窗完成的回调
     const operFinish = () => {
@@ -657,6 +624,34 @@ export default {
       }
     }
 
+    // 睡眠切换
+    const changeSleep = (item) => {
+      let eqeStatus = 1;
+      showConfirmDialog({
+        title: t('user.tips'),
+        message: t("device.changeSleep"),
+      }).then(async () => {
+        if (item.isSleep) {
+          eqeStatus = 0;
+        }
+        const { data } = await sleepEquipment({
+          equipmentId: item.id,
+          eqeStatus,
+        });
+        if (data.code) {
+          showSuccessToast(t("device.changeSleepSuccess"));
+          setTimeout(() => {
+            // router.go(0);
+            init();
+          }, 1000);
+        } else {
+          showFailToast(data.message);
+        }
+      }).catch(() => {
+        return;
+      })
+    };
+
     // 重启炉头
     const restartHead = (id) => {
       showConfirmDialog({
@@ -731,6 +726,7 @@ export default {
       editSleepDesc,
       sleepDescBoxShow,
       sleepDescChg,
+      changeSleep,
       backTop,
       user,
       labelList,