-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
163 lines (153 loc) · 4.37 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>流程图</title>
<style>
.leftPanel {
width: 20%;
background: deepskyblue;
float: left;
min-height: 700px;
border: 1px solid #666666;
border-radius: 5px;
}
.rightPanel {
width: 75%;
float: left;
}
#container {
min-height: 700px;
position: relative;
border: 1px solid #666666;
background-color: #ffffff;
border-radius: 5px;
z-index: 0;
overflow: auto;
}
#container .model {
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 0;
min-width: 150px;
min-height: 75px;
}
#container .model h4 {
background-color: #438eb9;
text-align: center;
background-image: none;
font-size: 16px;
color: #fff;
border: 1px solid #438eb9;
margin: 0px;
height: 35px;
vertical-align: middle;
padding: 0 3px;
line-height: 30px;
}
#container .model h4 a {
color: #fff !important;
}
#container .model ul {
border: 1px solid #62a8d1;
max-height: 320px;
overflow: auto;
margin: 0px;
width: 100%;
padding: 0px;
}
#container .model ul li {
border-bottom: 1px solid #62a8d1;
font-size: 15px;
list-style-type: none;
}
.jtk-endpoint, .endpointTargetLabel, .endpointSourceLabel {
cursor: pointer;
}
#leftMenu li {
height: 40px;
width: 150px;
background-color: #438eb9;
border-radius: 5px;
font-size: 18px;
color: #fff;
text-align: center;
margin-bottom: 10px;
list-style-type: none;
vertical-align: middle;
line-height: 40px;
z-index: 1;
cursor: pointer;
}
.aLabel {
background-color: white;
padding: 0.4em;
font: 12px sans-serif;
color: #444;
z-index: 21;
border: 1px dotted gray;
opacity: 0.8;
cursor: pointer;
}
.aLabel.jtk-hover {
background-color: #5C96BC;
color: white;
border: 1px solid white;
}
</style>
</head>
<body>
<div id="demo" style="margin:20px;">
<div>
<div>
<!--左侧选择面板-->
<div class="leftPanel">
<div class="content_wrap" style="width: 100%;">
<div class="left" style="width: 100%;">
<ul id="leftMenu" style="overflow: auto;margin: 0px;padding:0px;"></ul>
</div>
</div>
</div>
<!--右侧面板-->
<div class="rightPanel">
<div id="container"></div>
</div>
</div>
<button onclick="save();" style="width: 100px;height: 50px">保存到本地内存</button>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jsPlumb.min.js"></script>
<script type="text/javascript" src="metadata.js"></script>
<script type="text/javascript" src="demo.js"></script>
<script type="text/javascript">
$(function () {
setLeftMenu(metadata);
/**
* 设置左边菜单
* @param Data
*/
function setLeftMenu(list)
{
for(var obj in list){
var element_str = '<li id="' + list[obj].id + '">' + list[obj].name + '</li>';
$("#leftMenu").append(element_str);
}
//拖拽设置
$("#leftMenu li").draggable({
helper: "clone",
scope: "plant"
});
$("#container").droppable({
scope: "plant",
drop: function(event, ui){
CreateModel(ui, $(this));
}
});
}
loaddate();
});
</script>