Bläddra i källkod

fix: 修改地址ipad

chenzhen 4 dagar sedan
förälder
incheckning
90ac11402c

+ 1 - 1
public/index.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-  <meta base="/tenantslink/">
+  <meta base="/ipad/">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta http-equiv="Content-Security-Policy" content="">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

+ 9 - 9
src/config/default/vue.custom.config.js

@@ -1,19 +1,19 @@
 const vueDefaultConfig = {
-  publicPath: "/tenantslink/",
-  outputDir: "dist/tenantslink",
-  assetsDir: "static",
+  publicPath: '/ipad/',
+  outputDir: 'dist/ipad',
+  assetsDir: 'static',
   parallel: false,
   lintOnSave: false,
-  transpileDependencies: ["vue-echarts", "resize-detector"],
+  transpileDependencies: ['vue-echarts', 'resize-detector'],
   //webpack 配置的项目名称
-  title: "SagaCare",
-  titleSeparator: " - ",
+  title: 'SagaCare',
+  titleSeparator: ' - ',
   titleReverse: false,
-  devPort: "9999",
-  abbreviation: "vt2at",
+  devPort: '9999',
+  abbreviation: 'vt2at',
   providePlugin: {},
   build7z: false,
-  startMessage: "欢迎使用SagaCare"
+  startMessage: '欢迎使用SagaCare',
 };
 
 module.exports = vueDefaultConfig;

+ 29 - 30
src/router/index.ts

@@ -3,23 +3,22 @@ import {
   Router,
   createWebHashHistory,
   createWebHistory,
-  RouteRecordRaw
-} from 'vue-router'
+  RouteRecordRaw,
+} from 'vue-router';
 
-const Home: any = () => import('@/views/home/index.vue')
-const Envmonitor: any = () => import('@/views/envmonitor/index.vue')
-const EnvmonitorDetail: any = () => import('@/views/envmonitor/detail.vue')
-const UserPortrait: any = () => import('@/views/portrait/index.vue')
-const EnergySavig: any = () => import('@/views/portrait/energySavig.vue')
-const EnergyDetail: any = () => import('@/views/portrait/energyDetail.vue')
-const TodayEnergyDetail: any = () =>
-  import('@/views/portrait/todayEnergyDetail.vue')
-const EnergyRank: any = () => import('@/views/portrait/energyRank.vue')
-const IntegralDesc: any = () => import('@/views/portrait/integralDesc.vue')
-const Record: any = () => import('@/views/portrait/record.vue')
-const MySpace: any = () => import('@/views/envmonitor/mySpace/index.vue')
-const SetMainSpace: any = () => import('@/views/choiceSpace/setMainSpace.vue')
-const TaiguIndex: any = () => import('@/views/envmonitor/taiguv1/index.vue')
+const Home: any = () => import('@/views/home/index.vue');
+const Envmonitor: any = () => import('@/views/envmonitor/index.vue');
+const EnvmonitorDetail: any = () => import('@/views/envmonitor/detail.vue');
+const UserPortrait: any = () => import('@/views/portrait/index.vue');
+const EnergySavig: any = () => import('@/views/portrait/energySavig.vue');
+const EnergyDetail: any = () => import('@/views/portrait/energyDetail.vue');
+const TodayEnergyDetail: any = () => import('@/views/portrait/todayEnergyDetail.vue');
+const EnergyRank: any = () => import('@/views/portrait/energyRank.vue');
+const IntegralDesc: any = () => import('@/views/portrait/integralDesc.vue');
+const Record: any = () => import('@/views/portrait/record.vue');
+const MySpace: any = () => import('@/views/envmonitor/mySpace/index.vue');
+const SetMainSpace: any = () => import('@/views/choiceSpace/setMainSpace.vue');
+const TaiguIndex: any = () => import('@/views/envmonitor/taiguv1/index.vue');
 
 export const constantRoutes: Array<RouteRecordRaw> = [
   {
@@ -27,8 +26,8 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     redirect: '/index',
     meta: {
       title: '首页',
-      hideHeader: true
-    }
+      hideHeader: true,
+    },
   },
   // {
   //   path: "/home",
