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