dd-js-library
v1.2.1
Published
vue3 + vite + antv/x6 工具栏拖拽项目 业务需要的功能点目前已经都支持了,接下来,将会对样式以及antv画布工具做持续的优化
Downloads
6
Readme
dd-js-workspace
vue3 + vite + antv/x6 工具栏拖拽项目 业务需要的功能点目前已经都支持了,接下来,将会对样式以及antv画布工具做持续的优化
使用
npm install --save dd-js-library
main.js / main.ts
import ddJsLibrary from 'dd-js-library'
import 'dd-js-library/lib/style.css'
app.use(ddJsLibrary)
1.2.1版本功能
1、拖拽组件树种组件到画布
2、双击组件显示/修改属性
3、连接组件及其上下游
4、格式化
5、复制节点
6、序列化&反序列化
节点类型
1、d-node:圆角,支持输入输出节点——暂不启用
2、img-node:矩形,带图标,支持输入输出节点
mock数据
const compList = [{
id: '1',
label: 'SHELL',
type: 'img-node',
color: 'whitesmoke',
title: 'SHELL',
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAASxQTFRFAAAA////////v7+/mZmZtra2oqKiqqqqnZ2dpKSkmZmZn5+fpaWlnJycmZmZoqKim5ubn5+fmZmZnJycmZmZmZmZm5ubmpqam5ubnJycm5ubnZ2dmZmZmpqanJycm5ubnJycmpqam5ubm5ubmpqam5ubmpqanJycmpqampqampqampqamZmZmpqampqamZmZm5ubmZmZmZmZmpqampqampqampqamZmZmZmZmpqamZmZmpqamZmZmpqamZmZmpqampqamZmZmpqampqampqampqamZmZmpqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZmZmZmpqamZmZmZmZmpqamZmZmpqampqampqamZmZmZmZmpqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZTrBa4AAAAGN0Uk5TAAECBAUHCwwNDg8QERIUFhcYHh8jKCkrLjEzNDc6Oz0+P0BCREVMTU5laGpub3JzdXZ4eY2SnaCjp6qur7Gys7W5u72/wMPExsfIzM3Q0dLX4OLk5enq7e/w8fLz9PX3+Pr+lq1DxAAAAP5JREFUOMvd1FszglEUxvGng0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6JNYBhh6241Kc/CB1N34R8L8CIgZFIw3EKMrtUYu6KWWbL0J2LRU1PtVfCOtu8MN/j66CXaQc89XtgDWc8BO1MzRfc99iZWq+46bIztV9z6YEFstzWWFn9Oc8h67S6Q3JD1ivU7vMRsT/IBvlJSd3x7b9myjF//mtKkhacFTr5x1aJShofkCQ1zsV+W+wtmbZkWqRkEVsmG+4r2/Q7YYeNVdjxt5bC6PnTjKHURJX9bD8Ovoaaq/CXIwAAAABJRU5ErkJggg==',
level: 1,
desc: '描述',
children: null,
detailMode: 'dialog',
// status: 'success'
}, {
id: '2',
label: 'Data-X',
type: 'img-node',
color: 'wheat',
title: 'Data-X',
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAAddQTFRFAAAA////////qqqqv7+/mZmZqqqqtra2qqqqoqKiqqqqnZ2dpKSkmZmZn5+fpaWlnJycoaGhmZmZnp6eoqKim5ubmZmZn5+fm5ubnp6emZmZnJycmpqanZ2dmZmZm5ubmZmZm5ubnZ2dmpqamZmZm5ubnZ2dmpqamZmZnJycmpqam5ubmZmZmpqampqampqampqanJycmpqamZmZm5ubmpqampqam5ubmpqamZmZmpqampqamZmZmpqamZmZmpqa7OzsmpqamZmZmZmZmpqam5ubmpqam5ubmpqa8/Pzm5ubmpqampqampqamZmZmpqamZmZmZmZmpqampqamZmZmpqamZmZmZmZmZmZmpqampqamZmZmpqamZmZmpqamZmZ7Ozsurq6mpqampqampqamZmZmpqa0NDQ4uLimpqampqampqampqamZmZmpqamZmZxsbGmZmZmZmZmpqampqamZmZmZmZ7u7umpqamZmZxcXFmZmZmZmZmpqamZmZmpqas7OzmZmZycnJmpqara2tuLi41dXVmpqanp6emZmZmZmZmZmZmpqamZmZo6OjmZmZmpqamZmZmpqa8vLympqanp6epaWlmZmZn5+fo6Ojqqqqs7Oz29vbywBn/gAAAJd0Uk5TAAECAwQFBgcJCwwNDg8QERITFBUWHB4gISIjJC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DYIEsUjZLmziZJ4+zDLH5hpVjZOUSKG2WiUtXxkL/iI94dktGqwqpyV5b8R/4AFDmGNLkFgHsAAAAASUVORK5CYII=',
level: 1,
desc: '描述',
children: null,
detailMode: 'dialog',
// status: 'fail'
}, {
id: '3',
label: 'Python',
type: 'img-node',
color: 'wheat',
title: 'Python',
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAAqlQTFRFAAAA////////qqqqv7+/mZmZqqqqtra2n5+fqqqqoqKiqqqqnZ2dpKSkmZmZn5+fpaWlnJycoaGhmZmZnp6eoqKim5ubn5+fmZmZnZ2dl5eXm5ubnp6emZmZnJycl5eXm5ubnp6emZmZmJiYnZ2dmZmZm5ubnp6empqanJycmZmZm5uboaGhn5+fnJycmZmZm5ubnZ2dmpqanJycmZmZnp6em5ubnZ2dnJycmZmZlpaWl5eXm5ubm5ubmJiYmJiYmpqamJiYnJycmpqamJiYm5ubl5eXmpqamJiYmpqalZWVm5ubmpqanJycmJiYm5ubmZmZmJiYm5ubmpqamJiYm5ubnJycmZmZl5eXmpqamZmZmZmZmZmZmZmZmpqampqal5eXmpqamZmZmJiYmZmZmJiYmZmZl5eXmpqamZmZmJiYmZmZmpqamZmZmpqamZmZmJiYmpqamZmZmpqamZmZmZmZmJiYmZmZmJiYmZmZmZmZmJiYmZmZmZmZmJiYmZmZmJiYmZmZmJiYmpqal5eXmJiYmZmZmZmZmJiYmJiYmpqamZmZmJiYmZmZmJiYmpqampqamJiYmJiYmJiYmZmZmpqamJiYmZmZmJiYmJiYmpqamZmZmZmZmJiYmZmZmJiYmpqamJiYmZmZmJiYmZmZmJiYl5eXmZmZmJiYmJiYmJiYmpqamZmZmpqamZmZmZmZmZmZmZmZmJiYmpqamZmZmpqamZmZmJiYmZmZmZmZmZmZmpqamZmZmJiYmZmZmJiYmZmZmpqamZmZmZmZmZmZmJiYmZmZmZmZmZmZmJiYmZmZmZmZmpqamZmZ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ra+wsbK0tbi5u7y9vr/AwcLExcbHycrMzc7P0NHS1tna3N3h5+vw8/T19vf4+fr7/P3+83t5LAAAAehJREFUGBnNwftbS3EAB+DP2pmJXGpyqLGGWKQt2sjIiGIVIoSa69BM5BZtUkwil1yGpmz7/KXO6Xu29uyc/OZ5vC/+IbPnwr3J6S/vntzp2YRFuT5TkflO1f0yGFs7+/PirqqVJZDKN7Z/4HMTDIXow84tEKzv6YehIS6rI+shdLAfhmKUqn8zAMHLKAzFKGFrEzReRqFnqbYnWGNXVULlZRTFGsdnuWAPFD5m078mj6NALzl2+2bO1XIofPz2MpFkCHm7+bUWxXyMAsvj2R3IeUg3dHyMArClB6Gxzn2EXicvQ/F4xgLBxVvQWTLFg1Cc5WYIx9gJjbnWK3RMcUKCIsAjEE7Sj3ml4STzJmSo3DwB4TS9UK2ZZnL4rnAlIGHedp6BEGQbFKZnHChFsWYGIXjYB0UD4ybodLMRwgqOQdHD/dAbSVmhSWRsAAZYBZ3KzBByuhgFEKEMnRvcixzLaw53tb6gDNU6Z96285lRLLA9pUqGoomFxitQqOZQ8BVlKFZduq4a5Ggw2OY0o1iEMjT29XAwDEMRyhDq0nMOB8MwdI1OCM1kvYshGGplLzSHD6CfR2FIepM5txRCWV/2kwXGVsf548GpFk9L96MU31ZgMSX7RlJUzcTaJfyN5HD7GzaY8T/4Ayc6qS17WRLVAAAAAElFTkSuQmCC',
level: 1,
desc: '描述',
children: null,
detailMode: 'dialog',
// status: 'pending'
}, {
id: '4',
label: 'SQL',
type: 'img-node',
color: 'wheat',
title: 'SQL',
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAAhBQTFRFAAAA////////qqqqv7+/mZmZqqqqtra2n5+fqqqqmZmZoqKinZ2dpKSkmZmZn5+fpaWlnJycmZmZoqKim5ubn5+fmZmZoaGhnp6emZmZnJycn5+fm5ubnp6emZmZnJycn5+fmpqanZ2dmZmZnp6empqanJycm5ubnZ2dmpqanJycmZmZnZ2dmpqam5ubnZ2dmpqam5ubnJycmpqam5ubmZmZm5ubmpqamZmZmpqanJycmpqampqanJycmpqam5ubmZmZmpqam5ubmpqamZmZm5ubmpqam5ubm5ubmZmZmpqampqampqam5ubmpqampqamZmZmZmZm5ubmpqampqamZmZmpqamZmZmZmZmZmZmZmZmZmZmpqampqamZmZmpqampqampqampqampqamZmZmZmZmpqampqamZmZmpqampqampqamZmZmpqampqampqamZmZmZmZmpqampqamZmZmpqamZmZmpqamZmZmpqampqamZmZmZmZmpqamZmZmpqampqampqamZmZmpqamZmZmpqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZmpqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZmZmZmpqamZmZmpqamZmZmZmZmpqamZmZmZmZmpqamZmZmpqamZmZmpqampqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZmpqamZmZpRRZ2gAAAK90Uk5TAAECAwQFBgcICQoLDQ4PEBESFBYXGBkbHR4fICEiIyQlJicoKissLi8wMTI0NTg5Oj0+P0BBQkRGR0hJTE1OT1BRUlNVV1hcXl9gYmVmaGpsbnBydHZ5fYCChYeIiYqLjZCSl5mbnJ2en6Gio6Smp6iqq6ytrq+xsrO2uby9vr/AwsPFxsfIycvMzc7R09TV1trb3d/g4eLj5OXm6err7O3u7/Hy9Pb3+Pn6+/z9/rq41S0AAAIISURBVDjLzdTZV1JRFAbwT7xk5XDVLMvKTMUsRbI0tGzSsIEib9BspYVNNmdRJmlZNBlFmENkEFJCIt+/2EMDnMtdy8faT+ec9Vt77b3vPQf4r0NaXt3Qam1vqi3N1gb65vOvovwTiQ839xem5XB8IpmYfHbves/V2wO+GMnopWLB5L0gR8+a5WTeGvsTMrQpFfVyco9Onb3Kzc+ptYVZqVFmppdbUrZktz4dtcywVUD0dRQJYuH2flKFAmTijVPZZVq31mBsPnjG/Y2MhVQo1zY8RyFGO1c+UCEJyG+09z5+7Z+aeO/pO9leDkADpYcaVWh9yhF14Z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KI//KZD/KY//KZD/KI//KJD/KJD/KY//KZD/KY//KJD/KI//KJD/KI//meMr/AAAAKN0Uk5TAAECAwQFBgcICgsMDQ4PEBESExYXGBkaGxweICEiIyQlJigqKywtLzEzNDU2Nzs8Q0RFRkhJTlBRUlNVVldYWl1gYmVoam1xcnN0dXZ4enx9foCChIWHiouNjpCRk5SVl5qeoaKjpKeorLCxsrO1t7i5ur2+v8DDxMbHyMnKy83O0NHS09TW2Nrd3t/g4eLk5enq7u/x8vP09fb3+Pn6+/z9/mSkwPAAAAIBSURBVDjL1dT7V8thHAfw97fVLi3CsoyQNhtJFho1cq+5FEm+rFxrZilFWnSRGa3RYmXDWH239z/qB+P0vXROvzk+P33Oc17POc/7uQH/SRVt2V13uN6+1bA2cVwemM+zUEtjt9wlGqjlDUlKC9PhkdFXsQxJLl4vUyDjEzIVPOPQ/RnY5vHHyQ9OObvDVJtZMVU4+o5x+SIXeVBjIaY5HpINkFc0WG2KTQrG8WN6Odr3YIUq9p1MD15rqrVtNm20Ohpb++ZJZlTMdiNBeX17VDeoYsWA47T/xVwyy3z609TDS24joMkKZRD+tmpm0zq/KRWbrVcha1CdlJxosxetMi2Ps1Sz22mSX6dDd8Wum72B8GeSHIqoI5SfC31ZtR3SZKdjjaTC9obz7d09/s5W7169dlKLVtL9jRUKNl61jjdAcjnk2QQAQlV1MQCYdwqA0WqQs2GS+fdAdYxMuGAZyDF5As30KCK4/BGJQD+9x3+MYUjq8kZzLjUDYHYD/ey27im1MQC4eF/BsqwsdLtmKA3vOMILgJB9qWCjfG3/3ekqajoyswfYAZTyuYLVJJkbOWUDEF3Q4RktyVg5fGxXMFQGV0gmgLOMP5XCOLm8FOXbsmZ+jEQismtzdeInATTc67u4AXD2cNIEpyiKoqjYZL3ssfbSt57fyRDwlfzjD/IXv5LKA8lmV0IAAAAASUVORK5CYII=',
level: 1,
desc: '描述',
children: null,
detailMode: 'dialog',
// status: 'warning'
}, {
id: '5',
label: 'Spark',
type: 'img-node',
color: 'wheat',
title: 'Spark',
img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAMAAACbFsmhAAAAAXNSR0IArs4c6QAAAbNQTFRFAAAA////////qqqqmZmZqqqqtra2n5+fqqqqmZmZoqKiqqqqnZ2dmZmZn5+fpaWlnJycmZmZnp6eoqKin5+foaGhnp6emZmZnJycn5+fm5ubmZmZmpqanZ2dmZmZm5ubnp6enJycnZ2dmpqanJycmZmZm5ubnZ2dmpqam5ubnZ2dmpqanJycnJycmZmZm5ubnJycmpqampqam5ubmpqanJycm5ubmpqam5ubm5ubm5ubm5ubmZmZm5ubm5ubmZmZm5ubmpqampqamZmZmpqam5ubmZmZmpqamZmZmpqam5ubmpqampqamZmZmZmZmpqamZmZmpqampqampqamZmZmpqampqampqamZmZmZmZmZmZmpqampqampqamZmZmpqamZmZmpqampqampqamZmZmZmZmpqamZmZmpqampqampqampqampqampqamZmZmZmZmZmZmpqamZmZmZmZmpqampqamZmZmZmZmpqamZmZmpqampqamZmZmZmZmZmZmZmZmpqamZmZmpqamZmZmpqamZmZmpqamZmZmZmZmpqamZmZmpqamZmZmpqamZmZmpqamZmZ7a4xowAAAJB0Uk5TAAECAwUGBwgJCgsMDQ8QERIUFRYYGx0eHyAhIyYnKCkqLC8wMTIzNDU4OTo7PkFCQ0RJSkxNT1FUV1leX2FjZGZqb3F0dXh5fX5/gYOFh4mKjY6QkZKVl5mbnqKkp6qur7Gztbe5vb7AwsXKzM/Q09XW19jZ29zd3t/g4+Tm6+zt7u/x8vP09fb3+Pn7/P3+yY5kHQAAAYpJREFUGBnVwflbDAEAx+Hv7CQR1rFSrsKmpBVJjhxFiEVLbtZtHDlSZFeZlrWOpPn8ySZ5mqPnmf2xp/fVwlp/tEbl1Np82akyLGBoiSKtchiFtCLthV3v+V2vKGcoma0OLwz9t6xC89znmXQVjklmY8/tV0WmOxU2xkVpeQ6793GRWWmFJKBDUpvDjG9Pzl5wnG0KOQBr5LrJ10e9zaaSJa4rZPM9P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FCQ0RJSkxNT1FUV1leX2FjZGZqb3F0dXh5fX5/gYOFh4mKjY6QkZKVl5mbnqKkp6qur7Gztbe5vb7AwsXKzM/Q09XW19jZ29zd3t/g4+Tm6+zt7u/x8vP09fb3+Pn7/P3+yY5kHQAAAYlJREFUGBnVwflbDAEAx+Hv7CQRlqyUq7Ad0ookR4guZdGSm3UbR44U2VWmZa0jaT5/skk9mtnpaX7lffVP2HS8UuGqbD7VK5QFjKxQiHUO45BUiP2w5y0/a7S8Pgpms8MzQwtWlWgJd3kiXYYTkll3+uaLPLPtCprgvLQ6g93zMM+8pAJi0CapxWHOl0dnzjnOTgUcgg1yXefzg55GU/ECVxWw7Q7vNGfN7ohcVR8ZKZdfw4VR4JYWRd+Q2yqveCqLa2Joh/4qfcr3vfLY9wrXh4tNhhYZaX61y2sK3g82ym8QOuVlzpJtM+S3HSz5PQbGTpXJ5zkzW+RT3pUF7ORGeRyEaypiHh0G0hF5vGQ6poDE/W75HIGUwkVGKUS1hMOtmhc/u0tSBwwowEjRIGl9iVQNmUuJ0ixTZSpWCVEp9vqAZHzFZWdgrYolyEnV41yRVNtr/cBlKaCDYdVMMnNMf6xs6b89FFNAP+k6m2+tWt4NrDy5JoW4B0zWKszJacY2K1xFc1T/od9QRHqBvM4OIwAAAABJRU5ErkJggg==',
level: 1,
desc: '描述',
children: null,
detailMode: 'dialog'
}]
export default compList
引用示例
<script setup>
import DdPanel from "../packages/DdPanel/src/dd-panel.vue";
import compList from "./mock/compsNoTree.js";
import {reactive, ref} from "vue";
const dialogVisible = ref(false)
const form = reactive({
formValue: {}
})
const openDialog = (e) => {
form.formValue = e
options.value = []
console.log(1, e)
getAllNodes().forEach(item => {
console.log(item)
if (item.data.content.id !== e._node.id) {
options.value.push(item)
}
})
dialogVisible.value = true
}
const handleConfirm = () => {
form.formValue._node.setData({
content: {
...form.formValue,
isNew: false
}
}, {
overwrite: true,
deep: true
})
dialogVisible.value = false
}
const save = (e) => {
console.log('save', JSON.stringify(e))
}
const closePanel = () => {
console.log('关闭')
}
const options = ref([])
const ddPanelT = ref(null)
const getAllNodes = () => {
return ddPanelT.value.getAllNodes()
}
const getAllLines = () => {
console.log(ddPanelT.value.getAllLines())
return ddPanelT.value.getAllLines()
}
const cancel = () => {
dialogVisible.value = false
console.log(form.formValue)
if (form.formValue._node.data.content.isNew) {
ddPanelT.value.dltNode(form.formValue._node.id)
}
}
</script>
<template>
<div style="width: 100%;height: 100vh">
<!-- <dd-panel ref="ddPanelT" :graphJson="graphJson" :comps="compList" @openCompDialog="openDialog" :title="'创建工作流'" @save="save" @closePanel="closePanel"></dd-panel>-->
<dd-panel ref="ddPanelT" :graphJson="[]" :comps="compList" @openCompDialog="openDialog" :title="'创建工作流'" @save="save" @closePanel="closePanel"></dd-panel>
<el-dialog v-model="dialogVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="form.formValue" label-width="120px">
<el-form-item label="标题">
<el-input v-model="form.formValue.title" />
</el-form-item>
<el-form-item label="标签">
<el-input v-model="form.formValue.label" />
</el-form-item>
<el-form-item label="描述">
<el-input v-model="form.formValue.desc" />
</el-form-item>
<el-form-item label="前置节点">
<el-select v-model="form.formValue.preId" multiple>
<el-option
v-for="item in options"
:key="item.id"
:label="item.data.content.label"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">
确认
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<style></style>
淘宝源:http://registry.npmmirror.com/ npm官方源:https://registry.npmjs.org/ npm config set registry=源