cz 1 year ago
parent
commit
b821b817c4

+ 23 - 44
src/views/JXSK/mes/forward/add.vue

@@ -1,77 +1,49 @@
 <template>
   <div class="form" style="padding-bottom: 60px">
-    <van-nav-bar
-      :title="$t('forward.name')"
-      :left-text="$t('common.back')"
-      left-arrow
-      @click-left="onClickLeft"
-    >
+    <van-nav-bar :title="$t('forward.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft">
     </van-nav-bar>
-    <testForm
-      v-model="formData.data"
-      :formOption="formOption"
-      :formConfig="formConfig"
-      :rules="rules"
-      @onSubmit="onSubmit"
-      @otherBtnClick="otherBtnClick"
-      ref="formDom"
-    >
+    <testForm v-model="formData.data" :formOption="formOption" :formConfig="formConfig" :rules="rules" @onSubmit="onSubmit"
+              @otherBtnClick="otherBtnClick" ref="formDom">
       <template #productRemark>
         <div style="width: 100%">
           {{ formData.data.productRemark }}
         </div>
       </template>
       <template #fileOne>
-        <div
-          style="width: 100%"
-          v-if="
+        <div style="width: 100%" v-if="
             formData.data.fileListOne && formData.data.fileListOne.length > 0
-          "
-        >
-          <span
+          ">
+          <!-- <span
             v-for="item in formData.data.fileListOne"
             :key="item.id"
             @click="onPreviewFile(item)"
             style="margin-right: 10px; cursor: pointer; color: #409eff"
           >
             {{ item.name }}
-          </span>
+          </span> -->
+          <img :src="item.url" alt="" class="pic">
         </div>
         <div style="width: 100%" v-else>无</div>
       </template>
 
       <template #fileTwo>
-        <div
-          style="width: 100%"
-          v-if="
+        <div style="width: 100%" v-if="
             formData.data.fileListTwo && formData.data.fileListTwo.length > 0
-          "
-        >
-          <span
-            v-for="item in formData.data.fileListTwo"
-            :key="item.id"
-            @click="onPreviewFile(item)"
-            style="margin-right: 10px; cursor: pointer; color: #409eff"
-          >
+          ">
+          <span v-for="item in formData.data.fileListTwo" :key="item.id" @click="onPreviewFile(item)"
+                style="margin-right: 10px; cursor: pointer; color: #409eff">
             {{ item.name }}
           </span>
         </div>
         <div v-else>无</div>
       </template>
       <template #fileThree>
-        <div
-          style="width: 100%"
-          v-if="
+        <div style="width: 100%" v-if="
             formData.data.fileListThree &&
             formData.data.fileListThree.length > 0
-          "
-        >
-          <span
-            v-for="item in formData.data.fileListThree"
-            :key="item.id"
-            @click="onPreviewFile(item)"
-            style="margin-right: 10px; cursor: pointer; color: #409eff"
-          >
+          ">
+          <span v-for="item in formData.data.fileListThree" :key="item.id" @click="onPreviewFile(item)"
+                style="margin-right: 10px; cursor: pointer; color: #409eff">
             {{ item.name }}
           </span>
         </div>
@@ -445,4 +417,11 @@ const onPreviewFile = (item) => {
     text-align: center;
   }
 }
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
 </style>

+ 7 - 34
src/views/JXSK/mes/forward/index.vue

@@ -1,48 +1,21 @@
 <template>
-  <van-nav-bar
-    :title="$t('forward.name')"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-    @click-right="onClickRight"
-  >
-    <template #right>
+  <van-nav-bar :title="$t('forward.name')" left-text="" left-arrow @click-left="onClickLeft">
+    <!-- <template #right>
       <div v-show="!isShowVideo">扫码</div>
       <div v-show="isShowVideo">关闭</div>
-    </template>
+    </template> -->
   </van-nav-bar>
