# qtum-ui

> // npm安装 npm i qtum-ui // cnpm安装 cnpm i qtum-ui # 依赖包 vue

Latest version **2.1.3** (published 2023-09-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install qtum-ui
pnpm add qtum-ui
yarn add qtum-ui
bun add qtum-ui
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2023-09-26 |
| First published | 2023-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jysson |

## Links

- npm: https://www.npmjs.com/package/qtum-ui
- npm.io page: https://npm.io/package/qtum-ui

## Recent versions

- 2.1.3 (latest) — 2023-09-26
- 2.1.2 — 2023-09-26
- 2.1.1 — 2023-04-21
- 2.1.0 — 2023-04-18
- 2.0.9 — 2023-04-18
- 2.0.8 — 2023-04-18
- 2.0.7 — 2023-04-18
- 2.0.6 — 2023-04-17
- 2.0.5 — 2023-04-17
- 2.0.4 — 2023-04-17
- 2.0.3 — 2023-04-07
- 2.0.2 — 2023-04-04
- 2.0.1 — 2023-04-04
- 2.0.0 — 2023-03-24

## README

# 安装
    // npm安装
    npm i qtum-ui
    // cnpm安装
    cnpm i qtum-ui
#  依赖包
vue

    cnpm/npm i element-ui
    cnpm/npm i vuedraggable

#  引入
在main.js中引入qtum-ui

    import QtumUi from "qtum-ui";
    import "qtum-ui/lib/qtum-ui.css";
    Vue.use(QtumUi);

# 组件
## FlowChart（流程图）
可进行拖拽生成流程图
### 使用

    <template>
	    <qt-flow-chart :data="flowData" @changeFlow="changeFlow" ref="qtFormChart">
		    <!-- 需要拖拽的列表 -->
		    <ul slot-scope="scope">
              <li v-for="item in lists" :key="item.id">
                  <draggable
                  v-bind="scope.getDragOptions()"
                  @end="scope.drag(item, $event)">
                      <div>{{item.name}}</div>
                  </draggable>
              </li>
          </ul>
          
          <!-- 节点内容 -->
          <div slot="node" slot-scope="scope">{{scope.node.name}}</div>
	    </qt-flow-chart>
    </template>
    
    // 需要npm/cnpm i vuedraggable
    import draggable from "vuedraggable";
    export default {
	    data() {
		    return {
			    lists: [{
				    id: "01",
				    name: "测试"
			    },{
				    id: "02",
				    name: "测试2"
			    }],
			    flowData: {
				    nodes: [{
					    // 可拖拽的节点列表信息 -- lists里面的子项
					    id: "01",
					    name: "测试",
					    // 节点数据
					    sign: "oxtsnt", // 必须，唯一标志符
					    top: "10px", // 必须，节点距离顶部的偏移
					    left: "10px", // 必须， 节点距离左侧的偏移
				    }, {
					    id: "02",
					    name: "测试2",
					    sign: "osien",
					    top: "50px", 
					    left: "50px"
				    }],
				    lines: [{
					    from: "oxtsnt", // 源节点sign
					    to: "osien" // 目标节点sign
				    }]
			    }
		    }
	    },
	    methods: {
		    changeFlow(data) {
			    // 流程图拖拽删除等操作返回数据
		    },
            addNode() {
                // 添加节点
                this.$refs.qtFormChart.addNode({
                    name: "节点名称",
                    ... // 节点信息
                })
            }
	    }
    }
   ### 配置参数
   <table>
	   <tr>
		   <th>属性</th>
		   <th>描述</th>
		   <th>类型</th>
		   <th>默认值</th>
	   </tr>
	   <tr>
		   <td>flowClass</td>
		   <td>流程图内容区样式</td>
		   <td>String</td>
		   <td>-</td>
	   </tr>
	   <tr>
		   <td>nodeClass</td>
		   <td>流程图的节点（data.nodes里面的子项）样式</td>
		   <td>String</td>
		   <td>-</td>
	   </tr>
	   <tr>
		   <td>jsplumbSet</td>
		   <td>流程图配置</td>
		   <td>Object</td>
		   <td>
		   {<br/>
			   connector: ['Bezier', {curviness: 100}], // 连接样式，默认是曲线<br/>
			   paintColor: "#4385F5", // 连线颜色<br/>
			   paintWidth: 1, // 连线宽度<br/>
			   hoverPointColor: "#b0b2b5", // 鼠标移入到连线的颜色<br/>
			   hoverPointWidth: 1, // 鼠标移入到连线的宽度<br/>
			   arrowWidth: 10, // 箭头宽度<br/>
			   arrowHeight: 8, // 箭头高度<br/>
			   foldback: 0.623, // 箭头尾翼角度，1是直角三角形<br/>
			   nodeDragClass: ".flow-node-drag" // 节点可以拖拽的样式名称<br/>
		   }
		   </td>
	   </tr>
	   <tr>
		   <td>data</td>
		   <td>流程图数据</td>
		   <td>Object</td>
		   <td>
		   {<br/>
			   lines: [], // 连线数据<br/>
			   nodes: [] // 节点数据 <br/>
		   }
		   </td>
	   </tr>
	   <tr>
		   <td>flowClass</td>
		   <td>流程图内容区样式</td>
		   <td>String</td>
		   <td>-</td>
	   </tr>
   </table>



### 插槽
#### 默认插槽

    
    // 父组件中使用
    // slot-scope获取drag和getDragOptions
    <ul slot-scope="scope">
        <li v-for="item in lists" :key="item.id">
	        // scope.drag: 拖拽添加流程图节点
		    // scope.getDragOptions：拖拽默认配置样式（可自行配置 - 根据vuedraggable配置参数进行配置）
            <draggable
            v-bind="scope.getDragOptions()"
            @end="scope.drag($event, item)">
                <div>{{item.name}}</div>
            </draggable>
        </li>
    </ul>
    // cnpm/npm i vuedraggable
    import draggable from "vuedraggable";
    export default {
	    components: { draggable }
    }
#### 节点插槽

    //父组件中使用
    <div slot="node" slot-scope="scope">{{scope.node}}</div>

### 方法
#### changeFlow
流程图节点或者连线等信息（增删改）改变

    <FlowChart :data="flowData" @changeFlow="changeFlow"><FlowChart>
    
    export default {
	    methods: {
		    changeFlow(flowData) {}
	    }
    }
#### contextmenuNode
节点右键事件

    <FlowChart :data="flowData" @contextmenuNode="contextmenuNode"><FlowChart>
    
    export default {
	    methods: {
		    contextmenuNode(node) {}
	    }
    }

---
_Source: https://npm.io/package/qtum-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