@@ -46,8 +45,8 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     meta: {
       title: '会议室控制',
       color: '#F5F5F5',
-      hideHeader: true
-    }
+      hideHeader: true,
+    },
   },
   // {
   //   path: "/envmonitor",
@@ -239,22 +238,22 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     meta: {
       title: '错误页面',
       color: '#F5F5F5',
-      hideHeader: true
-    }
-  }
-]
+      hideHeader: true,
+    },
+  },
+];
 
 export const asyncRoutes: Array<RouteRecordRaw> = [
   // ...permissionModules
-]
+];
 const router = createRouter({
-  history: createWebHistory('/tenantslink/'),
-  routes: constantRoutes
-})
+  history: createWebHistory('/ipad/'),
+  routes: constantRoutes,
+});
 
 export function resetRouter() {
   const newRouter = router;
-  (router as any).matcher = (newRouter as any).matcher // reset router
+  (router as any).matcher = (newRouter as any).matcher; // reset router
 }
 
-export default router
+export default router;

+ 1 - 1
src/styles/_variables.scss

@@ -31,7 +31,7 @@ $elBg: #f5f5f5;
 $elActive4: rgba(206, 159, 39, 0.4);
 $elActiveText: #fff;
 $elDeleteColor: #e5574f;
-$bg: "/tenantslink/images/page-officehome/officehome.jpg";
+$bg: '/ipad/images/page-officehome/officehome.jpg';
 $headerHeight: 48px;
 $headerHeightPading: 58px;
 

+ 7 - 7
src/styles/index.scss

