引擎集成

组态系统属于单独运行系统,在集成可使用内嵌的形式,需要传递系统token,和画布Id给组态系统。
组态程序在编辑完成,保存时使用token,和画布Id进行保存,并截取组态图片base64一起存储到上一步创建的数据表中。

具体项目中集成如下:

<template>
  <iframe
      height="100%"
      width="100%"
      :src="url+ '/?token=' + Session.get('token') +'&screenId=' +screenId +'&userId=' +userId"
      frameborder="0"
      scrolling="no"
  />
</template>
<script setup lang="ts">
  import { ref, onMounted, computed } from 'vue';
  import { useRoute } from 'vue-router';
  import { useUserInfosState } from "@/stores/userInfos";
  import { Session } from '@/utils/storage';

  const route = useRoute();
  const userInfos = useUserInfosState();
  const userId = computed(() => userInfos.userInfos.userId);
  const url = ref(import.meta.env.VITE_SCREEN_URL);
  const screenId: any = ref('');
  onMounted(() => {
    screenId.value = route.query.id;
  });
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
上次更新: 2025/4/25 22:42:47
贡献者: PandaX-Go