-  <van-search
-    v-model="req.keyword"
-    :placeholder="$t('common.pleaseEnterKeywords')"
-    @search="onRefresh"
-  />
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
 
   <van-pull-refresh v-model="loading" @refresh="onRefresh">
     <div class="list">
-      <van-list
-        v-model:loading="loading"
-        :finished="finished"
-        :finished-text="$t('common.noMore')"
-        @load="onLoad"
-        style="margin-bottom: 60px"
-      >
-        <commonList
-          :data="listData"
-          :config="listConfig"
-          :showMore="true"
-          @onClick="toDtl"
-        ></commonList>
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" :config="listConfig" :showMore="true" @onClick="toDtl"></commonList>
       </van-list>
     </div>
   </van-pull-refresh>
 
-  <video
-    ref="video"
-    id="video"
-    class="scan-video"
-    autoplay
-    v-show="isShowVideo"
-  ></video>
+  <video ref="video" id="video" class="scan-video" autoplay v-show="isShowVideo"></video>
 </template>
 <script setup>
 import { ref, getCurrentInstance, onMounted } from "vue";

+ 14 - 46
src/views/login.vue

@@ -1,39 +1,16 @@
 <template>
   <div class="login">
     <div class="login-header">
-      <img
-        class="logo"
-        :style="VUE_APP_USERNAME == 'smt' ? 'width:200px;height:200px' : ''"
-        :src="VUE_APP_USERNAME == 'smt' ? smtLogo : logo"
-      />
+      <img class="logo" :style="VUE_APP_USERNAME == 'smt' ? 'width:200px;height:200px' : ''" :src="VUE_APP_USERNAME == 'smt' ? smtLogo : logo" />
       <h2 v-if="VUE_APP_USERNAME != 'smt'">{{ $t("login.title") }}</h2>
     </div>
     <div class="login-form">
-      <van-field
-        v-model="loginForm.tenantId"
-        name=""
-        label=""
-        :placeholder="$t('login.form.tenantId')"
-        :rules="[{ required: true, message: $t('login.form.tenantId') }]"
-        autocomplete="off"
-      />
-      <van-field
-        v-model="loginForm.username"
-        name=""
-        label=""
-        :placeholder="$t('login.form.username')"
-        :rules="[{ required: true, message: $t('login.form.username') }]"
-        autocomplete="off"
-      />
-      <van-field
-        v-model="loginForm.password"
-        type="password"
-        name=""
-        label=""
-        :placeholder="$t('login.form.password')"
-        :rules="[{ required: true, message: $t('login.form.password') }]"
-        autocomplete="off"
-      />
+      <van-field v-model="loginForm.tenantId" name="" label="" :placeholder="$t('login.form.tenantId')"
+                 :rules="[{ required: true, message: $t('login.form.tenantId') }]" autocomplete="off" />
+      <van-field v-model="loginForm.username" name="" label="" :placeholder="$t('login.form.username')"
+                 :rules="[{ required: true, message: $t('login.form.username') }]" autocomplete="off" />
+      <van-field v-model="loginForm.password" type="password" name="" label="" :placeholder="$t('login.form.password')"
+                 :rules="[{ required: true, message: $t('login.form.password') }]" autocomplete="off" />
 
       <van-form @submit="onSubmit">
         <van-cell-group inset> </van-cell-group>
@@ -63,19 +40,10 @@
         </div>
       </div>
     </div>
-    <van-dialog
-      v-model:show="langModal"
-      title="选择语言"
-      show-cancel-button
-      @confirm="changeLang"
-    >
+    <van-dialog v-model:show="langModal" title="选择语言" show-cancel-button @confirm="changeLang">
       <van-radio-group v-model="langType">
-        <van-radio name="zh-cn" style="height: 50px; padding-left: 20px"
-          >简体中文</van-radio
-        >
-        <van-radio name="en-us" style="height: 50px; padding-left: 20px"
-          >English</van-radio
-        >
+        <van-radio name="zh-cn" style="height: 50px; padding-left: 20px">简体中文</van-radio>
+        <van-radio name="en-us" style="height: 50px; padding-left: 20px">English</van-radio>
       </van-radio-group>
     </van-dialog>
   </div>