@@ -1,7 +1,7 @@
-@import "font";
-@import "svgicon";
-@import "reset";
-@import "~@/styles/comMedia.scss";
+@import 'font';
+@import 'svgicon';
+@import 'reset';
+@import '~@/styles/comMedia.scss';
 
 /* Global scss */
 * {
@@ -16,7 +16,7 @@ body {
   width: 100%;
   height: 100%;
   overflow: hidden;
-  font-family: "Noto Sans SC";
+  font-family: 'Noto Sans SC';
   -webkit-touch-callout: none !important;
   -webkit-user-select: none;
 }
@@ -123,7 +123,7 @@ div:focus {
 /*==for IE6/7 Maxthon2==*/
 .clearfix :after {
   clear: both;
-  content: ".";
+  content: '.';
   display: block;
   width: 0;
   height: 0;
@@ -158,7 +158,7 @@ div:focus {
   box-shadow: none;
   background-repeat: repeat;
   border: 2px solid #dfe3ed;
-  background-image: url("/tenantslink/images/map-icon/bg_disable.png");
+  background-image: url('/ipad/images/map-icon/bg_disable.png');
 }
 
 .main-left {

+ 48 - 53
src/views/home/index.vue

@@ -14,12 +14,7 @@
       <div class="home-right">
         <div class="box" v-if="type === 1">
           <div class="qrcode-main">
-            <qrcode-vue
-              :value="codeValue"
-              class="qrcode"
-              foreground="#CE9F27"
-              level="H"
-            />
+            <qrcode-vue :value="codeValue" class="qrcode" foreground="#CE9F27" level="H" />
             <div class="qrcode-model" v-if="codeStatus.status">
               <span v-if="codeStatus.status === 1">已扫描</span>
               <!-- <span v-if="codeStatus.status === 2">已确认</span> -->
@@ -71,18 +66,18 @@ import {
   onBeforeMount,
   onMounted,
   ref,
-  onBeforeUnmount
-} from "vue";
-import QrcodeVue from "qrcode.vue";
-import { useRouter } from "vue-router";
-import { getUserInfo, newNumber, parseImgUrl, setQueryConfig } from "@/utils";
-import { store, useStore } from "@/store";
-import { login } from "@/apis/user";
-import { Form, Field, CellGroup, Button, Toast } from "vant";
-import { getCookieMac, setToken } from "@/utils/cookies";
-import { getPadQrCodeStatus, queryWorkSpace } from "@/apis/envmonitor";
-import { UserMutationTypes } from "@/store/modules/user/mutation-types";
-import { setTimeout, clearTimeout } from "timers";
+  onBeforeUnmount,
+} from 'vue';
+import QrcodeVue from 'qrcode.vue';
+import { useRouter } from 'vue-router';
+import { getUserInfo, newNumber, parseImgUrl, setQueryConfig } from '@/utils';
+import { store, useStore } from '@/store';
+import { login } from '@/apis/user';
+import { Form, Field, CellGroup, Button, Toast } from 'vant';
+import { getCookieMac, setToken } from '@/utils/cookies';
+import { getPadQrCodeStatus, queryWorkSpace } from '@/apis/envmonitor';
+import { UserMutationTypes } from '@/store/modules/user/mutation-types';
+import { setTimeout, clearTimeout } from 'timers';
 
 export default defineComponent({
   components: {
@@ -90,12 +85,12 @@ export default defineComponent({
     vanForm: Form,
     vanField: Field,
     CellGroup: CellGroup,
-    vanButton: Button
+    vanButton: Button,
   },
   beforeRouteEnter(to, from, next) {
     let mac: any = getCookieMac();
-    if (mac && mac != "null") {
-      if (to.query.type !== "logoOut") {
+    if (mac && mac != 'null') {
+      if (to.query.type !== 'logoOut') {
         next((e: any) => {
           console.log(e);
           e.queryPageWorkSpace();
@@ -112,7 +107,7 @@ export default defineComponent({
         });
       }
     } else {
-      next("/error");
+      next('/error');
     }
   },
   setup(props) {
@@ -125,7 +120,7 @@ export default defineComponent({
     const orgin: any = location.origin;
     const proxyData = reactive({
       parseImgUrl: parseImgUrl,
-      codeValue: `${orgin}/tenantslink/home`,
+      codeValue: `${orgin}/ipad/home`,
       showLogin: false,
       size: 134,
       spaceTimer: spaceTimer,
@@ -146,8 +141,8 @@ export default defineComponent({
           }
         }
       },
-      username: "",
-      password: "",
+      username: '',
+      password: '',
       onSubmit(values: any) {
         // console.log("submit", values);
         let params: any = values;
@@ -157,13 +152,13 @@ export default defineComponent({
         // params.password = params.password
         //   ? params.password.trim()
         //   : params.password;
-        login(params).then(res => {
+        login(params).then((res) => {
           let resData: any = res;
-          if (resData.result === "success") {
+          if (resData.result === 'success') {
             setToken(resData.token);
-            router.push({ path: "/choice-project" });
+            router.push({ path: '/choice-project' });
           } else {
-            Toast("登录失败!");
+            Toast('登录失败!');
           }
         });
       },
@@ -173,36 +168,36 @@ export default defineComponent({
           proxyData.showLogin = true;
           // next("/error");
           router.push({
-            name: "error"
+            name: 'error',
           });
         } else {
           let params: any = {
             criteria: {
               macAddress: proxyData.userInfo.mac,
-              isMajorSpace: 1
+              isMajorSpace: 1,
             },
             orders: [
               {
-                column: "createTime",
+                column: 'createTime',
 
-                asc: false
-              }
+                asc: false,
+              },
             ],
             page: 1,
-            size: 1
+            size: 1,
           };
           queryWorkSpace(params)
             .then((res: any) => {
               let resData: any = res;
-              if (resData.result === "success") {
+              if (resData.result === 'success') {
                 let content: any = resData?.content ?? [];
                 if (content && content.length) {
                   proxyData.showLogin = false;
                   let projectId: any = content[0].projectId;
                   store.commit(UserMutationTypes.SET_PROJECT_ID, projectId);
                   router.push({
-                    name: "envmonitor",
-                    query: { spaceId: content[0].spaceId }
+                    name: 'envmonitor',
+                    query: { spaceId: content[0].spaceId },
                   });
                 } else {
                   proxyData.showLogin = true;
@@ -232,12 +227,12 @@ export default defineComponent({
         const id: any = newNumber(0, 100000, mac);
         return id;
       },
-      qrCodeId: "",
+      qrCodeId: '',
       setCodeUrl() {
         let mac: any = proxyData.userInfo.mac;
         let qrCodeId: any = proxyData.getQrcode();
         proxyData.qrCodeId = qrCodeId;
-        proxyData.codeValue = `${orgin}/tenantslink/home?type=ipad&id=${proxyData.qrCodeId}&mac=${mac}`;
+        proxyData.codeValue = `${orgin}/ipad/home?type=ipad&id=${proxyData.qrCodeId}&mac=${mac}`;
       },
       //  定时器清楚
       clearTimer() {
@@ -260,7 +255,7 @@ export default defineComponent({
       timer: timer,
       getPadQrCodeStatus() {
         let params: any = setQueryConfig({ qrCodeId: proxyData.qrCodeId });
-        getPadQrCodeStatus(params).then(res => {
+        getPadQrCodeStatus(params).then((res) => {
           let resData: any = res;
           proxyData.codeStatus = resData?.data ?? {};
           if (proxyData.codeStatus.status === 2) {
@@ -272,13 +267,13 @@ export default defineComponent({
               // setLocalProjectId(projectId)
               store.commit(UserMutationTypes.SET_PROJECT_ID, projectId);
               router.push({
-                name: "choiceSpace",
-                query: { id: projectId, spaceId: spaceId }
+                name: 'choiceSpace',
+                query: { id: projectId, spaceId: spaceId },
               });
             } else if (projectId) {
               // 去选择项目页面
               store.commit(UserMutationTypes.SET_PROJECT_ID, projectId);
-              router.push({ name: "choiceSpace", query: { id: projectId } });
+              router.push({ name: 'choiceSpace', query: { id: projectId } });
             }
           } else {
             if (proxyData.timer) {
@@ -290,7 +285,7 @@ export default defineComponent({
             }, 1000);
           }
         });
-      }
+      },
     });
     onBeforeUnmount(() => {
       if (proxyData.timer) {
@@ -306,9 +301,9 @@ export default defineComponent({
       proxyData.getPadQrCodeStatus();
     });
     return {
-      ...toRefs(proxyData)
+      ...toRefs(proxyData),
     };
-  }
+  },
 });
 </script>
 <style lang="scss" scoped>
@@ -327,7 +322,7 @@ export default defineComponent({
     line-height: 46px;
     background: #ffffff;
     border: 1px solid #e2d0a0;
-    font-family: "Persagy";
+    font-family: 'Persagy';
     font-style: normal;
     font-weight: 500;
     font-size: 16px;
@@ -361,7 +356,7 @@ export default defineComponent({
       }
       .logo-text {
         padding-top: 17px;
-        font-family: "Persagy";
+        font-family: 'Persagy';
         font-style: normal;
         font-weight: 700;
         font-size: 24px;
@@ -421,7 +416,7 @@ export default defineComponent({
       }
       .qrcode-text {
         padding-top: 25px;
-        font-family: "Noto Sans SC";
+        font-family: 'Noto Sans SC';
         font-style: normal;
         font-weight: 400;
         font-size: 14px;
@@ -437,7 +432,7 @@ export default defineComponent({
     left: 0;
     width: 100%;
     bottom: 80px;
-    font-family: "Persagy";
+    font-family: 'Persagy';
     font-style: normal;
     font-weight: 500;
     font-size: 24px;
@@ -459,7 +454,7 @@ export default defineComponent({
     border: 1px solid #c3c7cb;
     border-radius: 16px;
     margin-bottom: 28px;
-    font-family: "Microsoft YaHei UI";
+    font-family: 'Microsoft YaHei UI';
     font-style: normal;
     font-weight: 400;
     font-size: 14px;
@@ -471,7 +466,7 @@ export default defineComponent({
     height: 48px;
     background: #ce9f27;
     border-radius: 16px;
-    font-family: "PingFang SC";
+    font-family: 'PingFang SC';
     font-style: normal;
     font-weight: 500;
     font-size: 20px;