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

@kaitu/configure

v1.0.3

Published

> kaitu web 组态软件,方便组件化模块化工程化引入

Downloads

2

Readme

@kaitu/configure

kaitu web 组态软件,方便组件化模块化工程化引入

kaitu 组态官网

configure

安装 @kaitu/configure 版本

npm install @kaitu/configure

main.js引入 @kaitu/configure

const app = createApp(App)
import kaituConfigure from '@kaitu/configure'
import '@kaitu/configure/dist/style.css'
app.use(kaituConfigure)

渲染器

<kaituConfigureRender
  ref="kaituConfigureRenderRef"
  :graph="previewData.graph"
  :originData="previewData.originData"
  :updateData="previewData.updateData"
  @completed="handleCompleted"
  @event="handleEvent"
  @dialogEvent="handleEvent"
  @getEditor="handleGetEditor"
></kaituConfigureRender>
const kaituConfigureRenderRef = ref(null)

let previewData = reactive({
  graph: '',
  originData: [],
  updateData: [],
})

// 加载图纸完成
const handleCompleted = () => {
  kaituConfigureRenderRef.value.handleFitView()
}
// 事件监听
const handleEvent = (row, eventItem, eventType) => {
  /**
   * row: 当前元件所有数据
   */
  /**
   * eventItem: 事件数据
    eventItem.type: '',//事件
    eventItem.action: '',//事件类型
    eventItem.name: '',// 页面type/链接地址/图纸名称/弹窗类型/下发name/自定义name
    eventItem.value: '', ///URL/打开方式/图纸路径/弹窗value/下发value/自定义value
    eventItem.status: '' //下发值类型
    eventItem.uuid: '' 设备uuid
   */
  /**
   * eventItem.action: 动作类型 //
   * dialog: 打开弹窗
   * dialogPage: 打开图纸弹窗
   * control: 控制下发
   * link: 打开链接
   * page: 打开页面
   * custom: 自定义
   * variable: 变量赋值
   */

  /**
   * eventType: 事件类型 //click dblclick mouserover mouseout
   */
  if (eventItem.action === 'dialog') {
    console.log(row)
  }
  if (eventItem.action === 'link') {
    const url = eventItem.name
    const type = eventItem.value ? eventItem.value : '_blank'
    window.open(url, type)
  }
  if (eventItem.action === 'variable') {
    const obj = {
      uuid: eventItem.uuid,
      value: eventItem.value,
    }
    console.log(row)
  }
}
// 渲染器
const handleGetEditor = (editor, objects) => {
  /**
   * editor: 渲染器实例
   * objects: 所有的组件
   * */
  console.log(editor, objects)
}

graph: 图纸数据, 为String格式

参数

originData: 设备数据,为Array格式

;[
  {
    uuid: 'dev_001_01',
    value: 8,
    name: '1号进线柜-Ia',
  },
  {
    uuid: 'dev_001_02',
    value: 0,
    name: '1号进线柜-Ib',
  },
]

updateData: 更新设备数据,为Array格式

;[
  {
    uuid: 'dev_001_01',
    value: 7,
    name: '1号进线柜-Ia',
  },
]

事件

@completed: 图纸加载完成 @event: 点击事件 @dialogEvent: 二次弹窗页面点击事件 @getEditor: 渲染器示例和全部组件