@@ -210,10 +178,10 @@ onMounted(() => {
   let password = window.localStorage.getItem("password");
   let tenantId = window.localStorage.getItem("tenantId");
   let rememberMeCopy = window.localStorage.getItem("rememberMe");
-  let lang = window.localStorage.getItem("lang");
-  if (!lang) {
-    langModal.value = true;
-  }
+  // let lang = window.localStorage.getItem("lang");
+  // if (!lang) {
+  //   langModal.value = true;
+  // }
   if (rememberMeCopy == "true") {
     loginForm.value.username = username;
     loginForm.value.password = password;

+ 12 - 51
src/views/main.vue

@@ -5,72 +5,33 @@
     	</KeepAlive> -->
     <router-view v-slot="{ Component, route }">
       <keep-alive include="working">
-        <component
-          v-if="!route.meta.link"
-          :is="Component"
-          :key="route.fullPath"
-        />
+        <component v-if="!route.meta.link" :is="Component" :key="route.fullPath" />
       </keep-alive>
     </router-view>
   </div>
-  <van-tabbar
-    v-model="tabType"
-    v-if="routerName != '/main/processDtl'"
-    @change="onChange"
-    :style="isIos() ? 'height:65px' : ''"
-  >
-    <van-tabbar-item
-      to="/main/message"
-      name="message"
-      :badge="msgCount"
-      :style="isIos() ? 'padding-bottom:15px' : ''"
-    >
+  <van-tabbar v-model="tabType" v-if="routerName != '/main/processDtl'" @change="onChange" :style="isIos() ? 'height:65px' : ''">
+    <van-tabbar-item to="/main/message" name="message" :badge="msgCount" :style="isIos() ? 'padding-bottom:15px' : ''">
       {{ $t("common.message") }}
       <template #icon="props">
-        <i
-          class="icon iconfont icon-btn_shengc_gray1 footer-icon"
-          :class="props.active ? 'footer-icon-active' : ''"
-        ></i>
+        <i class="icon iconfont icon-btn_shengc_gray1 footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
       </template>
     </van-tabbar-item>
-    <van-tabbar-item
-      to="/main/working"
-      name="working"
-      :badge="msgCountOne"
-      :style="isIos() ? 'padding-bottom:15px' : ''"
-    >
+    <van-tabbar-item to="/main/working" name="working" :badge="msgCountOne" :style="isIos() ? 'padding-bottom:15px' : ''">
       {{ $t("common.workbench") }}
       <template #icon="props">
-        <i
-          class="icon iconfont icon-btn_gongz footer-icon"
-          :class="props.active ? 'footer-icon-active' : ''"
-        ></i>
+        <i class="icon iconfont icon-btn_gongz footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
       </template>
     </van-tabbar-item>
-    <van-tabbar-item
-      :style="isIos() ? 'padding-bottom:15px' : ''"
-      :to="tenantId == 'smt' ? '/main/xiamenList' : '/main/equipment'"
-      name="equipment"
-      >{{ $t("common.things") }}
+    <!-- <van-tabbar-item :style="isIos() ? 'padding-bottom:15px' : ''" :to="tenantId == 'smt' ? '/main/xiamenList' : '/main/equipment'"
+                     name="equipment">{{ $t("common.things") }}
       <template #icon="props">
-        <i
-          class="icon iconfont icon-btn_wulw footer-icon"
-          :class="props.active ? 'footer-icon-active' : ''"
-        ></i>
+        <i class="icon iconfont icon-btn_wulw footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
       </template>
-    </van-tabbar-item>
-    <van-tabbar-item
-      icon="setting-o"
-      to="/main/home"
-      :style="isIos() ? 'padding-bottom:15px' : ''"
-      name="home"
-    >
+    </van-tabbar-item> -->
+    <van-tabbar-item icon="setting-o" to="/main/home" :style="isIos() ? 'padding-bottom:15px' : ''" name="home">
       {{ $t("common.mine") }}
       <template #icon="props">
-        <i
-          class="icon iconfont icon-btn_mine footer-icon"
-          :class="props.active ? 'footer-icon-active' : ''"
-        ></i>
+        <i class="icon iconfont icon-btn_mine footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
       </template>
     </van-tabbar-item>
   </van-tabbar>

+ 44 - 56
src/views/working/index.vue

@@ -1,26 +1,22 @@
 <template>
   <div class="working">
-    <van-search
-      v-model="keyword"
-      :placeholder="$t('common.pleaseEnterKeywords')"
-      @update:model-value="searchFn"
-    />
+    <van-search v-model="keyword" :placeholder="$t('common.pleaseEnterKeywords')" @update:model-value="searchFn" />
     <van-swipe class="my-swipe" indicator-color="white" style="margin-top:10px">
       <van-swipe-item @click="toWinfaster">
         <img src="../../assets/images/banner1.png" alt="">
       </van-swipe-item>
       <van-swipe-item>2</van-swipe-item>
     </van-swipe>
-    
+
     <div class="card" v-if="keyword">
       <div class="title">{{$t('common.searchResults')}}</div>
       <ul>
         <li v-for="j in searchList" :key="j.path" @click="toRouter(j)" :style="colorRgb(j.background || '#0084FF',0.1)">
-          <div class="icon"  :style="colorRgb(j.background || '#0084FF',1)">
-            <i class="iconfont" :class="'icon-' + j.meta.icon" ></i>
-            
+          <div class="icon" :style="colorRgb(j.background || '#0084FF',1)">
+            <i class="iconfont" :class="'icon-' + j.meta.icon"></i>
+
           </div>
-          
+
           <div class="yuan" :style="colorRgb(j.background || '#0084FF',0.2)"></div>
           <div class="text">{{ j.meta.title }}</div>
         </li>
@@ -31,11 +27,11 @@
       <div class="title">{{ i.meta.title }}</div>
       <ul>
         <li v-for="j in i.children" :key="j.path" @click="toRouter(j)" :style="colorRgb(j.background || '#0084FF',0.1)">
-          <div class="icon"  :style="colorRgb(j.background || '#0084FF',1)">
-            <i class="iconfont" :class="'icon-' + j.meta.icon" ></i>
-            
+          <div class="icon" :style="colorRgb(j.background || '#0084FF',1)">
+            <i class="iconfont" :class="'icon-' + j.meta.icon"></i>
+
           </div>
-          
+
           <div class="yuan" :style="colorRgb(j.background || '#0084FF',0.2)"></div>
           <div class="text">{{ j.meta.title }}</div>
         </li>
@@ -44,13 +40,13 @@
   </div>
 </template>
 <script>
- export default {
-    name:'working'
- }
+export default {
+  name: "working",
+};
 </script>
 <script setup name="working">
 import { nextTick } from "vue";
-import { ref, reactive, getCurrentInstance, toRaw,onActivated } from "vue";
+import { ref, reactive, getCurrentInstance, toRaw, onActivated } from "vue";
 const proxy = getCurrentInstance().proxy;
 console.log(toRaw(proxy), "asss");
 const routerData = ref([]);
@@ -58,13 +54,11 @@ const getRouter = () => {
   proxy.get("getRouters", {}).then((res) => {
     for (let i = 0; i < res.data.length; i++) {
       const element = res.data[i];
-      if(element.type == 2){
-        
+      if (element.type == 2) {
         routerData.value = element.children;
-        console.log(routerData.value)
+        console.log(routerData.value);
       }
     }
-    
   });
 };
 
@@ -72,23 +66,22 @@ const keyword = ref(null);
 const searchList = ref([]);
 const searchFn = (text) => {
   searchList.value = [];
-  if(!text) return
+  if (!text) return;
   //在routerData中查找
-  routerData.value.map(item => {
-    item.children.map(item => {
-      if(item.meta.title.indexOf(text) > -1){
-        searchList.value.push(item)
+  routerData.value.map((item) => {
+    item.children.map((item) => {
+      if (item.meta.title.indexOf(text) > -1) {
+        searchList.value.push(item);
       }
-    })
-    
-  })
-  console.log(searchList)
+    });
+  });
+  console.log(searchList);
 };
 getRouter();
 const toWinfaster = () => {
-  proxy.$router.push({
-    path: "/main/iframWinfaster",
-  });
+  // proxy.$router.push({
+  //   path: "/main/iframWinfaster",
+  // });
 };
 //16进制转rgba的函数
 const colorRgb = (sColor, alpha) => {
@@ -98,9 +91,7 @@ const colorRgb = (sColor, alpha) => {
     if (sColor.length === 4) {
       var sColorNew = "#";
       for (var i = 1; i < 4; i += 1) {
-        sColorNew += sColor
-          .slice(i, i + 1)
-          .concat(sColor.slice(i, i + 1));
+        sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
       }
       sColor = sColorNew;
     }
@@ -109,9 +100,7 @@ const colorRgb = (sColor, alpha) => {
     for (var i = 1; i < 7; i += 2) {
       sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
     }
-    return (
-      "background:rgba(" + sColorChange.join(",") + "," + alpha + ")"
-    );
+    return "background:rgba(" + sColorChange.join(",") + "," + alpha + ")";
   } else {
     return sColor;
   }
@@ -119,8 +108,10 @@ const colorRgb = (sColor, alpha) => {
 const toRouter = (item) => {
   //获取class为main的滚动条位置
 
-  
-  sessionStorage.setItem("scrollTop", document.querySelector('#main').scrollTop);
+  sessionStorage.setItem(
+    "scrollTop",
+    document.querySelector("#main").scrollTop
+  );
   proxy.$router.push(item.path);
 };
 
@@ -128,10 +119,8 @@ const toRouter = (item) => {
 onActivated(() => {
   const scrollTop = sessionStorage.getItem("scrollTop");
   nextTick(() => {
-    document.querySelector('#main').scrollTop = scrollTop;
+    document.querySelector("#main").scrollTop = scrollTop;
   });
-  
-  
 });
 </script>
 <style lang="scss" scoped>
@@ -140,22 +129,22 @@ onActivated(() => {
   padding: 12px;
   color: #333;
   position: relative;
-  top:-46px;
-  
-  .my-swipe{
+  top: -46px;
+
+  .my-swipe {
     height: 150px;
     background: #0084ff;
     color: #fff;
     border-radius: 5px;
     text-align: center;
-    .van-swipe-item{
+    .van-swipe-item {
       height: 150px;
       text-align: center;
       line-height: 150px;
-      img{
+      img {
         width: 100%;
         height: 100%;
-      }        
+      }
     }
   }
   .card {
@@ -191,7 +180,7 @@ onActivated(() => {
 
       li {
         width: 23%;
-        
+
         padding: 12px;
         margin: 10px 1% 0;
         box-sizing: border-box;
@@ -209,7 +198,7 @@ onActivated(() => {
           font-size: 14px;
           z-index: 2;
           position: relative;
-          .iconfont{
+          .iconfont {
             font-size: 14px;
           }
         }
@@ -217,7 +206,7 @@ onActivated(() => {
           font-size: 12px;
           height: 26px;
           line-height: 14px;
-          margin-top:12px;
+          margin-top: 12px;
           color: #333;
           font-weight: bold;
           position: relative;
@@ -228,9 +217,8 @@ onActivated(() => {
           display: -webkit-box;
           -webkit-line-clamp: 2;
           -webkit-box-orient: vertical;
-          
         }
-        .yuan{
+        .yuan {
           width: 20px;
           height: 20px;
           border-radius: 50%;