npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-ue-sdk

v2.1.2

Published

基于vue2实现的ue sdk

Downloads

25

Readme

安装

使用 npm 或 yarn 安装

$ npm install vue-ue-sdk --save
$ yarn add vue-ue-sdk --save

如果你的网络环境不佳,推荐使用 cnpm

使用方法

main.js

import { createApp } from 'vue'
import App from './App.vue'
import vueUeSdk from 'vue-ue-sdk';
const app=createApp(App)
app.use(vueUeSdk)
app.mount('#app')

App.vue

<template>
  <UEPlayer />
</template>
<script>
import { app_load, api_register, api_send } from "vue-ue-sdk";
export default {
  name: "EditView",
  mounted() {
    const url = "127.0.0.1:777"; // UE的服务器地址
    app_load(url, () => {
        console.log('画面出现后回调,可进行一些初始操作');
        // 监听UE发送过来的消息
        api_register("onUE4Call", (info) => {
          console.log(info);
        });
        // 发送消息给UE
        api_send("changeWeather", { stauts: 'windy' }, (res)=>{
            console.log(res);
        });
    });
  },
  methods: {},
};
</script>

UE 提供接口

查看风险一张图

api_send("changeRiskChart", {}, ()=> {
  // to do
}) 

查看监控一张图(散热图)

api_send("changeMonitorChart", {}, ()=> {
  // to do
})

前往详情

api_send('goToDetail', { type: 'fire'}, ()=> {
  // to do
})
type: fire // 火
type: water // 水
type: waterSupply // 热力
type: elevator // 电梯
type: bridge // 桥梁
type: fireControlOfForest // 森林消防
type: fireControlOfBuilding // 建筑消防
type: heat // 热力

前往水灾详情

api_send('goToWaterDetail', { }, ()=> {
  // to do
})

前往火灾详情

api_send('goToFireDetail', { }, ()=> {
  // to do
})

打开火灾与关闭火灾

api_send('switchFire', { isOpen: false }, ()=> {
  // to do
})

开关

api_send('switch', { isOpen: false, type: 'fire' }, ()=> {
  // to do
})
type: water 水灾详情 
type: fire 火灾详情
type: technology 科技风场景
type: waterSupply // 热力
type: elevator // 电梯
type: bridge // 桥梁
type: fireControlOfForest // 森林消防
type: fireControlOfBuilding // 建筑消防
type: heat // 热力

打开火灾与关闭火灾

api_send('switchFire', { isOpen: false }, ()=> {
  // to do
})
isOpen是布尔值,true是打开,false是关闭

打开水灾与关闭水灾

api_send('switchWater', { isOpen: false }, ()=> {
  // to do
})
isOpen是布尔值,true是打开,false是关闭

地图标记类交互接口

api_send('markSymbol', { type:  'gas'}, ()=> {
  // to do
})
type: default // 默认展示全部
type: gas // 燃气
type: heat // 热力
type: bridge // 桥梁
type: pipe // 综合管廊
type: waterSupply // 供水
type: drain // 排水
type: subwayTunnel // 地铁隧道
type: elevator // 电梯
type: fireControl // 消防
type: technologyDetail // 

前往场景例如切换火灾火水灾详情

api_send('change3DScene', { type: 'water' }, ()=> {
  // to do
})
type: water 水灾详情 
type: fire 火灾详情
type: technology 科技风场景
type: waterSupply // 热力
type: elevator // 电梯
type: bridge // 桥梁
type: fireControlOfForest // 森林消防
type: fireControlOfBuilding // 建筑消防
type: heat // 热力

关闭科技风侧边栏UI

api_send('closeMenuUI')

监听UE切换场景

api_register('Enter3DSecene',  (res)=> {
// 监听用户点击切换火灾详情
  if(res.type === 'fire') {
    //
  }
  // 监听用户点击切换水灾详情
  if(res.type === 'water') {
    //
  }
  // 监听切换到科技风场景
  if(res.type === 'technology') {
    //
  }
  // 监听切换到科技风火灾场景详情
  if(res.type === 'technologyDetailFire') {
    //
  }
  // 监听切换到科技风场景水灾详情
  if(res.type === 'technologyDetailWater') {
    //
  }
})

取消注册

api_unregister('Enter3DSecene', ()=>{

})