|
@@ -145,7 +145,7 @@ import { ref, onMounted } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { showNotify } from 'vant';
|
|
import { showNotify } from 'vant';
|
|
|
import { controlGate, controlGateByBigInv, getGateStatus } from '../api/gate.js';
|
|
import { controlGate, controlGateByBigInv, getGateStatus } from '../api/gate.js';
|
|
|
-
|
|
|
|
|
|
|
+import { LIGHT_NORMAL, LIGHT_OPEN, LIGHT_CLOSE, LIGHT_ALARM, LIGHT_RESTART } from '../gate/Light.js';
|
|
|
// 图片资源
|
|
// 图片资源
|
|
|
import bgImg from '../assets/images/bj.png';
|
|
import bgImg from '../assets/images/bj.png';
|
|
|
// import { plugin } from 'postcss';
|
|
// import { plugin } from 'postcss';
|
|
@@ -162,6 +162,7 @@ const goHome = () => {
|
|
|
router.push('/home');
|
|
router.push('/home');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 执行闸机控制
|
|
// 执行闸机控制
|
|
|
const handleControl = async (command, actionName, isBigInv) => {
|
|
const handleControl = async (command, actionName, isBigInv) => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -174,6 +175,15 @@ const handleControl = async (command, actionName, isBigInv) => {
|
|
|
// res = await controlGate(command);
|
|
// res = await controlGate(command);
|
|
|
// }
|
|
// }
|
|
|
plugin.gateConfig.controlGate(command);
|
|
plugin.gateConfig.controlGate(command);
|
|
|
|
|
+ if(command == 'OPEN' || command == 'SHOTOPEN'){
|
|
|
|
|
+ plugin.gateConfig.controlLight(JSON.stringify(LIGHT_OPEN));
|
|
|
|
|
+ }else if(command == 'CLOSE'){
|
|
|
|
|
+ plugin.gateConfig.controlLight(JSON.stringify(LIGHT_CLOSE));
|
|
|
|
|
+ }else if(command == 'REBOOT'){
|
|
|
|
|
+ plugin.gateConfig.controlLight(JSON.stringify(LIGHT_RESTART));
|
|
|
|
|
+ }else if(command == 'ALARM'){
|
|
|
|
|
+ plugin.gateConfig.controlLight(JSON.stringify(LIGHT_ALARM));
|
|
|
|
|
+ }
|
|
|
showNotify({ type: 'success', message: `${actionName}操作成功`, duration: 2000 });
|
|
showNotify({ type: 'success', message: `${actionName}操作成功`, duration: 2000 });
|
|
|
// if (res.errorCode === 0) {
|
|
// if (res.errorCode === 0) {
|
|
|
// showNotify({ type: 'success', message: `${actionName}操作成功`, duration: 2000 });
|
|
// showNotify({ type: 'success', message: `${actionName}操作成功`, duration: 2000 });
|