|
|
@@ -4,8 +4,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import imageUrl from '@/assets/images/backage-afc.png'
|
|
|
import { DeviceIcon, DeviceItem, AFC_GATE_MACHINE, AFC_TICKETING_AUTO } from "@/types/device";
|
|
|
-import { deviceAll } from "@/api/device";
|
|
|
-
|
|
|
+import { StoreDevices } from '@/store/modules/devices.ts'
|
|
|
const devices = reactive<DeviceIcon[]>([
|
|
|
{ icon: "客服中心", name: "", size: 30, statusColor: "#000", style: "left: 216px;top: 276px;" },
|
|
|
{ icon: "客服中心", name: "", size: 30, statusColor: "#000", style: "left: 216px;top: 310px;" },
|
|
|
@@ -25,8 +24,8 @@ const devices = reactive<DeviceIcon[]>([
|
|
|
{ command: AFC_GATE_MACHINE, icon: "闸机", code: "AGM0208", size: 30, statusColor: "#00FF00", style: "left: 798px;top:362px" },
|
|
|
]);
|
|
|
|
|
|
-const getDevice = async function () {
|
|
|
- const deviceList = (await deviceAll()).data as DeviceItem[];
|
|
|
+const getDevice = function () {
|
|
|
+ const deviceList: DeviceItem[] = StoreDevices().getDeviceArray;
|
|
|
for (let i = 0; i < devices.length; i++) {
|
|
|
const deviceItem = devices[i];
|
|
|
const matchedDevice = deviceList.find(item => item.code === deviceItem.code);
|
|
|
@@ -44,4 +43,5 @@ const getDevice = async function () {
|
|
|
}
|
|
|
}
|
|
|
onMounted(getDevice);
|
|
|
+watch(() => StoreDevices().getDeviceArray, () => { getDevice(); })
|
|
|
</script>
|