1.完成节点、群组、连线、拖拽、删除、节点拉伸
This commit is contained in:
commit
9fc0b40cd6
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules/
|
||||||
|
dist/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"name": "basic",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@antv/x6": "^1.32.3-beta.1",
|
||||||
|
"@antv/x6-vue-shape": "^1.4.0",
|
||||||
|
"@vue/composition-api": "^1.6.3",
|
||||||
|
"core-js": "^3.6.5",
|
||||||
|
"element-ui": "^2.15.9",
|
||||||
|
"vue": "^2.6.11",
|
||||||
|
"vue-json-viewer": "^2.2.22",
|
||||||
|
"vue-baidu-map": "^0.21.22"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "~4.5.13",
|
||||||
|
"@vue/cli-plugin-eslint": "~4.5.13",
|
||||||
|
"@vue/cli-service": "~4.5.13",
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
|
"eslint": "^6.7.2",
|
||||||
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
|
"node-sass": "^4.14.1",
|
||||||
|
"sass": "^1.54.0",
|
||||||
|
"sass-loader": "^7.3.1",
|
||||||
|
"vue-template-compiler": "^2.6.11"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "babel-eslint"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<index-stencil></index-stencil>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import indexStencil from "./demo/index-stencil.vue";
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
components: {
|
||||||
|
indexStencil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html,body,#app {
|
||||||
|
height:100%;
|
||||||
|
margin:0px;
|
||||||
|
padding:0px
|
||||||
|
}
|
||||||
|
.v-modal{
|
||||||
|
opacity: 0.5!important;
|
||||||
|
background: rgba(0,0,0,0.5)!important;
|
||||||
|
}
|
||||||
|
</style>
|
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
|
@ -0,0 +1,514 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="tools-bar">
|
||||||
|
<el-popover
|
||||||
|
placement="bottom"
|
||||||
|
width="200"
|
||||||
|
class="el-po"
|
||||||
|
trigger="click">
|
||||||
|
<div ref="stencilContainer" class="x6-stencil"></div>
|
||||||
|
<i class="el-icon-s-operation opt-btn" slot="reference" ></i>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
<div class="content" :style="{ height: contentHeight }">
|
||||||
|
<!-- <div ref="stencilContainer" class="x6-stencil"></div> -->
|
||||||
|
<div class="middle-box">
|
||||||
|
<div ref="container" class="x6-content" :style="{ height: contentHeight }"></div>
|
||||||
|
<!-- <div @click="click" style="width:600px;height:600px; position: absolute;z-index: 3;background:red;pointer-events;none;">这个是上层</div> -->
|
||||||
|
<!-- <div @click="click2" style="width:800px;height:600px; position: absolute;z-index: 2;background:yellow;pointer-events;none;">这个是中层</div> -->
|
||||||
|
<!-- 中间地图 -->
|
||||||
|
<baidu-map
|
||||||
|
class="mp-view"
|
||||||
|
:style="{ height: mapHeight }"
|
||||||
|
:center="center"
|
||||||
|
:zoom="zoom"
|
||||||
|
@ready="handler"></baidu-map>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Graph, Shape, Addon,Path } from '@antv/x6';
|
||||||
|
const { Stencil } = Addon
|
||||||
|
const { Rect, Circle } = Shape
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
contentHeight:'0px', //容器高度,x6高度
|
||||||
|
mapHeight: "200px", //地图高度
|
||||||
|
center: {lng: 0, lat: 0},//地图中心点变量
|
||||||
|
zoom: 3,//地图缩放变量
|
||||||
|
|
||||||
|
graph:undefined,//x6画布
|
||||||
|
stencil:undefined,//x6拖拽
|
||||||
|
|
||||||
|
projection:undefined,//地图projection参数
|
||||||
|
data : {
|
||||||
|
// 节点
|
||||||
|
nodes: [
|
||||||
|
{
|
||||||
|
id: 'node1', // String,可选,节点的唯一标识
|
||||||
|
x: 0, // Number,必选,节点位置的 x 值
|
||||||
|
y: 0, // Number,必选,节点位置的 y 值
|
||||||
|
width: 80, // Number,可选,节点大小的 width 值
|
||||||
|
height: 40, // Number,可选,节点大小的 height 值
|
||||||
|
label: 'hello', // String,节点标签
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'node2', // String,节点的唯一标识
|
||||||
|
x: 160, // Number,必选,节点位置的 x 值
|
||||||
|
y: 180, // Number,必选,节点位置的 y 值
|
||||||
|
width: 80, // Number,可选,节点大小的 width 值
|
||||||
|
height: 40, // Number,可选,节点大小的 height 值
|
||||||
|
label: 'world', // String,节点标签
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 边
|
||||||
|
edges: [
|
||||||
|
{
|
||||||
|
source: 'node1', // String,必须,起始节点 id
|
||||||
|
target: 'node2', // String,必须,目标节点 id
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.init()
|
||||||
|
this.initCell()
|
||||||
|
this.initGraph();
|
||||||
|
this.initStencil()
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
init() {
|
||||||
|
this.contentHeight = document.documentElement.clientHeight -45 + "px";
|
||||||
|
this.mapHeight = document.documentElement.clientHeight -45 + "px";
|
||||||
|
},
|
||||||
|
//初始化地图设置数据
|
||||||
|
handler ({BMap, map}) {
|
||||||
|
console.log(BMap, map)
|
||||||
|
this.center.lng = 116.404
|
||||||
|
this.center.lat = 39.915
|
||||||
|
this.zoom = 14
|
||||||
|
this.projection = map
|
||||||
|
},
|
||||||
|
//初始化图形
|
||||||
|
initCell(){
|
||||||
|
//桩
|
||||||
|
const ports = {
|
||||||
|
groups: {
|
||||||
|
top: {
|
||||||
|
position: 'top',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 4,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#fff',
|
||||||
|
style: {
|
||||||
|
visibility: 'hidden',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
right: {
|
||||||
|
position: 'right',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 4,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#fff',
|
||||||
|
style: {
|
||||||
|
visibility: 'hidden',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
bottom: {
|
||||||
|
position: 'bottom',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 4,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#fff',
|
||||||
|
style: {
|
||||||
|
visibility: 'hidden',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
left: {
|
||||||
|
position: 'left',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 4,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#fff',
|
||||||
|
style: {
|
||||||
|
visibility: 'hidden',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
group: 'top',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
group: 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
group: 'bottom',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
group: 'left',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
//自定义节点
|
||||||
|
Graph.registerNode(
|
||||||
|
'custom-rect',
|
||||||
|
{
|
||||||
|
inherit: 'rect',
|
||||||
|
width: 66,
|
||||||
|
height: 36,
|
||||||
|
attrs: {
|
||||||
|
body: {
|
||||||
|
strokeWidth: 1,
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
fill: '#EFF4FF',
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 12,
|
||||||
|
fill: '#262626',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ports: { ...ports },
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
//初始化画布
|
||||||
|
initGraph(){
|
||||||
|
let mapZoom = this.zoom
|
||||||
|
this.graph = new Graph({
|
||||||
|
container: this.$refs.container,
|
||||||
|
background: {//背景
|
||||||
|
color: 'transport', // 设置画布背景颜色
|
||||||
|
},
|
||||||
|
grid: {//网格
|
||||||
|
size: 10, // 网格大小 10px
|
||||||
|
visible: true, // 渲染网格背景
|
||||||
|
},
|
||||||
|
// panning: {//画布是否可以拖动
|
||||||
|
// enabled: true, //开启支持拖拽平移
|
||||||
|
// modifiers: 'shift', //按下修饰键并点击鼠标才能触发画布拖拽
|
||||||
|
// },
|
||||||
|
mousewheel: {//滚轮缩放画布
|
||||||
|
enabled: true,
|
||||||
|
modifiers: ['ctrl'],
|
||||||
|
guard(e){//判断一个滚轮事件是否应该被处理
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
snapline: true,//对齐线
|
||||||
|
selecting: {//点选/框选
|
||||||
|
enabled: true,//开启点选/框选
|
||||||
|
rubberband: true,//启用框选
|
||||||
|
showNodeSelectionBox: true,//是否显示节点的选择框
|
||||||
|
},
|
||||||
|
resizing:true,//缩放节点
|
||||||
|
highlighting: {//高亮选项,指定触发某种交互时的高亮样式
|
||||||
|
// 当链接桩可以被链接时,在链接桩外围渲染一个蓝色
|
||||||
|
magnetAdsorbed: {
|
||||||
|
name: 'stroke',
|
||||||
|
args: {
|
||||||
|
attrs: {
|
||||||
|
//fill: '#5F95FF',
|
||||||
|
stroke: '#5F95FF',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//当可以当父节点时,高亮
|
||||||
|
embedding: {
|
||||||
|
name: 'stroke',
|
||||||
|
args: {
|
||||||
|
padding: -1,
|
||||||
|
attrs: {
|
||||||
|
stroke: '#73d13d',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
connecting:{//连线配置
|
||||||
|
//设置连接桩自动吸附,吸附距离为20
|
||||||
|
snap: {
|
||||||
|
radius: 20,
|
||||||
|
},
|
||||||
|
allowBlank:false,//是否允许连接到画布空白位置的点,设置为否
|
||||||
|
allowNode:false,//是否允许边链接到节点(非节点上的链接桩)
|
||||||
|
allowEdge:false,//是否允许边链接到另一个边
|
||||||
|
anchor: 'center',//当连接到节点时,通过 anchor 来指定被连接的节点的锚点
|
||||||
|
connectionPoint: 'anchor',//指定连接点
|
||||||
|
router: {//路由将边的路径点 vertices 做进一步转换处理
|
||||||
|
name: 'manhattan',
|
||||||
|
args: {
|
||||||
|
padding: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
connector: {//连接器
|
||||||
|
name: 'rounded',
|
||||||
|
args: {
|
||||||
|
radius: 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
createEdge() {//创建新的边
|
||||||
|
return new Shape.Edge({
|
||||||
|
attrs: {
|
||||||
|
line: {
|
||||||
|
//stroke: '#A2B1C3',
|
||||||
|
stroke: 'green',
|
||||||
|
strokeWidth: 3,
|
||||||
|
targetMarker: {
|
||||||
|
name: 'block',
|
||||||
|
width: 12,
|
||||||
|
height: 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
zIndex: 20,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
validateConnection({ targetMagnet }) {//在移动边的时候判断连接是否有效
|
||||||
|
return !!targetMagnet
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//节点嵌套
|
||||||
|
embedding:{
|
||||||
|
enabled:true,//开启节点嵌套
|
||||||
|
findParent(node){//在节点被移动时通过 findParent 指定的方法返回父节点
|
||||||
|
const bbox = node.node.getBBox()
|
||||||
|
return this.getNodes().filter((node) => {
|
||||||
|
// 只有 data.parent 为 true 的节点才是父节点
|
||||||
|
const data = node.getData()
|
||||||
|
if (data && data.canBeParent) {
|
||||||
|
const targetBBox = node.getBBox()
|
||||||
|
return bbox.isIntersectWithRect(targetBBox)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//限制子节点的移动范围
|
||||||
|
translating: {
|
||||||
|
restrict(view) {
|
||||||
|
if(view){
|
||||||
|
const cell = view.cell
|
||||||
|
if (cell.isNode()) {
|
||||||
|
const parent = cell.getParent()
|
||||||
|
if (parent) {
|
||||||
|
return parent.getBBox()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
//this.graph.fromJSON(this.data)
|
||||||
|
|
||||||
|
//事件注册
|
||||||
|
//鼠标移动到节点上,显示桩、给当前节点添加删除按钮
|
||||||
|
this.graph.on('node:mouseenter', ( e ) => {
|
||||||
|
const container = this.$refs.container
|
||||||
|
const ports = container.querySelectorAll(
|
||||||
|
'.x6-port-body',
|
||||||
|
)
|
||||||
|
this.showPorts(ports, true)
|
||||||
|
this.showNodeTool(e.node,true)
|
||||||
|
})
|
||||||
|
//鼠标移出节点,隐藏桩、删除当前节点删除按钮
|
||||||
|
this.graph.on('node:mouseleave', ( e) => {
|
||||||
|
const container = this.$refs.container
|
||||||
|
const ports = container.querySelectorAll(
|
||||||
|
'.x6-port-body',
|
||||||
|
)
|
||||||
|
this.showPorts(ports, false)
|
||||||
|
this.showNodeTool(e.node,false)
|
||||||
|
})
|
||||||
|
//鼠标移动到线上,给当前线添加删除按钮
|
||||||
|
this.graph.on('edge:mouseenter',(e)=>{
|
||||||
|
this.showEdgeTool(e.edge,true)
|
||||||
|
})
|
||||||
|
//鼠标移出线,删除当前线的删除按钮
|
||||||
|
this.graph.on('edge:mouseleave',(e)=>{
|
||||||
|
this.showEdgeTool(e.edge,false)
|
||||||
|
})
|
||||||
|
//移入父节点,父节点改变后
|
||||||
|
this.graph.on('node:change:parent', ({ node }) => {
|
||||||
|
node.attr({
|
||||||
|
body:{
|
||||||
|
stroke: 'none',
|
||||||
|
fill: '#47C769',
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
text: '节点-过程',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//节点添加到画布中
|
||||||
|
this.graph.on('node:added',(args)=>{
|
||||||
|
//将在容器的位置坐标转换为地图的地理坐标
|
||||||
|
this.pixelToPoint(args.node,args.node.store.data.position)
|
||||||
|
})
|
||||||
|
//节点在画布上移动
|
||||||
|
this.graph.on('node:change:position',(args)=>{
|
||||||
|
//将在容器的位置坐标转换为地图的地理坐标
|
||||||
|
this.pixelToPoint(args.node,args.current)
|
||||||
|
})
|
||||||
|
//画布平移
|
||||||
|
// this.graph.on('translate', ({ tx, ty }) => {
|
||||||
|
// console.log("平移tx",tx)
|
||||||
|
// //console.log("平移ty",ty)
|
||||||
|
// this.mapScrollBy(tx,ty)
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
//初始化拖拽Stencil
|
||||||
|
initStencil(){
|
||||||
|
this.stencil = new Stencil({
|
||||||
|
target: this.graph,//设置画布
|
||||||
|
stencilGraphWidth: 200,//模板画布宽度
|
||||||
|
stencilGraphHeight: 80,//模板画布高度
|
||||||
|
groups: [
|
||||||
|
{
|
||||||
|
name: 'group1',//分组名称
|
||||||
|
title: '元素',//分组标题
|
||||||
|
collapsable: false,//分组是否可折叠,默认为 true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
//将Stencil挂载到页面上
|
||||||
|
this.$refs.stencilContainer.appendChild(this.stencil.container)
|
||||||
|
//定义模板节点
|
||||||
|
const process = this.graph.createNode({
|
||||||
|
shape: 'custom-rect',
|
||||||
|
label: '过程',
|
||||||
|
zIndex: 10,
|
||||||
|
attrs: {
|
||||||
|
body: {
|
||||||
|
stroke: 'none',
|
||||||
|
fill: '#3199FF',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const node = this.graph.createNode({
|
||||||
|
shape: 'custom-rect',
|
||||||
|
label: '节点',
|
||||||
|
zIndex: 1,
|
||||||
|
data: {
|
||||||
|
canBeParent: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
//装载模板节点
|
||||||
|
this.stencil.load([process,node], 'group1')
|
||||||
|
},
|
||||||
|
//链接桩显示/隐藏事件
|
||||||
|
showPorts(ports,show){
|
||||||
|
ports.forEach(port => {
|
||||||
|
port.style.visibility = show?'visible' : 'hidden'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//节点上的删除按钮添加/删除事件
|
||||||
|
showNodeTool(node,show){
|
||||||
|
if(show){
|
||||||
|
node.addTools({
|
||||||
|
name: 'button-remove',
|
||||||
|
args: {
|
||||||
|
x: '100%',
|
||||||
|
y: 0,
|
||||||
|
offset: { x: -3, y: 3 },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
node.removeTools()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//线上的删除按钮添加/删除事件
|
||||||
|
showEdgeTool(edge,show){
|
||||||
|
if(show){
|
||||||
|
edge.addTools({
|
||||||
|
name: 'button-remove',
|
||||||
|
args: { distance: -40 },
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
edge.removeTools()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//将像素坐标转换为地理坐标
|
||||||
|
pixelToPoint(node,position){
|
||||||
|
let ePoint = this.projection.pixelToPoint({x:position.x,y:position.y})
|
||||||
|
//将数据记录到node中
|
||||||
|
node.store.data.mapPoint = ePoint
|
||||||
|
},
|
||||||
|
//地图平移
|
||||||
|
mapScrollBy(tx,ty){
|
||||||
|
this.projection.panBy(tx,ty)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.tools-bar{
|
||||||
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.opt-btn{
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 35px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
.x6-stencil{
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
.middle-box{
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
.x6-content {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.mp-view{
|
||||||
|
width: 100%;
|
||||||
|
position:absolute;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-popover{
|
||||||
|
height: 500px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.el-popover{
|
||||||
|
height: 120px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,16 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
import ElementUI from 'element-ui';
|
||||||
|
import 'element-ui/lib/theme-chalk/index.css';
|
||||||
|
import App from './App.vue'
|
||||||
|
//全局引入注册
|
||||||
|
import BaiduMap from 'vue-baidu-map'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
Vue.use(ElementUI);
|
||||||
|
Vue.use(BaiduMap, {
|
||||||
|
ak:'mnFNphcQGzYVF90CZScxgmZQ3o8ABga8'
|
||||||
|
})
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
render: h => h(App),
|
||||||
|
}).$mount('#app')
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
lintOnSave: false,
|
||||||
|
runtimeCompiler: true,
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
Arguments:
|
||||||
|
/usr/local/bin/node /usr/local/bin/yarn add @vue/composition-api --dev
|
||||||
|
|
||||||
|
PATH:
|
||||||
|
/Users/zijunwang/Desktop/Flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/zijunwang/Desktop/Flutter/bin:/Users/zijunwang/Library/Android/sdk/tools:/Users/zijunwang/Library/Android/sdk/platform-tools:/Users/zijunwang/Library/Android/sdk/tools:/Users/zijunwang/Library/Android/sdk/platform-tools
|
||||||
|
|
||||||
|
Yarn version:
|
||||||
|
1.22.18
|
||||||
|
|
||||||
|
Node version:
|
||||||
|
14.17.3
|
||||||
|
|
||||||
|
Platform:
|
||||||
|
darwin x64
|
||||||
|
|
||||||
|
Trace:
|
||||||
|
Error: EINVAL: invalid argument, unlink '/Users/zijunwang/Desktop/vue-project/rule-chain/node_modules/globule/node_modules/glob'
|
||||||
|
|
||||||
|
npm manifest:
|
||||||
|
{
|
||||||
|
"name": "basic",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@antv/x6": "^1.32.3-beta.1",
|
||||||
|
"@antv/x6-vue-shape": "^1.4.0",
|
||||||
|
"@vue/composition-api": "^1.6.3",
|
||||||
|
"core-js": "^3.6.5",
|
||||||
|
"element-ui": "^2.15.9",
|
||||||
|
"vue": "^2.6.11",
|
||||||
|
"vue-json-viewer": "^2.2.22"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "~4.5.13",
|
||||||
|
"@vue/cli-plugin-eslint": "~4.5.13",
|
||||||
|
"@vue/cli-service": "~4.5.13",
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
|
"eslint": "^6.7.2",
|
||||||
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
|
"vue-template-compiler": "^2.6.11",
|
||||||
|
"node-sass": "^4.14.1",
|
||||||
|
"sass-loader": "^7.3.1"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "babel-eslint"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
yarn manifest:
|
||||||
|
No manifest
|
||||||
|
|
||||||
|
Lockfile:
|
||||||
|
No lockfile
|
Loading…
Reference in New Issue